PoSetDeviceBusyEx function (ntifs.h)

The PoSetDeviceBusyEx routine notifies the power manager that the device associated with the specified idle counter is busy.

Syntax

void PoSetDeviceBusyEx(
  [in, out] PULONG IdlePointer
);

Parameters

[in, out] 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 PoSetDeviceBusyEx.

Return value

None

Remarks

This routine is a direct replacement for the PoSetDeviceBusy macro. If you are writing new driver code for Windows Vista with Service Pack 1 (SP1) and later versions of Windows, call PoSetDeviceBusyEx instead of PoSetDeviceBusy.

A driver calls the PoSetDeviceBusyEx and PoRegisterDeviceForIdleDetection routines to enable system idle detection for its device. If a device that is registered for idle detection stays idle for the driver-specified time-out period, the power manager sends an IRP_MN_SET_POWER request to put the device in a requested sleep state.

PoSetDeviceBusyEx reports that the device is busy, so that the power manager can restart its idle countdown. If the device is in a sleep state, PoSetDeviceBusyEx does not change the state of the device. That is, it does not cause the system to send an IRP_MN_SET_POWER request to awaken the device.

PoSetDeviceBusyEx is designed for use with I/O operations that are relatively brief compared to the time-out period of the idle counter. For longer operations that might exceed this period, use the PoStartDeviceBusy and PoEndDeviceBusy routines instead.

A driver that makes multiple requests for brief I/O operations should call PoSetDeviceBusyEx for every I/O request that it makes.

Requirements

Requirement Value
Minimum supported client Windows Vista with SP1
Target Platform Universal
Header ntifs.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL Any level

See also

IRP_MN_SET_POWER

PoEndDeviceBusy

PoRegisterDeviceForIdleDetection

PoSetDeviceBusy

PoStartDeviceBusy