The PnP Manager Redistributes System Resources (UMDF 1)

Warning

UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2.

The archived UMDF 1 samples can be found in the Windows 11, version 22H2 - May 2022 Driver Samples Update.

For more info, see Getting Started with UMDF.

If a user adds a device to a system, and if the device requires system resources that the PnP manager has already assigned to another device, the PnP manager attempts to reassign resources.

During this process, the PnP manager stops devices and takes them out of their working (D0) states. It then delivers new resource lists to the devices so that they can restart, using the new resources.

When redistributing resources, the PnP manager will not alter a device's resource assignment if one of the device's UMDF-based drivers has supplied an IPnpCallback::OnQueryStop callback function, and the callback function has vetoed the reassignment.

Power-Down Sequence
For each UMDF-based function and filter driver that supports the device being stopped, the framework does the following, in sequence, one driver at a time, starting with the driver that is highest in the driver stack:

  1. If the driver is using self-managed I/O, the framework calls the driver's IPnpCallbackSelfManagedIo::OnSelfManagedIoSuspend callback function.

  2. The framework stops all of the device's power-managed I/O queues.

  3. The framework calls the driver's IPnpCallback::OnD0Exit callback function (if it exists).

  4. The framework calls the driver's IPnpCallbackHardware::OnReleaseHardware callback function (if it exists) passing the list of hardware resources that the PnP manager has assigned to the device.

To see a diagram that shows these steps, see the orderly removal figure in A User Unplugs a Device.

Power-Up Sequence
For each UMDF-based function and filter driver that supports the device, the framework does the following, in sequence, one driver at a time, starting with the driver that is lowest in the driver stack:

  1. The framework calls the driver's IPnpCallbackHardware::OnPrepareHardware callback function (if it exists), passing the list of hardware resources that the PnP manager has assigned to the device.

  2. The framework calls the driver's IPnpCallback::OnD0Entry callback function (if it exists).

  3. The framework restarts all of the device's power-managed I/O queues.

  4. If the driver is using self-managed I/O, the framework calls the driver's IPnpCallbackSelfManagedIo::OnSelfManagedIoRestart callback function.

To see a diagram that shows these steps, see A User Plugs in a Device.