ReactOS 0.4.15-dev-8219-ge8b88cf
green.c File Reference
#include "green.h"
#include <debug.h>
Include dependency graph for green.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI DriverUnload (IN PDRIVER_OBJECT DriverObject)
 
NTSTATUS NTAPI DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 
NTSTATUS GreenDuplicateUnicodeString (IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file green.c.

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath 
)

Definition at line 24 of file green.c.

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}
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
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
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
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
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
_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

◆ DriverUnload()

VOID NTAPI DriverUnload ( IN PDRIVER_OBJECT  DriverObject)

Definition at line 15 of file green.c.

16{
17 // nothing to do here yet
18}

◆ GreenDuplicateUnicodeString()

NTSTATUS GreenDuplicateUnicodeString ( IN ULONG  Flags,
IN PCUNICODE_STRING  SourceString,
OUT PUNICODE_STRING  DestinationString 
)

Definition at line 71 of file green.c.

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}
#define NULL
Definition: types.h:112
#define PagedPool
Definition: env_spec_w32.h:308
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING
Definition: green.h:16
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: green.h:15
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1910
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1909
#define UNICODE_NULL
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
unsigned short USHORT
Definition: pedump.c:61
unsigned short Length
Definition: sprintf.c:451
void * Buffer
Definition: sprintf.c:453
unsigned short MaximumLength
Definition: sprintf.c:452
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DriverEntry(), and GreenQueryId().