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

Re: Check for windows shutdown/restart in device Driver by Maxim

Maxim
Fri Apr 30 07:21:38 CDT 2004

> 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



Re: Check for windows shutdown/restart in device Driver by Thomas

Thomas
Mon May 03 02:17:34 CDT 2004

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
>
>