PoUnregisterFromEffectivePowerModeNotifications function (wdm.h)

The PoUnregisterFromEffectivePowerModeNotifications function unregisters from effective power mode change notifications. This function is intended to be called from cleanup code and will wait for all callbacks to complete before unregistering.

Syntax

NTSTATUS PoUnregisterFromEffectivePowerModeNotifications(
  PO_EPM_HANDLE RegistrationHandle
);

Parameters

RegistrationHandle

The handle corresponding to a single power mode registration. This handle should have been saved by the caller after the call to PowerRegisterForEffectivePowerModeNotifications and passed in here.

Return value

Returns S_OK (zero) if the call was successful, and a nonzero value if the call failed.

Remarks

Immediately after registration, the callback will be invoked with the current value of the power setting. If the registration occurs while the power setting is changing, you may receive multiple callbacks; the last callback is the most recent update.

Requirements

Requirement Value
Minimum supported client Windows 11, version 24H2
Header wdm.h (include Wdm.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL

See also

PO_EFFECTIVE_POWER_MODE

PO_EFFECTIVE_POWER_MODE_CALLBACK

PoRegisterForEffectivePowerModeNotifications