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