mirror of
https://github.com/reactos/reactos.git
synced 2024-11-28 05:53:31 +08:00
[GDI32] Prevent double initialization in GdiProcessSetup
Found with Application Verifier :)
This commit is contained in:
parent
49a8816a82
commit
7ed0f25b64
@ -4,6 +4,7 @@
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
static BOOL gbInitialized = FALSE;
|
||||
extern HGDIOBJ stock_objects[];
|
||||
BOOL SetStockObjects = FALSE;
|
||||
PDEVCAPS GdiDevCaps = NULL;
|
||||
@ -40,18 +41,22 @@ VOID
|
||||
WINAPI
|
||||
GdiProcessSetup(VOID)
|
||||
{
|
||||
hProcessHeap = GetProcessHeap();
|
||||
if (!gbInitialized)
|
||||
{
|
||||
gbInitialized = TRUE;
|
||||
hProcessHeap = GetProcessHeap();
|
||||
|
||||
/* map the gdi handle table to user space */
|
||||
GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
|
||||
GdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
|
||||
GdiDevCaps = &GdiSharedHandleTable->DevCaps;
|
||||
CurrentProcessId = NtCurrentTeb()->ClientId.UniqueProcess;
|
||||
GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList;
|
||||
GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer;
|
||||
RtlInitializeCriticalSection(&semLocal);
|
||||
InitializeCriticalSection(&gcsClientObjLinks);
|
||||
GdiInitializeLanguagePack(0);
|
||||
/* map the gdi handle table to user space */
|
||||
GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
|
||||
GdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
|
||||
GdiDevCaps = &GdiSharedHandleTable->DevCaps;
|
||||
CurrentProcessId = NtCurrentTeb()->ClientId.UniqueProcess;
|
||||
GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList;
|
||||
GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer;
|
||||
RtlInitializeCriticalSection(&semLocal);
|
||||
InitializeCriticalSection(&gcsClientObjLinks);
|
||||
GdiInitializeLanguagePack(0);
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
|
Loading…
Reference in New Issue
Block a user