Discussion:
Removal of PDO
(too old to reply)
Sushil
2010-07-07 07:09:56 UTC
Permalink
Hi,
I have written a Bus driver based on KMDF Toaster dynamic bus driver.
I can plugin a device and load the corresponding driver. The only
problem I am facing in unplug & ejecting the device. Although while
trying device unplug i can see drivers got removed but if I see the
hidden device, the driver is still there and properties says device is
not connected(code 45).

Could anyone please help me in removing the device cleanly.

Thanks & regards,
Sushil
Sushil
2010-07-07 13:38:37 UTC
Permalink
Post by Sushil
Hi,
I have written a Bus driver based on KMDF Toaster dynamic bus driver.
I can plugin a device and load the corresponding driver. The only
problem I am facing in unplug & ejecting the device. Although while
trying device unplug i can see drivers got removed but if I see the
hidden device, the driver is still there and properties says device is
not connected(code 45).
Could anyone please help me in removing the device cleanly.
Thanks & regards,
Sushil
Event I tried MS Toaster example on WindowsXP and Windows 7, I am
getting the same issue.
enum -p 1
Post by Sushil
driver loaded
enum -u 1 or enum -e 1
driver unloaded
but if I click on "show hidden devices"(set
devmgr_show_nonpresent_devices=1) option in device manager, I can see
the driver is still there and the properties says device is not
connected(code 45).

Is it the normal behavior, can't we completely removed the device?
Please help us in this regards.
Wilhelm Noeker
2010-07-07 15:23:28 UTC
Permalink
Post by Sushil
Post by Sushil
Hi,
I have written a Bus driver based on KMDF Toaster dynamic bus driver.
I can plugin a device and load the corresponding driver. The only
problem I am facing in unplug & ejecting the device. Although while
trying device unplug i can see drivers got removed but if I see the
hidden device, the driver is still there and properties says device is
not connected(code 45).
Is it the normal behavior, can't we completely removed the device?
Please help us in this regards.
Yes, this is normal behavior. You've just discovered the difference
between a PDO (which a bus driver can create and make disappear as it
pleases) and a device node (which is essentially what you're seeing in
the device manager).

There is a reason why device nodes are persistent like that: They
contain driver information. And that design allows you, for example, to
plug and unplug a USB device as often as you like, but you only have to
install the driver once.

If you want to delete the device node, too, you can do so from the
device manager, or via setup API calls (as shown in the devcon sample),
but not from your kernel driver itself.
Maxim S. Shatskih
2010-07-07 18:07:24 UTC
Permalink
Post by Sushil
Is it the normal behavior
Yes.
Post by Sushil
, can't we completely removed the device?
"Uninstall" in the device manager.
--
Maxim S. Shatskih
Windows DDK MVP
***@storagecraft.com
http://www.storagecraft.com
Loading...