[vbox-dev] IoGetDeviceObjectPointer hangs vboxusbmon

Huihong Luo huisinro at yahoo.com
Tue Mar 13 11:10:10 PDT 2012

This api simply returns a device object from a name, and usually does not block. What is the 
device name? you can examine ObjectName unicode string.
IoGetDeviceObjectPointer() does the following thing:
ZwOpenFile(ObjectName) to get a handle
ObReferenceObjectByHandle(handle) to get the FileObject
IoGetRelatedDeviceObject(FileObject) to get the device object
you can further step into the assembly code to nail down which function call causes the lock.
you can also list all locks using these commands in windbg:
--- On Tue, 3/13/12, Ribhi Kamal <rbhkamal at gmail.com> wrote:

From: Ribhi Kamal <rbhkamal at gmail.com>
Subject: Re: [vbox-dev] IoGetDeviceObjectPointer hangs vboxusbmon
To: "vbox-dev" <vbox-dev at virtualbox.org>
Date: Tuesday, March 13, 2012, 10:49 AM

Sorry, actually the IRQL == PASSIVE_LEVEL is okay. So just ignore that bit.

On Tue, Mar 13, 2012 at 1:27 PM, Ribhi Kamal <rbhkamal at gmail.com> wrote:

I've been troubleshooting an issue that prevents vbox from capturing USB devices when other specific USB devices are plugged in (i.e. Sprint USB crap). I finally managed to track down the problem to IoGetDeviceObjectPointer in VboxUsbMonHubDevWalk. IoGetDeviceObjectPointer was getting called, however, it never returned.

I'm not an expert in windows driver development so I'd like to run things by you before I start fixing it.

Firstly, I'm not really sure why it hangs (deadlocks?) there for some devices and not others. However, I believe that it may be due to the fact that some driver interfaces cause blocking PnP events. Due to that, vboxusbmon runs into a deadlock when executing IoGetDeviceObjectPointer because it is being used directly from a callback function, VBoxUsbMonDeviceControl, and IRQL==PASSIVE_LEVEL.

What led me to that conclusion is that right after IoGetDeviceObjectPointer is executed, I start seeing lots of PnP events.

IoGetDeviceObjectPointer - Starting     

VBoxUsbMonPnPHook In    

==>PnP: Mn(IRP_MN_QUERY_DEVICE_RELATIONS), PDO(0x8833d028), IRP(0x882a71a8), Status(0xc00000bb) 

See attached for complete debug view.

Are my assumptions correct? If so how would you go about fixing the problem.


-- Ribhi

-- Ribhi

-----Inline Attachment Follows-----

vbox-dev mailing list
vbox-dev at virtualbox.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20120313/673641ac/attachment-0001.html 

More information about the vbox-dev mailing list