https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4563ca28d3bc5cf0e2e7b…
commit 4563ca28d3bc5cf0e2e7b1394807ee14c0a342e7
Author: jimtabor <james.tabor(a)reactos.org>
AuthorDate: Sat Jul 27 14:13:14 2019 -0500
Commit: jimtabor <james.tabor(a)reactos.org>
CommitDate: Sat Jul 27 14:13:14 2019 -0500
[GDI32] Add more to Local DC structure.
Make the two structures identical. These are used for printing and
enhanced metafile support.
---
win32ss/gdi/gdi32/wine/gdi_private.h | 28 +++++++++++++++++++++++-----
win32ss/gdi/gdi32/wine/rosglue.c | 13 +++++++++++++
win32ss/include/ntgdihdl.h | 10 +++++++---
3 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/win32ss/gdi/gdi32/wine/gdi_private.h b/win32ss/gdi/gdi32/wine/gdi_private.h
index 0bce298918a..f3b79c462b7 100644
--- a/win32ss/gdi/gdi32/wine/gdi_private.h
+++ b/win32ss/gdi/gdi32/wine/gdi_private.h
@@ -52,17 +52,35 @@ struct gdi_obj_funcs
BOOL (*pDeleteObject)( HGDIOBJ handle );
};
+/* DC_ATTR LCD Types */
+#define LDC_LDC 0x00000001
+#define LDC_EMFLDC 0x00000002
+
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;
- PHYSDEV physDev; /* current top of the physdev stack */
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 );
diff --git a/win32ss/gdi/gdi32/wine/rosglue.c b/win32ss/gdi/gdi32/wine/rosglue.c
index d5d99d8c3bd..d1b5038f27d 100644
--- a/win32ss/gdi/gdi32/wine/rosglue.c
+++ b/win32ss/gdi/gdi32/wine/rosglue.c
@@ -320,6 +320,8 @@ alloc_dc_ptr(WORD magic)
return NULL;
}
+ pWineDc->iType = LDC_EMFLDC;
+
/* Set the Wine DC as LDC */
GdiSetLDC(pWineDc->hdc, pWineDc);
}
@@ -1132,6 +1134,17 @@ METADC_Dispatch(
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)
{
diff --git a/win32ss/include/ntgdihdl.h b/win32ss/include/ntgdihdl.h
index 647acb341c6..1cbb8545d45 100644
--- a/win32ss/include/ntgdihdl.h
+++ b/win32ss/include/ntgdihdl.h
@@ -173,10 +173,11 @@
#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_DIRECT 0x00040000
+#define LDC_RESET_BANDING 0x00080000
#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 */
- 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;
+ // wine data
+ DWORD dwData[7];
} LDC, *PLDC;
typedef struct _DC_ATTR