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.
This commit is contained in:
Noel Borthwick 1999-06-05 08:52:30 +00:00 committed by Alexandre Julliard
parent 28b3ee73df
commit 86b686fb8c
2 changed files with 17 additions and 1 deletions

View File

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

View File

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