d3d8: Add a dll global critical section.
This commit is contained in:
parent
8f689ee023
commit
193ccecaee
|
@ -24,6 +24,15 @@
|
|||
#include "d3d8_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
static CRITICAL_SECTION_DEBUG d3d8_cs_debug =
|
||||
{
|
||||
0, 0, &d3d8_cs,
|
||||
{ &d3d8_cs_debug.ProcessLocksList,
|
||||
&d3d8_cs_debug.ProcessLocksList },
|
||||
0, 0, { (DWORD_PTR)(__FILE__ ": d3d8_cs") }
|
||||
};
|
||||
CRITICAL_SECTION d3d8_cs = { &d3d8_cs_debug, -1, 0, 0, 0, 0 };
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
|
||||
|
||||
HRESULT WINAPI D3D8GetSWInfo(void) {
|
||||
|
@ -36,13 +45,18 @@ void WINAPI DebugSetMute(void) {
|
|||
}
|
||||
|
||||
IDirect3D8* WINAPI Direct3DCreate8(UINT SDKVersion) {
|
||||
IDirect3D8Impl* object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D8Impl));
|
||||
IDirect3D8Impl* object;
|
||||
TRACE("SDKVersion = %x\n", SDKVersion);
|
||||
|
||||
EnterCriticalSection(&d3d8_cs);
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D8Impl));
|
||||
|
||||
object->lpVtbl = &Direct3D8_Vtbl;
|
||||
object->ref = 1;
|
||||
object->WineD3D = WineDirect3DCreate(SDKVersion, 8, (IUnknown *)object);
|
||||
|
||||
TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D);
|
||||
TRACE("Created Direct3D object @ %p, WineObj @ %p\n", object, object->WineD3D);
|
||||
LeaveCriticalSection(&d3d8_cs);
|
||||
|
||||
return (IDirect3D8*) object;
|
||||
}
|
||||
|
|
|
@ -123,6 +123,9 @@ typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclara
|
|||
/* Advance declaration of structures to satisfy compiler */
|
||||
typedef struct IDirect3DVertexShader8Impl IDirect3DVertexShader8Impl;
|
||||
|
||||
/* Global critical section */
|
||||
extern CRITICAL_SECTION d3d8_cs;
|
||||
|
||||
/* ===========================================================================
|
||||
The interfactes themselves
|
||||
=========================================================================== */
|
||||
|
|
Loading…
Reference in New Issue