IRP_MJ_READ (Kbdclass)
A IRP_MJ_READ request transfers data from the Kbdclass input data queue to a client.
When Sent
The raw input thread in the Microsoft Win32 subsystem sends read requests to obtain keyboard input.
Input Parameters
The Parameters.Read.Length member specifies the size, in bytes, of zero or more KEYBOARD_INPUT_DATA structures.
Output Parameters
The AssociatedIrp.SystemBuffer member points to the output buffer that is allocated by the Win32 subsystem to output the requested number of KEYBOARD_INPUT_DATA structures.
I/O Status Block
The Information member specifies the number of bytes that are transferred to the Win32 subsystem output buffer. The number of bytes that are transferred is the smallest of the requested number of bytes and the number of bytes currently in the internal data queue.
The Status member is set to one of the following values:
STATUS_SUCCESS
At least one KEYBOARD_INPUT_DATA structure was transferred.STATUS_BUFFER_TOO_SMALL
The number of requested bytes is not an integer multiple of the size, in bytes, of a KEYBOARD_INPUT_DATA structure.STATUS_CANCELLED
The request was canceled before the transfer actually took place.STATUS_DEVICE_NOT_CONNECTED
The device has been removed.STATUS_PRIVILEGE_NOT_HELD
The requesting subsystem does not have read privileges.
Operation
The IRP_MJ_READ request transfers zero or more KEYBOARD_INPUT_DATA structures from Kbdclass's internal data queue to the Win32 subsystem buffer. If there is no data in the data queue, a read request remains pending until it is completed or canceled.
Kbdclass completes a read request and does not send the request down the device stack.
A read request can be canceled. If a cleanup is in progress when a read request is received, no action is taken.
Note that a read request can be completed successfully only if the request was made by a trusted subsystem. Kbdclass performs a privilege check to enforce this restriction. The Win32 subsystem is currently the only trusted subsystem.
Requirements
Header |
Ntddk.h (include Wdm.h, Ntddk.h, or Wdm.h) |
See also