From 69b02e115558485c699e64998b9e1b154c707b6b Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Thu, 12 Nov 2009 20:41:12 +0000 Subject: [PATCH] - Win32k doesn't know what "opaque" means. Store the module base address in the structure too for the code that relied on the handle being the base address. svn path=/trunk/; revision=44120 --- reactos/subsystems/win32/win32k/include/driver.h | 12 +++++++----- reactos/subsystems/win32/win32k/ldr/loader.c | 10 ++-------- reactos/subsystems/win32/win32k/ntuser/kbdlayout.c | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/reactos/subsystems/win32/win32k/include/driver.h b/reactos/subsystems/win32/win32k/include/driver.h index 8c5e09a14f9..04cd33b986f 100644 --- a/reactos/subsystems/win32/win32k/include/driver.h +++ b/reactos/subsystems/win32/win32k/include/driver.h @@ -4,11 +4,13 @@ #include - - - - - +typedef struct _DRIVERS +{ + LIST_ENTRY ListEntry; + PVOID SectionPointer; + PVOID BaseAddress; + UNICODE_STRING DriverName; +}DRIVERS, *PDRIVERS; BOOL DRIVER_RegisterDriver(LPCWSTR Name, PFN_DrvEnableDriver EnableDriver); PFN_DrvEnableDriver DRIVER_FindExistingDDIDriver(LPCWSTR Name); diff --git a/reactos/subsystems/win32/win32k/ldr/loader.c b/reactos/subsystems/win32/win32k/ldr/loader.c index 838483efafe..9803c8d4009 100644 --- a/reactos/subsystems/win32/win32k/ldr/loader.c +++ b/reactos/subsystems/win32/win32k/ldr/loader.c @@ -26,13 +26,6 @@ #include -typedef struct _DRIVERS -{ - LIST_ENTRY ListEntry; - PVOID SectionPointer; - UNICODE_STRING DriverName; -}DRIVERS, *PDRIVERS; - extern LIST_ENTRY GlobalDriverListHead; @@ -181,7 +174,7 @@ EngFindImageProcAddress(IN HANDLE Module, return NULL; } RtlInitAnsiString(&ProcNameString, ProcName); - Status = LdrGetProcedureAddress(Module, + Status = LdrGetProcedureAddress(((PDRIVERS)Module)->BaseAddress, &ProcNameString, 0, &Function); @@ -235,6 +228,7 @@ EngLoadImage (LPWSTR DriverName) DriverInfo->DriverName.Buffer = ExAllocatePool(PagedPool, GdiDriverInfo.DriverName.MaximumLength); RtlCopyUnicodeString(&DriverInfo->DriverName, &GdiDriverInfo.DriverName); DriverInfo->SectionPointer = GdiDriverInfo.SectionPointer; + DriverInfo->BaseAddress = GdiDriverInfo.ImageAddress; InsertHeadList(&GlobalDriverListHead, &DriverInfo->ListEntry); } } diff --git a/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c b/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c index cbb5a5fd50f..c43a6c2aae5 100644 --- a/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c +++ b/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c @@ -163,7 +163,7 @@ static BOOL UserLoadKbdDll(WCHAR *wsKLID, DPRINT("Loaded %wZ\n", &FullLayoutPath); RtlInitAnsiString( &kbdProcedureName, "KbdLayerDescriptor" ); - LdrGetProcedureAddress((PVOID)*phModule, + LdrGetProcedureAddress((*(PDRIVERS*)phModule)->BaseAddress, &kbdProcedureName, 0, (PVOID*)&layerDescGetFn);