mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-26 02:19:24 +01:00
add a check for DDSCAPS_OWNDC
This commit is contained in:
parent
9671d810af
commit
a4f927b095
@ -917,6 +917,7 @@ HRESULT dds_GetDC(IDirectDrawSurfaceImpl* This, HDC FAR* lpHDC)
|
|||||||
if (lpHDC)
|
if (lpHDC)
|
||||||
*lpHDC = dc;
|
*lpHDC = dc;
|
||||||
|
|
||||||
|
if (!(This->caps & DDSCAPS_OWNDC))
|
||||||
InterlockedExchange((LONG*)&This->dc_state, SaveDC(dc));
|
InterlockedExchange((LONG*)&This->dc_state, SaveDC(dc));
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
@ -1025,6 +1026,7 @@ HRESULT dds_ReleaseDC(IDirectDrawSurfaceImpl* This, HDC hDC)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(This->caps & DDSCAPS_OWNDC))
|
||||||
RestoreDC(hDC, InterlockedExchangeAdd((LONG*)&This->dc_state, 0));
|
RestoreDC(hDC, InterlockedExchangeAdd((LONG*)&This->dc_state, 0));
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user