[ros-diffs] [jimtabor] 28375: Fix memory DC so CreateCompatibleDC with null will create it. Based on msdn2 info, we need to setup display surface, etc.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Fri Aug 17 02:08:49 CEST 2007


Author: jimtabor
Date: Fri Aug 17 04:08:48 2007
New Revision: 28375

URL: http://svn.reactos.org/svn/reactos?rev=28375&view=rev
Log:
Fix memory DC so CreateCompatibleDC with null will create it. Based on msdn2 info, we need to setup display surface, etc.

Modified:
    trunk/reactos/dll/win32/gdi32/objects/dc.c
    trunk/reactos/subsystems/win32/win32k/objects/dc.c
    trunk/reactos/subsystems/win32/win32k/objects/gdiobj.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=28375&r1=28374&r2=28375&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/dc.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/dc.c Fri Aug 17 04:08:48 2007
@@ -789,14 +789,11 @@
       case GDI_OBJECT_TYPE_ENHMETAFILE:
         Ret = OBJ_ENHMETAFILE;
         break;
-      case GDI_OBJECT_TYPE_ENHMETADC:
-        Ret = OBJ_ENHMETADC;
-        break;
+      case GDI_OBJECT_TYPE_METADC:
+        Ret = OBJ_METADC;
+        break;      
       case GDI_OBJECT_TYPE_EXTPEN:
         Ret = OBJ_EXTPEN;
-        break;
-      case GDI_OBJECT_TYPE_MEMDC:
-        Ret = OBJ_MEMDC;
         break;
 
       default:

Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/dc.c?rev=28375&r1=28374&r2=28375&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Fri Aug 17 04:08:48 2007
@@ -166,7 +166,8 @@
   HDC hNewDC, DisplayDC;
   HRGN hVisRgn;
   UNICODE_STRING DriverName;
-
+  INT DC_Type = DC_TYPE_DIRECT;
+  
   DisplayDC = NULL;
   if (hDC == NULL)
     {
@@ -177,6 +178,7 @@
           return NULL;
         }
       hDC = DisplayDC;
+      DC_Type = DC_TYPE_MEMORY; // Null hDC == Memory DC.
     }
 
   /*  Allocate a new DC based on the original DC's device  */
@@ -205,7 +207,8 @@
   /* Copy information from original DC to new DC  */
   NewDC->hSelf = hNewDC;
   NewDC->IsIC = FALSE;
-
+  NewDC->DC_Type = DC_Type;
+  
   NewDC->PDev = OrigDC->PDev;
   memcpy(NewDC->FillPatternSurfaces,
          OrigDC->FillPatternSurfaces,
@@ -891,6 +894,7 @@
     return NULL;
   }
 
+  NewDC->DC_Type = DC_TYPE_DIRECT;
   NewDC->IsIC = CreateAsIC;
   NewDC->DevInfo = &PrimarySurface.DevInfo;
   NewDC->GDIInfo = &PrimarySurface.GDIInfo;
@@ -2174,12 +2178,7 @@
     case GdiGetFontLanguageInfo:
       break;
     case GdiGetIsMemDc:
-      {
-        if (dc->w.flags & DC_MEMORY)
-          SafeResult = DC_TYPE_MEMORY;  // = dc->DC_Type;
-        else
-          SafeResult = DC_TYPE_DIRECT;
-      }
+          SafeResult = dc->DC_Type;
       break;
     case GdiGetMapMode:
       SafeResult = dc->Dc_Attr.iMapMode;

Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c?rev=28375&r1=28374&r2=28375&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Fri Aug 17 04:08:48 2007
@@ -84,8 +84,6 @@
   {GDI_OBJECT_TYPE_METADC,      sizeof(DC),             GDI_CleanupDummy},
   {GDI_OBJECT_TYPE_METAFILE,    sizeof(DC),            GDI_CleanupDummy},
   {GDI_OBJECT_TYPE_ENHMETAFILE, 0,                     GDI_CleanupDummy},
-  {GDI_OBJECT_TYPE_ENHMETADC,   0,                     GDI_CleanupDummy},
-  {GDI_OBJECT_TYPE_MEMDC,       0,                     GDI_CleanupDummy},
   {GDI_OBJECT_TYPE_EMF,         0,                     GDI_CleanupDummy}
 };
 




More information about the Ros-diffs mailing list