IOCTL_READ_REGISTERS IOCTL (usbscan.h)

Reads from USB device registers, using the control pipe.

Major code

IRP_MJ_DEVICE_CONTROL

Input buffer

Pointer to an IO_BLOCK structure.

Input buffer length

Size of the input buffer.

Output buffer

Pointer to a buffer to receive register contents.

Output buffer length

Size of the output buffer. The value must match the contents of the uLength member of the IO_BLOCK structure.

Status block

Irp->IoStatus.Status is set to STATUS_SUCCESS if the request is successful. Otherwise, Status to the appropriate error condition as a NTSTATUS code.

Remarks

DeviceIoControl Parameters

When the DeviceloControl function is called with the IOCTL_READ_REGISTERS I/O control code, the caller must specify the address of an IO_BLOCK structure as the function's lpInBuffer parameter.

Using the IO_BLOCK contents, the kernel-mode driver creates a URB that contains a _URB_CONTROL_VENDOR_OR_CLASS_REQUEST structure.

The following table indicates the values assigned to _URB_CONTROL_VENDOR_OR_CLASS_REQUEST structure members.

Structure Member Value Assigned
TransferFlags 1
TransferBufferLength pIoBlock->uLength
TransferBuffer DeviceIoControl's lpOutBuffer argument.
TransferBufferMDL NULL
RequestTypeReservedBits 0xC0
Request (pIoBlock->uLength > 1) ? 0x04 : 0x0C
Value (SHORT)pIoBlock->uOffset
Index pIoBlock->uIndex

For more information, see Accessing Kernel-Mode Drivers for Still Image Devices.

Requirements

Requirement Value
Header usbscan.h (include Usbscan.h)