IRP_MN_QUERY_PNP_DEVICE_STATE

Function, filter, and bus drivers can handle this request.

Value47

0x14

Major Code

IRP_MJ_PNP

When Sent

The PnP manager sends this IRP after the drivers for a device return success from the IRP_MN_START_DEVICE request sent when a device is first started. This IRP is not sent on a start after a stop for resource rebalancing. The PnP manager also sends this IRP when a driver for the device calls IoInvalidateDeviceState.

The PnP manager sends this IRP at IRQL PASSIVE_LEVEL in the context of an arbitrary thread.

Input Parameters

None

Output Parameters

Returned in I/O status block.

I/O Status Block

A driver sets Irp->IoStatus.Status to STATUS_SUCCESS or to an appropriate error status such as STATUS_UNSUCCESSFUL.

On success, a driver sets Irp->IoStatus.Information to a PNP_DEVICE_STATE bitmask.

If a function or filter driver does not handle this IRP, it calls IoSkipCurrentIrpStackLocation, does not set an IoCompletion routine, and passes the IRP down to the next driver. Such a driver must not modify Irp->IoStatus and must not complete the IRP.

If a bus driver does not handle this IRP, it leaves Irp->IoStatus.Status as is and completes the IRP.

Operation

This IRP is handled first by the driver at the top of the device stack and then by each next lower driver in the stack.

A driver handles this IRP if it has information about the PnP state of a device. A driver can set or clear the flags in the PNP_DEVICE_STATE bitmask. If another driver has set a PNP_DEVICE_STATE in Irp->IoStatus.Information, a driver must take care to modify the flags in that bitmask rather than overwrite the whole structure.

See Plug and Play for the general rules for handling Plug and Play minor IRPs.

Sending This IRP

Reserved for system use. Drivers must not send this IRP.

Requirements

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

See also

IoInvalidateDeviceState

PNP_DEVICE_STATE