Hello,
Why does the DDK say that only one driver in the stack should
register for a shutdown notification ? What if more than one drivers
in the stack need to know about a shutdown ?
Thanks,
- Gary.
Hello,
Why does the DDK say that only one driver in the stack should
register for a shutdown notification ? What if more than one drivers
in the stack need to know about a shutdown ?
Thanks,
Gary wrote:
Why does the DDK say that only one driver in the stack should
register for a shutdown notification ? What if more than one drivers
in the stack need to know about a shutdown ?
Remember, in this context when they say “stack” they mean “devnode”.
I think the idea is that multiple drivers shouldn’t be trying to do
stuff like flush caches, etc, for the same device. Sort of like having
a single driver be responsible for power policy.
Having said that, if you need to know about shut down for some reason,
you have to register for notification,
Peter
OSR
Another point to consider is this is primarily a non pnp related API.
You can distinguish shutdown in the system power irp’s ShutdownType.
Typically, a pnp driver does not register or handle IRP_MJ_SHUTDOWN, and
if one hit the stack, it would not be forwarded down, rather be
completed immediately with error.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of PeterGV
Sent: Monday, November 08, 2004 2:04 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] A question on IoRegisterShutdownNotification()
Gary wrote:
Why does the DDK say that only one driver in the stack should
register for a shutdown notification ? What if more than one drivers
in the stack need to know about a shutdown ?
Remember, in this context when they say “stack” they mean “devnode”.
I think the idea is that multiple drivers shouldn’t be trying to do
stuff like flush caches, etc, for the same device. Sort of like having
a single driver be responsible for power policy.
Having said that, if you need to know about shut down for some reason,
you have to register for notification,
Peter
OSR
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Also note that if the driver below you in a device stack registered for
shutdown notification, depending on the specific stack, you can just pick up
the IRP_MJ_SHUTDOWN on its way down the stack. The request is specifically
sent to the top device object at the time of the shutdown, not directly to
the requesting device object.
Additionally, the storage stack translates IRP_MJ_SHUTDOWN into
SRB_FUNCTION_SHUTDOWN, which if you happen to be below disk.sys would be
equivalent to shutdown notification.
Finally, you may get more than one shutdown notification, especially if you
are a filter driver of any sort in the storage stack.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of PeterGV
Sent: Monday, November 08, 2004 5:04 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] A question on IoRegisterShutdownNotification()Gary wrote:
>
> Why does the DDK say that only one driver in the stack
should register
> for a shutdown notification ? What if more than one drivers in the
> stack need to know about a shutdown ?
>Remember, in this context when they say “stack” they mean “devnode”.
I think the idea is that multiple drivers shouldn’t be trying
to do stuff like flush caches, etc, for the same device.
Sort of like having a single driver be responsible for power policy.Having said that, if you need to know about shut down for
some reason, you have to register for notification,Peter
OSR
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com
Thanks guys for the replies.
Also note that if the driver below you in a device stack registered for
shutdown notification, depending on the specific stack, you can just pick
up
the IRP_MJ_SHUTDOWN on its way down the stack. The request is specifically
sent to the top device object at the time of the shutdown, not directly to
the requesting device object.
This is a very good point as I was wondering why I was getting this
notification
though I never registered for it. Since the driver below me has already
registered,
I am getting this by default without explicitly registering for this
notification.
BTW I am trying to implement a volume level filter driver and log all the
read/write requests
to a file. Since Shutdown notification can be called before file systems
flush the data, it is
possible that I might get more read/write requests. So how do I log these
requests ?
If I register for LastChance shutdown notification, I cannot access the file
system at this
stage. If you have any thoughts on this, would be very helpful.
Thanks a lot,
“Mark Roddy” wrote in message news:xxxxx@ntdev…
> Also note that if the driver below you in a device stack registered for
> shutdown notification, depending on the specific stack, you can just pick
up
> the IRP_MJ_SHUTDOWN on its way down the stack. The request is specifically
> sent to the top device object at the time of the shutdown, not directly to
> the requesting device object.
>
> Additionally, the storage stack translates IRP_MJ_SHUTDOWN into
> SRB_FUNCTION_SHUTDOWN, which if you happen to be below disk.sys would be
> equivalent to shutdown notification.
>
> Finally, you may get more than one shutdown notification, especially if
you
> are a filter driver of any sort in the storage stack.
>
>
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of PeterGV
> > Sent: Monday, November 08, 2004 5:04 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] A question on IoRegisterShutdownNotification()
> >
> > Gary wrote:
> > >
> > > Why does the DDK say that only one driver in the stack
> > should register
> > > for a shutdown notification ? What if more than one drivers in the
> > > stack need to know about a shutdown ?
> > >
> >
> > Remember, in this context when they say “stack” they mean “devnode”.
> >
> > I think the idea is that multiple drivers shouldn’t be trying
> > to do stuff like flush caches, etc, for the same device.
> > Sort of like having a single driver be responsible for power policy.
> >
> > Having said that, if you need to know about shut down for
> > some reason, you have to register for notification,
> >
> > Peter
> > OSR
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@hollistech.com To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
>
>
>
>