wined3d: Refuse to ReleaseDC the wrong DC.

This commit is contained in:
Stefan Dösinger 2007-08-14 14:40:33 +02:00 committed by Alexandre Julliard
parent ea283d3cba
commit 50c101135c
1 changed files with 5 additions and 0 deletions

View File

@ -1456,6 +1456,11 @@ HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC) {
if (!(This->Flags & SFLAG_DCINUSE))
return WINED3DERR_INVALIDCALL;
if (This->hDC !=hDC) {
WARN("Application tries to release an invalid DC(%p), surface dc is %p\n", hDC, This->hDC);
return WINED3DERR_INVALIDCALL;
}
/* we locked first, so unlock now */
IWineD3DSurface_UnlockRect(iface);