PoStartDeviceBusy routine

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

Syntax


VOID PoStartDeviceBusy(
  _Inout_  PULONG IdlePointer
);

Parameters

IdlePointer [in, out]

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

None

Remarks

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.

Requirements

Version

Available starting with Windows 7.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

Any level

See also

PoEndDeviceBusy
PoRegisterDeviceForIdleDetection
PoSetDeviceBusy

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft