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

ddraw: Hold the lock in IDirectDrawPalette methods.

parent 38079e07
...@@ -105,11 +105,13 @@ IDirectDrawPaletteImpl_Release(IDirectDrawPalette *iface) ...@@ -105,11 +105,13 @@ IDirectDrawPaletteImpl_Release(IDirectDrawPalette *iface)
if (ref == 0) if (ref == 0)
{ {
EnterCriticalSection(&ddraw_cs);
IWineD3DPalette_Release(This->wineD3DPalette); IWineD3DPalette_Release(This->wineD3DPalette);
if(This->ifaceToRelease) if(This->ifaceToRelease)
{ {
IUnknown_Release(This->ifaceToRelease); IUnknown_Release(This->ifaceToRelease);
} }
LeaveCriticalSection(&ddraw_cs);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
} }
...@@ -160,9 +162,13 @@ IDirectDrawPaletteImpl_GetCaps(IDirectDrawPalette *iface, ...@@ -160,9 +162,13 @@ IDirectDrawPaletteImpl_GetCaps(IDirectDrawPalette *iface,
DWORD *Caps) DWORD *Caps)
{ {
ICOM_THIS_FROM(IDirectDrawPaletteImpl, IDirectDrawPalette, iface); ICOM_THIS_FROM(IDirectDrawPaletteImpl, IDirectDrawPalette, iface);
HRESULT hr;
TRACE("(%p)->(%p): Relay\n", This, Caps); TRACE("(%p)->(%p): Relay\n", This, Caps);
return IWineD3DPalette_GetCaps(This->wineD3DPalette, Caps); EnterCriticalSection(&ddraw_cs);
hr = IWineD3DPalette_GetCaps(This->wineD3DPalette, Caps);
LeaveCriticalSection(&ddraw_cs);
return hr;
} }
/***************************************************************************** /*****************************************************************************
...@@ -191,12 +197,16 @@ IDirectDrawPaletteImpl_SetEntries(IDirectDrawPalette *iface, ...@@ -191,12 +197,16 @@ IDirectDrawPaletteImpl_SetEntries(IDirectDrawPalette *iface,
PALETTEENTRY *PalEnt) PALETTEENTRY *PalEnt)
{ {
ICOM_THIS_FROM(IDirectDrawPaletteImpl, IDirectDrawPalette, iface); ICOM_THIS_FROM(IDirectDrawPaletteImpl, IDirectDrawPalette, iface);
HRESULT hr;
TRACE("(%p)->(%x,%d,%d,%p): Relay\n", This, Flags, Start, Count, PalEnt); TRACE("(%p)->(%x,%d,%d,%p): Relay\n", This, Flags, Start, Count, PalEnt);
if(!PalEnt) if(!PalEnt)
return DDERR_INVALIDPARAMS; return DDERR_INVALIDPARAMS;
return IWineD3DPalette_SetEntries(This->wineD3DPalette, Flags, Start, Count, PalEnt); EnterCriticalSection(&ddraw_cs);
hr = IWineD3DPalette_SetEntries(This->wineD3DPalette, Flags, Start, Count, PalEnt);
LeaveCriticalSection(&ddraw_cs);
return hr;
} }
/***************************************************************************** /*****************************************************************************
...@@ -224,12 +234,16 @@ IDirectDrawPaletteImpl_GetEntries(IDirectDrawPalette *iface, ...@@ -224,12 +234,16 @@ IDirectDrawPaletteImpl_GetEntries(IDirectDrawPalette *iface,
PALETTEENTRY *PalEnt) PALETTEENTRY *PalEnt)
{ {
ICOM_THIS_FROM(IDirectDrawPaletteImpl, IDirectDrawPalette, iface); ICOM_THIS_FROM(IDirectDrawPaletteImpl, IDirectDrawPalette, iface);
HRESULT hr;
TRACE("(%p)->(%x,%d,%d,%p): Relay\n", This, Flags, Start, Count, PalEnt); TRACE("(%p)->(%x,%d,%d,%p): Relay\n", This, Flags, Start, Count, PalEnt);
if(!PalEnt) if(!PalEnt)
return DDERR_INVALIDPARAMS; return DDERR_INVALIDPARAMS;
return IWineD3DPalette_GetEntries(This->wineD3DPalette, Flags, Start, Count, PalEnt); EnterCriticalSection(&ddraw_cs);
hr = IWineD3DPalette_GetEntries(This->wineD3DPalette, Flags, Start, Count, PalEnt);
LeaveCriticalSection(&ddraw_cs);
return hr;
} }
const IDirectDrawPaletteVtbl IDirectDrawPalette_Vtbl = const IDirectDrawPaletteVtbl IDirectDrawPalette_Vtbl =
......
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