RE: usbaudio/usbvideo and the usb hub driver.

I’m seeing a similar issue. Glen can you please explain this.
I’ve put in the WdfDeviceInitAssignWdmIrpPreprocessCallback routine but
not sure how to handle it there.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@microsoft.com
Sent: Friday, April 23, 2010 10:31 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] usbaudio/usbvideo and the usb hub driver.

You will need to implement multiple versions of the interface. Due to
the way this USB interface is defined with different sizes for the
different versions of the interface you will need to register an Irp
Preprocess Callback (WdfDeviceInitAssignWdmIrpPreprocessCallback) to
handle this correctly in your WDF driver.

-Glen


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

I haven’t looked into the full details of this myself, but it appears that doing something like the following in the Preprocess Callback for USB_BUS_INTERFACE_USBDI_GUID does something to work around an issue with supporting multiple versions of the interface. This comes with no guarantees that it will correctly help solve your issue.

NTSTATUS
QueryInterfaceIrpPreprocessCallback(
WDFDEVICE Device,
PIRP Irp
)
{
PIO_STACK_LOCATION irpStack;
PINTERFACE interface;
NTSTATUS status;

irpStack = IoGetCurrentIrpStackLocation(Irp);

if (RtlCompareMemory(irpStack->Parameters.QueryInterface.InterfaceType,
&USB_BUS_INTERFACE_USBDI_GUID,
sizeof(GUID)) == sizeof(GUID)) {

interface = irpStack->Parameters.QueryInterface.Interface;

interface->Size = irpStack->Parameters.QueryInterface.Size;
interface->Version = irpStack->Parameters.QueryInterface.Version;
}

IoSkipCurrentIrpStackLocation(Irp);
status = WdfDeviceWdmDispatchPreprocessedIrp(Device, Irp);

return status;
}