OpenCBM
Functions
thread.c File Reference

Common functions für initialization the WDM and NT4 driver. More...

#include <wdm.h>
#include "cbm_driver.h"

Go to the source code of this file.

Functions

NTSTATUS cbm_start_thread (IN PDEVICE_EXTENSION Pdx)
 Start the worker thread. More...
 
VOID cbm_stop_thread (IN PDEVICE_EXTENSION Pdx)
 Stop the worker thread. More...
 
VOID cbm_thread (IN PVOID Context)
 The thread function. More...
 

Detailed Description

Common functions für initialization the WDM and NT4 driver.



Author
Spiro Trikaliotis

Definition in file thread.c.

Function Documentation

NTSTATUS cbm_start_thread ( IN PDEVICE_EXTENSION  Pdx)

Start the worker thread.

This function start the worker thread.

Parameters
PdxPointer to a DEVICE_EXTENSION structure.
Returns
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it return one of the error status values.
Todo:
Replace Pdx->QuitThread with a event for quitting

Definition at line 34 of file thread.c.

References cbm_thread(), DBG_ASSERT, DBG_ERROR, DBG_PREFIX, FUNC_ENTER, LogErrorString, and PERF_EVENT_THREAD_START_SCHED.

Referenced by AddDeviceCommonInit().

VOID cbm_stop_thread ( IN PDEVICE_EXTENSION  Pdx)

Stop the worker thread.

This function stops the worker thread.

Parameters
PdxPointer to a DEVICE_EXTENSION structure.
Returns
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it return one of the error status values.

Definition at line 117 of file thread.c.

References DBG_ASSERT, FUNC_ENTER, FUNC_LEAVE, PERF_EVENT_THREAD_STOP_SCHED, and QueueSignal().

Referenced by DriverUnload().

VOID cbm_thread ( IN PVOID  Context)

The thread function.

This function is the function of the thread itself. It polls the QUEUE and executed the IRPs which are on it.

Parameters
ContextPointer to the thread context. This is a PDX in reality.

Definition at line 165 of file thread.c.

References FUNC_ENTER, FUNC_LEAVE, PERF_EVENT_THREAD_POLL, PERF_EVENT_THREAD_START_EXEC, PERF_EVENT_THREAD_STOP_EXEC, and QueuePoll().

Referenced by cbm_start_thread().