TRACE("(%p) : ReleaseRef to %d\n", This, ref);
if (ref == 0) {
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
IWineD3DBuffer_Release(This->wineD3DIndexBuffer);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
IDirect3DDevice9Ex_Release(This->parentDevice);
HeapFree(GetProcessHeap(), 0, This);
}
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DBuffer_GetDevice(This->wineD3DIndexBuffer, &wined3d_device);
if (SUCCEEDED(hr))
{
IWineD3DDevice_GetParent(wined3d_device, (IUnknown **)ppDevice);
IWineD3DDevice_Release(wined3d_device);
}
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DBuffer_SetPrivateData(This->wineD3DIndexBuffer, refguid, pData, SizeOfData, Flags);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DBuffer_GetPrivateData(This->wineD3DIndexBuffer, refguid, pData, pSizeOfData);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DBuffer_FreePrivateData(This->wineD3DIndexBuffer, refguid);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
DWORD ret;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
ret = IWineD3DBuffer_SetPriority(This->wineD3DIndexBuffer, PriorityNew);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return ret;
}
DWORD ret;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
ret = IWineD3DBuffer_GetPriority(This->wineD3DIndexBuffer);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return ret;
}
IDirect3DIndexBuffer9Impl *This = (IDirect3DIndexBuffer9Impl *)iface;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
IWineD3DBuffer_PreLoad(This->wineD3DIndexBuffer);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
}
static D3DRESOURCETYPE WINAPI IDirect3DIndexBuffer9Impl_GetType(LPDIRECT3DINDEXBUFFER9 iface) {
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DBuffer_Map(This->wineD3DIndexBuffer, OffsetToLock, SizeToLock, (BYTE **)ppbData, Flags);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DBuffer_Unmap(This->wineD3DIndexBuffer);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
WINED3DBUFFER_DESC desc;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DBuffer_GetDesc(This->wineD3DIndexBuffer, &desc);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
if (SUCCEEDED(hr)) {
pDesc->Format = d3dformat_from_wined3dformat(This->format);
/* IDirect3DDevice9 IDirect3DIndexBuffer9 Methods follow: */
-HRESULT WINAPI IDirect3DDevice9Impl_CreateIndexBuffer(LPDIRECT3DDEVICE9EX iface,
- UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool,
- IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) {
-
+HRESULT WINAPI IDirect3DDevice9Impl_CreateIndexBuffer(IDirect3DDevice9Ex *iface, UINT Length, DWORD Usage,
+ D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9 **ppIndexBuffer, HANDLE *pSharedHandle)
+{
IDirect3DIndexBuffer9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hrc = D3D_OK;
-
+
TRACE("(%p) Relay\n", This);
/* Allocate the storage for the device */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
object->ref = 1;
object->format = wined3dformat_from_d3dformat(Format);
TRACE("Calling wined3d create index buffer\n");
- EnterCriticalSection(&d3d9_cs);
+
+ wined3d_mutex_lock();
hrc = IWineD3DDevice_CreateIndexBuffer(This->WineD3DDevice, Length, Usage & WINED3DUSAGE_MASK,
(WINED3DPOOL)Pool, &object->wineD3DIndexBuffer, (IUnknown *)object);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
if (hrc != D3D_OK) {
/* free up object */