ddraw: Hold the lock in IDirect3DLight methods.

This commit is contained in:
Stefan Dösinger 2007-05-30 16:16:04 +02:00 committed by Alexandre Julliard
parent a2227de7af
commit 6eb8e3fb6f
1 changed files with 6 additions and 0 deletions

View File

@ -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;
}