Stefan Dösinger stefandoesinger@gmx.at writes:
@@ -810,8 +841,12 @@ IDirectDrawSurfaceImpl_AddAttachedSurface(IDirectDrawSurfaceImpl *This, { TRACE("(%p)->(%p)\n", This, Surf);
- EnterCriticalSection(&ddraw_cs); if(Surf == This)
- {
LeaveCriticalSection(&ddraw_cs); return DDERR_CANNOTATTACHSURFACE; /* unchecked */
- }
Parameter checks can be done outside the section, it simplifies the code. There are many more such cases in the patch.