The IRP_MJ_CREATE request opens a mouse device.
The Microsoft Win32 subsystem opens all mouse devices for its exclusive use during a system boot or after a new mouse device is installed. This request is also sent when a user switch is requested.
I/O Status Block
How Mouclass sets the Information member and the Status member of the I/O status block of the IRP depends on whether the mouse is a Plug and Play (PnP) device or a nonPnP device, as follows:
The Information member of the IRP is set to zero.
The Status member is set to one of the following values:
The request completed successfully.
The device is not started.
A lower-level driver returned an error status.
The Information member is set to zero.
The Status member is set to STATUS_SUCCESS or the status returned by a lower-level driver for the IOCTL_INTERNAL_MOUSE_ENABLE request.
How Mouclass opens a mouse depends on whether the mouse is a PnP device or a nonPnP device, as follows:
If the device is started, Mouclass sends the IRP_MJ_CREATE request down the device stack. If the device is not started, Mouclass completes the request without sending the request down the driver stack. Mouclass sets the "trusted" file that is permitted read access to the device. If there is a grandmaster device, Mouclass sends a create request to all the mouse devices associated with the subordinate class device objects.
Mouclass sends a synchronous IOCTL_INTERNAL_MOUSE_ENABLE request down the device stack.
|Ntddk.h (include Wdm.h, Ntddk.h, or Wdm.h)|