save and restore dc state

This commit is contained in:
FunkyFr3sh 2024-08-15 12:06:02 +02:00
parent 79feefac26
commit f49f09895b
3 changed files with 6 additions and 1 deletions

View file

@ -914,6 +914,8 @@ HRESULT dds_GetDC(IDirectDrawSurfaceImpl* This, HDC FAR* lpHDC)
if (lpHDC)
*lpHDC = dc;
InterlockedExchange(&This->dc_state, SaveDC(dc));
return DD_OK;
}
@ -1024,6 +1026,8 @@ HRESULT dds_ReleaseDC(IDirectDrawSurfaceImpl* This, HDC hDC)
}
}
RestoreDC(hDC, InterlockedExchangeAdd((LONG*)&This->dc_state, 0));
return DD_OK;
}