Order of Remove Irps in Win2k Drivers !!

When I try to delete a partition, the Pnp manager sends an IRP_MN_SURPRISE_REMOVAL followed by an IRP_MN_REMOVE_DEVICE. Are there any exceptions to this because for a partition with open handles I just get an IRP_MN_SURPRISE_REMOVAL and no IRP_MJ_REMOVE_DEVICE?

Thanks,
Anima

There are no exceptions. In general the PnP manager will not send a
IRP_MN_REMOVE_DEVICE followed by either IRP_MN_QUERY_REMOVE (in the case of
graceful remove) or IRP_MN_SURPRISE_REMOVE so long as there is an handle to
the device open.

-Eliyas

-----Original Message-----
From: anima [mailto:xxxxx@Legato.COM]
Sent: Tuesday, March 21, 2000 1:53 AM
To: NT Developers Interest List
Subject: [ntdev] Order of Remove Irps in Win2k Drivers !!

When I try to delete a partition, the Pnp manager sends an
IRP_MN_SURPRISE_REMOVAL followed by an IRP_MN_REMOVE_DEVICE. Are there any
exceptions to this because for a partition with open handles I just get an
IRP_MN_SURPRISE_REMOVAL and no IRP_MJ_REMOVE_DEVICE?

Thanks,
Anima

I’ve tried to parse your sentence several times but my sematic module must
be out of rev. Are you saying that surprise will never follow remove (which
I think is true) or are you saying that surprise will sometimes follow
remove?

=
Mark Roddy

Windows 2000/Windows NT Consulting:

xxxxx@hollistech.com
www.hollistech.com

=

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Eliyas Yakub
Sent: Tuesday, March 21, 2000 1:22 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Order of Remove Irps in Win2k Drivers !!

There are no exceptions. In general the PnP manager will not send a
IRP_MN_REMOVE_DEVICE followed by either IRP_MN_QUERY_REMOVE (in the case of
graceful remove) or IRP_MN_SURPRISE_REMOVE so long as there is an handle to
the device open.

-Eliyas

-----Original Message-----
From: anima [mailto:xxxxx@Legato.COM]
Sent: Tuesday, March 21, 2000 1:53 AM
To: NT Developers Interest List
Subject: [ntdev] Order of Remove Irps in Win2k Drivers !!

When I try to delete a partition, the Pnp manager sends an
IRP_MN_SURPRISE_REMOVAL followed by an IRP_MN_REMOVE_DEVICE. Are there any
exceptions to this because for a partition with open handles I just get an
IRP_MN_SURPRISE_REMOVAL and no IRP_MJ_REMOVE_DEVICE?

Thanks,
Anima

I meant IRP_MN_REMOVE_DEVICE device will be sent after either
IRP_MN_QUERY_REMOVE or IRP_MN_SURPRISE_REMOVE only if there are no handles
to the device open.

During graceful remove (disable/uninstall/eject), the system sends
QUERY_REMOVE to the device stack and if:

a) Nobody in the driver stack fails the request
b) All the usermode component (applications & services) and drivers that
have handle to the device okays QUERY_REMOVE device change notification and
close the handle

the system sends REMOVE, otherwise it sends CANCEL_REMOVE and aborts the
removal.

During surprise remove, the system sends SURPRISE_REMOVE IRP, and if all the
user apps and drivers close the handle, it sends REMOVE. No driver should
fail the SURPRISE_REMOVE IRP sent to the device stack.

I hope this is clear.

-Eliyas

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@wattanuck.mv.com]
Sent: Tuesday, March 21, 2000 4:16 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Order of Remove Irps in Win2k Drivers !!

I’ve tried to parse your sentence several times but my sematic module must
be out of rev. Are you saying that surprise will never follow remove (which
I think is true) or are you saying that surprise will sometimes follow
remove?

=
Mark Roddy

Windows 2000/Windows NT Consulting:

xxxxx@hollistech.com
www.hollistech.com

=

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Eliyas Yakub
Sent: Tuesday, March 21, 2000 1:22 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Order of Remove Irps in Win2k Drivers !!

There are no exceptions. In general the PnP manager will not send a
IRP_MN_REMOVE_DEVICE followed by either IRP_MN_QUERY_REMOVE (in the case of
graceful remove) or IRP_MN_SURPRISE_REMOVE so long as there is an handle to
the device open.

-Eliyas

-----Original Message-----
From: anima [mailto:xxxxx@Legato.COM]
Sent: Tuesday, March 21, 2000 1:53 AM
To: NT Developers Interest List
Subject: [ntdev] Order of Remove Irps in Win2k Drivers !!

When I try to delete a partition, the Pnp manager sends an
IRP_MN_SURPRISE_REMOVAL followed by an IRP_MN_REMOVE_DEVICE. Are there any
exceptions to this because for a partition with open handles I just get an
IRP_MN_SURPRISE_REMOVAL and no IRP_MJ_REMOVE_DEVICE?

Thanks,
Anima