Hi,
I can receive the IRP_MJ_INTERNAL_DEVICE_CONTROL from the PDO of xusb after I changed the code to set the query interface as below. Next, I will respond the GET_DESCRIPTOR from the event callback function.
RtlZeroMemory(&xusbInterface, sizeof(xusbInterface));
xusbInterface.Size = sizeof(xusbInterface);
xusbInterface.Version = USB_BUSIF_USBDI_VERSION_1;
xusbInterface.BusContext = (PVOID)hChild;
xusbInterface.InterfaceDereference = WdfDeviceInterfaceReferenceNoOp;
xusbInterface.InterfaceDereference = WdfDeviceInterfaceDereferenceNoOp;
xusbInterface.SubmitIsoOutUrb = Bthxusb_SubmitIsoOutUrb;
xusbInterface.GetUSBDIVersion = Bthxusb_GetUSBDIVersion;
xusbInterface.QueryBusTime = Bthxusb_QueryBusTime;
xusbInterface.QueryBusInformation = Bthxusb_QueryBusInformation;
xusbInterface.IsDeviceHighSpeed = Bthxusb_IsDeviceHighSpeed;
WDF_QUERY_INTERFACE_CONFIG_INIT(
&qiConfig,
(PINTERFACE)&xusbInterface,
&USB_BUS_INTERFACE_USBDI_GUID,
NULL
);
status = WdfDeviceAddQueryInterface(hChild, &qiConfig);
IfFailGoToExit(status, BTHX_PDO, “WdfDeviceAddQueryInterface failed”);
VOID
USB_BUSIFFN
Bthxusb_GetUSBDIVersion(
IN PVOID BusContext,
IN OUT PUSBD_VERSION_INFORMATION VersionInformation,
IN OUT PULONG pHcdCapabilities
)
{
UNREFERENCED_PARAMETER(BusContext);
BthxTraceFuncEntry();
if (VersionInformation != NULL)
{
VersionInformation->USBDI_Version = 0x600; /* Usbport */
VersionInformation->Supported_USB_Version = 0x200; /* USB 2.0 */
}
if (pHcdCapabilities != NULL)
{
*pHcdCapabilities = 0;
}
BthxTraceFuncExit();
}
NTSTATUS
USB_BUSIFFN
Bthxusb_QueryBusTime(
IN PVOID BusContext,
IN OUT PULONG pCurrUsbFrame
)
{
UNREFERENCED_PARAMETER(BusContext);
UNREFERENCED_PARAMETER(pCurrUsbFrame);
BthxTraceFuncEntry();
BthxTraceFuncExit();
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
USB_BUSIFFN
Bthxusb_SubmitIsoOutUrb(
IN PVOID BusContext,
IN PURB Urb
)
{
UNREFERENCED_PARAMETER(BusContext);
UNREFERENCED_PARAMETER(Urb);
BthxTraceFuncEntry();
BthxTraceFuncExit();
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
USB_BUSIFFN
Bthxusb_QueryBusInformation(
IN PVOID BusContext,
IN ULONG Level,
IN OUT PVOID pBusInfoBufr,
IN OUT PULONG pBusInfoBufrLen,
OUT PULONG pBusInfoActlLen
)
{
UNREFERENCED_PARAMETER(BusContext);
UNREFERENCED_PARAMETER(Level);
UNREFERENCED_PARAMETER(pBusInfoBufr);
UNREFERENCED_PARAMETER(pBusInfoBufrLen);
UNREFERENCED_PARAMETER(pBusInfoActlLen);
BthxTraceFuncEntry();
BthxTraceFuncExit();
return STATUS_NOT_IMPLEMENTED;
}
BOOLEAN
USB_BUSIFFN
Bthxusb_IsDeviceHighSpeed(
IN PVOID BusContext
)
{
UNREFERENCED_PARAMETER(BusContext);
BthxTraceFuncEntry();
BthxTraceFuncExit();
return TRUE;
}