[ros-diffs] [jimtabor] 25235: Implement GetDCDWord, update GetObjectType and printing.c fixups.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Thu Dec 28 23:36:55 CET 2006


Author: jimtabor
Date: Fri Dec 29 01:36:53 2006
New Revision: 25235

URL: http://svn.reactos.org/svn/reactos?rev=25235&view=rev
Log:
Implement GetDCDWord, update GetObjectType and printing.c fixups.

Modified:
    trunk/reactos/dll/win32/gdi32/objects/dc.c
    trunk/reactos/dll/win32/gdi32/objects/painting.c

Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc.c?rev=25235&r1=25234&r2=25235&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/dc.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/dc.c Fri Dec 29 01:36:53 2006
@@ -322,6 +322,17 @@
   return NtGdiGetRelAbs(hdc);
 }
 
+
+DWORD
+STDCALL
+GetDCDWord( HDC hDC, INT u, DWORD Result )
+{
+BOOL Ret = TRUE; //NtGdiGetDCDword( hDC, u, (DWORD*) &u );
+  if (!Ret) return Result;
+  else return u;
+}
+
+
 /*
  * @implemented
 */
@@ -528,10 +539,15 @@
         Ret = OBJ_REGION;
         break;
       case GDI_OBJECT_TYPE_DC:
-        Ret = OBJ_DC;
-        break;
-      case GDI_OBJECT_TYPE_METADC:
-        Ret = OBJ_METADC;
+        if ( GetDCDWord( h, GdiGetIsMemDc, 0))
+        {
+           Ret = OBJ_MEMDC;
+        }
+        else
+           Ret = OBJ_DC;
+        break;
+      case GDI_OBJECT_TYPE_COLORSPACE:
+        Ret = OBJ_COLORSPACE;
         break;
       case GDI_OBJECT_TYPE_METAFILE:
         Ret = OBJ_METAFILE;
@@ -559,3 +575,5 @@
     SetLastError(ERROR_INVALID_HANDLE);
   return Ret;
 }
+
+

Modified: trunk/reactos/dll/win32/gdi32/objects/painting.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/painting.c?rev=25235&r1=25234&r2=25235&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/painting.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/painting.c Fri Dec 29 01:36:53 2006
@@ -139,8 +139,7 @@
  if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
  {
     if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
-//      return MFDRV_MetaParam2( hDC, META_MOVETO, x, y);
-         return FALSE;
+      return MFDRV_MetaParam2( hDC, META_MOVETO, x, y);
     else
     {
       PLDC pLDC = Dc_Attr->pvLDC;
@@ -151,8 +150,7 @@
       }
       if (pLDC->iType == LDC_EMFLDC)
       {
-        //if (!EMFDRV_MoveTo( hDC, x, y))
-          return FALSE;
+        if (!EMFDRV_MoveTo( hDC, x, y)) return FALSE;
       }
     }
  }
@@ -441,12 +439,8 @@
 STDCALL
 GetPixel( HDC hDC, INT x, INT y )
 {
- PDC_ATTR Dc_Attr;
- 
  if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) return CLR_INVALID;
-
- if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return CLR_INVALID;
- 
+ if (!GdiIsHandleValid((HGDIOBJ) hDC)) return CLR_INVALID;
  return NtGdiGetPixel( hDC, x, y);
 }
 




More information about the Ros-diffs mailing list