Disabling a device in device manager causes it to disappear...

When I disable a device which my bus driver enumerates, it disappears
from device manager until I reboot. This isn’t the behaviour I
expected… In the D0Exit of the PDO I get a target state of
WdfPowerDeviceD3Final.

If something in my code returned an error, would Windows just remove the
device completely? Or should I be looking elsewhere for the cause?

Thanks

James

Do you mark the pdo as missing in any path that processes the power down ? Or after d0exit()? Run !wdfkd.wdflogudmp immediately after disabling the device and see what kmdf thinks is happening

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: James Harper
Sent: Wednesday, February 25, 2009 4:52 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Disabling a device in device manager causes it to disappear…

When I disable a device which my bus driver enumerates, it disappears
from device manager until I reboot. This isn’t the behaviour I
expected… In the D0Exit of the PDO I get a target state of
WdfPowerDeviceD3Final.

If something in my code returned an error, would Windows just remove the
device completely? Or should I be looking elsewhere for the cause?

Thanks

James


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

WHen you receive REMOVE_DEVICE for your PDO, you should NOT delete the PDO.

This is a KMDF driver, so he has no control over when the PDO is deleted, KMDF does it for you at the right time.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@broadcom.com
Sent: Wednesday, February 25, 2009 7:21 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Disabling a device in device manager causes it to disappear…

WHen you receive REMOVE_DEVICE for your PDO, you should NOT delete the PDO.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

>

Do you mark the pdo as missing in any path that processes the power
down ?
Or after d0exit()? Run !wdfkd.wdflogudmp immediately after disabling
the
device and see what kmdf thinks is happening

I found the problem - I tell xen to close the device so that when it is
enabled it re-initialises correctly, but this closing triggers a
WdfPdoRequestEject in another callback in my driver. After converting to
KMDF I hadn’t properly synchronised the two sections of code so that the
close is understood to be a result of the device being enabled, not a
result of a xen device being deleted.

Thanks

James