diff --git a/dlls/ddraw/light.c b/dlls/ddraw/light.c index 93144d32cf2..aeb8390f82c 100644 --- a/dlls/ddraw/light.c +++ b/dlls/ddraw/light.c @@ -201,10 +201,12 @@ IDirect3DLightImpl_SetLight(IDirect3DLight *iface, light7->dvTheta = lpLight->dvTheta; light7->dvPhi = lpLight->dvPhi; + EnterCriticalSection(&ddraw_cs); memcpy(&This->light, lpLight, lpLight->dwSize); if ((This->light.dwFlags & D3DLIGHT_ACTIVE) != 0) { This->update(This); } + LeaveCriticalSection(&ddraw_cs); return D3D_OK; } @@ -230,7 +232,11 @@ IDirect3DLightImpl_GetLight(IDirect3DLight *iface, TRACE(" Returning light definition :\n"); dump_light(&This->light); } + + EnterCriticalSection(&ddraw_cs); memcpy(lpLight, &This->light, lpLight->dwSize); + LeaveCriticalSection(&ddraw_cs); + return DD_OK; }