ReactOS  0.4.13-dev-249-gcba1a2f
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:225

◆ DispatchClose()

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

Definition at line 45 of file dispatch.c.

47 {
49 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225

◆ DispatchCreate()

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

Definition at line 37 of file dispatch.c.

39 {
41 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225

◆ DispatchDeviceControl()

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

Definition at line 21 of file dispatch.c.

23 {
25 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225

Referenced by DriverEntry().

◆ DispatchShutdownControl()

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

Definition at line 29 of file dispatch.c.

31 {
33 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225

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 }
#define TRUE
Definition: types.h:120
PCHAR SerialPortBuffer
Definition: util.c:35
long __cdecl _InterlockedExchange(_Interlocked_operand_ long volatile *_Target, long _Value)
LONG NTSTATUS
Definition: precomp.h:26
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
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
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
LONG TimerDpcCount
Definition: dispatch.c:15
KPRIORITY PriorityBoost
Definition: sacdrv.h:512
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define SAC_SERIAL_PORT_BUFFER_SIZE
Definition: sacdrv.h:154
long __cdecl _InterlockedExchangeAdd(_Interlocked_operand_ long volatile *_Addend, long _Value)
LONG SerialPortProducerIndex
Definition: util.c:34
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:675

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 */
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 */
131  FreeGlobalData();
132  SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC UnloadHandler: Exiting.\n");
133 }
VOID NTAPI FreeDeviceData(IN PDEVICE_OBJECT DeviceObject)
Definition: data.c:147
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
VOID NTAPI FreeGlobalData(VOID)
Definition: data.c:100
#define SAC_DBG(x,...)
Definition: sacdrv.h:37
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1250
#define SAC_DBG_ENTRY_EXIT
Definition: sacdrv.h:32
PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:2168

Variable Documentation

◆ TimerDpcCount

LONG TimerDpcCount

Definition at line 15 of file dispatch.c.

Referenced by TimerDpcRoutine().