ReactOS  0.4.15-dev-3440-g915569a
FxCREvent Struct Reference

#include <fxwaitlock.hpp>

Collaboration diagram for FxCREvent:

Public Member Functions

 FxCREvent (__in BOOLEAN InitialState=FALSE)
 
 FxCREvent (__in EVENT_TYPE Type, __in BOOLEAN InitialState)
 
CHECK_RETURN_IF_USER_MODE NTSTATUS Initialize (__in BOOLEAN InitialState=FALSE)
 
CHECK_RETURN_IF_USER_MODE NTSTATUS Initialize (__in EVENT_TYPE Type, __in BOOLEAN InitialState)
 
 __drv_valueIs (==0;==258) _Acquires_lock_(_Global_critical_region_) NTSTATUS EnterCRAndWait(VOID)
 
NTSTATUS EnterCRAndWaitAndLeave (VOID)
 
 __drv_when (Timeout==NULL, __drv_valueIs(==0)) __drv_when(Timeout !
 
 __drv_valueIs (==0;==258)) __drv_when(Timeout !
 
_Must_inspect_result_ _Acquires_lock_ (_Global_critical_region_) NTSTATUS EnterCRAndWait(__in PLONGLONG Timeout)
 
_Must_inspect_result_ NTSTATUS EnterCRAndWaitAndLeave (__in PLONGLONG Timeout)
 
 _Releases_lock_ (_Global_critical_region_) VOID LeaveCR(VOID)
 
VOID Set (VOID)
 
VOID Clear (VOID)
 
LONG ReadState (VOID)
 
PVOID GetEvent (VOID)
 
FxCREventGetSelfPointer (VOID)
 

Private Member Functions

FxCREventoperator & (VOID)
 

Private Attributes

MxEvent m_Event
 

Detailed Description

Definition at line 16 of file fxwaitlock.hpp.

Constructor & Destructor Documentation

◆ FxCREvent() [1/2]

FxCREvent::FxCREvent ( __in BOOLEAN  InitialState = FALSE)
inline

Definition at line 17 of file fxwaitlock.hpp.

20  {
21  //
22  // For kernel mode letting c'tor do the initialization to not churn the
23  // non-shared code
24  //
25 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
27 #else
29 #endif
30  }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
CHECK_RETURN_IF_USER_MODE __inline NTSTATUS Initialize(__in EVENT_TYPE Type, __in BOOLEAN InitialState)
Definition: mxeventkm.h:55
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ EVENT_TYPE _In_ BOOLEAN InitialState
Definition: exfuncs.h:165
MxEvent m_Event
Definition: fxwaitlock.hpp:208

◆ FxCREvent() [2/2]

FxCREvent::FxCREvent ( __in EVENT_TYPE  Type,
__in BOOLEAN  InitialState 
)
inline

Definition at line 36 of file fxwaitlock.hpp.

40  {
41 #if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
43 #else
46 #endif
47  }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
CHECK_RETURN_IF_USER_MODE __inline NTSTATUS Initialize(__in EVENT_TYPE Type, __in BOOLEAN InitialState)
Definition: mxeventkm.h:55
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ EVENT_TYPE _In_ BOOLEAN InitialState
Definition: exfuncs.h:165
Type
Definition: Type.h:6
MxEvent m_Event
Definition: fxwaitlock.hpp:208

Member Function Documentation

◆ __drv_valueIs() [1/2]

FxCREvent::__drv_valueIs ( )
inline

Definition at line 68 of file fxwaitlock.hpp.

74  {
76 
77  Mx::MxEnterCriticalRegion();
78 
80  KernelMode,
81  FALSE,
82  NULL);
83  return status;
84  }
LONG NTSTATUS
Definition: precomp.h:26
#define FALSE
Definition: types.h:117
_Must_inspect_result_ __inline NTSTATUS WaitFor(__in KWAIT_REASON WaitReason, __in KPROCESSOR_MODE WaitMode, __in BOOLEAN Alertable, __in_opt PLARGE_INTEGER Timeout)
Definition: mxeventkm.h:115
MxEvent m_Event
Definition: fxwaitlock.hpp:208
#define NULL
Definition: types.h:112
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ __drv_valueIs() [2/2]

FxCREvent::__drv_valueIs ( )

◆ __drv_when()

FxCREvent::__drv_when ( Timeout  = NULL,
__drv_valueIs(==0)   
)

◆ _Acquires_lock_()

_Must_inspect_result_ FxCREvent::_Acquires_lock_ ( _Global_critical_region_  )
inline

Definition at line 102 of file fxwaitlock.hpp.

107  {
109 
110  Mx::MxEnterCriticalRegion();
111 
113  KernelMode,
114  FALSE,
116 
117  return status;
118  }
LONG NTSTATUS
Definition: precomp.h:26
#define FALSE
Definition: types.h:117
_Must_inspect_result_ __inline NTSTATUS WaitFor(__in KWAIT_REASON WaitReason, __in KPROCESSOR_MODE WaitMode, __in BOOLEAN Alertable, __in_opt PLARGE_INTEGER Timeout)
Definition: mxeventkm.h:115
MxEvent m_Event
Definition: fxwaitlock.hpp:208
static ULONG Timeout
Definition: ping.c:61
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ _Releases_lock_()

FxCREvent::_Releases_lock_ ( _Global_critical_region_  )
inline

Definition at line 134 of file fxwaitlock.hpp.

139  {
140  Mx::MxLeaveCriticalRegion();
141  }

◆ Clear()

◆ EnterCRAndWaitAndLeave() [1/2]

NTSTATUS FxCREvent::EnterCRAndWaitAndLeave ( VOID  )
inline

◆ EnterCRAndWaitAndLeave() [2/2]

_Must_inspect_result_ NTSTATUS FxCREvent::EnterCRAndWaitAndLeave ( __in PLONGLONG  Timeout)
inline

Definition at line 122 of file fxwaitlock.hpp.

125  {
127 
128  status = EnterCRAndWait(Timeout);
129  LeaveCR();
130 
131  return status;
132  }
LONG NTSTATUS
Definition: precomp.h:26
static ULONG Timeout
Definition: ping.c:61
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ GetEvent()

◆ GetSelfPointer()

FxCREvent* FxCREvent::GetSelfPointer ( VOID  )
inline

Definition at line 180 of file fxwaitlock.hpp.

183  {
184  //
185  // Since operator& is hidden, we still need to be able to get a pointer
186  // to this object, so we must make it an explicit method.
187  //
188  return this;
189  }

Referenced by FxPkgPnp::CleanupStateMachines(), FxPkgPnp::ReleasePowerThread(), and FxIoTarget::WaitForDisposeEvent().

◆ Initialize() [1/2]

CHECK_RETURN_IF_USER_MODE NTSTATUS FxCREvent::Initialize ( __in BOOLEAN  InitialState = FALSE)
inline

Definition at line 51 of file fxwaitlock.hpp.

54  {
56  }
CHECK_RETURN_IF_USER_MODE __inline NTSTATUS Initialize(__in EVENT_TYPE Type, __in BOOLEAN InitialState)
Definition: mxeventkm.h:55
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ EVENT_TYPE _In_ BOOLEAN InitialState
Definition: exfuncs.h:165
MxEvent m_Event
Definition: fxwaitlock.hpp:208

Referenced by FxPkgPnp::CleanupStateMachines(), FxPowerIdleMachine::Init(), FxWorkItem::Initialize(), FxSystemWorkItem::Initialize(), FxPkgPnp::Initialize(), FxWmiIrpHandler::ResetStateForPdoRestart(), and FxIoTarget::WaitForDisposeEvent().

◆ Initialize() [2/2]

CHECK_RETURN_IF_USER_MODE NTSTATUS FxCREvent::Initialize ( __in EVENT_TYPE  Type,
__in BOOLEAN  InitialState 
)
inline

Definition at line 60 of file fxwaitlock.hpp.

64  {
66  }
CHECK_RETURN_IF_USER_MODE __inline NTSTATUS Initialize(__in EVENT_TYPE Type, __in BOOLEAN InitialState)
Definition: mxeventkm.h:55
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ EVENT_TYPE _In_ BOOLEAN InitialState
Definition: exfuncs.h:165
Type
Definition: Type.h:6
MxEvent m_Event
Definition: fxwaitlock.hpp:208

◆ operator &()

FxCREvent* FxCREvent::operator & ( VOID  )
inlineprivate

Definition at line 191 of file fxwaitlock.hpp.

194  {
195  //
196  // By making the address of operator private, we make it harder (hopefully
197  // impossible) to accidentally use this object in an improper fashion, ie
198  // something like this is prevented:
199  //
200  // FxCREvent event;
201  // KeWaitForSingleObject(&event, ...);
202  //
203  ASSERT(FALSE);
204  return NULL;
205  }
#define FALSE
Definition: types.h:117
#define ASSERT(a)
Definition: mode.c:44
#define NULL
Definition: types.h:112

◆ ReadState()

LONG FxCREvent::ReadState ( VOID  )
inline

Definition at line 160 of file fxwaitlock.hpp.

163  {
164  return m_Event.ReadState();
165  }
MxEvent m_Event
Definition: fxwaitlock.hpp:208
__inline LONG ReadState()
Definition: mxeventkm.h:135

Referenced by FxPowerIdleMachine::InD0Locked(), and FxPowerIdleMachine::IsTransitioning().

◆ Set()

Member Data Documentation

◆ m_Event

MxEvent FxCREvent::m_Event
private

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