RE: why this API (SetSystemPowerState) can not change the system power

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Ricky,

are you calling SetSystemPowerState from a driver or from an application?

If you are calling the API from a driver:
-since the driver is aware of the availabe system powerstats you can call it
with the name of the system powere stat as you do in your example
-however, even though the driver has requested a specific state ("on" in
your case), the power manager does not have to grant the request, meaning the
power manager can change to the requested state, to another state or not
change the power state at all. So the driver must not assume that the request
has been granted.

If you are calling the API from an application:
- the application is not aware of available system powerstates so you should
use a bitmask to describe the power state you want to change to
-the power manager may restrict applications from entering cerain system
power states
-again: the power manager might not honor the request at all.

Best regards
-Jochen

"Hzh" wrote:

Does anyone can tell me why?

My system power state is in useridle mode, when I got an event in my driver
under CE 5.0, I want to change the system power state from useridle to on,
so I call this API, SetSystemPowerState(L"on",0,0); but it does not work,
the system power state still keep in useridle mode, and I could not get the
PBT_TRANSITION notification either. It seems that my system could not
broadcast the PBT_TRANSITION notification.

Anyone can give me some advice? Thank you all very much.

Ricky

--





.



Relevant Pages

  • Re: why this API (SetSystemPowerState) can not change the system power
    ... I called this API from a driver. ... could you tell me why the PM might not honor the request at all?? ... can I change the system power state in my driver?? ... My system power state is in useridle mode, when I got an event in my ...
    (microsoft.public.windowsce.embedded)
  • RE: User defined system power state
    ... user can define their own power state. ... adding one registry and calling SetSystemPowerstate. ... work in the PM driver. ... I want to know how to create a user defined system power state and how ...
    (microsoft.public.windowsce.platbuilder)
  • Re: [PATCH -mm] kexec jump -v9
    ... methods for each and every driver to handle that case, ... hibernation and suspend should be solved in separate patches. ... for a possible power state transition. ... @suspend place the device in a low power state. ...
    (Linux-Kernel)
  • Re: [PATCH 2/5] [pm] Add state field to pm_message_t (to hold actual state device is in)
    ... some devices support>1 low-power state which can be used to save ... not being used will most likely use the lowest power state, ... How, from the above message, is the driver to know that it's being asked ...
    (Linux-Kernel)
  • Re: [PATCH 0/8] Suspend block api (version 6)
    ... I'm faced with is that as a result of using system suspend much more ... instructions about what the lowest power state possible is. ... normal course of affairs means that the driver should shut everything ...
    (Linux-Kernel)