Commit 86b686fb authored by Noel Borthwick's avatar Noel Borthwick Committed by Alexandre Julliard

From CreateCompatibleDC, pass the device name associated with the

source DC in order to allow PSDRV_CreateDC to locate the printer info for the device.
parent 28b3ee73
......@@ -216,9 +216,19 @@ static BOOL PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODEA* initData )
{
PSDRV_PDEVICE *physDev;
PRINTERINFO *pi = PSDRV_FindPrinterInfo(device);
PRINTERINFO *pi;
DeviceCaps *devCaps;
/* If no device name was specified, retrieve the device name
* from the DEVMODE structure from the DC's physDev.
* (See CreateCompatibleDC) */
if ( !device && dc->physDev )
{
physDev = (PSDRV_PDEVICE *)dc->physDev;
device = physDev->Devmode->dmPublic.dmDeviceName;
}
pi = PSDRV_FindPrinterInfo(device);
TRACE(psdrv, "(%s %s %s %p)\n", driver, device, output, initData);
if(!pi) return FALSE;
......
......@@ -634,6 +634,12 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
dc->w.hBitmap = hbitmap;
dc->w.hFirstBitmap = hbitmap;
/* Copy the driver-specific physical device info into
* the new DC. The driver may use this read-only info
* while creating the compatible DC below. */
if (origDC)
dc->physDev = origDC->physDev;
if (dc->funcs->pCreateDC &&
!dc->funcs->pCreateDC( dc, NULL, NULL, NULL, NULL ))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment