ReactOS  0.4.15-dev-2344-g8ddbfde
FxPowerPolicyMachine Struct Reference

#include <fxpowerpolicystatemachine.hpp>

Inheritance diagram for FxPowerPolicyMachine:
Collaboration diagram for FxPowerPolicyMachine:

Public Member Functions

 FxPowerPolicyMachine (VOID)
 
 ~FxPowerPolicyMachine (VOID)
 
VOID UsbSSCallbackProcessingComplete (VOID)
 
_Must_inspect_result_ NTSTATUS InitUsbSS (VOID)
 
VOID SetWaitWakeUnclaimed (VOID)
 
BOOLEAN CanCompleteWaitWakeIrp (VOID)
 
- Public Member Functions inherited from FxThreadedEventQueue
 FxThreadedEventQueue (__in UCHAR QueueDepth)
 
 ~FxThreadedEventQueue (VOID)
 
_Must_inspect_result_ NTSTATUS Init (__inout FxPkgPnp *Pnp, __in PFN_PNP_EVENT_WORKER WorkerRoutine, __in PVOID WorkerContext=NULL)
 
VOID QueueToThread (VOID)
 
- Public Member Functions inherited from FxEventQueue
 FxEventQueue (__in UCHAR QueueDepth)
 
_Must_inspect_result_ NTSTATUS Initialize (__in PFX_DRIVER_GLOBALS DriverGlobals)
 
 _Acquires_lock_ (this->m_QueueLock) __drv_maxIRQL(DISPATCH_LEVEL) __drv_setsIRQL(DISPATCH_LEVEL) VOID Lock(__out __drv_deref(__drv_savesIRQL) PKIRQL Irql)
 
 _Releases_lock_ (this->m_QueueLock) __drv_requiresIRQL(DISPATCH_LEVEL) VOID Unlock(__in __drv_restoresIRQL KIRQL Irql)
 
BOOLEAN IsFull (VOID)
 
BOOLEAN IsEmpty (VOID)
 
VOID IncrementHead (VOID)
 
UCHAR GetHead (VOID)
 
UCHAR InsertAtHead (VOID)
 
UCHAR InsertAtTail (VOID)
 
UCHAR IncrementHistoryIndex (VOID)
 
BOOLEAN IsClosedLocked (VOID)
 
VOID GetFinishedState (__inout FxPostProcessInfo *Info)
 
BOOLEAN SetFinished (__in FxCREvent *Event)
 
VOID SetDelayedDeletion (VOID)
 
- Public Member Functions inherited from FxStump
PVOID operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
PVOID operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in POOL_TYPE PoolType)
 
VOID operator delete (__in PVOID pointer)
 
PVOID operator new[] (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
VOID operator delete[] (__in PVOID pointer)
 

Public Attributes

FxPowerPolicyEvent m_Queue [FxPowerPolicyEventQueueDepth]
 
FxPowerPolicyMachineStateHistory m_States
 
FxPowerPolicyOwnerSettingsm_Owner
 
union {
   ULONG   m_SingularEventsPresent
 
   union {
      ULONG   PwrPolStartKnown: 1
 
      ULONG   PwrPolStopKnown: 1
 
      ULONG   PwrPolSxKnown: 1
 
      ULONG   PwrPolS0Known: 1
 
      ULONG   PwrPolPowerDownKnown: 1
 
      ULONG   PwrPolPowerUpKnown: 1
 
      ULONG   PwrPolPowerDownIoStoppedKnown: 1
 
      ULONG   PwrPolPowerUpHwStartedKnown: 1
 
      ULONG   PwrPolWakeArrivedKnown: 1
 
      ULONG   PwrPolWakeSuccessKnown: 1
 
      ULONG   PwrPolWakeFailedKnown: 1
 
      ULONG   PwrPolIoPresentKnown: 1
 
      ULONG   PwrPolPowerTimeoutExpiredKnown: 1
 
      ULONG   PwrPolS0IdlePolicyChangedKnown: 1
 
      ULONG   PwrPolSurpriseRemoveKnown: 1
 
      ULONG   PwrPolUsbSelectiveSuspendCallbackKnown: 1
 
      ULONG   PwrPolUsbSelectiveSuspendCompletedKnown: 1
 
      ULONG   PwrPolPowerDownFailedKnown: 1
 
      ULONG   PwrPolPowerUpFailedKnown: 1
 
   }   m_SingularEventsPresentByName
 
}; 
 
- Public Attributes inherited from FxEventQueue
FxWaitLockInternal m_StateMachineLock
 

Additional Inherited Members

- Protected Member Functions inherited from FxThreadedEventQueue
VOID QueueWorkItem (VOID)
 
- Protected Member Functions inherited from FxEventQueue
VOID Configure (__in FxPkgPnp *Pnp, __in PFN_PNP_EVENT_WORKER WorkerRoutine, __in PVOID Context)
 
BOOLEAN QueueToThreadWorker (VOID)
 
VOID EventQueueWorker (VOID)
 
BOOLEAN IsIdleLocked (VOID)
 
- Protected Member Functions inherited from FxStump
 FxStump (VOID)
 
- Protected Attributes inherited from FxThreadedEventQueue
MxWorkItem m_WorkItem
 
WORK_QUEUE_ITEM m_EventWorkQueueItem
 
- Protected Attributes inherited from FxEventQueue
UCHAR m_QueueHead
 
UCHAR m_QueueTail
 
UCHAR m_QueueDepth
 
UCHAR m_HistoryIndex
 
FxPkgPnpm_PkgPnp
 
PVOID m_EventWorkerContext
 
MxLock m_QueueLock
 
PFN_PNP_EVENT_WORKER m_EventWorker
 
FxCREventm_WorkItemFinished
 
union {
   UCHAR   m_QueueFlags
 
   struct {
      UCHAR   WorkItemQueued: 1
 
      UCHAR   Closed: 1
 
      UCHAR   DelayDeletion: 1
 
   }   m_QueueFlagsByName
 
}; 
 
UCHAR m_WorkItemRunningCount
 
- Static Protected Attributes inherited from FxThreadedEventQueue
static WORKER_THREAD_ROUTINE _WorkerThreadRoutine
 
static MX_WORKITEM_ROUTINE _WorkItemCallback
 

Detailed Description

Definition at line 722 of file fxpowerpolicystatemachine.hpp.

Constructor & Destructor Documentation

◆ FxPowerPolicyMachine()

FxPowerPolicyMachine::FxPowerPolicyMachine ( VOID  )

Definition at line 2536 of file powerpolicystatemachine.cpp.

2539 {
2540  m_Owner = NULL;
2541 
2542  RtlZeroMemory(&m_Queue[0], sizeof(m_Queue));
2543  RtlZeroMemory(&m_States, sizeof(m_States));
2544 
2546 
2548 }
FxPowerPolicyEvent m_Queue[FxPowerPolicyEventQueueDepth]
FxPowerPolicyMachineStateHistory m_States
UCHAR IncrementHistoryIndex(VOID)
FxThreadedEventQueue(__in UCHAR QueueDepth)
Definition: eventqueue.cpp:352
FxPowerPolicyOwnerSettings * m_Owner
const UCHAR FxPowerPolicyEventQueueDepth
Definition: fxpkgpnp.hpp:35
USHORT History[FxPowerPolicyEventQueueDepth]
#define NULL
Definition: types.h:112
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

◆ ~FxPowerPolicyMachine()

FxPowerPolicyMachine::~FxPowerPolicyMachine ( VOID  )

Definition at line 2550 of file powerpolicystatemachine.cpp.

2553 {
2554  if (m_Owner != NULL) {
2555  delete m_Owner;
2556  m_Owner = NULL;
2557  }
2558 }
FxPowerPolicyOwnerSettings * m_Owner
#define NULL
Definition: types.h:112

Member Function Documentation

◆ CanCompleteWaitWakeIrp()

BOOLEAN FxPowerPolicyMachine::CanCompleteWaitWakeIrp ( VOID  )
inline

Definition at line 751 of file fxpowerpolicystatemachine.hpp.

754  {
755  //
756  // We have 2 potential call sites racing on trying to complete the wait
757  // wake irp. The first is the cancelling call site. The other is the
758  // irp's completion routine. What we want is for the *2nd* (and last)
759  // call site to actually complete the irp. This is why we check to see
760  // if the result of the exchange is that the ownership is already claimed
761  // (and not unclaimed as one might first be led to think).
762  //
765  return TRUE;
766  }
767  else {
768  return FALSE;
769  }
770  }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
FxPowerPolicyOwnerSettings * m_Owner
#define InterlockedExchange
Definition: armddk.h:54

Referenced by FxPkgPnp::PowerPolicyCancelWaitWake().

◆ InitUsbSS()

_Must_inspect_result_ NTSTATUS FxPowerPolicyMachine::InitUsbSS ( VOID  )

Definition at line 2562 of file powerpolicystatemachine.cpp.

2565 {
2566  FxUsbIdleInfo* pInfo;
2567  NTSTATUS status;
2568 
2569  //
2570  // The field is already set, we are good to go
2571  //
2572  if (m_Owner->m_UsbIdle != NULL) {
2573  return STATUS_SUCCESS;
2574  }
2575 
2576  pInfo = new (m_PkgPnp->GetDriverGlobals()) FxUsbIdleInfo(m_PkgPnp);
2577 
2578  if (pInfo == NULL) {
2580  }
2581 
2582  status = pInfo->Initialize();
2583  if (!NT_SUCCESS(status)) {
2584  delete pInfo;
2585  return status;
2586  }
2587 
2589  pInfo,
2590  NULL) == NULL) {
2591  //
2592  // This thread was the one that set the field value.
2593  //
2594  DO_NOTHING();
2595  }
2596  else {
2597  //
2598  // Another thread raced in and beat this thread in setting the field,
2599  // just delete our allocation and use the other allocated FxUsbIdleInfo.
2600  //
2601  delete pInfo;
2602  }
2603 
2604  return STATUS_SUCCESS;
2605 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONG NTSTATUS
Definition: precomp.h:26
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
_Must_inspect_result_ NTSTATUS Initialize(VOID)
FxPkgPnp * m_PkgPnp
FxPowerPolicyOwnerSettings * m_Owner
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65
static SERVICE_STATUS status
Definition: service.c:31
#define DO_NOTHING()
Definition: mxgeneral.h:32
Definition: ps.c:97

Referenced by FxPkgPnp::PowerPolicySetS0IdleSettings().

◆ SetWaitWakeUnclaimed()

VOID FxPowerPolicyMachine::SetWaitWakeUnclaimed ( VOID  )
inline

◆ UsbSSCallbackProcessingComplete()

VOID FxPowerPolicyMachine::UsbSSCallbackProcessingComplete ( VOID  )

Definition at line 237 of file powerpolicystatemachinekm.cpp.

240 {
243 }
FxCREvent * m_IdleCallbackEvent
VOID Set(VOID)
Definition: fxwaitlock.hpp:144
FxPowerPolicyOwnerSettings * m_Owner
#define ASSERT(a)
Definition: mode.c:45
#define NULL
Definition: types.h:112

Referenced by FxPkgPnp::PowerPolicyProcessEventInner().

Member Data Documentation

◆ @4570

union { ... }

◆ m_Owner

FxPowerPolicyOwnerSettings* FxPowerPolicyMachine::m_Owner

Definition at line 777 of file fxpowerpolicystatemachine.hpp.

Referenced by __drv_maxIRQL(), FxPkgPnp::_S0IdleQueryInstance(), FxPkgPnp::_SxWakeQueryInstance(), CanCompleteWaitWakeIrp(), FxPkgPnp::CleanupStateMachines(), FxPkgFdo::DispatchDeviceSetPower(), FxPkgPdo::DispatchDeviceSetPower(), FxPkgPnp::DispatchWaitWake(), FxPowerPolicyMachine(), if(), FxPkgPnp::Initialize(), InitUsbSS(), FxPkgPnp::IsPowerPolicyOwner(), FxPkgPnp::IsS0IdleSystemManaged(), FxPkgPnp::IsS0IdleUsbSSEnabled(), FxPkgPnp::IsS0IdleWakeFromS0Enabled(), FxPkgPnp::IsSxWakeEnabled(), FxPkgPnp::PnpPowerReferenceDuringQueryPnp(), FxDevice::PoFxDevicePowerNotRequired(), FxDevice::PoFxDevicePowerRequired(), FxPkgPnp::PowerDereference(), FxPkgPnp::PowerMakeWakeRequestNonCancelable(), FxPkgPdo::PowerNotifyParentChildWakeArmed(), FxPkgPdo::PowerNotifyParentChildWakeDisarmed(), FxPkgPnp::PowerPolicyBlockChildrenPowerUp(), FxPkgPnp::PowerPolicyCancelUsbSS(), FxPkgPnp::PowerPolicyCancelUsbSSIfCapable(), FxPkgPnp::PowerPolicyCanChildPowerUp(), FxPkgPnp::PowerPolicyCanIdlePowerDown(), FxPkgPnp::PowerPolicyChildPoweredDown(), FxPkgPnp::PowerPolicyChildrenCanPowerUp(), FxPkgPnp::PowerPolicyDisarmWakeFromSx(), FxPkgPnp::PowerPolicyGetCurrentWakeReason(), FxPkgPnp::PowerPolicyProcessEventInner(), FxPkgPnp::PowerPolicySendDevicePowerRequest(), FxPkgPnp::PowerPolicySendWaitWakeRequest(), FxPkgPnp::PowerPolicySetS0IdleSettings(), FxPkgPnp::PowerPolicySetS0IdleState(), FxPkgPnp::PowerPolicySetSxWakeSettings(), FxPkgPnp::PowerPolicySetSxWakeState(), FxPkgPnp::PowerPolicyShouldPropagateWakeStatusToChildren(), FxPkgPnp::PowerPolicyUpdateSystemWakeSource(), FxPkgPnp::PowerReference(), FxPkgPnp::PowerSendIdlePowerEvent(), FxPkgPnp::PowerSendPowerDownEvents(), FxPkgPnp::PowerSendPowerDownFailureEvent(), FxDevice::ProcessWmiPowerQueryOrSetData(), FxPkgPnp::QueryForCapabilities(), FxPkgPnp::RegisterPowerPolicyCallbacks(), FxPkgPnp::SaveState(), FxPkgPnp::SetPowerCaps(), SetWaitWakeUnclaimed(), UsbSSCallbackProcessingComplete(), and ~FxPowerPolicyMachine().

◆ m_Queue

◆ m_SingularEventsPresent

ULONG FxPowerPolicyMachine::m_SingularEventsPresent

◆ m_SingularEventsPresentByName

union { ... } FxPowerPolicyMachine::m_SingularEventsPresentByName

◆ m_States

◆ PwrPolIoPresentKnown

ULONG FxPowerPolicyMachine::PwrPolIoPresentKnown

Definition at line 799 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolPowerDownFailedKnown

ULONG FxPowerPolicyMachine::PwrPolPowerDownFailedKnown

Definition at line 805 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolPowerDownIoStoppedKnown

ULONG FxPowerPolicyMachine::PwrPolPowerDownIoStoppedKnown

Definition at line 794 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolPowerDownKnown

ULONG FxPowerPolicyMachine::PwrPolPowerDownKnown

Definition at line 792 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolPowerTimeoutExpiredKnown

ULONG FxPowerPolicyMachine::PwrPolPowerTimeoutExpiredKnown

Definition at line 800 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolPowerUpFailedKnown

ULONG FxPowerPolicyMachine::PwrPolPowerUpFailedKnown

Definition at line 806 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolPowerUpHwStartedKnown

ULONG FxPowerPolicyMachine::PwrPolPowerUpHwStartedKnown

Definition at line 795 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolPowerUpKnown

ULONG FxPowerPolicyMachine::PwrPolPowerUpKnown

Definition at line 793 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolS0IdlePolicyChangedKnown

ULONG FxPowerPolicyMachine::PwrPolS0IdlePolicyChangedKnown

Definition at line 801 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolS0Known

ULONG FxPowerPolicyMachine::PwrPolS0Known

Definition at line 791 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolStartKnown

ULONG FxPowerPolicyMachine::PwrPolStartKnown

Definition at line 788 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolStopKnown

ULONG FxPowerPolicyMachine::PwrPolStopKnown

Definition at line 789 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolSurpriseRemoveKnown

ULONG FxPowerPolicyMachine::PwrPolSurpriseRemoveKnown

Definition at line 802 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolSxKnown

ULONG FxPowerPolicyMachine::PwrPolSxKnown

Definition at line 790 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolUsbSelectiveSuspendCallbackKnown

ULONG FxPowerPolicyMachine::PwrPolUsbSelectiveSuspendCallbackKnown

Definition at line 803 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolUsbSelectiveSuspendCompletedKnown

ULONG FxPowerPolicyMachine::PwrPolUsbSelectiveSuspendCompletedKnown

Definition at line 804 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolWakeArrivedKnown

ULONG FxPowerPolicyMachine::PwrPolWakeArrivedKnown

Definition at line 796 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolWakeFailedKnown

ULONG FxPowerPolicyMachine::PwrPolWakeFailedKnown

Definition at line 798 of file fxpowerpolicystatemachine.hpp.

◆ PwrPolWakeSuccessKnown

ULONG FxPowerPolicyMachine::PwrPolWakeSuccessKnown

Definition at line 797 of file fxpowerpolicystatemachine.hpp.


The documentation for this struct was generated from the following files: