> 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
(E-Mail Removed)
http://www.storagecraft.com