ReactOS 0.4.15-dev-8100-g1887773
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 */
21DRIVER_INITIALIZE DriverEntry;
22DRIVER_UNLOAD ConDrvUnload;
23/*
24DRIVER_DISPATCH ConDrvIoControl;
25DRIVER_DISPATCH ConDrvCreate;
26DRIVER_DISPATCH ConDrvClose;
27DRIVER_DISPATCH ConDrvRead;
28DRIVER_DISPATCH ConDrvWrite;
29DRIVER_DISPATCH ConDrvCleanup;
30*/
32
36{
38 USHORT i;
40
41 DPRINT1("Loading ReactOS Console Driver v0.0.1...\n");
42
43 DriverObject->DriverUnload = ConDrvUnload;
44
45 /* Initialize the different callback function pointers */
46 for (i = 0 ; i <= IRP_MJ_MAXIMUM_FUNCTION ; ++i)
47 DriverObject->MajorFunction[i] = ConDrvDispatch;
48
49#if 0
50 DriverObject->MajorFunction[IRP_MJ_CREATE] = ConDrvCreate;
51 DriverObject->MajorFunction[IRP_MJ_CLOSE] = ConDrvClose;
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
59 DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = ConDrvIoControl;
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
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 */
91 ASSERT(DriverObject->DeviceObject == NULL);
92
93 DPRINT1("Done\n");
94 return;
95}
96
97/* EOF */
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
NTSTATUS NTAPI ConDrvCreateController(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: control.c:21
NTSTATUS NTAPI ConDrvDeleteController(IN PDRIVER_OBJECT DriverObject)
Definition: control.c:66
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
DRIVER_UNLOAD ConDrvUnload
Definition: condrv.c:22
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
DRIVER_DISPATCH ConDrvDispatch
Definition: condrv.c:31
Status
Definition: gdiplustypes.h:25
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
#define ASSERT(a)
Definition: mode.c:44
DRIVER_DISPATCH(nfs41_FsdDispatch)
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1826
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
unsigned short USHORT
Definition: pedump.c:61
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
WORD NTAPI ConDrvClose(PDOS_DEVICE_NODE Device)
Definition: condrv.c:124
#define NTAPI
Definition: typedefs.h:36
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define IRP_MJ_MAXIMUM_FUNCTION