Stefan Dösinger : wined3d: Refuse to ReleaseDC the wrong DC.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Aug 23 07:26:03 CDT 2007


Module: wine
Branch: master
Commit: 50c101135c6af901cef2082f542971ce5d9efe26
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=50c101135c6af901cef2082f542971ce5d9efe26

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Tue Aug 14 14:40:33 2007 +0200

wined3d: Refuse to ReleaseDC the wrong DC.

---

 dlls/wined3d/surface.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 7e525c5..2abb277 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);
 




More information about the wine-cvs mailing list