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



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: [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: Roadrunner & OS/2?
    ... IRQ number:0B ... Probably your driver is a wrong one. ... Device 0985h AN983 FastNIC PCI 10/100 Fast Ethernet Adapter ... Supports low power State D1 ...
    (comp.os.os2.setup.misc)
  • Re: [PATCH] call drv->shutdown at rmmod
    ... This has been one of the biggest problem areas ... You're assuming that a driver can always bring a device out a shutdown ... We have similar goals - introduce device power state code paths into ...
    (Linux-Kernel)