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

d3d9: Add a dll global critical section.

parent 6e5a5d27
...@@ -25,6 +25,15 @@ ...@@ -25,6 +25,15 @@
#include "initguid.h" #include "initguid.h"
#include "d3d9_private.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); WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
static int D3DPERF_event_level = 0; static int D3DPERF_event_level = 0;
...@@ -43,7 +52,9 @@ IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion) { ...@@ -43,7 +52,9 @@ IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion) {
object->lpVtbl = &Direct3D9_Vtbl; object->lpVtbl = &Direct3D9_Vtbl;
object->ref = 1; object->ref = 1;
EnterCriticalSection(&d3d9_cs);
object->WineD3D = WineDirect3DCreate(SDKVersion, 9, (IUnknown *)object); object->WineD3D = WineDirect3DCreate(SDKVersion, 9, (IUnknown *)object);
LeaveCriticalSection(&d3d9_cs);
TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D); TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D);
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
extern HRESULT vdecl_convert_fvf( extern HRESULT vdecl_convert_fvf(
DWORD FVF, DWORD FVF,
D3DVERTEXELEMENT9** ppVertexElements); D3DVERTEXELEMENT9** ppVertexElements);
extern CRITICAL_SECTION d3d9_cs;
/* =========================================================================== /* ===========================================================================
Macros Macros
......
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