ReactOS 0.4.16-dev-300-g2aadf2e
events.c File Reference
#include "precomp.h"
Include dependency graph for events.c:

Go to the source code of this file.

Classes

struct  _CTEBLOCK_EVENT
 
struct  _CTE_DELAYED_EVENT
 

Typedefs

typedef struct _CTEBLOCK_EVENT CTEBLOCK_EVENT
 
typedef struct _CTEBLOCK_EVENTPCTEBLOCK_EVENT
 
typedef void(* CTE_WORKER_ROUTINE) (struct _CTE_DELAYED_EVENT *, void *Context)
 
typedef struct _CTE_DELAYED_EVENT CTE_DELAYED_EVENT
 
typedef struct _CTE_DELAYED_EVENTPCTE_DELAYED_EVENT
 

Functions

NTSTATUS NTAPI CTEBlock (PCTEBLOCK_EVENT Block)
 
VOID NTAPI InternalWorker (IN PVOID Parameter)
 
VOID NTAPI CTEInitEvent (PCTE_DELAYED_EVENT Event, CTE_WORKER_ROUTINE Routine)
 
NTSTATUS NTAPI CTELogEvent (ULONG Unknown0, ULONG Unknown1, ULONG Unknown2, ULONG Unknown3, ULONG Unknown4, ULONG Unknown5, ULONG Unknown6)
 
BOOLEAN NTAPI CTEScheduleEvent (PCTE_DELAYED_EVENT Event, PVOID Context)
 
LONG NTAPI CTESignal (PCTEBLOCK_EVENT Block, NTSTATUS Status)
 

Typedef Documentation

◆ CTE_DELAYED_EVENT

◆ CTE_WORKER_ROUTINE

typedef void(* CTE_WORKER_ROUTINE) (struct _CTE_DELAYED_EVENT *, void *Context)

Definition at line 20 of file events.c.

◆ CTEBLOCK_EVENT

◆ PCTE_DELAYED_EVENT

◆ PCTEBLOCK_EVENT

Function Documentation

◆ CTEBlock()

NTSTATUS NTAPI CTEBlock ( PCTEBLOCK_EVENT  Block)

Definition at line 38 of file events.c.

39{
41
42 /* Perform the wait */
44
45 /* Update event status if wait was not successful */
46 if (!NT_SUCCESS(Status)) Block->Status = Status;
47
48 return Block->Status;
49}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
Status
Definition: gdiplustypes.h:25
#define KernelMode
Definition: asm.h:34
KEVENT Event
Definition: events.c:16
NTSTATUS Status
Definition: events.c:15
@ UserRequest
Definition: ketypes.h:421

◆ CTEInitEvent()

VOID NTAPI CTEInitEvent ( PCTE_DELAYED_EVENT  Event,
CTE_WORKER_ROUTINE  Routine 
)

Definition at line 79 of file events.c.

81{
82 /* Init the structure, lock and a work item */
83 Event->Queued = FALSE;
85 Event->WorkerRoutine = Routine;
87}
VOID NTAPI InternalWorker(IN PVOID Parameter)
Definition: events.c:54
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265

◆ CTELogEvent()

NTSTATUS NTAPI CTELogEvent ( ULONG  Unknown0,
ULONG  Unknown1,
ULONG  Unknown2,
ULONG  Unknown3,
ULONG  Unknown4,
ULONG  Unknown5,
ULONG  Unknown6 
)

Definition at line 94 of file events.c.

103{
104 /* Probably call
105 * IoAllocateErrorLogEntry and
106 * IoWriteErrorLogEntry
107 */
109}
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42

◆ CTEScheduleEvent()

BOOLEAN NTAPI CTEScheduleEvent ( PCTE_DELAYED_EVENT  Event,
PVOID  Context 
)

Definition at line 117 of file events.c.

119{
121
122 /* Acquire the lock */
124
125 /* Make sure it is queued */
126 if (!Event->Queued)
127 {
128 /* Mark it as queued and set optional context pointer */
129 Event->Queued = TRUE;
130 Event->Context = Context;
131
132 /* Actually queue it */
134 }
135
136 /* Release the lock */
138
139 return TRUE;
140}
#define TRUE
Definition: types.h:120
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:723
@ CriticalWorkQueue
Definition: extypes.h:189
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778

◆ CTESignal()

LONG NTAPI CTESignal ( PCTEBLOCK_EVENT  Block,
NTSTATUS  Status 
)

Definition at line 148 of file events.c.

149{
150 /* Set status right away */
151 Block->Status = Status;
152
153 /* Set the event */
154 return KeSetEvent(&Block->Event, IO_NO_INCREMENT, FALSE);
155}
#define KeSetEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:476
#define IO_NO_INCREMENT
Definition: iotypes.h:598

◆ InternalWorker()

VOID NTAPI InternalWorker ( IN PVOID  Parameter)

Definition at line 54 of file events.c.

55{
58
59 /* Acquire the lock */
61
62 /* Make sure it is queued */
63 ASSERT(Event->Queued);
64 Event->Queued = FALSE;
65
66 /* Release the lock */
68
69 /* Call the real worker routine */
70 (*Event->WorkerRoutine)(Event, Event->Context);
71}
struct _CTE_DELAYED_EVENT * PCTE_DELAYED_EVENT
#define ASSERT(a)
Definition: mode.c:44
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:336

Referenced by CTEInitEvent().