From 50c101135c6af901cef2082f542971ce5d9efe26 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20D=C3=B6singer?= Date: Tue, 14 Aug 2007 14:40:33 +0200 Subject: [PATCH] wined3d: Refuse to ReleaseDC the wrong DC. --- dlls/wined3d/surface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 7e525c5fa90..2abb277db33 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -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); -- 2.11.4.GIT