That IOCTL code doesn’t exist anywhere in my entire RC1 WDK source tree. Are you sure that isn’t one of your additions?
The nonpnp code I see has ioctls named for the various buffered/non-buffered methods (MEHOD_BUFFERED, METHOD_NEITHER, etc) only- it illustrates their handling. I don’t see a WdfObjectDelete call anywhere in the sample, either.
Normally you just delete the device in your unload routine in a non-Pnp driver. I believe KMDF will just do that for you (but I haven’t done it myself, so I’m not 100% on that).
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Chaney
Sent: Friday, September 15, 2006 11:56 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] hang when calling WdfObjectDelete(WdfIoQueueGetDevice(Queue));
Is anyone familiar with the nonpnp sample? I copied its method of
sending an ioctl (IOCTL_NONPNP_METHOD_DELETE_DEVICE) to delete the
device. What is it about that driver that makes it work? While my driver
has evolved quite a bit, it started as the nonpnp sample.
Peter suggested that I use my control object to delete the device- but
then how do I delete the control object?
Thanks,
–Jeremy
Bob Kjelgaard wrote:
H’mm, that’s a good one-line deadlock!
The queue can’t go away because you are in one of its callbacks- after all, we can’t know you haven’t got more IRPS to process, and that state would be maintained in the queue. The device can’t go away, because the queue can’t go away. The underlying device can’t go away (completely) anyway- you’ve got a handle open to it, or you couldn’t even be processing this IOCTL.
I’d suggest completing this request after queuing a work item to do the deletion (parent the item to the driver).
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer