unsigned i;
This->inDestruction = TRUE;
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
for(i = 0; i < This->numConvertedDecls; i++) {
/* Unless Wine is buggy or the app has a bug the refcount will be 0, because decls hold a reference to the
* device
IWineD3DDevice_Uninit3D(This->WineD3DDevice, D3D9CB_DestroyDepthStencilSurface, D3D9CB_DestroySwapChain);
IWineD3DDevice_Release(This->WineD3DDevice);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
HRESULT hr;
TRACE("(%p)\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_TestCooperativeLevel(This->WineD3DDevice);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
if(hr == WINED3D_OK && This->notreset) {
TRACE("D3D9 Device is marked not reset\n");
hr = D3DERR_DEVICENOTRESET;
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetAvailableTextureMem(This->WineD3DDevice);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) : Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_EvictManagedResources(This->WineD3DDevice);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
return D3DERR_INVALIDCALL;
}
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetDirect3D(This->WineD3DDevice, &pWineD3D);
if (hr == D3D_OK && pWineD3D != NULL)
{
*ppD3D9 = NULL;
}
TRACE("(%p) returning %p\n", This, *ppD3D9);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
}
memset(pCaps, 0, sizeof(*pCaps));
- EnterCriticalSection(&d3d9_cs);
+
+ wined3d_mutex_lock();
hrc = IWineD3DDevice_GetDeviceCaps(This->WineD3DDevice, pWineCaps);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
WINECAPSTOD3D9CAPS(pCaps, pWineCaps)
HeapFree(GetProcessHeap(), 0, pWineCaps);
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetDisplayMode(This->WineD3DDevice, iSwapChain, (WINED3DDISPLAYMODE *) pMode);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetCreationParameters(This->WineD3DDevice, (WINED3DDEVICE_CREATION_PARAMETERS *) pParameters);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
return WINED3DERR_INVALIDCALL;
}
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetCursorProperties(This->WineD3DDevice, XHotSpot, YHotSpot, pSurface->wineD3DSurface);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
IWineD3DDevice_SetCursorPosition(This->WineD3DDevice, XScreenSpace, YScreenSpace, Flags);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
}
static BOOL WINAPI IDirect3DDevice9Impl_ShowCursor(LPDIRECT3DDEVICE9EX iface, BOOL bShow) {
BOOL ret;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
ret = IWineD3DDevice_ShowCursor(This->WineD3DDevice, bShow);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return ret;
}
static HRESULT WINAPI reset_enum_callback(IWineD3DResource *resource, void *data) {
BOOL *resources_ok = data;
- WINED3DRESOURCETYPE type;
+ D3DRESOURCETYPE type;
HRESULT ret = S_OK;
WINED3DSURFACE_DESC surface_desc;
WINED3DVOLUME_DESC volume_desc;
D3DINDEXBUFFER_DESC index_desc;
D3DVERTEXBUFFER_DESC vertex_desc;
- WINED3DFORMAT dummy_format;
- WINED3DMULTISAMPLE_TYPE dummy_multisampletype;
- DWORD dummy_dword;
- WINED3DPOOL pool = WINED3DPOOL_SCRATCH; /* a harmless pool */
+ WINED3DPOOL pool;
IDirect3DResource9 *parent;
IWineD3DResource_GetParent(resource, (IUnknown **) &parent);
type = IDirect3DResource9_GetType(parent);
switch(type) {
case D3DRTYPE_SURFACE:
- surface_desc.Format = &dummy_format;
- surface_desc.Type = &type;
- surface_desc.Usage = &dummy_dword;
- surface_desc.Pool = &pool;
- surface_desc.Size = &dummy_dword;
- surface_desc.MultiSampleType = &dummy_multisampletype;
- surface_desc.MultiSampleQuality = &dummy_dword;
- surface_desc.Width = &dummy_dword;
- surface_desc.Height = &dummy_dword;
-
IWineD3DSurface_GetDesc((IWineD3DSurface *) resource, &surface_desc);
+ pool = surface_desc.pool;
break;
case D3DRTYPE_VOLUME:
- volume_desc.Format = &dummy_format;
- volume_desc.Type = &type;
- volume_desc.Usage = &dummy_dword;
- volume_desc.Pool = &pool;
- volume_desc.Size = &dummy_dword;
- volume_desc.Width = &dummy_dword;
- volume_desc.Height = &dummy_dword;
- volume_desc.Depth = &dummy_dword;
IWineD3DVolume_GetDesc((IWineD3DVolume *) resource, &volume_desc);
+ pool = volume_desc.Pool;
break;
case D3DRTYPE_INDEXBUFFER:
* is a D3DPOOL_DEFAULT surface or volume as well
*/
default:
+ pool = WINED3DPOOL_SCRATCH; /* a harmless pool */
break;
}
* Unsetting them is no problem, because the states are supposed to be reset anyway. If the validation
* below fails, the device is considered "lost", and _Reset and _Release are the only allowed calls
*/
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
IWineD3DDevice_SetIndices(This->WineD3DDevice, NULL, WINED3DFMT_UNKNOWN);
for(i = 0; i < 16; i++) {
IWineD3DDevice_SetStreamSource(This->WineD3DDevice, i, NULL, 0, 0);
if(!resources_ok) {
WARN("The application is holding D3DPOOL_DEFAULT resources, rejecting reset\n");
This->notreset = TRUE;
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return WINED3DERR_INVALIDCALL;
}
This->notreset = FALSE;
}
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_Present(This->WineD3DDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
rc = IWineD3DDevice_GetBackBuffer(This->WineD3DDevice, iSwapChain, BackBuffer, (WINED3DBACKBUFFER_TYPE) Type, &retSurface);
if (rc == D3D_OK && NULL != retSurface && NULL != ppBackBuffer) {
IWineD3DSurface_GetParent(retSurface, (IUnknown **)ppBackBuffer);
IWineD3DSurface_Release(retSurface);
}
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return rc;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetRasterStatus(LPDIRECT3DDEVICE9EX iface, UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) {
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetRasterStatus(This->WineD3DDevice, iSwapChain, (WINED3DRASTER_STATUS *) pRasterStatus);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetDialogBoxMode(This->WineD3DDevice, bEnableDialogs);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
-static void WINAPI IDirect3DDevice9Impl_SetGammaRamp(LPDIRECT3DDEVICE9EX iface, UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) {
-
+static void WINAPI IDirect3DDevice9Impl_SetGammaRamp(IDirect3DDevice9Ex *iface, UINT iSwapChain,
+ DWORD Flags, const D3DGAMMARAMP *pRamp)
+{
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
/* Note: D3DGAMMARAMP is compatible with WINED3DGAMMARAMP */
+ wined3d_mutex_lock();
IWineD3DDevice_SetGammaRamp(This->WineD3DDevice, iSwapChain, Flags, (CONST WINED3DGAMMARAMP *)pRamp);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
}
static void WINAPI IDirect3DDevice9Impl_GetGammaRamp(LPDIRECT3DDEVICE9EX iface, UINT iSwapChain, D3DGAMMARAMP* pRamp) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
/* Note: D3DGAMMARAMP is compatible with WINED3DGAMMARAMP */
+ wined3d_mutex_lock();
IWineD3DDevice_GetGammaRamp(This->WineD3DDevice, iSwapChain, (WINED3DGAMMARAMP *) pRamp);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
}
-static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface,D3DRESOURCETYPE Type, UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality,HANDLE* pSharedHandle ) {
+static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height,
+ D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface,
+ UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality)
+{
HRESULT hrc;
IDirect3DSurface9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) Relay\n", This);
-
- if(MultisampleQuality > 0){
+
+ if (MultisampleQuality > 0)
+ {
FIXME("MultisampleQuality set to %d, bstituting 0\n", MultisampleQuality);
- /*
- MultisampleQuality
- [in] Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by IDirect3D9::CheckDeviceMultiSampleType. Passing a larger value returns the error D3DERR_INVALIDCALL. The MultisampleQuality values of paired render targets, depth stencil surfaces, and the MultiSample type must all match.
- */
-
- MultisampleQuality=0;
+ MultisampleQuality = 0;
}
/*FIXME: Check MAX bounds of MultisampleQuality*/
TRACE("(%p) : w(%d) h(%d) fmt(%d) surf@%p\n", This, Width, Height, Format, *ppSurface);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, wined3dformat_from_d3dformat(Format),
- Lockable, Discard, Level, &object->wineD3DSurface, Type, Usage & WINED3DUSAGE_MASK,
- (WINED3DPOOL)Pool, MultiSample, MultisampleQuality, SURFACE_OPENGL, (IUnknown *)object);
- LeaveCriticalSection(&d3d9_cs);
+ Lockable, Discard, Level, &object->wineD3DSurface, Usage & WINED3DUSAGE_MASK, (WINED3DPOOL)Pool,
+ MultiSample, MultisampleQuality, SURFACE_OPENGL, (IUnknown *)object);
+ wined3d_mutex_unlock();
if (hrc != D3D_OK || NULL == object->wineD3DSurface) {
return hrc;
}
-
-
-static HRESULT WINAPI IDirect3DDevice9Impl_CreateRenderTarget(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height,
- D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample,
- DWORD MultisampleQuality, BOOL Lockable,
- IDirect3DSurface9 **ppSurface, HANDLE* pSharedHandle) {
+static HRESULT WINAPI IDirect3DDevice9Impl_CreateRenderTarget(IDirect3DDevice9Ex *iface, UINT Width, UINT Height,
+ D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable,
+ IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle)
+{
HRESULT hr;
TRACE("Relay\n");
- hr = IDirect3DDevice9Impl_CreateSurface(iface,Width,Height,Format,Lockable,FALSE/*Discard*/, 0/*Level*/, ppSurface,D3DRTYPE_SURFACE,D3DUSAGE_RENDERTARGET,D3DPOOL_DEFAULT,MultiSample,MultisampleQuality,pSharedHandle);
- return hr;
+ hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, Lockable, FALSE /* Discard */,
+ 0 /* Level */, ppSurface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality);
+
+ return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height,
HRESULT hr;
TRACE("Relay\n");
- hr = IDirect3DDevice9Impl_CreateSurface(iface,Width,Height,Format,TRUE/* Lockable */,Discard, 0/* Level */
- ,ppSurface,D3DRTYPE_SURFACE,D3DUSAGE_DEPTHSTENCIL,
- D3DPOOL_DEFAULT,MultiSample,MultisampleQuality,pSharedHandle);
- return hr;
+ hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, Discard,
+ 0 /* Level */, ppSurface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality);
+
+ return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_UpdateSurface(This->WineD3DDevice, ((IDirect3DSurface9Impl *)pSourceSurface)->wineD3DSurface, pSourceRect, ((IDirect3DSurface9Impl *)pDestinationSurface)->wineD3DSurface, pDestPoint);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_UpdateTexture(This->WineD3DDevice, ((IDirect3DBaseTexture9Impl *)pSourceTexture)->wineD3DBaseTexture, ((IDirect3DBaseTexture9Impl *)pDestinationTexture)->wineD3DBaseTexture);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p)->(%p,%p)\n" , This, renderTarget, destSurface);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DSurface_BltFast(destSurface->wineD3DSurface, 0, 0, renderTarget->wineD3DSurface, NULL, WINEDDBLTFAST_NOCOLORKEY);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetFrontBufferData(This->WineD3DDevice, iSwapChain, destSurface->wineD3DSurface);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p)->(%p,%p,%p,%p,%d)\n" , This, src, pSourceRect, dst, pDestRect, Filter);
- EnterCriticalSection(&d3d9_cs);
+
+ wined3d_mutex_lock();
hr = IWineD3DSurface_Blt(dst->wineD3DSurface, pDestRect, src->wineD3DSurface, pSourceRect, 0, NULL, Filter);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- memset(&desc, 0, sizeof(desc));
- desc.Usage = &usage;
- desc.Pool = &pool;
- desc.Type = &restype;
+ wined3d_mutex_lock();
- EnterCriticalSection(&d3d9_cs);
IWineD3DSurface_GetDesc(surface->wineD3DSurface, &desc);
+ usage = desc.usage;
+ pool = desc.pool;
+ restype = desc.resource_type;
/* This method is only allowed with surfaces that are render targets, or offscreen plain surfaces
* in D3DPOOL_DEFAULT
*/
- if(!(usage & WINED3DUSAGE_RENDERTARGET) && (pool != D3DPOOL_DEFAULT || restype != D3DRTYPE_SURFACE)) {
- LeaveCriticalSection(&d3d9_cs);
+ if(!(usage & WINED3DUSAGE_RENDERTARGET) && (pool != WINED3DPOOL_DEFAULT || restype != WINED3DRTYPE_SURFACE)) {
+ wined3d_mutex_unlock();
WARN("Surface is not a render target, or not a stand-alone D3DPOOL_DEFAULT surface\n");
return D3DERR_INVALIDCALL;
}
/* Colorfill can only be used on rendertarget surfaces, or offscreen plain surfaces in D3DPOOL_DEFAULT */
/* Note: D3DRECT is compatible with WINED3DRECT */
hr = IWineD3DDevice_ColorFill(This->WineD3DDevice, surface->wineD3DSurface, (CONST WINED3DRECT*)pRect, color);
- LeaveCriticalSection(&d3d9_cs);
+
+ wined3d_mutex_unlock();
+
return hr;
}
if(Pool == D3DPOOL_MANAGED ){
FIXME("Attempting to create a managed offscreen plain surface\n");
return D3DERR_INVALIDCALL;
- }
+ }
/*
'Off-screen plain surfaces are always lockable, regardless of their pool types.'
but then...
D3DPOOL_DEFAULT is the appropriate pool for use with the IDirect3DDevice9::StretchRect and IDirect3DDevice9::ColorFill.
Why, their always lockable?
- should I change the usage to dynamic?
+ should I change the usage to dynamic?
*/
- hr = IDirect3DDevice9Impl_CreateSurface(iface,Width,Height,Format,TRUE/*Loackable*/,FALSE/*Discard*/,0/*Level*/ , ppSurface,D3DRTYPE_SURFACE, 0/*Usage (undefined/none)*/,(WINED3DPOOL) Pool,D3DMULTISAMPLE_NONE,0/*MultisampleQuality*/,pSharedHandle);
+ hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, FALSE /* Discard */,
+ 0 /* Level */, ppSurface, 0 /* Usage (undefined/none) */, (WINED3DPOOL)Pool, D3DMULTISAMPLE_NONE,
+ 0 /* MultisampleQuality */);
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, RenderTargetIndex, pSurface ? pSurface->wineD3DSurface : NULL);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9EX iface, DWORD RenderTargetIndex, IDirect3DSurface9 **ppRenderTarget) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
- HRESULT hr = D3D_OK;
IWineD3DSurface *pRenderTarget;
+ HRESULT hr;
TRACE("(%p) Relay\n" , This);
return D3DERR_INVALIDCALL;
}
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
+
hr=IWineD3DDevice_GetRenderTarget(This->WineD3DDevice,RenderTargetIndex,&pRenderTarget);
- if (hr == D3D_OK && pRenderTarget != NULL) {
- IWineD3DSurface_GetParent(pRenderTarget,(IUnknown**)ppRenderTarget);
- IWineD3DSurface_Release(pRenderTarget);
- } else {
- FIXME("Call to IWineD3DDevice_GetRenderTarget failed\n");
+ if (FAILED(hr))
+ {
+ FIXME("Call to IWineD3DDevice_GetRenderTarget failed, hr %#x\n", hr);
+ }
+ else if (!pRenderTarget)
+ {
*ppRenderTarget = NULL;
}
- LeaveCriticalSection(&d3d9_cs);
+ else
+ {
+ IWineD3DSurface_GetParent(pRenderTarget, (IUnknown **)ppRenderTarget);
+ IWineD3DSurface_Release(pRenderTarget);
+ }
+
+ wined3d_mutex_unlock();
return hr;
}
TRACE("(%p) Relay\n" , This);
pSurface = (IDirect3DSurface9Impl*)pZStencilSurface;
- EnterCriticalSection(&d3d9_cs);
+
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, NULL==pSurface ? NULL : pSurface->wineD3DSurface);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
return D3DERR_INVALIDCALL;
}
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetDepthStencilSurface(This->WineD3DDevice,&pZStencilSurface);
if (hr == WINED3D_OK) {
IWineD3DSurface_GetParent(pZStencilSurface,(IUnknown**)ppZStencilSurface);
WARN("Call to IWineD3DDevice_GetDepthStencilSurface failed with 0x%08x\n", hr);
*ppZStencilSurface = NULL;
}
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_BeginScene(This->WineD3DDevice);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_EndScene(This->WineD3DDevice);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
TRACE("(%p) Relay\n" , This);
/* Note: D3DRECT is compatible with WINED3DRECT */
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_Clear(This->WineD3DDevice, Count, (CONST WINED3DRECT*) pRects, Flags, Color, Z, Stencil);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
TRACE("(%p) Relay\n" , This);
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetTransform(This->WineD3DDevice, State, (CONST WINED3DMATRIX*) lpMatrix);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetTransform(This->WineD3DDevice, State, (WINED3DMATRIX*) pMatrix);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
return hr;
}
TRACE("(%p) Relay\n" , This);
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_MultiplyTransform(This->WineD3DDevice, State, (CONST WINED3DMATRIX*) pMatrix);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
TRACE("(%p) Relay\n" , This);
/* Note: D3DVIEWPORT9 is compatible with WINED3DVIEWPORT */
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetViewport(This->WineD3DDevice, (const WINED3DVIEWPORT *)pViewport);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
TRACE("(%p) Relay\n" , This);
/* Note: D3DVIEWPORT9 is compatible with WINED3DVIEWPORT */
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetViewport(This->WineD3DDevice, (WINED3DVIEWPORT *)pViewport);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
TRACE("(%p) Relay\n" , This);
/* Note: D3DMATERIAL9 is compatible with WINED3DMATERIAL */
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetMaterial(This->WineD3DDevice, (const WINED3DMATERIAL *)pMaterial);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
TRACE("(%p) Relay\n" , This);
/* Note: D3DMATERIAL9 is compatible with WINED3DMATERIAL */
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetMaterial(This->WineD3DDevice, (WINED3DMATERIAL *)pMaterial);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
TRACE("(%p) Relay\n" , This);
/* Note: D3DLIGHT9 is compatible with WINED3DLIGHT */
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetLight(This->WineD3DDevice, Index, (const WINED3DLIGHT *)pLight);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
TRACE("(%p) Relay\n" , This);
/* Note: D3DLIGHT9 is compatible with WINED3DLIGHT */
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetLight(This->WineD3DDevice, Index, (WINED3DLIGHT *)pLight);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetLightEnable(This->WineD3DDevice, Index, Enable);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetLightEnable(This->WineD3DDevice, Index, pEnable);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetClipPlane(This->WineD3DDevice, Index, pPlane);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetClipPlane(This->WineD3DDevice, Index, pPlane);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetRenderState(This->WineD3DDevice, State, Value);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetRenderState(This->WineD3DDevice, State, pValue);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetClipStatus(This->WineD3DDevice, (const WINED3DCLIPSTATUS *)pClipStatus);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetClipStatus(This->WineD3DDevice, (WINED3DCLIPSTATUS *)pClipStatus);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
return D3DERR_INVALIDCALL;
}
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
rc = IWineD3DDevice_GetTexture(This->WineD3DDevice, Stage, &retTexture);
if (SUCCEEDED(rc) && NULL != retTexture) {
IWineD3DBaseTexture_GetParent(retTexture, (IUnknown **)ppTexture);
}
*ppTexture = NULL;
}
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
return rc;
}
HRESULT hr;
TRACE("(%p) Relay %d %p\n" , This, Stage, pTexture);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetTexture(This->WineD3DDevice, Stage,
pTexture==NULL ? NULL:((IDirect3DBaseTexture9Impl *)pTexture)->wineD3DBaseTexture);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetTextureStageState(This->WineD3DDevice, Stage, tss_lookup[Type], pValue);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetTextureStageState(This->WineD3DDevice, Stage, tss_lookup[Type], Value);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
-static HRESULT WINAPI IDirect3DDevice9Impl_GetSamplerState(LPDIRECT3DDEVICE9EX iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) {
- IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
+static HRESULT WINAPI IDirect3DDevice9Impl_GetSamplerState(IDirect3DDevice9Ex *iface, DWORD Sampler,
+ D3DSAMPLERSTATETYPE Type, DWORD *pValue)
+{
+ IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetSamplerState(This->WineD3DDevice, Sampler, Type, pValue);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetSamplerState(This->WineD3DDevice, Sampler, Type, Value);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_ValidateDevice(This->WineD3DDevice, pNumPasses);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
-static HRESULT WINAPI IDirect3DDevice9Impl_SetPaletteEntries(LPDIRECT3DDEVICE9EX iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries) {
- IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
+static HRESULT WINAPI IDirect3DDevice9Impl_SetPaletteEntries(IDirect3DDevice9Ex *iface, UINT PaletteNumber,
+ const PALETTEENTRY *pEntries)
+{
+ IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetPaletteEntries(This->WineD3DDevice, PaletteNumber, pEntries);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetPaletteEntries(This->WineD3DDevice, PaletteNumber, pEntries);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetCurrentTexturePalette(This->WineD3DDevice, PaletteNumber);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetCurrentTexturePalette(This->WineD3DDevice, PaletteNumber);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetScissorRect(This->WineD3DDevice, pRect);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetScissorRect(This->WineD3DDevice, pRect);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetSoftwareVertexProcessing(This->WineD3DDevice, bSoftware);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
BOOL ret;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
ret = IWineD3DDevice_GetSoftwareVertexProcessing(This->WineD3DDevice);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return ret;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetNPatchMode(This->WineD3DDevice, nSegments);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
float ret;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
ret = IWineD3DDevice_GetNPatchMode(This->WineD3DDevice);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return ret;
}
-static HRESULT WINAPI IDirect3DDevice9Impl_DrawPrimitive(LPDIRECT3DDEVICE9EX iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) {
- IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
+static HRESULT WINAPI IDirect3DDevice9Impl_DrawPrimitive(IDirect3DDevice9Ex *iface, D3DPRIMITIVETYPE PrimitiveType,
+ UINT StartVertex, UINT PrimitiveCount)
+{
+ IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
IWineD3DDevice_SetPrimitiveType(This->WineD3DDevice, PrimitiveType);
hr = IWineD3DDevice_DrawPrimitive(This->WineD3DDevice, StartVertex,
vertex_count_from_primitive_count(PrimitiveType, PrimitiveCount));
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
TRACE("(%p) Relay\n" , This);
/* D3D8 passes the baseVertexIndex in SetIndices, and due to the stateblock functions wined3d has to work that way */
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
IWineD3DDevice_SetBaseVertexIndex(This->WineD3DDevice, BaseVertexIndex);
IWineD3DDevice_SetPrimitiveType(This->WineD3DDevice, PrimitiveType);
hr = IWineD3DDevice_DrawIndexedPrimitive(This->WineD3DDevice, MinVertexIndex, NumVertices,
startIndex, vertex_count_from_primitive_count(PrimitiveType, primCount));
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
-static HRESULT WINAPI IDirect3DDevice9Impl_DrawPrimitiveUP(LPDIRECT3DDEVICE9EX iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
- IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
+static HRESULT WINAPI IDirect3DDevice9Impl_DrawPrimitiveUP(IDirect3DDevice9Ex *iface, D3DPRIMITIVETYPE PrimitiveType,
+ UINT PrimitiveCount, const void *pVertexStreamZeroData, UINT VertexStreamZeroStride)
+{
+ IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
IWineD3DDevice_SetPrimitiveType(This->WineD3DDevice, PrimitiveType);
hr = IWineD3DDevice_DrawPrimitiveUP(This->WineD3DDevice,
vertex_count_from_primitive_count(PrimitiveType, PrimitiveCount),
pVertexStreamZeroData, VertexStreamZeroStride);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
IWineD3DDevice_SetPrimitiveType(This->WineD3DDevice, PrimitiveType);
hr = IWineD3DDevice_DrawIndexedPrimitiveUP(This->WineD3DDevice, MinVertexIndex, NumVertexIndices,
vertex_count_from_primitive_count(PrimitiveType, PrimitiveCount), pIndexData,
wined3dformat_from_d3dformat(IndexDataFormat), pVertexStreamZeroData, VertexStreamZeroStride);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
IDirect3DVertexBuffer9Impl *dest = (IDirect3DVertexBuffer9Impl *) pDestBuffer;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_ProcessVertices(This->WineD3DDevice,SrcStartIndex, DestIndex, VertexCount, dest->wineD3DVertexBuffer, Decl ? Decl->wineD3DVertexDeclaration : NULL, Flags, dest->fvf);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
return D3D_OK;
}
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
decl = getConvertedDecl(This, FVF);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
if (!decl)
{
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetStreamSource(This->WineD3DDevice, StreamNumber,
- pStreamData==NULL ? NULL:((IDirect3DVertexBuffer9Impl *)pStreamData)->wineD3DVertexBuffer,
- OffsetInBytes, Stride);
- LeaveCriticalSection(&d3d9_cs);
+ pStreamData ? ((IDirect3DVertexBuffer9Impl *)pStreamData)->wineD3DVertexBuffer : NULL,
+ OffsetInBytes, Stride);
+ wined3d_mutex_unlock();
+
return hr;
}
return D3DERR_INVALIDCALL;
}
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
rc = IWineD3DDevice_GetStreamSource(This->WineD3DDevice, StreamNumber, &retStream, OffsetInBytes, pStride);
if (rc == D3D_OK && NULL != retStream) {
IWineD3DBuffer_GetParent(retStream, (IUnknown **)pStream);
}
*pStream = NULL;
}
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
return rc;
}
-static HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSourceFreq(LPDIRECT3DDEVICE9EX iface, UINT StreamNumber, UINT Divider) {
- IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
+static HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSourceFreq(IDirect3DDevice9Ex *iface, UINT StreamNumber,
+ UINT Divider)
+{
+ IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetStreamSourceFreq(This->WineD3DDevice, StreamNumber, Divider);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n" , This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_GetStreamSourceFreq(This->WineD3DDevice, StreamNumber, Divider);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
IDirect3DIndexBuffer9Impl *ib = (IDirect3DIndexBuffer9Impl *) pIndexData;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_SetIndices(This->WineD3DDevice,
ib ? ib->wineD3DIndexBuffer : NULL,
ib ? ib->format : WINED3DFMT_UNKNOWN);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
return D3DERR_INVALIDCALL;
}
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData);
if (SUCCEEDED(rc) && retIndexData) {
IWineD3DBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData);
if (FAILED(rc)) FIXME("Call to GetIndices failed\n");
*ppIndexData = NULL;
}
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return rc;
}
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_DrawRectPatch(This->WineD3DDevice, Handle, pNumSegs, (CONST WINED3DRECTPATCH_INFO *)pRectPatchInfo);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_DrawTriPatch(This->WineD3DDevice, Handle, pNumSegs, (CONST WINED3DTRIPATCH_INFO *)pTriPatchInfo);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
HRESULT hr;
TRACE("(%p) Relay\n", This);
- EnterCriticalSection(&d3d9_cs);
+ wined3d_mutex_lock();
hr = IWineD3DDevice_DeletePatch(This->WineD3DDevice, Handle);
- LeaveCriticalSection(&d3d9_cs);
+ wined3d_mutex_unlock();
+
return hr;
}
"\tpool %#x, level %u, face %u, surface %p\n",
iface, superior, width, height, format, usage, pool, level, face, surface);
- if (pool == D3DPOOL_DEFAULT && !(usage & D3DUSAGE_DYNAMIC)) lockable = FALSE;
+ if (pool == WINED3DPOOL_DEFAULT && !(usage & D3DUSAGE_DYNAMIC))
+ lockable = FALSE;
hr = IDirect3DDevice9Impl_CreateSurface((IDirect3DDevice9Ex *)This, width, height,
d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level,
- (IDirect3DSurface9 **)&d3d_surface, D3DRTYPE_SURFACE, usage, pool,
- D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */, NULL);
+ (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */);
if (FAILED(hr))
{
ERR("(%p) CreateSurface failed, returning %#x\n", iface, hr);