mirror of
https://github.com/reactos/wine.git
synced 2024-11-28 14:10:32 +00:00
wineps.drv: Retrieve the full printer name to avoid truncation when the name is 32 characters or longer.
This commit is contained in:
parent
e18afef774
commit
547e97a461
@ -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);
|
||||
}
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user