ReactOS  0.4.15-dev-2487-g7b27e7c
MxEvent Class Reference

#include <mxevent.h>

Collaboration diagram for MxEvent:

Public Member Functions

__inline MxEvent ()
 
__inline ~MxEvent ()
 
CHECK_RETURN_IF_USER_MODE __inline NTSTATUS Initialize (__in EVENT_TYPE Type, __in BOOLEAN InitialState)
 
__inline PVOID GetEvent ()
 
__inline VOID Set ()
 
__inline VOID SetWithIncrement (__in KPRIORITY Priority)
 
__inline VOID Clear ()
 
 __drv_when (Timeout==NULL &&Alertable==FALSE, __drv_valueIs(==0)) __drv_when(Timeout !
 
 __drv_valueIs (==0;==258)) __drv_when(Timeout !
 
_Must_inspect_result_ __inline NTSTATUS WaitFor (__in KWAIT_REASON WaitReason, __in KPROCESSOR_MODE WaitMode, __in BOOLEAN Alertable, __in_opt PLARGE_INTEGER Timeout)
 
__inline LONG ReadState ()
 
__inline VOID Uninitialize ()
 
MxEventGetSelfPointer (VOID)
 

Private Member Functions

MxEventoperator & (VOID)
 

Private Attributes

MdEvent m_Event
 
 DECLARE_DBGFLAG_INITIALIZED
 

Detailed Description

Definition at line 28 of file mxevent.h.

Constructor & Destructor Documentation

◆ MxEvent()

__inline MxEvent::MxEvent ( )

Definition at line 31 of file mxeventkm.h.

32 {
33  //
34  // Make sure that m_Event is the first member. That way if someone passes
35  // address of MxEvent to Ke*Event functions, it would still work.
36  //
37  // If this statement causes compilation failure, check if you added a field
38  // before m_Event.
39  //
41 
43 }
MdEvent m_Event
Definition: mxevent.h:36
#define C_ASSERT(e)
Definition: intsafe.h:71
#define CLEAR_DBGFLAG_INITIALIZED
Definition: dbgmacros.h:60
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

◆ ~MxEvent()

__inline MxEvent::~MxEvent ( )

Definition at line 46 of file mxeventkm.h.

47 {
48 }

Member Function Documentation

◆ __drv_valueIs()

MxEvent::__drv_valueIs ( )

◆ __drv_when()

MxEvent::__drv_when ( Timeout  = NULL && Alertable == FALSE,
__drv_valueIs(==0)   
)

◆ Clear()

__inline VOID MxEvent::Clear ( )

Definition at line 102 of file mxeventkm.h.

104 {
106 
108 }
MdEvent m_Event
Definition: mxevent.h:36
#define ASSERT_DBGFLAG_INITIALIZED
Definition: dbgmacros.h:58
VOID NTAPI KeClearEvent(IN PKEVENT Event)
Definition: eventobj.c:22

Referenced by FxChildList::BeginIteration(), FxChildList::BeginScan(), FxCREvent::Clear(), FxUsbPipe::GotoStartState(), FxIoQueue::StartPowerTransitionOff(), FxIoQueue::StopProcessingForPower(), and FxSystemThread::Thread().

◆ GetEvent()

__inline PVOID MxEvent::GetEvent ( )

Definition at line 69 of file mxeventkm.h.

71 {
73 
74  return &m_Event;
75 }
MdEvent m_Event
Definition: mxevent.h:36
#define ASSERT_DBGFLAG_INITIALIZED
Definition: dbgmacros.h:58

Referenced by FxCREvent::GetEvent().

◆ GetSelfPointer()

MxEvent* MxEvent::GetSelfPointer ( VOID  )
inline

Definition at line 110 of file mxevent.h.

113  {
114  //
115  // Since operator& is hidden, we still need to be able to get a pointer
116  // to this object, so we must make it an explicit method.
117  //
118  return this;
119  }

Referenced by FxPkgPdo::_PnpEject(), FxPkgPnp::_PnpRemoveDevice(), FxDevice::DeleteDeviceFromFailedCreateNoDelete(), FxIoQueue::Dispose(), FxChildList::GetScanEvent(), FxIoQueue::QueueDrainSynchronously(), FxIoQueue::QueueIdleSynchronously(), FxIoQueue::QueuePurgeSynchronously(), FxIoQueue::StartPowerTransitionOff(), FxIoQueue::StopProcessingForPower(), and FxInterrupt::WakeInterruptIsr().

◆ Initialize()

◆ operator &()

MxEvent* MxEvent::operator & ( VOID  )
inlineprivate

Definition at line 122 of file mxevent.h.

125  {
126  //
127  // By making the address of operator private, we make it harder
128  // to accidentally use this object in an improper fashion, ie
129  // something like this is prevented:
130  //
131  // MxEvent event;
132  // KeWaitForSingleObject(&event, ...);
133  //
134  // However please note that in some cases event pointer is needed when
135  // event is passed around, in which case, GetSelfPointer() is used and
136  // this protection is circumvented. Calling code should be careful
137  // not to pass the pointer to KeWaitForSingleObject in such cases.
138  //
139  ASSERT(FALSE);
140  return NULL;
141  }
#define FALSE
Definition: types.h:117
#define ASSERT(a)
Definition: mode.c:45
#define NULL
Definition: types.h:112

◆ ReadState()

LONG __inline MxEvent::ReadState ( )

Definition at line 135 of file mxeventkm.h.

137 {
139 
140  return KeReadStateEvent(&m_Event);
141 }
MdEvent m_Event
Definition: mxevent.h:36
LONG NTAPI KeReadStateEvent(IN PKEVENT Event)
Definition: eventobj.c:120
#define ASSERT_DBGFLAG_INITIALIZED
Definition: dbgmacros.h:58

Referenced by FxCREvent::ReadState().

◆ Set()

__inline VOID MxEvent::Set ( )

Definition at line 91 of file mxeventkm.h.

93 {
95 
97 }
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
#define FALSE
Definition: types.h:117
MdEvent m_Event
Definition: mxevent.h:36
#define ASSERT_DBGFLAG_INITIALIZED
Definition: dbgmacros.h:58
#define IO_NO_INCREMENT
Definition: iotypes.h:598

Referenced by FxChildList::EndScan(), FxSystemThread::ExitThread(), FxSystemThread::ExitThreadAsync(), FxPkgPdo::PnpEventEjectHardwareOverload(), FxSystemThread::QueueWorkItem(), _FX_DRIVER_GLOBALS::Release(), FxCREvent::Set(), FxPkgPnp::SignalDeviceRemovedEvent(), and FxSystemThread::Thread().

◆ SetWithIncrement()

__inline VOID MxEvent::SetWithIncrement ( __in KPRIORITY  Priority)

Definition at line 80 of file mxeventkm.h.

83 {
85 
87 }
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
#define FALSE
Definition: types.h:117
MdEvent m_Event
Definition: mxevent.h:36
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:651
#define ASSERT_DBGFLAG_INITIALIZED
Definition: dbgmacros.h:58

◆ Uninitialize()

__inline VOID MxEvent::Uninitialize ( void  )

Definition at line 146 of file mxeventkm.h.

148 {
150 }
#define CLEAR_DBGFLAG_INITIALIZED
Definition: dbgmacros.h:60

Referenced by FxFreeDriverGlobals().

◆ WaitFor()

_Must_inspect_result_ __inline NTSTATUS MxEvent::WaitFor ( __in KWAIT_REASON  WaitReason,
__in KPROCESSOR_MODE  WaitMode,
__in BOOLEAN  Alertable,
__in_opt PLARGE_INTEGER  Timeout 
)

Definition at line 115 of file mxeventkm.h.

121 {
123 
124  return KeWaitForSingleObject(
125  &m_Event,
126  WaitReason,
127  WaitMode,
128  Alertable,
129  Timeout
130  );
131 }
_In_ PVOID _In_ BOOLEAN Alertable
Definition: exfuncs.h:452
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
MdEvent m_Event
Definition: mxevent.h:36
static ULONG Timeout
Definition: ping.c:61
#define ASSERT_DBGFLAG_INITIALIZED
Definition: dbgmacros.h:58

Referenced by FxCREvent::__drv_valueIs(), FxCREvent::_Acquires_lock_(), FxSystemThread::ExitThread(), FxSystemThread::Reaper(), and FxSystemThread::Thread().

Member Data Documentation

◆ DECLARE_DBGFLAG_INITIALIZED

MxEvent::DECLARE_DBGFLAG_INITIALIZED
private

Definition at line 38 of file mxevent.h.

◆ m_Event

MdEvent MxEvent::m_Event
private

Definition at line 36 of file mxevent.h.

Referenced by __drv_when(), Clear(), GetEvent(), Initialize(), MxEvent(), ReadState(), Set(), and SetWithIncrement().


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