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:
parent
28b3ee73df
commit
86b686fb8c
|
@ -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 ))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue