- GdiIsPlayMetafileDC: function GdiGetHandleUserData might fail
authorGregor Schneider <grschneider@gmail.com>
Sun, 5 Apr 2009 21:34:27 +0000 (21:34 +0000)
committerGregor Schneider <grschneider@gmail.com>
Sun, 5 Apr 2009 21:34:27 +0000 (21:34 +0000)
- Simplify code to use GdiGetLDC which takes this into consideration, fixes a umode crash in gdi32_winetest metafile

svn path=/trunk/; revision=40379

reactos/dll/win32/gdi32/misc/stubs.c

index 5366dcb..a826faf 100644 (file)
@@ -1157,17 +1157,10 @@ BOOL
 WINAPI
 GdiIsPlayMetafileDC(HDC hDC)
 {
-  PDC_ATTR Dc_Attr;
-  PLDC pLDC;
-  
-  GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr);
-  if ( Dc_Attr )
+  PLDC pLDC = GdiGetLDC(hDC);
+  if ( pLDC )
   {
-     pLDC = Dc_Attr->pvLDC;
-     if ( pLDC )
-     {
-        if ( pLDC->Flags & LDC_PLAY_MFDC ) return TRUE;
-     }
+     if ( pLDC->Flags & LDC_PLAY_MFDC ) return TRUE;
   }
   return FALSE;
 }