From 61f33dad43b58f0c44679df2e4eaf99a7e99b839 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 1 Jun 2008 07:54:17 +0000 Subject: [PATCH] merge down changes from win32k-gdi-dx 1. Cleanup the layout it was mix of space and tab for whitespace 2. dllmain add same behoirs as xp/vista svn path=/trunk/; revision=33797 --- reactos/dll/win32/gdi32/main/dllmain.c | 81 ++++++++++++++------------ 1 file changed, 44 insertions(+), 37 deletions(-) diff --git a/reactos/dll/win32/gdi32/main/dllmain.c b/reactos/dll/win32/gdi32/main/dllmain.c index 6b323b10418..0e06d490e34 100644 --- a/reactos/dll/win32/gdi32/main/dllmain.c +++ b/reactos/dll/win32/gdi32/main/dllmain.c @@ -15,18 +15,26 @@ PDEVCAPS GdiDevCaps = NULL; PGDIHANDLECACHE GdiHandleCache = NULL; /* - * GDI32.DLL doesn't have an entry point. The initialization is done by a call + * GDI32.DLL does have an entry point for disable threadlibrarycall,. The initialization is done by a call * to GdiDllInitialize(). This call is done from the entry point of USER32.DLL. */ BOOL WINAPI DllMain ( - HANDLE hDll, - DWORD dwReason, - LPVOID lpReserved - ) + HANDLE hDll, + DWORD dwReason, + LPVOID lpReserved) { - return TRUE; + switch (dwReason) + { + case DLL_PROCESS_ATTACH : + DisableThreadLibraryCalls(hDll); + break; + + default: + break; + } + return TRUE; } @@ -34,15 +42,15 @@ VOID WINAPI GdiProcessSetup (VOID) { - hProcessHeap = GetProcessHeap(); + hProcessHeap = GetProcessHeap(); - /* map the gdi handle table to user space */ - GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; - GdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; - GdiDevCaps = &GdiSharedHandleTable->DevCaps; - CurrentProcessId = NtCurrentTeb()->Cid.UniqueProcess; - GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList; - GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer; + /* map the gdi handle table to user space */ + GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; + GdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; + GdiDevCaps = &GdiSharedHandleTable->DevCaps; + CurrentProcessId = NtCurrentTeb()->Cid.UniqueProcess; + GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList; + GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer; } @@ -52,34 +60,33 @@ GdiProcessSetup (VOID) BOOL WINAPI GdiDllInitialize ( - HANDLE hDll, - DWORD dwReason, - LPVOID lpReserved - ) + HANDLE hDll, + DWORD dwReason, + LPVOID lpReserved) { - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - GdiProcessSetup (); - break; + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + GdiProcessSetup (); + break; - case DLL_THREAD_ATTACH: - NtCurrentTeb()->GdiTebBatch.Offset = 0; - NtCurrentTeb()->GdiBatchCount = 0; - break; + case DLL_THREAD_ATTACH: + NtCurrentTeb()->GdiTebBatch.Offset = 0; + NtCurrentTeb()->GdiBatchCount = 0; + break; - default: - return FALSE; - } + default: + return FALSE; + } - // Very simple, the list will fill itself as it is needed. - if(!SetStockObjects) - { - RtlZeroMemory( &stock_objects, NB_STOCK_OBJECTS); //Assume Ros is dirty. - SetStockObjects = TRUE; - } + // Very simple, the list will fill itself as it is needed. + if(!SetStockObjects) + { + RtlZeroMemory( &stock_objects, NB_STOCK_OBJECTS); //Assume Ros is dirty. + SetStockObjects = TRUE; + } - return TRUE; + return TRUE; } /* EOF */