how to pause the sleep process when the OS already enter into sleep process

how to pause the sleep process when the OS already enter into sleep process

Post by David Chin » Sat, 27 Sep 2008 04:05:25



Look at http://www.yqcomputer.com/ (VS.85).aspx,
PBT_QUERYAPMSUSPEND

-- David
 
 
 

how to pause the sleep process when the OS already enter into sleep process

Post by David Lown » Sat, 27 Sep 2008 07:42:20

>Look at http://www.yqcomputer.com/ (VS.85).aspx,

The problem is there's no guarantee of getting that message - the
documentation for PBT_APMSUSPEND says:

"The event may also be broadcast, without a prior PBT_APMQUERYSUSPEND
event, if an application or device driver uses the SetSystemPowerState
function to force suspension"

Dave

 
 
 

how to pause the sleep process when the OS already enter into sleep process

Post by David Chin » Sun, 28 Sep 2008 14:58:48


Thanks David, I think that is a result of some apps having misused the query
suspend and aborting the machine from being suspended. Customers complained
that the PC never suspended due to this. So MS said, "That's it, 3rd party
apps can't do the right thing, so they no longer have a say in whether the
PC is suspended." What a sorry state of affairs.

-- David
 
 
 

how to pause the sleep process when the OS already enter into sleep process

Post by Joseph M. » Mon, 29 Sep 2008 11:53:55

The capability actually forms an interesting variant of the denial-of-service attack:
whenever your laptop is idle and wants to shut down, a program can say "no you can't"
until the battery dies...
joe




Joseph M. Newcomer [MVP]
email: XXXX@XXXXX.COM
Web: http://www.yqcomputer.com/
MVP Tips: http://www.yqcomputer.com/
 
 
 

how to pause the sleep process when the OS already enter into sleep process

Post by David Chin » Mon, 29 Sep 2008 13:10:37


The problem I have with most "security fixes" is their definition of a fix
is to remove the capability. What? Security problem with letting apps veto
a suspend? OK, we'll remove that, problem solved. Meanwhile, legitimate
apps like video encoding apps that take hours to do their thing get
suspended, and the user's video is non-encoded the next morning.

Meanwhile, on XP SP2, if MS dictatorially decides it needs to reboot my PC
due to one of these security "fixes", it pops up a stupid dialog every time
I let the PC idle for a few minutes, saying I have 5 minutes to veto their
reboot, or it will reboot. The stupid thing aborted a 4 hour network copy I
had started and then went to lunch.

The medicine is worse than the disease.

-- David
 
 
 

how to pause the sleep process when the OS already enter into sleep process

Post by Joseph M. » Mon, 29 Sep 2008 14:45:44

I agree. My laptop has to run with sleep capability disabled on AC power because I don't
want it going into screen-saver mode or sleep mode if I take ten minutes to hold a
discussion with my students. OTOH, I have sleep enabled for pure-battery mode so if *I*
fall asleep while using it, I don't lose battery power.

But the illlusion that just because there is no user input the computer can be shut down
is a gross fallacy. And I truly despise that reboot-after-installing-updates message.
joe





Joseph M. Newcomer [MVP]
email: XXXX@XXXXX.COM
Web: http://www.yqcomputer.com/
MVP Tips: http://www.yqcomputer.com/