Previous Next

IRP_MN_DEVICE_USAGE_NOTIFICATION

System components send this IRP to ask the drivers for a device whether the device can support a special file. If all the drivers for the device succeed the IRP, the system creates the special file. The system also sends this IRP to inform drivers that a special file has been removed from the device. The special files can be a paging file, a crash dump file, or a hibernation file.

Function drivers must handle this IRP if their device can contain a paging file, dump file, or hibernation file. Filter drivers must handle this IRP if the function driver they are filtering handles the IRP. Bus drivers must handle this IRP for their adapter or controller (bus FDO) and for their child devices (child PDOs).

Major Code

IRP_MJ_PNP

When Sent

The system sends this IRP when it is creating or deleting a paging file, dump file, or hibernation file. A driver can send this IRP to propagate device usage information to another device stack.

System components and drivers send this IRP at IRQL PASSIVE_LEVEL in an arbitrary thread context.

Input

The Parameters.UsageNotification.InPath member of the IO_STACK_LOCATION structure is a BOOLEAN. When this parameter is TRUE, the system is creating a paging, crash dump, or hibernation file on the device. When InPath is FALSE, such a file has been removed from the device.

Parameters.UsageNotification.Type is an enum indicating the kind of file. This parameter has one of the following values: DeviceUsageTypePaging, DeviceUsageTypeDumpFile, or DeviceUsageTypeHibernation.

Output

None

I/O Status Block

Drivers set Irp->IoStatus.Status to STATUS_SUCCESS or to an appropriate error status.

Drivers do not modify the Irp->IoStatus.Information field; it remains at zero as set by the component sending the IRP.

Operation

A driver handles this IRP on the IRP's way down the device stack and on the IRP's way back up the stack.

A driver responds to this IRP with a procedure like the following:

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

Supporting Paging, Crash Dump, and Hibernation Files on a Device

When any of a driver's special file counts is nonzero, the driver must support the presence of the special file(s) on its device (or a descendant device).

For a DeviceUsageTypePaging file created on its device, a driver must do the following:

For a DeviceUsageTypeDumpFile file on its device, a driver must do the following:

For a DeviceUsageTypeHibernation file on its device, a driver must do the following:

See Power Management for more information about device power states, power IRPs, and supporting power management in drivers.

Sending This IRP

A driver can send an IRP_MN_DEVICE_USAGE_INFORMATION IRP, but only to propagate device usage information to another device stack. A driver is never the initial source of device usage information.

See Also

IoAdjustPagingPathCount, IRP_MN_QUERY_REMOVE_DEVICE, IRP_MN_QUERY_STOP_DEVICE