31#if defined(EVENT_TRACING)
32#include "PowerStateMachine.tmh"
36#if FX_STATE_MACHINE_VERIFY
37 #define VALIDATE_POWER_STATE(_CurrentState, _NewState) \
38 ValidatePowerStateEntryFunctionReturnValue((_CurrentState), (_NewState))
40 #define VALIDATE_POWER_STATE(_CurrentState, _NewState) (0)
1197 "WDFDEVICE 0x%p !devobj 0x%p current pwr pol state "
1198 "%!WDF_DEVICE_POWER_STATE! dropping event %!FxPowerEvent! because "
1215 ASSERT(!
"The Power queue is full. This shouldn't be able to happen.");
1222 "WDFDEVICE 0x%p !devobj 0x%p current pwr pol state "
1223 "%!WDF_DEVICE_POWER_STATE! dropping event %!FxPowerEvent! because "
1266 FALSE == ProcessOnDifferentThread) {
1272 if (FxWaitLockInternal::IsLockAcquired(
status)) {
1288 info.Evaluate(
this);
1321 This->m_PowerMachine.m_StateMachineLock.AcquireLock(
1322 This->GetDriverGlobals()
1328 This->PowerProcessEventInner(
Info);
1339 This->m_PowerMachine.m_StateMachineLock.ReleaseLock(
1340 This->GetDriverGlobals()
1401 if (
entry->StateInfo.Bits.QueueOpen ==
FALSE) {
1425 if (
entry->FirstTargetState.PowerEvent ==
event) {
1426 newState =
entry->FirstTargetState.TargetState;
1430 else if (
entry->OtherTargetStates !=
NULL) {
1436 if (
entry->OtherTargetStates[
i].PowerEvent ==
event) {
1437 newState =
entry->OtherTargetStates[
i].TargetState;
1447 "WDFDEVICE 0x%p !devobj 0x%p current power state "
1448 "%!WDF_DEVICE_POWER_STATE! dropping event %!FxPowerEvent!",
1457 if ((
entry->StateInfo.Bits.KnownDroppedEvents &
event) == 0) {
1462 "WDFDEVICE %p !devobj 0x%p current state "
1463 "%!WDF_DEVICE_POWER_STATE! event %!FxPowerEvent! is not a "
1464 "known dropped event, known dropped events are "
1468 event,
entry->StateInfo.Bits.KnownDroppedEvents);
1540 "WDFDEVICE 0x%p !devobj 0x%p entering Power State "
1541 "%!WDF_DEVICE_POWER_STATE! from %!WDF_DEVICE_POWER_STATE!",
1544 newState, currentState);
1553 data.Data.LeaveState.CurrentState = currentState;
1554 data.Data.LeaveState.NewState = newState;
1572 data.Data.EnterState.CurrentState = currentState;
1573 data.Data.EnterState.NewState = newState;
1582 currentState = newState;
1591 newState =
entry->StateFunc(
this);
1611 data.Data.PostProcessState.CurrentState = currentState;
1643 status =
This->PowerCheckParentOverload(&parentOn);
1648 else if (parentOn) {
1678 status =
This->PowerCheckParentOverload(&parentOn);
1683 else if (parentOn) {
1710 return This->PowerCheckDeviceTypeOverload();
1732 return This->PowerCheckDeviceTypeNPOverload();
1760 status =
This->PowerEnableWakeAtBusOverload();
1773 This->PowerCompleteWakeRequestFromWithinMachine(
status);
1805 status =
This->PowerEnableWakeAtBusOverload();
1823 This->PowerCompleteWakeRequestFromWithinMachine(
status);
1915 else if (
This->PowerIsWakeRequestPresent()) {
1951 else if (
This->PowerIsWakeRequestPresent()) {
2051 This->PowerDisableWakeAtBusOverload();
2084 This->PowerDisableWakeAtBusOverload();
2085 This->PowerCompletePendedWakeIrp();
2120 This->PowerDisableWakeAtBusOverload();
2121 This->PowerCompletePendedWakeIrp();
2157 This->m_Device->GetHandle(),
2163 "EvtDeviceD0Entry WDFDEVICE 0x%p !devobj 0x%p, old state "
2164 "%!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
2165 This->m_Device->GetHandle(),
2166 This->m_Device->GetDeviceObject(),
2208 status =
This->m_DeviceD0EntryPostInterruptsEnabled.Invoke(
2209 This->m_Device->GetHandle(),
2216 "EvtDeviceD0EntryPostInterruptsEnabed WDFDEVICE 0x%p !devobj 0x%p, "
2217 "old state %!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
2218 This->m_Device->GetHandle(),
2219 This->m_Device->GetDeviceObject(),
2278 This->m_Device->m_PkgIo->ResumeProcessingForPower();
2280 if (
This->m_SelfManagedIoMachine !=
NULL) {
2283 status =
This->m_SelfManagedIoMachine->Start();
2295 This->PowerSendPowerUpEvents();
2322 if (
This->m_SharedPower.m_WaitWakeOwner) {
2333 if (
This->m_SharedPower.m_WaitWakeOwner) {
2386 if (
This->m_SelfManagedIoMachine !=
NULL) {
2387 status =
This->m_SelfManagedIoMachine->Suspend();
2392 "EvtDeviceSelfManagedIoStop failed %!STATUS!",
status);
2404 if (
This->PowerDmaPowerDown() ==
FALSE) {
2408 status =
This->m_DeviceD0ExitPreInterruptsDisabled.Invoke(
2409 This->m_Device->GetHandle(),
2418 "EvtDeviceD0ExitPreInterruptsDisabled WDFDEVICE 0x%p !devobj 0x%p, "
2419 "new state %!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
2420 This->m_Device->GetHandle(),
2421 This->m_Device->GetDeviceObject(),
2440 status =
This->m_DeviceD0Exit.Invoke(
This->m_Device->GetHandle(),
2447 "EvtDeviceD0Exit WDFDEVICE 0x%p !devobj 0x%p, new state "
2448 "%!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
2449 This->m_Device->GetHandle(),
2450 This->m_Device->GetDeviceObject(),
2459 This->PowerParentPowerDereference();
2496 if (
This->m_Device->IsPdo()) {
2524 status =
This->PowerCheckParentOverload(&parentOn);
2529 "PowerReference on parent WDFDEVICE %p for child WDFDEVICE %p "
2530 "failed, %!STATUS!",
This->m_Device->m_ParentDevice->m_Device->GetHandle(),
2531 This->m_Device->GetHandle(),
2536 else if (parentOn) {
2574 This->PowerDisableWakeAtBusOverload();
2602 This->PowerDisableWakeAtBusOverload();
2624 This->PowerGotoDx();
2646 This->PowerGotoDx();
2656 if (
This->PowerGotoDxIoStopped() ==
FALSE) {
2668 if (
This->PowerGotoDxIoStoppedNP() ==
FALSE) {
2692 This->DisconnectInterruptNP();
2725 "EvtDeviceSelfManagedIoStop failed %!STATUS!",
status);
2813 "EvtDeviceD0ExitPreInterruptsDisabled WDFDEVICE 0x%p !devobj 0x%p, "
2814 "new state %!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
2871 "EvtDeviceD0Exit WDFEVICE 0x%p !devobj 0x%p, new state "
2872 "%!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
2982 "EvtDeviceD0ExitPreInterruptsDisabled WDFDEVICE 0x%p !devobj 0x%p, "
2983 "new state %!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
3010 "EvtDeviceD0Exit WDFDEVICE 0x%p !devobj 0x%p, new state "
3011 "%!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
3075 This->PowerGotoDx();
3099 This->PowerGotoDx();
3109 if (
This->PowerGotoDxIoStopped() ==
FALSE) {
3121 if (
This->PowerGotoDxIoStoppedNP() ==
FALSE) {
3152 status =
This->PowerCheckParentOverload(&parentOn);
3157 else if (parentOn) {
3185 status =
This->PowerCheckParentOverload(&parentOn);
3190 else if (parentOn) {
3224 This->m_Device->m_PkgIo->ResumeProcessingForPower();
3226 if (
This->m_SelfManagedIoMachine !=
NULL) {
3229 status =
This->m_SelfManagedIoMachine->Start();
3234 "EvtDeviceSelfManagedIoRestart failed - %!STATUS!",
status);
3246 This->PowerSendPowerUpEvents();
3248 This->PowerReleasePendingDeviceIrp();
3250 if (
This->m_SharedPower.m_WaitWakeOwner) {
3284 This->m_Device->m_PkgIo->ResumeProcessingForPower();
3286 if (
This->m_SelfManagedIoMachine !=
NULL) {
3289 status =
This->m_SelfManagedIoMachine->Start();
3294 "EvtDeviceSelfManagedIoRestart failed - %!STATUS!",
status);
3305 This->PowerSendPowerUpEvents();
3307 This->PowerReleasePendingDeviceIrp();
3309 if (
This->m_SharedPower.m_WaitWakeOwner) {
3392 This->PowerCompletePendedWakeIrp();
3416 This->PowerCompletePendedWakeIrp();
3447 This->m_Device->GetHandle(),
3453 "EvtDeviceD0Entry WDFDEVICE 0x%p !devobj 0x%p, old state "
3454 "%!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
3455 This->m_Device->GetHandle(),
3456 This->m_Device->GetDeviceObject(),
3492 This->m_Device->GetHandle(),
3498 "EvtDeviceD0Entry WDFDEVICE 0x%p !devobj 0x%p, old state "
3499 "%!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
3500 This->m_Device->GetHandle(),
3501 This->m_Device->GetDeviceObject(),
3540 status =
This->m_DeviceD0EntryPostInterruptsEnabled.Invoke(
3541 This->m_Device->GetHandle(),
3547 "EvtDeviceD0EntryPostInterruptsEnabed WDFDEVICE 0x%p !devobj 0x%p, "
3548 "old state %!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
3549 This->m_Device->GetHandle(),
3550 This->m_Device->GetDeviceObject(),
3589 status =
This->m_DeviceD0EntryPostInterruptsEnabled.Invoke(
3590 This->m_Device->GetHandle(),
3596 "EvtDeviceD0EntryPostInterruptsEnabed WDFDEVICE 0x%p !devobj 0x%p, "
3597 "old state %!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
3598 This->m_Device->GetHandle(),
3599 This->m_Device->GetDeviceObject(),
3625 This->PowerConnectInterruptFailed();
3656 "Force disconnecting interupts on !devobj %p, WDFDEVICE %p",
3657 This->m_Device->GetDeviceObject(),
3658 This->m_Device->GetHandle());
3660 This->PowerConnectInterruptFailed();
3684 ((
FxChildList*)
ple->GetTransactionedObject())->ScanForChildren();
3690 if (ImplicitPowerUp ==
FALSE) {
3775 status =
This->m_DeviceD0ExitPreInterruptsDisabled.Invoke(
3776 This->m_Device->GetHandle(),
3786 "EvtDeviceD0ExitPreInterruptsDisabled WDFDEVICE 0x%p !devobj 0x%p "
3787 "new state %!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
3788 This->m_Device->GetHandle(),
3789 This->m_Device->GetDeviceObject(),
3820 status =
This->m_DeviceD0ExitPreInterruptsDisabled.Invoke(
3821 This->m_Device->GetHandle(),
3831 "EvtDeviceD0ExitPreInterruptsDisabled WDFDEVICE 0x%p !devobj 0x%p "
3832 "new state %!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
3833 This->m_Device->GetHandle(),
3834 This->m_Device->GetDeviceObject(),
3862 This->PowerParentPowerDereference();
3887 This->PowerReleasePendingDeviceIrp();
3888 This->PowerSendPowerUpFailureEvent();
3946 This->PowerReleasePendingDeviceIrp();
3971 This->PowerConnectInterruptFailed();
3999 status =
This->m_DeviceD0ExitPreInterruptsDisabled.Invoke(
4000 This->m_Device->GetHandle(),
4010 "EvtDeviceD0ExitPreInterruptsDisabled WDFDEVICE 0x%p !devobj 0x%p "
4011 "new state %!WDF_POWER_DEVICE_STATE! failed, %!STATUS!",
4012 This->m_Device->GetHandle(),
4013 This->m_Device->GetDeviceObject(),
4069 This->PowerParentPowerDereference();
4091 This->PowerSendPowerUpFailureEvent();
4120 This->PowerDisableWakeAtBusOverload();
4149 This->PowerDisableWakeAtBusOverload();
4225 This->PowerReleasePendingDeviceIrp();
4254 This->PowerReleasePendingDeviceIrp();
4290 This->PowerSendPowerUpEvents();
4293 if (
This->PowerIsWakeRequestPresent()) {
4302 if (
This->PowerIsWakeRequestPresent()) {
4343 status =
This->PowerEnableWakeAtBusOverload();
4356 This->PowerCompleteWakeRequestFromWithinMachine(
status);
4391 status =
This->PowerEnableWakeAtBusOverload();
4404 This->PowerCompleteWakeRequestFromWithinMachine(
status);
4572 This->DisconnectInterruptNP();
4598 This->DisconnectInterruptNP();
4622 if (
This->m_WakeInterruptCount == 0) {
4650 if (
This->m_WakeInterruptCount == 0) {
4659 if (
This->m_WakeInterruptsKeepConnected ==
TRUE ||
4660 This->m_SharedPower.m_WaitWakeIrp !=
NULL) {
4699 if (
This->m_WakeInterruptCount == 0) {
4727 if (
This->m_WakeInterruptCount == 0) {
4736 if (
This->m_WakeInterruptsKeepConnected ==
TRUE ||
4737 This->m_SharedPower.m_WaitWakeIrp !=
NULL) {
4770 "Force disconnecting interrupts on !devobj 0x%p, WDFDEVICE %p",
4944 if (pOldCancelRoutine !=
NULL) {
4979 "WDFDEVICE 0x%p !devobj 0x%p WW !irp 0x%p is a source "
5313 "Interrupt(s) disconnect on WDFDEVICE %p failed, %!STATUS!",
5326 "EvtDeviceD0Exit WDFDEVICE 0x%p !devobj 0x%p failed, %!STATUS!",
WDFDEVICE __inline GetHandle(VOID)
MdDeviceObject __inline GetDeviceObject(VOID)
CfxDevice * m_ParentDevice
static FxDevice * GetFxDevice(__in MdDeviceObject DeviceObject)
__inline WDF_DEVICE_POWER_STATE GetDevicePowerState()
__inline VOID SetDevicePowerState(__in WDF_DEVICE_POWER_STATE DeviceState)
__inline FxPkgPdo * GetPdoPkg(VOID)
POWER_ACTION GetParameterPowerShutdownType()
MdCancelRoutine SetCancelRoutine(__in_opt MdCancelRoutine CancelRoutine)
VOID SetStatus(__in NTSTATUS Status)
DEVICE_POWER_STATE GetParameterPowerStateDeviceState()
static MdIrp GetIrpFromListEntry(__in PLIST_ENTRY Ple)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
_Must_inspect_result_ NTSTATUS StopProcessingForPower(__in FxIoStopProcessingForPowerAction Action)
static WDF_DEVICE_POWER_STATE PowerStartingChild(__inout FxPkgPnp *This)
VOID SetInternalFailure(VOID)
static WDF_DEVICE_POWER_STATE PowerReportPowerDownFailed(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerWakingDmaEnable(__inout FxPkgPnp *This)
BOOLEAN PowerDmaEnableAndScan(__in BOOLEAN ImplicitPowerUp)
static MdCancelRoutineType _PowerWaitWakeCancelRoutine
static WDF_DEVICE_POWER_STATE PowerD0DisarmingWakeAtBusNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerD0ArmedForWake(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerNotifyingD0ExitToWakeInterruptsNP(__inout FxPkgPnp *This)
static const POWER_EVENT_TARGET_STATE m_PowerD0BusWakeOwnerNPOtherStates[]
static WDF_DEVICE_POWER_STATE PowerWakePendingNP(__inout FxPkgPnp *This)
BOOLEAN PowerGotoDxIoStoppedNP(VOID)
static WDF_DEVICE_POWER_STATE PowerStartSelfManagedIoFailed(__inout FxPkgPnp *This)
VOID PowerCompleteWakeRequestFromWithinMachine(__in NTSTATUS Status)
FxSelfManagedIoMachine * m_SelfManagedIoMachine
static WDF_DEVICE_POWER_STATE PowerCheckDeviceTypeNP(__inout FxPkgPnp *This)
VOID PowerSendPowerDownFailureEvent(__in FxPowerDownType Type)
VOID DisconnectInterruptNP(VOID)
static WDF_DEVICE_POWER_STATE PowerD0DisarmingWakeAtBus(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerD0NP(__inout FxPkgPnp *This)
FxPowerStateCallback * m_PowerStateCallbacks
BOOLEAN m_ReleaseHardwareAfterDescendantsOnFailure
static WDF_DEVICE_POWER_STATE PowerReportPowerUpFailedDerefParent(__inout FxPkgPnp *This)
FxPowerMachine m_PowerMachine
virtual VOID PowerParentPowerDereference(VOID)=0
FxPnpDeviceD0Exit m_DeviceD0Exit
UCHAR m_SystemPowerAction
static const POWER_EVENT_TARGET_STATE m_PowerDNotZeroNPOtherStates[]
VOID PowerProcessEvent(__in FxPowerEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
static WDF_DEVICE_POWER_STATE PowerGotoDxIoStoppedArmedForWake(__inout FxPkgPnp *This)
BOOLEAN IsPowerPolicyOwner(VOID)
VOID PowerSendPowerUpFailureEvent(VOID)
FxEnumerationInfo * m_EnumInfo
static WDF_DEVICE_POWER_STATE PowerWakingDmaEnableNP(__inout FxPkgPnp *This)
static const POWER_EVENT_TARGET_STATE m_PowerD0NPOtherStates[]
static WDF_DEVICE_POWER_STATE PowerCheckParentStateArmedForWake(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerDxStoppedArmForWake(__inout FxPkgPnp *This)
static VOID _PowerProcessEventInner(__in FxPkgPnp *This, __in FxPostProcessInfo *Info, __in PVOID WorkerContext)
static WDF_DEVICE_POWER_STATE PowerInitialConnectInterruptFailed(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerD0BusWakeOwner(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerD0Starting(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerInitialSelfManagedIoFailed(__inout FxPkgPnp *This)
static const POWER_EVENT_TARGET_STATE m_PowerDxStoppedOtherStates[]
NTSTATUS NotifyResourceObjectsDx(__in ULONG NotifyFlags)
static WDF_DEVICE_POWER_STATE PowerD0ArmedForWakeNP(__inout FxPkgPnp *This)
BYTE m_DevicePowerStateOld
static WDF_DEVICE_POWER_STATE PowerWakingConnectInterruptFailed(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerGotoDxIoStoppedArmedForWakeNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerInitialPowerUpFailedDerefParent(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerWakingConnectInterruptFailedNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerGotoDxStopped(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerStartingCheckDeviceType(__inout FxPkgPnp *This)
VOID PowerConnectInterruptFailed(VOID)
static WDF_DEVICE_POWER_STATE PowerGotoStopped(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerCheckParentStateNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerStoppedCompleteDx(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerD0StartingConnectInterrupt(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerDxStoppedDecideDxState(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerCheckDeviceType(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerGotoDNotZero(__inout FxPkgPnp *This)
VOID PowerSendPowerDownEvents(__in FxPowerDownType Type)
static WDF_DEVICE_POWER_STATE PowerDxDisablingWakeAtBusNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerDxStoppedArmForWakeNP(__inout FxPkgPnp *This)
static const POWER_EVENT_TARGET_STATE m_DxArmedForWakeNPOtherStates[]
static WDF_DEVICE_POWER_STATE PowerUpFailed(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerWakingNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerWakingConnectInterruptNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerD0StartingDmaEnable(__inout FxPkgPnp *This)
static const POWER_EVENT_TARGET_STATE m_PowerD0BusWakeOwnerOtherStates[]
static const POWER_EVENT_TARGET_STATE m_PowerD0OtherStates[]
static WDF_DEVICE_POWER_STATE PowerGotoDxStoppedDisableInterruptNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerCheckParentState(__inout FxPkgPnp *This)
static VOID _PowerSetSystemWakeSource(__in FxIrp *Irp)
static WDF_DEVICE_POWER_STATE PowerNotifyingD0ExitToWakeInterrupts(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerGotoImplicitD3DisarmWakeAtBus(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerInitialPowerUpFailed(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerFinalPowerDownFailed(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerWakingDmaEnableFailedNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerUpFailedDerefParentNP(__inout FxPkgPnp *This)
BOOLEAN PowerDmaPowerDown(VOID)
static const POWER_EVENT_TARGET_STATE m_PowerD0ArmedForWakeNPOtherStates[]
static WDF_DEVICE_POWER_STATE PowerGotoDxArmedForWakeNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerWakingConnectInterrupt(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerWaking(__inout FxPkgPnp *This)
LONG GetUsageCount(__in __range(1, 4) ULONG Usage)
BOOLEAN PowerIndicateWaitWakeStatus(__in NTSTATUS WaitWakeStatus)
static WDF_DEVICE_POWER_STATE PowerStartSelfManagedIoNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerGotoDxFailed(__inout FxPkgPnp *This)
VOID PowerEnterNewState(__in WDF_DEVICE_POWER_STATE State)
static WDF_DEVICE_POWER_STATE PowerGotoDxNPFailed(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerPowerFailedPowerDown(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerUpFailedNP(__inout FxPkgPnp *This)
_Must_inspect_result_ BOOLEAN PowerDmaPowerUp(VOID)
static WDF_DEVICE_POWER_STATE PowerWakePending(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerGotoDNotZeroIoStopped(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerGotoD3Stopped(__inout FxPkgPnp *This)
BOOLEAN m_WakeInterruptsKeepConnected
static WDF_DEVICE_POWER_STATE PowerCheckParentStateArmedForWakeNP(__inout FxPkgPnp *This)
static CPPOWER_STATE_TABLE GetPowerTableEntry(__in WDF_DEVICE_POWER_STATE State)
static WDF_DEVICE_POWER_STATE PowerGotoDxArmedForWake(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerStartSelfManagedIo(__inout FxPkgPnp *This)
SharedPowerData m_SharedPower
static WDF_DEVICE_POWER_STATE PowerEnablingWakeAtBusNP(__inout FxPkgPnp *This)
static const POWER_EVENT_TARGET_STATE m_PowerStoppedOtherStates[]
static const POWER_STATE_TABLE m_WdfPowerStates[]
static WDF_DEVICE_POWER_STATE PowerInitialDmaEnableFailed(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerD0StartingStartSelfManagedIo(__inout FxPkgPnp *This)
VOID PnpProcessEvent(__in FxPnpEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
static WDF_DEVICE_POWER_STATE PowerGotoDNotZeroIoStoppedNP(__inout FxPkgPnp *This)
FxPnpDeviceD0ExitPreInterruptsDisabled m_DeviceD0ExitPreInterruptsDisabled
static WDF_DEVICE_POWER_STATE PowerWakingDmaEnableFailed(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerGotoDxStoppedDisableInterrupt(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerGotoDNotZeroNP(__inout FxPkgPnp *This)
virtual VOID PowerReleasePendingDeviceIrp(BOOLEAN IrpMustBePresent=TRUE)=0
static const POWER_EVENT_TARGET_STATE m_WakePendingNPOtherStates[]
static const POWER_EVENT_TARGET_STATE m_DxArmedForWakeOtherStates[]
static WDF_DEVICE_POWER_STATE PowerDZero(__inout FxPkgPnp *This)
NTSTATUS CompletePowerRequest(__inout FxIrp *Irp, __in NTSTATUS Status)
VOID PowerSetDevicePowerState(__in WDF_POWER_DEVICE_STATE State)
VOID PowerCompletePendedWakeIrp(VOID)
BOOLEAN PowerGotoDxIoStopped(VOID)
VOID PowerSendIdlePowerEvent(__in FxPowerIdleEvents Event)
static WDF_DEVICE_POWER_STATE PowerNotifyingD0EntryToWakeInterrupts(__inout FxPkgPnp *This)
BOOLEAN PowerMakeWakeRequestNonCancelable(__in NTSTATUS Status)
static const POWER_EVENT_TARGET_STATE m_WakePendingOtherStates[]
FxPowerPolicyMachine m_PowerPolicyMachine
static WDF_DEVICE_POWER_STATE PowerDxStoppedDisarmWakeNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerUpFailedDerefParent(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerD0BusWakeOwnerNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerNotifyingD0EntryToWakeInterruptsNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerDxStoppedDisarmWake(__inout FxPkgPnp *This)
static const POWER_EVENT_TARGET_STATE m_PowerDNotZeroOtherStates[]
static const POWER_EVENT_TARGET_STATE m_PowerD0ArmedForWakeOtherStates[]
static WDF_DEVICE_POWER_STATE PowerReportPowerUpFailed(__inout FxPkgPnp *This)
MdIrp m_PendingDevicePowerIrp
static WDF_DEVICE_POWER_STATE PowerEnablingWakeAtBus(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerDxDisablingWakeAtBus(__inout FxPkgPnp *This)
VOID PowerProcessEventInner(__inout FxPostProcessInfo *Info)
VOID PowerSendPowerUpEvents(VOID)
static WDF_DEVICE_POWER_STATE PowerStartSelfManagedIoFailedNP(__inout FxPkgPnp *This)
static WDF_DEVICE_POWER_STATE PowerDecideD0State(__inout FxPkgPnp *This)
VOID PowerCheckAssumptions(VOID)
VOID PowerPolicyProcessEvent(__in FxPowerPolicyEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
_Must_inspect_result_ NTSTATUS Invoke(__in WDFDEVICE Device, __in WDF_POWER_DEVICE_STATE TargetState)
_Must_inspect_result_ NTSTATUS Invoke(__in WDFDEVICE Device, __in WDF_POWER_DEVICE_STATE TargetState)
VOID ProcessPowerEvent(__in FxPowerIdleEvents Event)
_Must_inspect_result_ NTSTATUS Suspend(VOID)
_Must_inspect_result_ FxTransactionedEntry * GetNextEntry(__in_opt FxTransactionedEntry *Entry)
VOID UnlockFromEnum(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID LockForEnum(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
POWER_STATE SetPowerState(__in POWER_STATE_TYPE Type, __in POWER_STATE State)
#define TRACINGPNPPOWERSTATES
#define NT_SUCCESS(StatCode)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
_Must_inspect_result_ _In_ PFLT_CALLBACK_DATA _In_ PFLT_DEFERRED_IO_WORKITEM_ROUTINE WorkerRoutine
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
MxDeviceObject deviceObject
VOID(* PFN_PNP_EVENT_WORKER)(__in FxPkgPnp *PkgPnp, __in FxPostProcessInfo *Info, __in PVOID Context)
@ FxIoStopProcessingForPowerHold
@ NotifyResourcesExplicitPowerup
@ NotifyResourcesForceDisconnect
@ NotifyResourcesExplicitPowerDown
@ NotifyResourcesSurpriseRemoved
@ NotifyResourcesDisconnectInactive
@ NotifyResourcesArmedForWake
@ FxPowerDownTypeExplicit
@ FxPowerDownTypeImplicit
@ PnpEventPowerDownFailed
@ PowerIdleEventPowerUpComplete
@ PowerIdleEventPowerDown
@ PowerIdleEventPowerDownFailed
@ PowerIdleEventPowerUpFailed
@ PwrPolPowerDownIoStopped
@ PwrPolImplicitPowerDown
@ PwrPolImplicitPowerDownFailed
@ PowerPriorityEventsMask
@ PowerWakeInterruptCompleteTransition
@ WakeInterruptEventLeavingD0
@ WakeInterruptEventEnteringD0
@ WakeInterruptEventD0EntryFailed
@ WakeInterruptEventLeavingD0NotArmedForWake
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
WUDF_DRIVER_CANCEL * MdCancelRoutine
#define _Must_inspect_result_
#define UNREFERENCED_PARAMETER(P)
@ PowerActionShutdownReset
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
#define VALIDATE_POWER_STATE(_CurrentState, _NewState)
#define TRACE_LEVEL_WARNING
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_ERROR
#define TRACE_LEVEL_INFORMATION
FxWaitLockTransactionedList m_ChildListList
UCHAR IncrementHistoryIndex(VOID)
FxWaitLockInternal m_StateMachineLock
BOOLEAN IsClosedLocked(VOID)
VOID GetFinishedState(__inout FxPostProcessInfo *Info)
FxPowerMachineEventQueue m_Queue
BOOLEAN m_PowerDownFailure
FxPowerMachineStateHistory m_States
_Must_inspect_result_ NTSTATUS Init(__inout FxPkgPnp *Pnp, __in PFN_PNP_EVENT_WORKER WorkerRoutine)
BOOLEAN m_IoCallbackFailure
LIST_ENTRY m_WaitWakeIrpToBeProcessedList
USHORT m_SingularEventsPresent
FxPowerPolicyOwnerSettings * m_Owner
FxPowerIdleMachine m_PowerIdleMachine
BOOLEAN m_SystemWakeSource
VOID Invoke(__in WDF_DEVICE_POWER_STATE State, __in WDF_STATE_NOTIFICATION_TYPE Type, __in WDFDEVICE Device, __in PCWDF_DEVICE_POWER_NOTIFICATION_DATA NotificationData)
_Must_inspect_result_ NTSTATUS Init(__inout FxPkgPnp *Pnp, __in PFN_PNP_EVENT_WORKER WorkerRoutine, __in PVOID WorkerContext=NULL)
VOID StartTimer(__in ULONG State)
VOID CancelTimer(__in ULONG State)
#define RtlZeroMemory(Destination, Length)
USHORT Events[PowerEventQueueDepth]
USHORT History[PowerEventQueueDepth]
DEVICE_POWER_STATE DeviceState
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_In_ PDEVICE_OBJECT DeviceObject
_In_ PWDFDEVICE_INIT _In_ BOOLEAN IsPowerPolicyOwner
@ WdfPowerDevicePrepareForHibernation
enum _WDF_POWER_DEVICE_STATE WDF_POWER_DEVICE_STATE
enum _WDF_DEVICE_POWER_STATE WDF_DEVICE_POWER_STATE
@ StateNotificationEnterState
@ StateNotificationPostProcessState
@ StateNotificationLeaveState
@ WdfSpecialFileHibernation
_Must_inspect_result_ _In_ WDFDEVICE _In_ NTSTATUS WaitWakeStatus
@ WdfDevStatePowerStartingChild
@ WdfDevStatePowerD0StartingDmaEnable
@ WdfDevStatePowerDxStoppedArmForWakeNP
@ WdfDevStatePowerDxStoppedDecideDxState
@ WdfDevStatePowerDxStoppedDisarmWakeNP
@ WdfDevStatePowerWakingConnectInterruptFailed
@ WdfDevStatePowerNotifyingD0ExitToWakeInterruptsNP
@ WdfDevStatePowerInitialPowerUpFailedDerefParent
@ WdfDevStatePowerWakingDmaEnableFailedNP
@ WdfDevStatePowerDxDisablingWakeAtBusNP
@ WdfDevStatePowerUpFailed
@ WdfDevStatePowerD0StartingStartSelfManagedIo
@ WdfDevStatePowerGotoDxIoStoppedArmedForWakeNP
@ WdfDevStatePowerStartSelfManagedIoFailed
@ WdfDevStatePowerCheckDeviceTypeNP
@ WdfDevStatePowerGotoDxStopped
@ WdfDevStatePowerWakePendingNP
@ WdfDevStatePowerD0BusWakeOwner
@ WdfDevStatePowerDxStopped
@ WdfDevStatePowerGotoDxNPFailed
@ WdfDevStatePowerD0BusWakeOwnerNP
@ WdfDevStatePowerGotoDxStoppedDisableInterruptNP
@ WdfDevStatePowerNotifyingD0ExitToWakeInterrupts
@ WdfDevStatePowerD0ArmedForWake
@ WdfDevStatePowerWakingDmaEnable
@ WdfDevStatePowerWaitForParentArmedForWake
@ WdfDevStatePowerD0DisarmingWakeAtBus
@ WdfDevStatePowerD0Starting
@ WdfDevStatePowerGotoDxFailed
@ WdfDevStatePowerWakingConnectInterruptFailedNP
@ WdfDevStatePowerCheckDeviceType
@ WdfDevStatePowerD0StartingConnectInterrupt
@ WdfDevStatePowerStartSelfManagedIoFailedNP
@ WdfDevStatePowerUpFailedNP
@ WdfDevStatePowerWaitForParentNP
@ WdfDevStatePowerWaitForParent
@ WdfDevStatePowerGotoImplicitD3DisarmWakeAtBus
@ WdfDevStatePowerEnablingWakeAtBus
@ WdfDevStatePowerReportPowerUpFailedDerefParent
@ WdfDevStatePowerDxDisablingWakeAtBus
@ WdfDevStatePowerFinalPowerDownFailed
@ WdfDevStatePowerDxArmedForWake
@ WdfDevStatePowerReportPowerUpFailed
@ WdfDevStatePowerGotoDxArmedForWakeNP
@ WdfDevStatePowerCheckParentStateArmedForWake
@ WdfDevStatePowerGotoDxIoStoppedArmedForWake
@ WdfDevStatePowerGotoDxIoStopped
@ WdfDevStatePowerWakingConnectInterruptNP
@ WdfDevStatePowerWakingDmaEnableNP
@ WdfDevStatePowerCheckParentStateArmedForWakeNP
@ WdfDevStatePowerGotoDxStoppedDisableInterrupt
@ WdfDevStatePowerStartSelfManagedIoNP
@ WdfDevStatePowerStopped
@ WdfDevStatePowerWakingConnectInterrupt
@ WdfDevStatePowerD0ArmedForWakeNP
@ WdfDevStatePowerDxArmedForWakeNP
@ WdfDevStatePowerInitialDmaEnableFailed
@ WdfDevStatePowerWakePending
@ WdfDevStatePowerWakingDmaEnableFailed
@ WdfDevStatePowerInitialConnectInterruptFailed
@ WdfDevStatePowerWaitForParentArmedForWakeNP
@ WdfDevStatePowerUpFailedDerefParent
@ WdfDevStatePowerD0DisarmingWakeAtBusNP
@ WdfDevStatePowerDxStoppedDisarmWake
@ WdfDevStatePowerGotoD3Stopped
@ WdfDevStatePowerDecideD0State
@ WdfDevStatePowerEnablingWakeAtBusNP
@ WdfDevStatePowerReportPowerDownFailed
@ WdfDevStatePowerGotoStopped
@ WdfDevStatePowerGotoDxNP
@ WdfDevStatePowerNotifyingD0EntryToWakeInterruptsNP
@ WdfDevStatePowerStartingCheckDeviceType
@ WdfDevStatePowerDxStoppedArmForWake
@ WdfDevStatePowerObjectCreated
@ WdfDevStatePowerGotoDxIoStoppedNP
@ WdfDevStatePowerStoppedCompleteDx
@ WdfDevStatePowerNotifyingD0EntryToWakeInterrupts
@ WdfDevStatePowerWakingNP
@ WdfDevStatePowerUpFailedDerefParentNP
@ WdfDevStatePowerInitialPowerUpFailed
@ WdfDevStatePowerGotoDxArmedForWake
@ WdfDevStatePowerStartSelfManagedIo
@ WdfDevStatePowerPowerFailedPowerDown