[GDI32] Add more to Local DC structure.
authorjimtabor <james.tabor@reactos.org>
Sat, 27 Jul 2019 19:13:14 +0000 (14:13 -0500)
committerjimtabor <james.tabor@reactos.org>
Sat, 27 Jul 2019 19:13:14 +0000 (14:13 -0500)
Make the two structures identical. These are used for printing and
enhanced metafile support.

win32ss/gdi/gdi32/wine/gdi_private.h
win32ss/gdi/gdi32/wine/rosglue.c
win32ss/include/ntgdihdl.h

index 0bce298..f3b79c4 100644 (file)
@@ -52,17 +52,35 @@ struct gdi_obj_funcs
     BOOL    (*pDeleteObject)( HGDIOBJ handle );
 };
 
     BOOL    (*pDeleteObject)( HGDIOBJ handle );
 };
 
+/* DC_ATTR LCD Types */
+#define LDC_LDC           0x00000001
+#define LDC_EMFLDC        0x00000002
+
 typedef struct tagWINEDC
 {
     HDC          hdc;
 typedef struct tagWINEDC
 {
     HDC          hdc;
+    ULONG        Flags;
+    INT          iType;
+    union {
+    PVOID        pvEmfDC; /* Pointer to ENHMETAFILE structure */
+    PHYSDEV      physDev; /* current top of the physdev stack */
+    };
+    LPWSTR       pwszPort;
+    ABORTPROC    pAbortProc;
+    DWORD        CallBackTick;
+    HANDLE       hPrinter;
+    PDEVMODEW    pdm;
+    PVOID        pUMPDev;
+    PVOID        pUMdhpdev;
+    ULONG        DevCaps[36];
+    HBRUSH       hBrush;
+    HPEN         hPen;
+    ////
     struct gdi_physdev NullPhysDev;
     struct gdi_physdev NullPhysDev;
-    PHYSDEV      physDev;          /* current top of the physdev stack */
     LONG         refcount;         /* thread refcount */
     INT          saveLevel;
     LONG         refcount;         /* thread refcount */
     INT          saveLevel;
-    HFONT hFont;
-    HBRUSH hBrush;
-    HPEN hPen;
-    HPALETTE hPalette;
+    HFONT        hFont;
+    HPALETTE     hPalette;
 } WINEDC, DC;
 
 WINEDC* get_physdev_dc( PHYSDEV dev );
 } WINEDC, DC;
 
 WINEDC* get_physdev_dc( PHYSDEV dev );
index d5d99d8..d1b5038 100644 (file)
@@ -320,6 +320,8 @@ alloc_dc_ptr(WORD magic)
             return NULL;
         }
 
             return NULL;
         }
 
+        pWineDc->iType = LDC_EMFLDC;
+
         /* Set the Wine DC as LDC */
         GdiSetLDC(pWineDc->hdc, pWineDc);
     }
         /* Set the Wine DC as LDC */
         GdiSetLDC(pWineDc->hdc, pWineDc);
     }
@@ -1132,6 +1134,17 @@ METADC_Dispatch(
         return FALSE;
     }
 
         return FALSE;
     }
 
+    // See if this is other than a METADATA issue.
+    if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_ALTDC_TYPE)
+    {
+       WINEDC* pwdc = (WINEDC*)GdiGetLDC(hdc);
+       if (pwdc && pwdc->iType != LDC_EMFLDC)
+       {
+          /* Let the caller handle it */
+          return FALSE;
+       }
+    }
+
     physdev = GetPhysDev(hdc);
     if (physdev == NULL)
     {
     physdev = GetPhysDev(hdc);
     if (physdev == NULL)
     {
index 647acb3..1cbb854 100644 (file)
 #define LDC_INIT_DOCUMENT 0x00000040
 #define LDC_INIT_PAGE     0x00000080
 #define LDC_STARTPAGE     0x00000100
 #define LDC_INIT_DOCUMENT 0x00000040
 #define LDC_INIT_PAGE     0x00000080
 #define LDC_STARTPAGE     0x00000100
-#define LDC_PLAY_MFDC     0x00000800
 #define LDC_CLOCKWISE     0x00002000
 #define LDC_KILL_DOCUMENT 0x00010000
 #define LDC_META_PRINT    0x00020000
 #define LDC_CLOCKWISE     0x00002000
 #define LDC_KILL_DOCUMENT 0x00010000
 #define LDC_META_PRINT    0x00020000
+#define LDC_DIRECT        0x00040000
+#define LDC_RESET_BANDING 0x00080000
 #define LDC_INFODC        0x01000000 /* If CreateIC was passed. */
 #define LDC_DEVCAPS       0x02000000
 #define LDC_ATENDPAGE     0x10000000
 #define LDC_INFODC        0x01000000 /* If CreateIC was passed. */
 #define LDC_DEVCAPS       0x02000000
 #define LDC_ATENDPAGE     0x10000000
@@ -278,11 +279,14 @@ typedef struct _LDC
     ABORTPROC pAbortProc; /* AbortProc for Printing */
     DWORD CallBackTick;
     HANDLE hPrinter;      /* Local or Remote Printer driver */
     ABORTPROC pAbortProc; /* AbortProc for Printing */
     DWORD CallBackTick;
     HANDLE hPrinter;      /* Local or Remote Printer driver */
-    PVOID pUMPDev;
-    PUMDHPDEV pUMdhpdev;
+    PDEVMODEW pdm;
+    PVOID pUMPDev;        /* Ptr to User Mode Printer Device structure */
+    PUMDHPDEV pUMdhpdev;  /* Ptr to Combined UMPD and DHPDEV structure */
     DEVCAPS DevCaps;
     HBRUSH BrushColor;
     HPEN PenColor;
     DEVCAPS DevCaps;
     HBRUSH BrushColor;
     HPEN PenColor;
+    // wine data
+    DWORD dwData[7];
 } LDC, *PLDC;
 
 typedef struct _DC_ATTR
 } LDC, *PLDC;
 
 typedef struct _DC_ATTR