How to prevent Visra from entering Sleep or Hibernation mode

Vista is behaving as intended. Vista does not allow a driver or application to prevent a system power state transition. The solution is to fix your applications and drivers to function properly when an Sx transition occurs. This means listeing to the appropriate windows message and properly handling power and io irps in coordination with your device’s power state.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Quang Vu
Sent: Wednesday, December 19, 2007 10:35 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to prevent Visra from entering Sleep or Hibernation mode

Hi all

I have a driver for our PCI cards. The driver is for Windows 2000/XP and
Vista
I have a problem related to Power management and I hope someone can help
me.

In Win2000 / XP I can go only in Standby or Hibernate mode when all
applications talked to our drivers are closed. Otherwise Windows pops-up the
following message
" The device driver for “XYZ” device is preventing the machine from
entering hibernation. Please close all application and try again, "
It is OK because that is the behaviour we want.

In Windows Vista I do not have any messages above. The system just
enters into Sleep or Hibernate mode even if there are still applications
talk to our drivers.
My question is what I should do in driver to prevent Vista from entering
Sleep or Hibernate mode ?
More presisely, how can I obtain the same behavior and the same error
message as in Windows 2000 / XP ?

I tried to return an error when prosessing IRP_MN_SET_POWER but it does
not help. Please advise me the righ way to do.

Thanks in advance
QUANG


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer