Add Region object types and one Dc that was missed. Thanks Thomas!
authorJames Tabor <james.tabor@reactos.org>
Thu, 29 Nov 2007 13:07:38 +0000 (13:07 +0000)
committerJames Tabor <james.tabor@reactos.org>
Thu, 29 Nov 2007 13:07:38 +0000 (13:07 +0000)
svn path=/trunk/; revision=30897

reactos/dll/win32/gdi32/objects/enhmfile.c
reactos/dll/win32/gdi32/objects/region.c

index 73aad3b..5559173 100644 (file)
@@ -31,7 +31,7 @@ HDC WINAPI CreateEnhMetaFileW(
     mDC = NtGdiCreateMetafileDC( hDC ); // Basically changes the handle from 1xxxx to 46xxxx.
     // If hDC == NULL, works just like createdc in win32k.
 
-    if ( !GdiGetHandleUserData((HGDIOBJ) mDC, (PVOID) &Dc_Attr))
+    if ( !GdiGetHandleUserData((HGDIOBJ) mDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr))
     {
       SetLastError (ERROR_INVALID_PARAMETER);
       return NULL; // need to delete the handle?
index 0bbff2d..7f6c39e 100644 (file)
@@ -87,7 +87,7 @@ DeleteRegion( HRGN hRgn )
 #if 0
   PREGION_ATTR Rgn_Attr;
 
-  if ((GdiGetHandleUserData((HGDIOBJ) hRgn, (PVOID) &Rgn_Attr)) &&
+  if ((GdiGetHandleUserData((HGDIOBJ) hRgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) &&
       ( Rgn_Attr != NULL ))
   {
      PTEB pTeb = NtCurrentTeb();
@@ -151,8 +151,7 @@ SetRectRgn(HRGN hrgn,
 #if 0
   PREGION_ATTR Rgn_Attr;
 
-  if (!(GdiGetHandleUserData((HGDIOBJ) hrgn, (PVOID) &Rgn_Attr)) ||
-       (GDI_HANDLE_GET_TYPE(hrgn) != GDI_OBJECT_TYPE_REGION)) 
+  if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) 
 #endif
      return NtGdiSetRectRgn(hrgn, nLeftRect, nTopRect, nRightRect, nBottomRect);
 #if 0