Previous Next

IRP_MN_QUERY_REMOVE_DEVICE

All PnP drivers must handle this IRP.

Major Code

IRP_MJ_PNP

When Sent

The PnP Manager sends this IRP to inform drivers that a device is about to be removed from the machine and to query whether the device can be removed without disrupting the machine. The PnP Manager also sends this IRP if a user requests to update driver(s) for the device.

The PnP Manager sends this IRP at IRQL PASSIVE_LEVEL in the context of a system thread.

Input

None

Output

None

I/O Status Block

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

Operation

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

In response to this IRP, drivers indicate whether the device can be removed without disrupting the machine.

For more information about handling this IRP, see Handling an IRP_MN_QUERY_REMOVE_DEVICE Request. For general information about supporting device removal, see Removing a Device.

Sending This IRP

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

See Also

IRP_MN_CANCEL_REMOVE_DEVICE, IRP_MN_DEVICE_USAGE_NOTIFICATION, IRP_MN_REMOVE_DEVICE