Hi, all,
I' m trying to write a WLAN driver for USB interface.
When I called IoCalldriver to deliver a URB to USB bus, it returns 0xC0000010.
Can anyone help me? Thanks !
Below is the part of source generated by DriverStudio 3.2.
// we will use do{}while(FALSE); structure
// to help with resource cleanup
urb = NULL;
deviceDescriptor = NULL;
configDescriptor = NULL;
interfaceBuffer = NULL;
do
{
// we need to allocate an URB to talk
// to usb bus driver
urb = (PURB)ExAllocatePoolWithTag(
NonPagedPool,
sizeof(URB),
USBWIFI_POOL_TAG
);
if (urb == NULL)
{
status = STATUS_INSUFFICIENT_RESOURCES;
break;
}
// first let's read device descriptor
deviceDescriptor = (PUSB_DEVICE_DESCRIPTOR)ExAllocatePoolWithTag(
NonPagedPool,
sizeof(USB_DEVICE_DESCRIPTOR),
USBWIFI_POOL_TAG
);
if (deviceDescriptor == NULL)
{
status = STATUS_INSUFFICIENT_RESOURCES;
break;
}
Is the URB structure filled in with appropriate values before the call to ioCallDriver?
Peter
hello, Peter
I used UsbBuildGetDescriptorRequest MACRO to fill URB structure like below, is there any problem?
UsbBuildGetDescriptorRequest(
urb,
(USHORT)sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST),
USB_DEVICE_DESCRIPTOR_TYPE,
0,
0,
deviceDescriptor,
NULL,
sizeof(USB_DEVICE_DESCRIPTOR),
NULL
);
Bookmarks