Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to disallow sleep/hibernation in Windows Vista ?

0 views
Skip to first unread message

bhl...@gmail.com

unread,
Jun 22, 2008, 10:40:07 PM6/22/08
to
Hi , I want to disallow hibernation in Windows Vista .
So I programed a filter driver to catch IRP_MN_QUERY_POWER ,then fails
it .
case IRP_MN_QUERY_POWER:
if(PowerType==SystemPowerState)
{
if(State.SystemState==PowerSystemHibernate)
{

PoStartNextPowerIrp (Irp);
ntStatus = STATUS_NOT_SUPPORTED;

Irp->IoStatus.Status = ntStatus;
if(!NT_SUCCESS(ntStatus))
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return ntStatus;
}
}
break;
It work fine in Windows XP , but it doesn't work in Windows Vista as
MSDN said,

"Beginning with Windows Vista, transition to a system sleep state is
considered a critical operation. Although a driver might fail a system
query-power IRP, the power manager might still change the system power
state to a sleep state. After a driver receives a system query-power
IRP, the driver should always be prepared for a subsequent change in
the system power state."

Does there anyway to disallow hibernation in Windows Vista ?
Any suggstion will be helpful !

David Craig

unread,
Jun 22, 2008, 11:11:25 PM6/22/08
to
I have heard and read that Microsoft was getting far too much hassle about
companies releasing drivers that would not permit hibernation. They 'fixed'
it the only way it can be done. Don't allow any driver to block suspend and
hibernate. Remember that notebooks are becoming the replacement for
desktops and it is not good when they won't hibernate or suspend when
necessary. Even desktops should be able to suspend because in places like
Florida the power will go out and UPSes can only maintain a system for a
limited time without AC power returning.

Your device is not that important and neither is anyone else's. You can
rewrite Linux or FreeBSD, etc. to do whatever you want. Maybe that is why
so many embedded devices such as HDTVs use them. Remember the computer
belongs to someone else and it should do what they want and help them as
much as is condusive to assisting the user make use of the computer. That
previous statement is a reflection upon security software that asks the user
to decide what to do when it is most likely that they don't have the
knowledge to make a good decision.

<bhl...@gmail.com> wrote in message
news:656b0cdd-527d-48f6...@w8g2000prd.googlegroups.com...

Ken Snyder

unread,
Jun 22, 2008, 11:13:16 PM6/22/08
to
Hi Stranger,

maybe sometimes you dont need a driver to
handle this. A extremely simple usermode
application (or service if you like!) can handle
this for you by starting this:

http://support.microsoft.com/kb/920730/en-us


See here too:
http://technet2.microsoft.com/WindowsVista/en/library/1d58b934-f56a-4796-b2df-7be2eb9c03bc1033.mspx?mfr=true

Thats what you are looking for:
-hibernate [on|off]

Check Target Windows with GetCersionEx(..) and then decide
what to do, e.g the method you want to use. You can backtrack
the Registry Key Operations of the powercfg and then, if
you really want to do this from driver, access the registry and
set these options from your driver if you like,...

I think its registry where this stuff is stored,...where else,...

Regards

Kerem


--
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

<bhl...@gmail.com> schrieb im Newsbeitrag
news:656b0cdd-527d-48f6...@w8g2000prd.googlegroups.com...

bhl...@gmail.com

unread,
Jun 23, 2008, 9:52:44 PM6/23/08
to
Thanks ,KenSnyder and David Craig
0 new messages