PC Review


Reply
Thread Tools Rate Thread

Check for windows shutdown/restart in device Driver

 
 
Thomas Johansen
Guest
Posts: n/a
 
      30th Apr 2004
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


 
Reply With Quote
 
 
 
 
Maxim S. Shatskih
Guest
Posts: n/a
 
      30th Apr 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
(E-Mail Removed)
http://www.storagecraft.com


 
Reply With Quote
 
Thomas Johansen
Guest
Posts: n/a
 
      3rd May 2004
Thanks...


"Maxim S. Shatskih" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> > 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Windows restart notification to device driver Doron Holan [MSFT] Windows XP Drivers 1 17th Aug 2009 07:31 PM
Device detection probs - behavior changes restart vs shutdown/rest RobertBone Windows XP General 0 20th Dec 2008 02:27 PM
Re: Device driver causing restart? Cari \(MS-MVP\) Windows XP Drivers 0 14th May 2006 07:09 PM
driver device Errors andblue screen shutdown =?Utf-8?B?ZGFrYXJ0?= Windows XP New Users 0 8th Apr 2004 01:31 AM
Device driver error causing shutdown John Hemenway Windows XP Drivers 1 8th Oct 2003 09:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:48 AM.