阅读:4129回复:1
UsbBuildVendorRequest问题
UsbBuildVendorRequest(urb, //ptr to urb
URB_FUNCTION_VENDOR_DEVICE, (USHORT) siz, //siz of urb 0, 0x0, //reservedbits=bmRequestType 0x0C, //request = USBSCAN IOCTL_WRITE_REGISTER wValue, wIndex, ioBlock->pbyData, //TransferBuffer NULL, //mdl (unused) length, //bufferlength NULL); 的各个参数分别表示什么意思? |
|
最新喜欢:hellen... |
沙发#
发布于:2005-02-25 22:09
看英文没问题吧
下面是msdn的解释 UsbBuildVendorRequest UsbBuildVendorRequest formats an URB to send a vendor or class-specific command to a USB device, interface, endpoint, or other device-defined target. VOID UsbBuildVendorRequest( IN PURB Urb, IN USHORT Function, IN USHORT Length, IN ULONG TransferFlags, IN UCHAR ReservedBits, IN UCHAR Request, IN USHORT Value, IN USHORT Index, IN PVOID TransferBuffer OPTIONAL, IN PMDL TransferBufferMDL OPTIONAL, IN ULONG TransferBufferLength, IN PURB Link OPTIONAL, ); Parameters Urb Points to an URB that is to be formatted as a vendor or class request. Function Must be set to one of the following values: URB_FUNCTION_VENDOR_DEVICE Indicates the URB is a vendor-defined request for a USB device. URB_FUNCTION_VENDOR_INTERFACE Indicates the URB is a vendor-defined request for an interface on a USB device. URB_FUNCTION_VENDOR_ENDPOINT Indicates the URB is a vendor-defined request for an endpoint, in an interface, on a USB device. URB_FUNCTION_VENDOR_OTHER Indicates the URB is a vendor-defined request for a device-defined target. URB_FUNCTION_CLASS_DEVICE Indicates the URB is a USB-defined class request for a USB device. URB_FUNCTION_CLASS_INTERFACE Indicates the URB is a USB-defined class request for an interface on a USB device. URB_FUNCTION_CLASS_ENDPOINT Indicates the URB is a USB-defined class request for an endpoint, in an interface, on a USB device. URB_FUNCTION_CLASS_OTHER Indicates the URB is a USB-defined class request for a device-defined target. Length Specifies the length, in bytes, of the URB. TransferFlags Specifies zero, one, or a combination of the following flags: USBD_TRANSFER_DIRECTION_IN Is set to request data from a device. To transfer data to a device, this flag must be clear. The flag must be set if the pipe is an interrupt transfer pipe. USBD_SHORT_TRANSFER_OK Can be used if USBD_TRANSFER_DIRECTION_IN is set. If set, directs the HCD not to return an error if a packet is received from the device that is shorter than the maximum packet size for the endpoint. Otherwise, a short request is returns an error condition. ReservedBits Specifies a value, from 4 to 31 inclusive, that becomes part of the request type code in the USB-defined setup packet. This value is defined by USB for a class request or the vendor for a vendor request. Request Specifies the USB or vendor-defined request code for the device, interface, endpoint, or other device-defined target. Value Is a value, specific to Request, that becomes part of the USB-defined setup packet for the target. This value is defined by the creator of the code used in Request. Index Specifies the device-defined identifier if the request is for an endpoint, interface, or device-defined target. Otherwise, Index must be 0. TransferBuffer Points to a resident buffer for the transfer or is NULL if an MDL is supplied in TransferBufferMDL. The contents of this buffer depend on the value of TransferFlags. If USBD_TRANSFER_DIRECTION_IN is specified, this buffer will contain data read from the device on return from the HCD. Otherwise, this buffer contains driver-supplied data to be transferred to the device. TransferBufferMDL Points to an MDL that describes a resident buffer or is NULL if a buffer is supplied in TransferBuffer. The contents of the buffer depend on the value of TransferFlags. If USBD_TRANSFER_DIRECTION_IN is specified, the described buffer will contain data read from the device on return from the HCD. Otherwise, the buffer contains driver-supplied data to be transferred to the device. The MDL must be allocated from nonpaged pool. TransferBufferLength Specifies the length, in bytes, of the buffer specified in TransferBuffer or described in TransferBufferMDL. Link Points to an caller-initialized URB. Link becomes the subsequent URB in a chain of requests with Urb being its predecessor. Comments Callers of this routine must be running at IRQL <= DISPATCH_LEVEL. |
|