2010-03-27 15:31:25 +00:00
|
|
|
$if (_WDMDDK_)
|
2010-03-13 00:34:48 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* Power Management Support Functions *
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#define PoSetDeviceBusy(IdlePointer) ((void)(*(IdlePointer) = 0))
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PoCallDriver(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ struct _DEVICE_OBJECT *DeviceObject,
|
|
|
|
_Inout_ __drv_aliasesMem struct _IRP *Irp);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
PULONG
|
|
|
|
NTAPI
|
|
|
|
PoRegisterDeviceForIdleDetection(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ struct _DEVICE_OBJECT *DeviceObject,
|
|
|
|
_In_ ULONG ConservationIdleTime,
|
|
|
|
_In_ ULONG PerformanceIdleTime,
|
|
|
|
_In_ DEVICE_POWER_STATE State);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
PoRegisterSystemState(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_opt_ PVOID StateHandle,
|
|
|
|
_In_ EXECUTION_STATE Flags);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PoRequestPowerIrp(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ struct _DEVICE_OBJECT *DeviceObject,
|
|
|
|
_In_ UCHAR MinorFunction,
|
|
|
|
_In_ POWER_STATE PowerState,
|
|
|
|
_In_opt_ PREQUEST_POWER_COMPLETE CompletionFunction,
|
|
|
|
_In_opt_ __drv_aliasesMem PVOID Context,
|
|
|
|
_Outptr_opt_ struct _IRP **Irp);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
POWER_STATE
|
|
|
|
NTAPI
|
|
|
|
PoSetPowerState(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ struct _DEVICE_OBJECT *DeviceObject,
|
|
|
|
_In_ POWER_STATE_TYPE Type,
|
|
|
|
_In_ POWER_STATE State);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PoSetSystemState(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ EXECUTION_STATE Flags);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PoStartNextPowerIrp(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ struct _IRP *Irp);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PoUnregisterSystemState(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ PVOID StateHandle);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PoRequestShutdownEvent(
|
|
|
|
OUT PVOID *Event);
|
|
|
|
|
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
|
2010-03-27 15:31:25 +00:00
|
|
|
$endif (_WDMDDK_)
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2010-03-27 15:31:25 +00:00
|
|
|
$if (_NTIFS_)
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2010-03-27 15:31:25 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PoQueueShutdownWorkItem(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ __drv_aliasesMem PWORK_QUEUE_ITEM WorkItem);
|
2010-03-27 15:31:25 +00:00
|
|
|
#endif
|
|
|
|
$endif (_NTIFS_)
|
|
|
|
$if (_WDMDDK_)
|
2010-03-13 00:34:48 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2020-09-24 22:28:55 +00:00
|
|
|
NTKRNLVISTAAPI
|
2010-03-13 00:34:48 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PoSetSystemWake(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ struct _IRP *Irp);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2020-09-24 22:28:55 +00:00
|
|
|
NTKRNLVISTAAPI
|
2010-03-13 00:34:48 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PoGetSystemWake(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ struct _IRP *Irp);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2020-09-24 18:51:57 +00:00
|
|
|
NTKRNLVISTAAPI
|
2010-03-13 00:34:48 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PoRegisterPowerSettingCallback(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_opt_ PDEVICE_OBJECT DeviceObject,
|
|
|
|
_In_ LPCGUID SettingGuid,
|
|
|
|
_In_ PPOWER_SETTING_CALLBACK Callback,
|
|
|
|
_In_opt_ PVOID Context,
|
|
|
|
_Outptr_opt_ PVOID *Handle);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2020-09-24 18:51:57 +00:00
|
|
|
NTKRNLVISTAAPI
|
2010-03-13 00:34:48 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PoUnregisterPowerSettingCallback(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ PVOID Handle);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_VISTASP1)
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PoSetDeviceBusyEx(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ PULONG IdlePointer);
|
2010-03-13 00:34:48 +00:00
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_VISTASP1) */
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN7)
|
2010-03-18 22:45:30 +00:00
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PoStartDeviceBusy(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ PULONG IdlePointer);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PoEndDeviceBusy(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ PULONG IdlePointer);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2020-09-24 18:51:57 +00:00
|
|
|
NTKRNLVISTAAPI
|
2010-03-13 00:34:48 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
PoQueryWatchdogTime(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PDEVICE_OBJECT Pdo,
|
|
|
|
_Out_ PULONG SecondsRemaining);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PoDeletePowerRequest(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ PVOID PowerRequest);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PoSetPowerRequest(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ PVOID PowerRequest,
|
|
|
|
_In_ POWER_REQUEST_TYPE Type);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PoClearPowerRequest(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Inout_ PVOID PowerRequest,
|
|
|
|
_In_ POWER_REQUEST_TYPE Type);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PoCreatePowerRequest(
|
2012-01-22 14:43:53 +00:00
|
|
|
_Outptr_ PVOID *PowerRequest,
|
|
|
|
_In_ PDEVICE_OBJECT DeviceObject,
|
|
|
|
_In_opt_ PCOUNTED_REASON_CONTEXT Context);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
|
|
|
|
|