ReactOS 0.4.16-dev-125-g798ea90
dispatch.c File Reference
#include "sacdrv.h"
Include dependency graph for dispatch.c:

Go to the source code of this file.

Functions

NTSTATUS NTAPI DispatchDeviceControl (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI DispatchShutdownControl (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI DispatchCreate (IN PSAC_DEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
 
NTSTATUS NTAPI DispatchClose (IN PSAC_DEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
 
NTSTATUS NTAPI Dispatch (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
VOID NTAPI TimerDpcRoutine (IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
 
VOID NTAPI UnloadHandler (IN PDRIVER_OBJECT DriverObject)
 

Variables

LONG TimerDpcCount
 

Function Documentation

◆ Dispatch()

NTSTATUS NTAPI Dispatch ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 53 of file dispatch.c.

55{
57}
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239

◆ DispatchClose()

NTSTATUS NTAPI DispatchClose ( IN PSAC_DEVICE_EXTENSION  DeviceExtension,
IN PIRP  Irp 
)

Definition at line 45 of file dispatch.c.

47{
49}

◆ DispatchCreate()

NTSTATUS NTAPI DispatchCreate ( IN PSAC_DEVICE_EXTENSION  DeviceExtension,
IN PIRP  Irp 
)

Definition at line 37 of file dispatch.c.

39{
41}

◆ DispatchDeviceControl()

NTSTATUS NTAPI DispatchDeviceControl ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 21 of file dispatch.c.

23{
25}

Referenced by DriverEntry().

◆ DispatchShutdownControl()

NTSTATUS NTAPI DispatchShutdownControl ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 29 of file dispatch.c.

31{
33}

Referenced by DriverEntry().

◆ TimerDpcRoutine()

VOID NTAPI TimerDpcRoutine ( IN PKDPC  Dpc,
IN PVOID  DeferredContext,
IN PVOID  SystemArgument1,
IN PVOID  SystemArgument2 
)

Definition at line 61 of file dispatch.c.

65{
66 HEADLESS_RSP_GET_BYTE ByteValue;
67 SIZE_T ValueSize;
68 BOOLEAN GotChar;
70 PSAC_DEVICE_EXTENSION SacExtension;
71
72 /* Update our counter */
74
75 /* Set defaults and loop for new characters */
76 GotChar = FALSE;
77 ValueSize = sizeof(ByteValue);
78 do
79 {
80 /* Ask the kernel for a byte */
82 NULL,
83 0,
84 &ByteValue,
85 &ValueSize);
86
87 /* Break out if there's nothing interesting */
88 if (!NT_SUCCESS(Status)) break;
89 if (!ByteValue.Value) break;
90
91 /* Update the serial port buffer */
93 GotChar = TRUE;
94
95 /* Update the index, let it roll-over if needed */
99 } while (ByteValue.Value);
100
101 /* Did we get anything */
102 if (GotChar)
103 {
104 /* Signal the worker thread that there is work to do */
105 SacExtension = DeferredContext;
106 KeSetEvent(&SacExtension->Event, SacExtension->PriorityBoost, FALSE);
107 }
108}
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
LONG TimerDpcCount
Definition: dispatch.c:15
#define KeSetEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:476
Status
Definition: gdiplustypes.h:25
@ HeadlessCmdGetByte
Definition: hdl.h:140
NTSTATUS NTAPI HeadlessDispatch(IN HEADLESS_CMD Command, IN PVOID InputBuffer, IN SIZE_T InputBufferSize, OUT PVOID OutputBuffer, OUT PSIZE_T OutputBufferSize)
Definition: hdlsterm.c:570
long __cdecl _InterlockedExchangeAdd(_Interlocked_operand_ long volatile *_Addend, long _Value)
long __cdecl _InterlockedExchange(_Interlocked_operand_ long volatile *_Target, long _Value)
LONG SerialPortProducerIndex
Definition: sacdrv.h:1241
PCHAR SerialPortBuffer
Definition: util.c:35
#define SAC_SERIAL_PORT_BUFFER_SIZE
Definition: sacdrv.h:155
KPRIORITY PriorityBoost
Definition: sacdrv.h:513
ULONG_PTR SIZE_T
Definition: typedefs.h:80
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:687

Referenced by InitializeDeviceData().

◆ UnloadHandler()

VOID NTAPI UnloadHandler ( IN PDRIVER_OBJECT  DriverObject)

Definition at line 112 of file dispatch.c.

113{
114 PDEVICE_OBJECT DeviceObject, NextDevice;
115 SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC UnloadHandler: Entering.\n");
116
117 /* Go over every device part of the driver */
118 DeviceObject = DriverObject->DeviceObject;
119 while (DeviceObject)
120 {
121 /* Free and delete the information about this device */
122 NextDevice = DeviceObject->NextDevice;
125
126 /* Move on to the next one */
127 DeviceObject = NextDevice;
128 }
129
130 /* Free the driver data and exit */
132 SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC UnloadHandler: Exiting.\n");
133}
VOID NTAPI FreeGlobalData(VOID)
Definition: data.c:100
VOID NTAPI FreeDeviceData(IN PDEVICE_OBJECT DeviceObject)
Definition: data.c:147
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define SAC_DBG(x,...)
Definition: sacdrv.h:37
#define SAC_DBG_ENTRY_EXIT
Definition: sacdrv.h:32
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213

Variable Documentation

◆ TimerDpcCount

LONG TimerDpcCount

Definition at line 15 of file dispatch.c.

Referenced by TimerDpcRoutine().