No, the bus driver does not need to do anything to generate device interface arrival/departure notifications. It is up to the driver which registered the interface (typically the FDO) to set the interface state to false at the appropriate time. My point is that perhaps explorer is using a combination of interface state change + i/o completion before it closes the handle and that the normal usb bus driver causes this io to complete in the s.r. path while your bus driver does not.
d
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Pankaj Garg
Sent: Wednesday, November 28, 2007 10:40 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] KMDF Stuck Device
Doron,
I am reporting the PDO missing. Eveyrthing works ok in all other scenarios. As soon as I either kill explorer or click on c:\ , it frees that handle for my device.
I just tried both PurgeQueue calls and it didn’t make a difference.
I’m guessing explorer subscribes to device arrival and removal notifications and should clean up as soon as it sees this device going away.
Do I have to do anything special to generate those messages?
Thanks
Pankaj
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, November 28, 2007 9:47 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] KMDF Stuck Device
Well, first you have to report the PDO as missing. I am assuming that you are doing that part. Are you also purging the WDFQUEUEs? Perhaps explorer will close the handle when it sees a failed i/o.
d
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Pankaj Garg
Sent: Wednesday, November 28, 2007 9:36 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] KMDF Stuck Device
I create virtual USB devices using my Bus Driver. I am able to get explorer to recognize flash drives and I can do data transfers.
However when I’m in the middle of a transfer and if the device is deleted from the BUS, the stack should get cleaned up, i.e. explorer should get a notification that device went away and should close its handle.
It does that for regular USB devices.
In my case it keeps a handle open and so my PDO is stuck unless I go and click on dialog boxes thrown up by explorer and kill it. As soon as I kill it, everything gets cleaned up.
Question is what do I have to do in my BUS driver to support this kinda scenario? Is there an interface I need to implement? Is there some kind of flag or something I’m missing.
-pankaj
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
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
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