The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: BBalazs on January 05, 2007, 12:10:26 PM

Title: How to force the system to hibernate?
Post by: BBalazs on January 05, 2007, 12:10:26 PM
Hi,

How is it possible to force the w98 (or even more the XP) to step in hibernation?
Until now I used the ExitWindowsEx under w98.

Thanks in advance:
BBalazs
Title: Re: How to force the system to hibernate?
Post by: Tedd on January 05, 2007, 01:22:27 PM
http://msdn2.microsoft.com/en-us/library/aa373201.aspx

(Not supported on win98 though)
Title: Re: How to force the system to hibernate?
Post by: BBalazs on January 05, 2007, 02:32:02 PM
Tedd,

thanks, but I am uncertain how to handle the token privileges, etc, because I have no experience with XP or other network platforms.
My application is going to run on a solo EPIA M10000 in my car.
Title: Re: How to force the system to hibernate?
Post by: Tedd on January 08, 2007, 11:43:26 AM
If you have the 'privilege' to shutdown/hibernate then it should work, otherwise it won't.
(I think the general policy is that either everyone can, or only admin can - 'everyone' is usually the default.)
Title: Re: How to force the system to hibernate?
Post by: BBalazs on January 09, 2007, 02:11:09 PM
Tedd, thank you.

Title: Re: How to force the system to hibernate?
Post by: gabor on January 09, 2007, 03:06:40 PM
Hello!

On Iczelion's home page http://win32assembly.online.fr/source.html there is a little usefull app called "Time Shut Down". Its source is included. It also handles NT with that token and privilage stuff. However there is no hybernation :(

Greets, Gábor
Title: Re: How to force the system to hibernate?
Post by: BBalazs on January 10, 2007, 12:09:51 PM
Gabor and Tedd,

by means of these aids I was finally able to do that.

I have merged the AdjustToken routine from Itzelion's page and added the SetSystemPowerState,FALSE, TRUE and wow! the system went hibernate under XP!

Thank you, folks!