ReactOS  0.4.15-dev-2703-g05fb0f1
evtpair.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for evtpair.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

BOOLEAN NTAPI ExpInitializeEventPairImplementation (VOID)
 
NTSTATUS NTAPI NtCreateEventPair (OUT PHANDLE EventPairHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
 
NTSTATUS NTAPI NtOpenEventPair (OUT PHANDLE EventPairHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
 
NTSTATUS NTAPI NtSetHighEventPair (IN HANDLE EventPairHandle)
 
NTSTATUS NTAPI NtSetHighWaitLowEventPair (IN HANDLE EventPairHandle)
 
NTSTATUS NTAPI NtSetLowEventPair (IN HANDLE EventPairHandle)
 
NTSTATUS NTAPI NtSetLowWaitHighEventPair (IN HANDLE EventPairHandle)
 
NTSTATUS NTAPI NtWaitLowEventPair (IN HANDLE EventPairHandle)
 
NTSTATUS NTAPI NtWaitHighEventPair (IN HANDLE EventPairHandle)
 

Variables

POBJECT_TYPE ExEventPairObjectType = NULL
 
GENERIC_MAPPING ExEventPairMapping
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file evtpair.c.

Function Documentation

◆ ExpInitializeEventPairImplementation()

BOOLEAN NTAPI ExpInitializeEventPairImplementation ( VOID  )

Definition at line 33 of file evtpair.c.

34 {
35  OBJECT_TYPE_INITIALIZER ObjectTypeInitializer;
38  DPRINT("Creating Event Pair Object Type\n");
39 
40  /* Create the Event Pair Object Type */
41  RtlZeroMemory(&ObjectTypeInitializer, sizeof(ObjectTypeInitializer));
42  RtlInitUnicodeString(&Name, L"EventPair");
43  ObjectTypeInitializer.Length = sizeof(ObjectTypeInitializer);
44  ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(KEVENT_PAIR);
45  ObjectTypeInitializer.GenericMapping = ExEventPairMapping;
46  ObjectTypeInitializer.PoolType = NonPagedPool;
47  ObjectTypeInitializer.ValidAccessMask = EVENT_PAIR_ALL_ACCESS;
48  ObjectTypeInitializer.UseDefaultObject = TRUE;
49  ObjectTypeInitializer.InvalidAttributes = OBJ_OPENLINK;
50  Status = ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &ExEventPairObjectType);
51  if (!NT_SUCCESS(Status)) return FALSE;
52  return TRUE;
53 }
#define OBJ_OPENLINK
Definition: winternl.h:230
NTSTATUS NTAPI ObCreateObjectType(IN PUNICODE_STRING TypeName, IN POBJECT_TYPE_INITIALIZER ObjectTypeInitializer, IN PVOID Reserved, OUT POBJECT_TYPE *ObjectType)
Definition: oblife.c:1048
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
struct _KEVENT_PAIR KEVENT_PAIR
#define FALSE
Definition: types.h:117
struct NameRec_ * Name
Definition: cdprocs.h:459
#define EVENT_PAIR_ALL_ACCESS
Definition: extypes.h:125
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static const WCHAR L[]
Definition: oid.c:1250
GENERIC_MAPPING ExEventPairMapping
Definition: evtpair.c:20
GENERIC_MAPPING GenericMapping
Definition: obtypes.h:358
#define NULL
Definition: types.h:112
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
POBJECT_TYPE ExEventPairObjectType
Definition: evtpair.c:18
#define DPRINT
Definition: sndvol32.h:71
ULONG DefaultNonPagedPoolCharge
Definition: obtypes.h:365

Referenced by ExpInitSystemPhase1().

◆ NtCreateEventPair()

NTSTATUS NTAPI NtCreateEventPair ( OUT PHANDLE  EventPairHandle,
IN ACCESS_MASK  DesiredAccess,
IN POBJECT_ATTRIBUTES  ObjectAttributes 
)

Definition at line 57 of file evtpair.c.

60 {
61  PKEVENT_PAIR EventPair;
62  HANDLE hEventPair;
65  PAGED_CODE();
66  DPRINT("NtCreateEventPair: 0x%p\n", EventPairHandle);
67 
68  /* Check if we were called from user-mode */
69  if (PreviousMode != KernelMode)
70  {
71  /* Enter SEH Block */
72  _SEH2_TRY
73  {
74  /* Check handle pointer */
75  ProbeForWriteHandle(EventPairHandle);
76  }
78  {
79  /* Return the exception code */
81  }
82  _SEH2_END;
83  }
84 
85  /* Create the Object */
86  DPRINT("Creating EventPair\n");
91  NULL,
92  sizeof(KEVENT_PAIR),
93  0,
94  0,
95  (PVOID*)&EventPair);
96 
97  /* Check for Success */
98  if (NT_SUCCESS(Status))
99  {
100  /* Initialize the Event */
101  DPRINT("Initializing EventPair\n");
102  KeInitializeEventPair(EventPair);
103 
104  /* Insert it */
105  Status = ObInsertObject((PVOID)EventPair,
106  NULL,
108  0,
109  NULL,
110  &hEventPair);
111 
112  /* Check for success */
113  if (NT_SUCCESS(Status))
114  {
115  /* Enter SEH */
116  _SEH2_TRY
117  {
118  /* Return the handle */
119  *EventPairHandle = hEventPair;
120  }
122  {
123  /* Get the exception code */
125  }
126  _SEH2_END;
127  }
128  }
129 
130  /* Return Status */
131  return Status;
132 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2654
LONG NTSTATUS
Definition: precomp.h:26
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
_SEH2_TRY
Definition: create.c:4226
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
Definition: oblife.c:952
Status
Definition: gdiplustypes.h:24
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define ProbeForWriteHandle(Ptr)
Definition: probe.h:43
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
_SEH2_END
Definition: create.c:4400
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
Definition: obhandle.c:2931
LONG NTAPI ExSystemExceptionFilter(VOID)
Definition: harderr.c:351
#define NULL
Definition: types.h:112
POBJECT_TYPE ExEventPairObjectType
Definition: evtpair.c:18
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:168
#define DPRINT
Definition: sndvol32.h:71
VOID NTAPI KeInitializeEventPair(PKEVENT_PAIR EventPair)
#define PAGED_CODE()

◆ NtOpenEventPair()

NTSTATUS NTAPI NtOpenEventPair ( OUT PHANDLE  EventPairHandle,
IN ACCESS_MASK  DesiredAccess,
IN POBJECT_ATTRIBUTES  ObjectAttributes 
)

Definition at line 136 of file evtpair.c.

139 {
140  HANDLE hEventPair;
143  PAGED_CODE();
144 
145  /* Check if we were called from user-mode */
146  if (PreviousMode != KernelMode)
147  {
148  /* Enter SEH Block */
149  _SEH2_TRY
150  {
151  /* Check handle pointer */
152  ProbeForWriteHandle(EventPairHandle);
153  }
155  {
156  /* Return the exception code */
158  }
159  _SEH2_END;
160  }
161 
162  /* Open the Object */
165  PreviousMode,
166  NULL,
168  NULL,
169  &hEventPair);
170 
171  /* Check for success */
172  if (NT_SUCCESS(Status))
173  {
174  /* Enter SEH */
175  _SEH2_TRY
176  {
177  /* Return the handle */
178  *EventPairHandle = hEventPair;
179  }
181  {
182  /* Get the exception code */
184  }
185  _SEH2_END;
186  }
187 
188  /* Return status */
189  return Status;
190 }
NTSTATUS NTAPI ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN OUT PVOID ParseContext, OUT PHANDLE Handle)
Definition: obhandle.c:2528
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2654
LONG NTSTATUS
Definition: precomp.h:26
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
_SEH2_TRY
Definition: create.c:4226
Status
Definition: gdiplustypes.h:24
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define ProbeForWriteHandle(Ptr)
Definition: probe.h:43
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
_SEH2_END
Definition: create.c:4400
LONG NTAPI ExSystemExceptionFilter(VOID)
Definition: harderr.c:351
#define NULL
Definition: types.h:112
POBJECT_TYPE ExEventPairObjectType
Definition: evtpair.c:18
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:168
#define PAGED_CODE()

Referenced by NtOpenObject().

◆ NtSetHighEventPair()

NTSTATUS NTAPI NtSetHighEventPair ( IN HANDLE  EventPairHandle)

Definition at line 194 of file evtpair.c.

195 {
196  PKEVENT_PAIR EventPair;
199  PAGED_CODE();
200  DPRINT("NtSetHighEventPair(EventPairHandle 0x%p)\n", EventPairHandle);
201 
202  /* Open the Object */
203  Status = ObReferenceObjectByHandle(EventPairHandle,
204  SYNCHRONIZE,
206  PreviousMode,
207  (PVOID*)&EventPair,
208  NULL);
209 
210  /* Check for Success */
211  if(NT_SUCCESS(Status))
212  {
213  /* Set the Event */
214  KeSetEvent(&EventPair->HighEvent, EVENT_INCREMENT, FALSE);
215 
216  /* Dereference Object */
217  ObDereferenceObject(EventPair);
218  }
219 
220  /* Return status */
221  return Status;
222 }
LONG NTSTATUS
Definition: precomp.h:26
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
#define FALSE
Definition: types.h:117
Status
Definition: gdiplustypes.h:24
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ObDereferenceObject
Definition: obfuncs.h:203
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
#define SYNCHRONIZE
Definition: nt_native.h:61
#define EVENT_INCREMENT
Definition: iotypes.h:597
#define NULL
Definition: types.h:112
POBJECT_TYPE ExEventPairObjectType
Definition: evtpair.c:18
KEVENT HighEvent
Definition: ketypes.h:911
#define DPRINT
Definition: sndvol32.h:71
#define PAGED_CODE()

◆ NtSetHighWaitLowEventPair()

NTSTATUS NTAPI NtSetHighWaitLowEventPair ( IN HANDLE  EventPairHandle)

Definition at line 226 of file evtpair.c.

227 {
228  PKEVENT_PAIR EventPair;
231  PAGED_CODE();
232  DPRINT("NtSetHighWaitLowEventPair(Handle 0x%p)\n", EventPairHandle);
233 
234  /* Open the Object */
235  Status = ObReferenceObjectByHandle(EventPairHandle,
236  SYNCHRONIZE,
238  PreviousMode,
239  (PVOID*)&EventPair,
240  NULL);
241 
242  /* Check for Success */
243  if(NT_SUCCESS(Status))
244  {
245  /* Set the Event */
246  KeSetEvent(&EventPair->HighEvent, EVENT_INCREMENT, FALSE);
247 
248  /* Wait for the Other one */
249  KeWaitForSingleObject(&EventPair->LowEvent,
250  WrEventPair,
251  PreviousMode,
252  FALSE,
253  NULL);
254 
255  /* Dereference Object */
256  ObDereferenceObject(EventPair);
257  }
258 
259  /* Return status */
260  return Status;
261 }
LONG NTSTATUS
Definition: precomp.h:26
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
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
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
#define FALSE
Definition: types.h:117
Status
Definition: gdiplustypes.h:24
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ObDereferenceObject
Definition: obfuncs.h:203
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
KEVENT LowEvent
Definition: ketypes.h:910
#define SYNCHRONIZE
Definition: nt_native.h:61
#define EVENT_INCREMENT
Definition: iotypes.h:597
#define NULL
Definition: types.h:112
POBJECT_TYPE ExEventPairObjectType
Definition: evtpair.c:18
KEVENT HighEvent
Definition: ketypes.h:911
#define DPRINT
Definition: sndvol32.h:71
#define PAGED_CODE()

◆ NtSetLowEventPair()

NTSTATUS NTAPI NtSetLowEventPair ( IN HANDLE  EventPairHandle)

Definition at line 265 of file evtpair.c.

266 {
267  PKEVENT_PAIR EventPair;
270  PAGED_CODE();
271  DPRINT1("NtSetHighEventPair(EventPairHandle 0x%p)\n", EventPairHandle);
272 
273  /* Open the Object */
274  Status = ObReferenceObjectByHandle(EventPairHandle,
275  SYNCHRONIZE,
277  PreviousMode,
278  (PVOID*)&EventPair,
279  NULL);
280 
281  /* Check for Success */
282  if(NT_SUCCESS(Status))
283  {
284  /* Set the Event */
285  KeSetEvent(&EventPair->LowEvent, EVENT_INCREMENT, FALSE);
286 
287  /* Dereference Object */
288  ObDereferenceObject(EventPair);
289  }
290 
291  /* Return status */
292  return Status;
293 }
LONG NTSTATUS
Definition: precomp.h:26
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
#define FALSE
Definition: types.h:117
Status
Definition: gdiplustypes.h:24
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ObDereferenceObject
Definition: obfuncs.h:203
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
KEVENT LowEvent
Definition: ketypes.h:910
#define SYNCHRONIZE
Definition: nt_native.h:61
#define EVENT_INCREMENT
Definition: iotypes.h:597
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
POBJECT_TYPE ExEventPairObjectType
Definition: evtpair.c:18
#define PAGED_CODE()

◆ NtSetLowWaitHighEventPair()

NTSTATUS NTAPI NtSetLowWaitHighEventPair ( IN HANDLE  EventPairHandle)

Definition at line 297 of file evtpair.c.

298 {
299  PKEVENT_PAIR EventPair;
302  PAGED_CODE();
303  DPRINT("NtSetHighWaitLowEventPair(Handle 0x%p)\n", EventPairHandle);
304 
305  /* Open the Object */
306  Status = ObReferenceObjectByHandle(EventPairHandle,
307  SYNCHRONIZE,
309  PreviousMode,
310  (PVOID*)&EventPair,
311  NULL);
312 
313  /* Check for Success */
314  if(NT_SUCCESS(Status))
315  {
316  /* Set the Event */
317  KeSetEvent(&EventPair->LowEvent, EVENT_INCREMENT, FALSE);
318 
319  /* Wait for the Other one */
320  KeWaitForSingleObject(&EventPair->HighEvent,
321  WrEventPair,
322  PreviousMode,
323  FALSE,
324  NULL);
325 
326  /* Dereference Object */
327  ObDereferenceObject(EventPair);
328  }
329 
330  /* Return status */
331  return Status;
332 }
LONG NTSTATUS
Definition: precomp.h:26
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
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
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
#define FALSE
Definition: types.h:117
Status
Definition: gdiplustypes.h:24
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ObDereferenceObject
Definition: obfuncs.h:203
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
KEVENT LowEvent
Definition: ketypes.h:910
#define SYNCHRONIZE
Definition: nt_native.h:61
#define EVENT_INCREMENT
Definition: iotypes.h:597
#define NULL
Definition: types.h:112
POBJECT_TYPE ExEventPairObjectType
Definition: evtpair.c:18
KEVENT HighEvent
Definition: ketypes.h:911
#define DPRINT
Definition: sndvol32.h:71
#define PAGED_CODE()

◆ NtWaitHighEventPair()

NTSTATUS NTAPI NtWaitHighEventPair ( IN HANDLE  EventPairHandle)

Definition at line 373 of file evtpair.c.

374 {
375  PKEVENT_PAIR EventPair;
378 
379  PAGED_CODE();
380  DPRINT("NtSetHighWaitLowEventPair(Handle 0x%p)\n", EventPairHandle);
381 
382  /* Open the Object */
383  Status = ObReferenceObjectByHandle(EventPairHandle,
384  SYNCHRONIZE,
386  PreviousMode,
387  (PVOID*)&EventPair,
388  NULL);
389 
390  /* Check for Success */
391  if(NT_SUCCESS(Status))
392  {
393  /* Wait for the Event */
394  KeWaitForSingleObject(&EventPair->HighEvent,
395  WrEventPair,
396  PreviousMode,
397  FALSE,
398  NULL);
399 
400  /* Dereference Object */
401  ObDereferenceObject(EventPair);
402  }
403 
404  /* Return status */
405  return Status;
406 }
LONG NTSTATUS
Definition: precomp.h:26
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
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
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
#define FALSE
Definition: types.h:117
Status
Definition: gdiplustypes.h:24
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ObDereferenceObject
Definition: obfuncs.h:203
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
#define SYNCHRONIZE
Definition: nt_native.h:61
#define NULL
Definition: types.h:112
POBJECT_TYPE ExEventPairObjectType
Definition: evtpair.c:18
KEVENT HighEvent
Definition: ketypes.h:911
#define DPRINT
Definition: sndvol32.h:71
#define PAGED_CODE()

◆ NtWaitLowEventPair()

NTSTATUS NTAPI NtWaitLowEventPair ( IN HANDLE  EventPairHandle)

Definition at line 337 of file evtpair.c.

338 {
339  PKEVENT_PAIR EventPair;
342  PAGED_CODE();
343  DPRINT("NtSetHighWaitLowEventPair(Handle 0x%p)\n", EventPairHandle);
344 
345  /* Open the Object */
346  Status = ObReferenceObjectByHandle(EventPairHandle,
347  SYNCHRONIZE,
349  PreviousMode,
350  (PVOID*)&EventPair,
351  NULL);
352 
353  /* Check for Success */
354  if(NT_SUCCESS(Status))
355  {
356  /* Wait for the Event */
357  KeWaitForSingleObject(&EventPair->LowEvent,
358  WrEventPair,
359  PreviousMode,
360  FALSE,
361  NULL);
362 
363  /* Dereference Object */
364  ObDereferenceObject(EventPair);
365  }
366 
367  /* Return status */
368  return Status;
369 }
LONG NTSTATUS
Definition: precomp.h:26
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
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
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
#define FALSE
Definition: types.h:117
Status
Definition: gdiplustypes.h:24
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ObDereferenceObject
Definition: obfuncs.h:203
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
KEVENT LowEvent
Definition: ketypes.h:910
#define SYNCHRONIZE
Definition: nt_native.h:61
#define NULL
Definition: types.h:112
POBJECT_TYPE ExEventPairObjectType
Definition: evtpair.c:18
#define DPRINT
Definition: sndvol32.h:71
#define PAGED_CODE()

Variable Documentation

◆ ExEventPairMapping

GENERIC_MAPPING ExEventPairMapping
Initial value:
=
{
}
#define STANDARD_RIGHTS_WRITE
Definition: nt_native.h:66
#define STANDARD_RIGHTS_EXECUTE
Definition: nt_native.h:67
#define EVENT_PAIR_ALL_ACCESS
Definition: extypes.h:125
#define STANDARD_RIGHTS_READ
Definition: nt_native.h:65
#define SYNCHRONIZE
Definition: nt_native.h:61

Definition at line 20 of file evtpair.c.

Referenced by ExpInitializeEventPairImplementation().

◆ ExEventPairObjectType