IRP_MN_SURPRISE_REMOVAL

All PnP drivers must handle this IRP.

Value

0x17

Major Code

IRP_MJ_PNP

When Sent

The PnP manager sends this IRP to notify the drivers for a device that the device is no longer available for I/O operations. This IRP is sent on Windows 2000 and later systems only.

The PnP manager sends this IRP before notifying user-mode applications or other kernel-mode components. After this IRP completes, the PnP manager notifies registered applications and drivers that the device has been removed.

The device can be in any PnP state when the PnP manager sends this IRP.

On Windows 98/Windows Me, the PnP manager does not send this IRP.

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

Input Parameters

None

Output Parameters

None

I/O Status Block

A driver must set Irp->IoStatus.Status to STATUS_SUCCESS. A driver must not fail this IRP.

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.

For more information about this IRP, see Handling an IRP_MN_SURPRISE_REMOVAL Request. For additional information about supporting device removal, see Removing a Device.

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

IRP_MN_REMOVE_DEVICE