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