PoStartDeviceBusy function

The PoStartDeviceBusy routine marks the start of a period of time in which the device is busy.


void PoStartDeviceBusy(
  PULONG IdlePointer



A pointer to an idle counter. This is a pointer value that was previously returned by the PoRegisterDeviceForIdleDetection routine. Because PoRegisterDeviceForIdleDetection might return a NULL pointer, the caller must verify that the pointer is non-NULL before it calls PoStartDeviceBusy.

Return value



The PoStartDeviceBusy and PoEndDeviceBusy routines mark the start and end of a time period in which a device is busy. Each call to PoStartDeviceBusy must be followed by a corresponding call to PoEndDeviceBusy.

For each device, the power manager maintains a count of the number of outstanding PoStartDeviceBusy calls for which it has not yet received a corresponding PoEndDeviceBusy call. A PoStartDeviceBusy call increments the busy count by one. A PoEndDeviceBusy call decrements the busy count by one. A nonzero busy count disables the idle counter for the device. After the busy count reaches zero, the power manager resets the idle counter to the time-out period and enables the counter.

Rather than use the PoStartDeviceBusy and PoEndDeviceBusy routines to reset the idle counter, you can call the PoSetDeviceBusyEx routine (or the PoSetDeviceBusy macro). To disable the idle counter during an extended busy period, a driver can call the PoRegisterDeviceForIdleDetection routine to disable and enable idle notifications at the start and end of the busy period. However, PoStartDeviceBusy and PoEndDeviceBusy are typically more convenient to use for this purpose, and you should consider using these routines in new code that you write for Windows 7 and later versions of Windows.


Minimum supported client Available starting with Windows 7.
Target Platform Universal
Header ntifs.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL Any level

See also