From 854e23cc3e137bc8fdfcdc342851125843dce118 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 29 Mar 2011 10:02:38 +0000 Subject: [PATCH] [WIN32K] Make GdiTableSection a static variable and use it only from gdiobj.c svn path=/trunk/; revision=51189 --- reactos/subsystems/win32/win32k/include/gdiobj.h | 5 ++--- reactos/subsystems/win32/win32k/main/dllmain.c | 6 +++--- reactos/subsystems/win32/win32k/objects/gdiobj.c | 8 ++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/reactos/subsystems/win32/win32k/include/gdiobj.h b/reactos/subsystems/win32/win32k/include/gdiobj.h index e29077c2f42..032acc2c523 100644 --- a/reactos/subsystems/win32/win32k/include/gdiobj.h +++ b/reactos/subsystems/win32/win32k/include/gdiobj.h @@ -47,6 +47,7 @@ typedef struct _BASEOBJECT USHORT cExclusiveLock; USHORT BaseFlags; PTHREADINFO Tid; + EX_PUSH_LOCK pushlock; } BASEOBJECT, *POBJ; typedef struct _CLIENTOBJ @@ -62,8 +63,6 @@ enum BASEFLAGS BASEFLAG_READY_TO_DIE = 0x1000 }; -extern PSECTION_OBJECT GdiTableSection; - BOOL INTERNAL_CALL GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle); BOOL INTERNAL_CALL GDIOBJ_SetOwnership(HGDIOBJ ObjectHandle, PEPROCESS Owner); BOOL INTERNAL_CALL GDIOBJ_CopyOwnership(HGDIOBJ CopyFrom, HGDIOBJ CopyTo); @@ -78,7 +77,7 @@ PGDIOBJ INTERNAL_CALL GDIOBJ_LockObj (HGDIOBJ hObj, DWORD ObjectType); PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObj (HGDIOBJ hObj, DWORD ObjectType); VOID INTERNAL_CALL GDIOBJ_LockMultipleObjs(ULONG ulCount, IN HGDIOBJ* ahObj, OUT PGDIOBJ* apObj); -PVOID INTERNAL_CALL GDI_MapHandleTable(PSECTION_OBJECT SectionObject, PEPROCESS Process); +PVOID INTERNAL_CALL GDI_MapHandleTable(PEPROCESS Process); INIT_FUNCTION NTSTATUS diff --git a/reactos/subsystems/win32/win32k/main/dllmain.c b/reactos/subsystems/win32/win32k/main/dllmain.c index 1bff6e3f3b9..ce9f9b585b7 100644 --- a/reactos/subsystems/win32/win32k/main/dllmain.c +++ b/reactos/subsystems/win32/win32k/main/dllmain.c @@ -107,7 +107,7 @@ Win32kProcessCallback(struct _EPROCESS *Process, if(Process->Peb != NULL) { /* map the gdi handle table to user land */ - Process->Peb->GdiSharedHandleTable = GDI_MapHandleTable(GdiTableSection, Process); + Process->Peb->GdiSharedHandleTable = GDI_MapHandleTable(Process); Process->Peb->GdiDCAttributeList = GDI_BATCH_LIMIT; } @@ -264,7 +264,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread, if (Win32Thread->KeyboardLayout) pci->hKL = Win32Thread->KeyboardLayout->hkl; pci->dwTIFlags = Win32Thread->TIF_flags; /* CI may not have been initialized. */ - if (!pci->pDeskInfo && Win32Thread->pDeskInfo) + if (!pci->pDeskInfo && Win32Thread->pDeskInfo) { if (!pci->ulClientDelta) pci->ulClientDelta = DesktopHeapGetUserDelta(); @@ -440,7 +440,7 @@ DriverEntry( /* Register our per-process and per-thread structures. */ PsEstablishWin32Callouts((PWIN32_CALLOUTS_FPNS)&CalloutData); -#if 0 // DBG +#if 1 // DBG /* Register service hook callbacks */ KdSystemDebugControl('CsoR', DbgPreServiceHook, ID_Win32PreServiceHook, 0, 0, 0, 0); KdSystemDebugControl('CsoR', DbgPostServiceHook, ID_Win32PostServiceHook, 0, 0, 0, 0); diff --git a/reactos/subsystems/win32/win32k/objects/gdiobj.c b/reactos/subsystems/win32/win32k/objects/gdiobj.c index 45756ae81bf..55f8a1d9b42 100644 --- a/reactos/subsystems/win32/win32k/objects/gdiobj.c +++ b/reactos/subsystems/win32/win32k/objects/gdiobj.c @@ -70,7 +70,7 @@ OBJ_TYPE_INFO ObjTypeInfo[BASE_OBJTYPE_COUNT] = static LARGE_INTEGER ShortDelay; PGDI_HANDLE_TABLE GdiHandleTable = NULL; -PSECTION_OBJECT GdiTableSection = NULL; +static PSECTION_OBJECT GdiTableSection = NULL; /** INTERNAL FUNCTIONS ********************************************************/ @@ -1663,7 +1663,7 @@ LockHandleFrom: } PVOID INTERNAL_CALL -GDI_MapHandleTable(PSECTION_OBJECT SectionObject, PEPROCESS Process) +GDI_MapHandleTable(PEPROCESS Process) { PVOID MappedView = NULL; NTSTATUS Status; @@ -1672,10 +1672,10 @@ GDI_MapHandleTable(PSECTION_OBJECT SectionObject, PEPROCESS Process) Offset.QuadPart = 0; - ASSERT(SectionObject != NULL); + ASSERT(GdiTableSection != NULL); ASSERT(Process != NULL); - Status = MmMapViewOfSection(SectionObject, + Status = MmMapViewOfSection(GdiTableSection, Process, &MappedView, 0,