Doron is right. I solved the same issue a few weeks back.
Register a WDM preprocess routine for PNP IRPS, specify the minor code
to be Query Interface.
When you get called back, check the GUID Value matches
USB_BUS_INTERFACE_USBDI_GUID.
StackLocation->Parameters.QueryInterface.Version will have the right
version in it. Based in the version, fill out your pointers for call
backs and then complete the IRP.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, November 17, 2010 10:20 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Bug in KMDF?
IIRC, USBDI_V1 is not an import interface, so you will not see anything
from the caller’s buffer because there is nothing there. THE USBDI
interfaces across versions do not conform to the pnp rules of version
change for interfaces. KMDF expects that the GUID changes when you
change the interface, USBDI does not. If you want to support this
interface, you need a WDM preprocess routine to handle the QI
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Wednesday, November 17, 2010 1:48 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Bug in KMDF?
Im writing a USB bus driver for virtualizating USB and im having trouble
completing the IRP_MN_QUERY_INTERFACE irp. I need to return the
USB_BUS_INTERFACE_USBDI_V1 interface.
Therefore firstly I call WdfDeviceAddQueryInterface() with a
EvtDeviceProcessQueryInterfaceRequest callback. The callback receives
all its parameters as zero, even though i can see the IRP come in
correctly filled in a tracing program i have). Its as if the KMDF
doesnt copy over the IRP parameters into the callback arguments until
after the callback is made and instead just has a default zeros.
I notice that this thread explains a very similar issue
http://www.osronline.com/showThread.cfm?link=188281.
So i tried preprocessing the IRP method instead, like in that thread and
i can now receive the correct parameters as they are sent in the
incoming IRP, however i cant set the return status to SUCCESS. It always
sets IoStatus.Status to 1 regardless of what i set it to, and i DONT
call WdfDeviceWdmDispatchPreprocessedIrp.
Can someone confirm this is a bug in KMDF and if there is a workaround?
Thanks
Michael
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