Commit 547e97a4 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

wineps.drv: Retrieve the full printer name to avoid truncation when the name is…

wineps.drv: Retrieve the full printer name to avoid truncation when the name is 32 characters or longer.
parent e18afef7
......@@ -305,27 +305,22 @@ BOOL CDECL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWST
{
PSDRV_PDEVICE *physDev;
PRINTERINFO *pi;
char *deviceA;
/* If no device name was specified, retrieve the device name
* from the DEVMODE structure from the DC's physDev.
* from the PRINTERINFO structure from the DC's physDev.
* (See CreateCompatibleDC) */
if ( !device && *pdev )
{
physDev = *pdev;
deviceA = HeapAlloc(GetProcessHeap(), 0, CCHDEVICENAME);
lstrcpynA(deviceA, (LPCSTR)physDev->Devmode->dmPublic.dmDeviceName, CCHDEVICENAME);
pi = PSDRV_FindPrinterInfo((*pdev)->pi->FriendlyName);
}
else
{
DWORD len = WideCharToMultiByte(CP_ACP, 0, device, -1, NULL, 0, NULL, NULL);
deviceA = HeapAlloc(GetProcessHeap(), 0, len);
char *deviceA = HeapAlloc(GetProcessHeap(), 0, len);
WideCharToMultiByte(CP_ACP, 0, device, -1, deviceA, len, NULL, NULL);
}
pi = PSDRV_FindPrinterInfo(deviceA);
HeapFree(GetProcessHeap(), 0, deviceA);
deviceA = NULL;
}
TRACE("(%s %s %s %p)\n", debugstr_w(driver), debugstr_w(device),
debugstr_w(output), initData);
......
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