PoFxUnregisterDevice function (wdm.h)

The PoFxUnregisterDevice routine removes the registration of a device from the power management framework (PoFx).

Syntax

void PoFxUnregisterDevice(
  [in] POHANDLE Handle
);

Parameters

[in] Handle

A handle that represents the registration of the device with PoFx. The device driver previously received this handle from the PoFxRegisterDevice routine.

Return value

None

Remarks

The driver that owns the power policy for a device must unregister the device from PoFx when the device is removed. The Plug and Play (PnP) manager can remove the device stack from the PnP tree only after the device is unregistered.

To unregister the device, the driver calls PoFxUnregisterDevice during the handling of an IRP_MN_REMOVE_DEVICE or IRP_MN_SURPRISE_REMOVAL request, whichever is received first. This call should occur after the driver no longer requires access to the device's hardware.

A device driver that calls this routine must previously have called the PoFxRegisterDevice routine to register the device with PoFx.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 8.
Target Platform Universal
Header wdm.h
Library Ntoskrnl.lib
DLL Ntoskrnl.exe
IRQL PASSIVE_LEVEL

See also

IRP_MN_REMOVE_DEVICE

IRP_MN_SURPRISE_REMOVAL

PoFxRegisterDevice