From ef61c0b632149c684b083f842923f91ef0a38fed Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Sat, 8 May 1999 09:45:50 +0000 Subject: [PATCH] Initialize WIN_CritSection earlier. --- include/win.h | 1 + loader/main.c | 4 ++++ windows/win.c | 14 ++++++++++---- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/include/win.h b/include/win.h index aa366b91fdd..e15fb09a7b5 100644 --- a/include/win.h +++ b/include/win.h @@ -158,6 +158,7 @@ typedef struct #define BWA_SKIPICONIC 0x0008 /* Window functions */ +extern void WIN_Init( void ); extern void WIN_LockWnds(); extern void WIN_UnlockWnds(); extern int WIN_SuspendWndsLock(); diff --git a/loader/main.c b/loader/main.c index 3d8b03babff..5f75eb0ab3a 100644 --- a/loader/main.c +++ b/loader/main.c @@ -36,6 +36,7 @@ #include "global.h" #include "dce.h" #include "shell.h" +#include "win.h" #include "winproc.h" #include "syslevel.h" #include "services.h" @@ -213,6 +214,9 @@ BOOL WINAPI MAIN_UserInit(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserve /* Global atom table initialisation */ if (!ATOM_Init( USER_HeapSel )) return FALSE; + /* Initialize window handling (critical section) */ + WIN_Init(); + /* Initialize system colors and metrics*/ SYSMETRICS_Init(); SYSCOLOR_Init(); diff --git a/windows/win.c b/windows/win.c index c81a247f20d..032af871e6b 100644 --- a/windows/win.c +++ b/windows/win.c @@ -52,6 +52,16 @@ static WORD wDragHeight= 3; /* thread safeness */ static CRITICAL_SECTION WIN_CritSection; +/*********************************************************************** + * WIN_Init + */ +void WIN_Init( void ) +{ + /* Initialisation of the critical section for thread safeness */ + InitializeCriticalSection(&WIN_CritSection); + MakeCriticalSectionGlobal(&WIN_CritSection); +} + /*********************************************************************** * WIN_LockWnds * @@ -604,10 +614,6 @@ BOOL WIN_CreateDesktopWindow(void) TRACE_(win)("Creating desktop window\n"); - - /* Initialisation of the critical section for thread safeness */ - InitializeCriticalSection(&WIN_CritSection); - MakeCriticalSectionGlobal(&WIN_CritSection); if (!ICONTITLE_Init() || !WINPOS_CreateInternalPosAtom() ||