60 Pdx->QuitThread = FALSE;
64 DBG_IRQL( == PASSIVE_LEVEL);
65 ntStatus = PsCreateSystemThread(&Pdx->ThreadHandle,
73 if (!NT_SUCCESS(ntStatus))
78 LogErrorString(fdo, CBM_START_FAILED, L
"creation of the system thread.", NULL);
87 DBG_IRQL( == PASSIVE_LEVEL);
88 ObReferenceObjectByHandle(Pdx->ThreadHandle,
89 THREAD_ALL_ACCESS, NULL, KernelMode, &Pdx->Thread, NULL);
97 DBG_IRQL( == PASSIVE_LEVEL);
98 KeSetPriorityThread(Pdx->Thread, LOW_REALTIME_PRIORITY);
102 FUNC_LEAVE_NTSTATUS(ntStatus);
126 if ((Pdx->ThreadHandle != 0) && (Pdx->Thread != 0))
132 Pdx->QuitThread = TRUE;
140 KeWaitForSingleObject(Pdx->Thread, Executive, KernelMode, FALSE, NULL);
144 ObDereferenceObject(Pdx->Thread);
145 ZwClose(Pdx->ThreadHandle);
150 Pdx->ThreadHandle = 0;
167 PDEVICE_EXTENSION pdx;
180 ntStatus = STATUS_SUCCESS;
184 while (!pdx->QuitThread)
190 ntStatus =
QueuePoll(&pdx->IrpQueue, pdx->Fdo);
197 DBG_IRQL( == PASSIVE_LEVEL);
198 PsTerminateSystemThread(ntStatus);
#define LogErrorString(_Fdo_, _UniqueErrorValue_, _String1_, _String2_)
#define PERF_EVENT_THREAD_START_EXEC()
#define PERF_EVENT_THREAD_POLL()
#define PERF_EVENT_THREAD_STOP_EXEC()
NTSTATUS cbm_start_thread(IN PDEVICE_EXTENSION Pdx)
Start the worker thread.
NTSTATUS QueuePoll(PQUEUE Queue, PDEVICE_OBJECT Fdo)
Poll the QUEUE.
#define PERF_EVENT_THREAD_START_SCHED()
VOID cbm_thread(IN PVOID Context)
The thread function.
#define PERF_EVENT_THREAD_STOP_SCHED()
NTSTATUS QueueSignal(PQUEUE Queue)
Signal to the QUEUE need for processing.
Definitions for the opencbm driver.
VOID cbm_stop_thread(IN PDEVICE_EXTENSION Pdx)
Stop the worker thread.