ReactOS  0.4.15-dev-2528-g5506091
mxeventkm.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 ModuleName:
6 
7  MxEvent.h
8 
9 Abstract:
10 
11  Kernel mode implementation of event
12  class defined in MxEvent.h
13 
14 Author:
15 
16 
17 
18 Revision History:
19 
20 
21 
22 --*/
23 
24 #pragma once
25 
26 typedef KEVENT MdEvent;
27 
28 #include "mxevent.h"
29 
30 __inline
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 }
44 
45 __inline
47 {
48 }
49 
50 __inline
52 #ifdef _MSC_VER
53 #pragma prefast(suppress:__WARNING_UNMATCHED_DECL_ANNO, "_Must_inspect_result_ not needed in kernel mode as the function always succeeds");
54 #endif
58  )
59 {
61 
63 
64  return STATUS_SUCCESS;
65 }
66 
67 __inline
68 PVOID
70  )
71 {
73 
74  return &m_Event;
75 }
76 
77 
78 __inline
79 VOID
82  )
83 {
85 
87 }
88 
89 __inline
90 VOID
92  )
93 {
95 
97 }
98 
99 
100 __inline
101 VOID
103  )
104 {
106 
108 }
109 
111 __drv_when(Timeout != NULL && Alertable == FALSE, __drv_valueIs(==0;==258))
113 __inline
114 NTSTATUS
115 MxEvent::WaitFor(
116  __in KWAIT_REASON WaitReason,
117  __in KPROCESSOR_MODE WaitMode,
120  )
121 {
123 
124  return KeWaitForSingleObject(
125  &m_Event,
126  WaitReason,
127  WaitMode,
128  Alertable,
129  Timeout
130  );
131 }
132 
133 LONG
134 __inline
136  )
137 {
139 
140  return KeReadStateEvent(&m_Event);
141 }
142 
143 
144 __inline
145 VOID
147  )
148 {
150 }
__inline VOID Uninitialize()
Definition: mxeventkm.h:146
_In_ PVOID _In_ BOOLEAN Alertable
Definition: exfuncs.h:452
#define _Must_inspect_result_
Definition: no_sal2.h:62
__drv_valueIs(==0;==258)) __drv_when(Timeout !
KEVENT MdEvent
Definition: mxeventkm.h:26
#define __in_opt
Definition: dbghelp.h:38
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
__inline VOID Set()
Definition: mxeventkm.h:91
__drv_when(Timeout==NULL &&Alertable==FALSE, __drv_valueIs(==0)) __drv_when(Timeout !
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
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
LONG KPRIORITY
Definition: compat.h:662
__inline PVOID GetEvent()
Definition: mxeventkm.h:69
CHECK_RETURN_IF_USER_MODE __inline NTSTATUS Initialize(__in EVENT_TYPE Type, __in BOOLEAN InitialState)
Definition: mxeventkm.h:55
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
MdEvent m_Event
Definition: mxevent.h:36
unsigned char BOOLEAN
#define C_ASSERT(e)
Definition: intsafe.h:71
__inline VOID Clear()
Definition: mxeventkm.h:102
enum _EVENT_TYPE EVENT_TYPE
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ EVENT_TYPE _In_ BOOLEAN InitialState
Definition: exfuncs.h:165
#define SET_DBGFLAG_INITIALIZED
Definition: dbgmacros.h:59
Type
Definition: Type.h:6
#define CLEAR_DBGFLAG_INITIALIZED
Definition: dbgmacros.h:60
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:651
__inline ~MxEvent()
Definition: mxeventkm.h:46
__inline LONG ReadState()
Definition: mxeventkm.h:135
static ULONG Timeout
Definition: ping.c:61
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
__inline MxEvent()
Definition: mxeventkm.h:31
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NULL
Definition: types.h:112
__inline VOID SetWithIncrement(__in KPRIORITY Priority)
Definition: mxeventkm.h:80
enum _KWAIT_REASON KWAIT_REASON
LONG NTAPI KeReadStateEvent(IN PKEVENT Event)
Definition: eventobj.c:120
#define ASSERT_DBGFLAG_INITIALIZED
Definition: dbgmacros.h:58
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define STATUS_SUCCESS
Definition: shellext.h:65
VOID NTAPI KeClearEvent(IN PKEVENT Event)
Definition: eventobj.c:22
#define __in
Definition: dbghelp.h:35