The PoRegisterSystemState routine registers the system as busy due to certain activity.
PVOID
PoRegisterSystemState(
IN PVOID StateHandle,
IN EXECUTION_STATE Flags
);
PoRegisterSystemState returns a handle to be used later to change or unregister the system busy state. It returns NULL if the handle could not be allocated.
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
PoRegisterSystemState registers the system busy state as indicated by the flags. The registration persists until the caller explicitly changes it with another call to PoRegisterSystemState or cancels it with a call to PoUnregisterSystemState.
The Flags parameter specifies the type of activity in progress. Drivers can specify any combination of the flags.
Setting ES_CONTINUOUS makes the busy state persist until a driver explicitly changes or cancels it by calling PoRegisterSystemState or PoUnregisterSystemState.
A driver can set the system busy state to request that the Power Manager avoid system power state transitions out of the system working state (S0) while driver activity is occurring. Note, however, that under some circumstances (such as a critically low battery) the Power Manager may override this request and put the system to sleep anyway.
Callers of PoRegisterSystemState must be running at IRQL < DISPATCH_LEVEL.