Commit ef61c0b6 authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Initialize WIN_CritSection earlier.

parent 3d35e989
......@@ -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();
......
......@@ -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();
......
......@@ -53,6 +53,16 @@ static WORD wDragHeight= 3;
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
*
* Locks access to all WND structures for thread safeness
......@@ -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() ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment