ReactOS 0.4.15-dev-8344-g0574987
green.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS VT100 emulator
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: drivers/base/green/green.c
5 * PURPOSE: Driver entry point
6 * PROGRAMMERS: Copyright 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
7 */
8
9#include "green.h"
10
11#define NDEBUG
12#include <debug.h>
13
16{
17 // nothing to do here yet
18}
19
20/*
21 * Standard DriverEntry method.
22 */
27{
29 ULONG i;
31
37 if (!NT_SUCCESS(Status))
38 {
39 DPRINT("IoAllocateDriverObjectExtension() failed with status 0x%08lx\n", Status);
40 return Status;
41 }
43
45 0,
47 &DriverExtension->RegistryPath);
48 if (!NT_SUCCESS(Status))
49 {
50 DPRINT("GreenDuplicateUnicodeString() failed with status 0x%08lx\n", Status);
51 return Status;
52 }
53
55 if (!NT_SUCCESS(Status))
56 {
57 DPRINT("ReadRegistryEntries() failed with status 0x%08lx\n", Status);
58 return Status;
59 }
60
61 DriverObject->DriverUnload = DriverUnload;
62 DriverObject->DriverExtension->AddDevice = GreenAddDevice;
63
64 for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++)
65 DriverObject->MajorFunction[i] = GreenDispatch;
66
67 return STATUS_SUCCESS;
68}
69
75{
80 {
82 }
83
84
85 if ((SourceString->Length == 0)
88 {
92 }
93 else
94 {
95 USHORT DestMaxLength = SourceString->Length;
96
98 DestMaxLength += sizeof(UNICODE_NULL);
99
102 return STATUS_NO_MEMORY;
103
106 DestinationString->MaximumLength = DestMaxLength;
107
110 }
111
112 return STATUS_SUCCESS;
113}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
#define PagedPool
Definition: env_spec_w32.h:308
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
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
NTSTATUS GreenDuplicateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
Definition: green.c:71
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING
Definition: green.h:16
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: green.h:15
NTSTATUS NTAPI GreenAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo)
Definition: pnp.c:179
NTSTATUS ReadRegistryEntries(IN PUNICODE_STRING RegistryPath, OUT PI8042_SETTINGS Settings)
Definition: registry.c:21
static DRIVER_UNLOAD DriverUnload
Definition: kbdclass.c:17
NTSTATUS NTAPI GreenDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:15
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1922
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1921
#define UNICODE_NULL
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1826
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
unsigned short Length
Definition: sprintf.c:451
void * Buffer
Definition: sprintf.c:453
unsigned short MaximumLength
Definition: sprintf.c:452
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define IRP_MJ_MAXIMUM_FUNCTION
__wchar_t WCHAR
Definition: xmlstorage.h:180