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



Hi, Jochen

Thank you very much for your response.

I called this API from a driver.

could you tell me why the PM might not honor the request at all?? And how
can I change the system power state in my driver??


--

"JochenD" <JochenD@xxxxxxxxxxxxxxxxxxxxxxxxx> дÈëÏûÏ¢ÐÂÎÅ:215E7748-2449-4912-8E97-16BA47A3B12C@xxxxxxxxxxxxxxxx
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
    ... are you calling SetSystemPowerState from a driver or from an application? ... So the driver must not assume that the request ... use a bitmask to describe the power state you want to change to ... My system power state is in useridle mode, when I got an event in my driver ...
    (microsoft.public.windowsce.embedded)
  • 2.6.0-test7: suspend to disk: no mouse or sound after suspend
    ... Using Gentoo with kernel 2.6.0-test7. ... Sound, no output after suspend. ... completing PM request, suspend ... registered new driver usbfs ...
    (Linux-Kernel)
  • [git pull] IDE updates #1
    ... which there is a better driver available. ... Use special driver requests for handling IDE settings. ... * Generate a new packet command request in front of the request queue, ... unsigned int alignment; ...
    (Linux-Kernel)
  • [Q] Bio traversal trouble?
    ... unable to handle kernel paging request at virtual address 8c1d2071 ... Since the last time this driver was posted it changed considerably and as one of the chances it's now requesting just one hardware sector at a time from the drive as requesting multiple didn't actually work -- I seemed to have fouled up earlier tests somehow. ... I'd also simply like to understand it, so this is doing a manual bio traversal, requesting frames from the hardware as it goes along. ...
    (Linux-Kernel)
  • Re: [PATCH][RFC] Kill off legacy power management stuff.
    ... -your driver into the driver model, ... -should include power management support. ... Unregister all devices with a matching callback function ... * cback - previously registered request callback ...
    (Linux-Kernel)