Stefan Dösinger : d3d9: Add a dll global critical section.
Module: wine Branch: master Commit: c4b801b7d174f6be0f30134ef6071907b2a514eb URL: http://source.winehq.org/git/wine.git/?a=commit;h=c4b801b7d174f6be0f30134ef6... Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Sun Jun 10 17:13:01 2007 +0200 d3d9: Add a dll global critical section. --- dlls/d3d9/d3d9_main.c | 11 +++++++++++ dlls/d3d9/d3d9_private.h | 1 + 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/dlls/d3d9/d3d9_main.c b/dlls/d3d9/d3d9_main.c index a5e1cef..ba4da66 100644 --- a/dlls/d3d9/d3d9_main.c +++ b/dlls/d3d9/d3d9_main.c @@ -25,6 +25,15 @@ #include "initguid.h" #include "d3d9_private.h" +static CRITICAL_SECTION_DEBUG d3d9_cs_debug = +{ + 0, 0, &d3d9_cs, + { &d3d9_cs_debug.ProcessLocksList, + &d3d9_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": d3d9_cs") } +}; +CRITICAL_SECTION d3d9_cs = { &d3d9_cs_debug, -1, 0, 0, 0, 0 }; + WINE_DEFAULT_DEBUG_CHANNEL(d3d9); static int D3DPERF_event_level = 0; @@ -43,7 +52,9 @@ IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion) { object->lpVtbl = &Direct3D9_Vtbl; object->ref = 1; + EnterCriticalSection(&d3d9_cs); object->WineD3D = WineDirect3DCreate(SDKVersion, 9, (IUnknown *)object); + LeaveCriticalSection(&d3d9_cs); TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D); diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index af308ac..9049777 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -44,6 +44,7 @@ extern HRESULT vdecl_convert_fvf( DWORD FVF, D3DVERTEXELEMENT9** ppVertexElements); +extern CRITICAL_SECTION d3d9_cs; /* =========================================================================== Macros
participants (1)
-
Alexandre Julliard