Commit 5307dd20 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

ddraw: Make the ddraw list lock a global dll lock.

parent 2e67fa32
...@@ -80,6 +80,9 @@ extern ULONG WINAPI D3D7CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain); ...@@ -80,6 +80,9 @@ extern ULONG WINAPI D3D7CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain);
extern ULONG WINAPI D3D7CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface); extern ULONG WINAPI D3D7CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface);
/* Global critical section */
extern CRITICAL_SECTION ddraw_cs;
/***************************************************************************** /*****************************************************************************
* IDirectDraw implementation structure * IDirectDraw implementation structure
*****************************************************************************/ *****************************************************************************/
......
...@@ -59,15 +59,14 @@ WINED3DSURFTYPE DefaultSurfaceType = SURFACE_UNKNOWN; ...@@ -59,15 +59,14 @@ WINED3DSURFTYPE DefaultSurfaceType = SURFACE_UNKNOWN;
/* DDraw list and critical section */ /* DDraw list and critical section */
static struct list global_ddraw_list = LIST_INIT(global_ddraw_list); static struct list global_ddraw_list = LIST_INIT(global_ddraw_list);
static CRITICAL_SECTION ddraw_list_cs; static CRITICAL_SECTION_DEBUG ddraw_cs_debug =
static CRITICAL_SECTION_DEBUG ddraw_list_cs_debug =
{ {
0, 0, &ddraw_list_cs, 0, 0, &ddraw_cs,
{ &ddraw_list_cs_debug.ProcessLocksList, { &ddraw_cs_debug.ProcessLocksList,
&ddraw_list_cs_debug.ProcessLocksList }, &ddraw_cs_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": ddraw_list_cs") } 0, 0, { (DWORD_PTR)(__FILE__ ": ddraw_cs") }
}; };
static CRITICAL_SECTION ddraw_list_cs = { &ddraw_list_cs_debug, -1, 0, 0, 0, 0 }; CRITICAL_SECTION ddraw_cs = { &ddraw_cs_debug, -1, 0, 0, 0, 0 };
/*********************************************************************** /***********************************************************************
* *
...@@ -319,9 +318,9 @@ DDRAW_Create(const GUID *guid, ...@@ -319,9 +318,9 @@ DDRAW_Create(const GUID *guid,
list_init(&This->surface_list); list_init(&This->surface_list);
EnterCriticalSection(&ddraw_list_cs); EnterCriticalSection(&ddraw_cs);
list_add_head(&global_ddraw_list, &This->ddraw_list_entry); list_add_head(&global_ddraw_list, &This->ddraw_list_entry);
LeaveCriticalSection(&ddraw_list_cs); LeaveCriticalSection(&ddraw_cs);
This->decls = HeapAlloc(GetProcessHeap(), 0, 0); This->decls = HeapAlloc(GetProcessHeap(), 0, 0);
if(!This->decls) if(!This->decls)
...@@ -948,7 +947,7 @@ DllMain(HINSTANCE hInstDLL, ...@@ -948,7 +947,7 @@ DllMain(HINSTANCE hInstDLL,
void void
remove_ddraw_object(IDirectDrawImpl *ddraw) remove_ddraw_object(IDirectDrawImpl *ddraw)
{ {
EnterCriticalSection(&ddraw_list_cs); EnterCriticalSection(&ddraw_cs);
list_remove(&ddraw->ddraw_list_entry); list_remove(&ddraw->ddraw_list_entry);
LeaveCriticalSection(&ddraw_list_cs); LeaveCriticalSection(&ddraw_cs);
} }
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