-----Original Message-----
From: Zhou, James
Sent: Thursday, June 14, 2001 4:21 PM
To: ‘NT Developers Interest List’
Subject: [ntdev] How does BUS driver handle device removal?
Hi all,
Can any body tell me how a BUS driver should do when a device is removed
from the bus? When a device is inserted, the bus driver will craete a PDO
and call IoInvalidateDeviceRelations() with BusRelations and the PDO. Then
in the IRP_MN_QUERY_DEVICE_RELATIONS entry, the bus driver will add the new
relation to the old one. But to remove a device, does the bus driver have to
call IoInvalidateDeviceRelations and handle IRP_MN_QUERY_DEVICE_RELATIONS
request?
Thanks in advance
James
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Yes. See the toaster sample in the ddk. Pay close attention to
IRP_MN_REMOVE_DEVICE processing.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Zhai, Shunnian
Sent: Thursday, June 14, 2001 4:30 AM
To: NT Developers Interest List
Subject: [ntdev] FW: How does BUS driver handle device removal?
-----Original Message-----
From: Zhou, James
Sent: Thursday, June 14, 2001 4:21 PM
To: ‘NT Developers Interest List’
Subject: [ntdev] How does BUS driver handle device removal?
Hi all,
Can any body tell me how a BUS driver should do when a device is removed
from the bus? When a device is inserted, the bus driver will craete a
PDO and call IoInvalidateDeviceRelations() with BusRelations and the
PDO. Then in the IRP_MN_QUERY_DEVICE_RELATIONS entry, the bus driver
will add the new relation to the old one. But to remove a device, does
the bus driver have to call IoInvalidateDeviceRelations and handle
IRP_MN_QUERY_DEVICE_RELATIONS request?
Thanks in advance
James
You are currently subscribed to ntdev as: xxxxx@tellink.net
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>Can any body tell me how a BUS driver should do when a device
is removed from the bus?
- mark the device object as “dead” logically
- call IoInvalidateDeviceRelations
Then:
3) do not report any “dead” PDOs to IRP_MN_QUERY_DEVICE_RELATIONS
4) handle MN_REMOVE_DEVICE for a “dead” PDO as necessary, deleting it in
progress.
Max
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> Hi all,
Can any body tell me how a BUS driver should do when a device is removed
from the bus? When a device is inserted, the bus driver will craete a PDO
and call IoInvalidateDeviceRelations() with BusRelations and the PDO. Then
in the IRP_MN_QUERY_DEVICE_RELATIONS entry, the bus driver will add the new
relation to the old one. But to remove a device, does the bus driver have to
call IoInvalidateDeviceRelations and handle IRP_MN_QUERY_DEVICE_RELATIONS
request?
Thanks in advance
James
Yes, you are not allowed to delete a PDO until the PDO has been
un-reported, (new word), in a response to an IRP_MN_QUERY_DEVICE_RELATIONS
IRP of BusRelations type by the FDO of the bus driver. Further, you should
only call IoInvalidateDeviceRelations if the hardware is truly gone. In
other words someone disabling the device from DeviceManager should not
cause a deletion of the PDO.
As Mark Roddy suggested, the Toaster bus driver sample is a really good one
to follow.
Bill M.
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com