我想通过设备的控制端点EndPoint 0,进行读取寄存器的操作,寄存器是R\W的,地址是由Value的低位设置的
-
- ReservedBits = 0;
- urbflags = USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK;
- uValue = VALUEHIGH(*value)|reg;//将value的值向右移动8位,reg是寄存器的地址,结果存放在value中
- bRequest = 0xc3;
- uIndex = 0;
- UsbBuildVendorRequest(urb,
- URB_FUNCTION_VENDOR_ENDPOINT,
- sizeof(urb),
- urbflags,
- ReservedBits,
- bRequest,
- uValue,
- uIndex,
- value,
- NULL,
- sizeof(value),
- NULL);
-
然后,发送URB
- irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_SUBMIT_URB,
- deviceExtension->TopOfStackDeviceObject,
- NULL,
- 0,
- NULL,
- 0,
- TRUE,
- &event,
- &ioStatus);
- nextStack = IoGetNextIrpStackLocation(irp);
- ASSERT(nextStack != NULL);
- nextStack->Parameters.Others.Argument1 = Urb;
结果ntStatus==INVALID_PARAMTER,不知哪位给予指点,究竟参数该怎么设置