ReactOS  0.4.14-dev-608-gd495a4f
condrv.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Console Driver
4  * FILE: drivers/base/condrv/condrv.c
5  * PURPOSE: Console Driver Management Functions
6  * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include "condrv.h"
12 
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* FUNCTIONS ******************************************************************/
17 
18 /*
19  * Callback functions prototypes
20  */
21 DRIVER_INITIALIZE DriverEntry;
22 DRIVER_UNLOAD ConDrvUnload;
23 /*
24 DRIVER_DISPATCH ConDrvIoControl;
25 DRIVER_DISPATCH ConDrvCreate;
26 DRIVER_DISPATCH ConDrvClose;
27 DRIVER_DISPATCH ConDrvRead;
28 DRIVER_DISPATCH ConDrvWrite;
29 DRIVER_DISPATCH ConDrvCleanup;
30 */
32 
36 {
38  USHORT i;
40 
41  DPRINT1("Loading ReactOS Console Driver v0.0.1...\n");
42 
44 
45  /* Initialize the different callback function pointers */
46  for (i = 0 ; i <= IRP_MJ_MAXIMUM_FUNCTION ; ++i)
48 
49 #if 0
50  DriverObject->MajorFunction[IRP_MJ_CREATE] = ConDrvCreate;
52 
53  /* temporary deactivated...
54  DriverObject->MajorFunction[IRP_MJ_CLEANUP] = ConDrvCleanup;
55  */
56  DriverObject->MajorFunction[IRP_MJ_READ] = ConDrvRead;
57  DriverObject->MajorFunction[IRP_MJ_WRITE] = ConDrvWrite;
58 
60 #endif
61 
63  DriverObject, // Unique ID for the driver object extension ==> gives it its address !
64  sizeof(CONDRV_DRIVER),
66  if (!NT_SUCCESS(Status))
67  {
68  DPRINT1("IoAllocateDriverObjectExtension() failed with status 0x%08lx\n", Status);
69  return Status;
70  }
72 
74 
75  DPRINT1("Done, Status = 0x%08lx\n", Status);
76  return Status;
77 }
78 
79 VOID NTAPI
81 {
82  DPRINT1("Unloading ReactOS Console Driver v0.0.1...\n");
83 
84  /*
85  * Delete the Controller device. This has as effect
86  * to delete also all the terminals.
87  */
89 
90  /* Sanity check: No devices must exist at this point */
92 
93  DPRINT1("Done\n");
94  return;
95 }
96 
97 /* EOF */
#define IN
Definition: typedefs.h:38
NTSTATUS NTAPI ConDrvDeleteController(IN PDRIVER_OBJECT DriverObject)
Definition: control.c:66
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1764
#define IRP_MJ_MAXIMUM_FUNCTION
LONG NTSTATUS
Definition: precomp.h:26
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
WORD NTAPI ConDrvClose(PDOS_DEVICE_NODE Device)
Definition: condrv.c:124
smooth NULL
Definition: ftsmooth.c:416
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
DRIVER_UNLOAD ConDrvUnload
Definition: condrv.c:22
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2180
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:41
DRIVER_DISPATCH(nfs41_FsdDispatch)
Status
Definition: gdiplustypes.h:24
DRIVER_DISPATCH ConDrvDispatch
Definition: condrv.c:31
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
unsigned short USHORT
Definition: pedump.c:61
#define DPRINT1
Definition: precomp.h:8
#define IRP_MJ_READ
Definition: rdpdr.c:46
NTSTATUS NTAPI ConDrvCreateController(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: control.c:21
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2181
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:2169
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52