[GDI32] Add more to Local DC structure.

Make the two structures identical. These are used for printing and
enhanced metafile support.
This commit is contained in:
jimtabor 2019-07-27 14:13:14 -05:00
parent 294af4a774
commit 4563ca28d3
3 changed files with 43 additions and 8 deletions

View file

@ -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 );

View file

@ -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)
{

View file

@ -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