Tom's Hardware > Forum > Windows XP > Device Driver > Check for windows shutdown/restart in device Driver

Check for windows shutdown/restart in device Driver

Forum Windows XP : Device Driver - Check for windows shutdown/restart in device Driver

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: microsoft.public.development.device.drivers,microsoft.public.win32.programmer.kernel,microsoft.public.windowsxp.device_driver.dev (More info?)

 

Hi

1: I just wonder if it's possible to check in an device driver, that a
system restart/shutdown has been issued by the system ?

2: I know I can get an notification by using IoRegisterShutdownNotification
but when is my ShutDown function called ?
Is it as soon a restart/shutdown har been issued or when windows think
it's time to close my driver ?

3: Can I gen a notification as soon an system restart/shutdown has bee
issued ?


I need to check in my watchdog driver if a reboot has been started to catch
any reboots/shutdowns thats failes.. (Its sometimes does)

Thomas

Sponsored Links
Register or log in to remove.

Archived from groups: microsoft.public.development.device.drivers,microsoft.public.win32.programmer.kernel,microsoft.public.windowsxp.device_driver.dev (More info?)

 

> 1: I just wonder if it's possible to check in an device driver, that a
> system restart/shutdown has been issued by the system ?

Yes. The power IRP path for a System power IRP.

> 2: I know I can get an notification by using IoRegisterShutdownNotification
> but when is my ShutDown function called ?

If you're not in the disk stack - then it is called when FSDs are still up.
Otherwise, it is called just after cache flush, when FSD is already down.

The MJ_POWER mechanism is employed only after these calls.

> Is it as soon a restart/shutdown har been issued or when windows think
> it's time to close my driver ?

Closes are not related to power management. At all.

> 3: Can I gen a notification as soon an system restart/shutdown has bee
> issued ?

Yes. See answer 1.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

Reply to Anonymous

Archived from groups: microsoft.public.development.device.drivers,microsoft.public.win32.programmer.kernel,microsoft.public.windowsxp.device_driver.dev (More info?)

 

Thanks...


"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:eGtgN2qLEHA.2260@TK2MSFTNGP09.phx.gbl...
> > 1: I just wonder if it's possible to check in an device driver, that a
> > system restart/shutdown has been issued by the system ?
>
> Yes. The power IRP path for a System power IRP.
>
> > 2: I know I can get an notification by using
IoRegisterShutdownNotification
> > but when is my ShutDown function called ?
>
> If you're not in the disk stack - then it is called when FSDs are still
up.
> Otherwise, it is called just after cache flush, when FSD is already down.
>
> The MJ_POWER mechanism is employed only after these calls.
>
> > Is it as soon a restart/shutdown har been issued or when windows
think
> > it's time to close my driver ?
>
> Closes are not related to power management. At all.
>
> > 3: Can I gen a notification as soon an system restart/shutdown has bee
> > issued ?
>
> Yes. See answer 1.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>

Reply to Anonymous
Tom's Hardware > Forum > Windows XP > Device Driver > Check for windows shutdown/restart in device Driver
Go to:

There are 527 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them