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.
diff --git a/graphics/psdrv/init.c b/graphics/psdrv/init.c
index fbf111c..f118828 100644
--- a/graphics/psdrv/init.c
+++ b/graphics/psdrv/init.c
@@ -216,9 +216,19 @@
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;