Commit c2320dbc authored by Alexandre Julliard's avatar Alexandre Julliard

Avoid crashes when devmode is null.

parent 3a910c7d
...@@ -569,7 +569,7 @@ static LPPRINTER_INFO_2W PRINTER_INFO_2AtoW(HANDLE heap, LPPRINTER_INFO_2A piA) ...@@ -569,7 +569,7 @@ static LPPRINTER_INFO_2W PRINTER_INFO_2AtoW(HANDLE heap, LPPRINTER_INFO_2A piA)
piW->pDriverName = asciitounicode(&usBuffer,piA->pDriverName); piW->pDriverName = asciitounicode(&usBuffer,piA->pDriverName);
piW->pComment = asciitounicode(&usBuffer,piA->pComment); piW->pComment = asciitounicode(&usBuffer,piA->pComment);
piW->pLocation = asciitounicode(&usBuffer,piA->pLocation); piW->pLocation = asciitounicode(&usBuffer,piA->pLocation);
piW->pDevMode = GdiConvertToDevmodeW(piA->pDevMode); piW->pDevMode = piA->pDevMode ? GdiConvertToDevmodeW(piA->pDevMode) : NULL;
piW->pSepFile = asciitounicode(&usBuffer,piA->pSepFile); piW->pSepFile = asciitounicode(&usBuffer,piA->pSepFile);
piW->pPrintProcessor = asciitounicode(&usBuffer,piA->pPrintProcessor); piW->pPrintProcessor = asciitounicode(&usBuffer,piA->pPrintProcessor);
piW->pDatatype = asciitounicode(&usBuffer,piA->pDatatype); piW->pDatatype = asciitounicode(&usBuffer,piA->pDatatype);
...@@ -784,7 +784,7 @@ BOOL WINAPI OpenPrinterA(LPSTR lpPrinterName,HANDLE *phPrinter, ...@@ -784,7 +784,7 @@ BOOL WINAPI OpenPrinterA(LPSTR lpPrinterName,HANDLE *phPrinter,
if(pDefault) { if(pDefault) {
DefaultW.pDatatype = asciitounicode(&usBuffer,pDefault->pDatatype); DefaultW.pDatatype = asciitounicode(&usBuffer,pDefault->pDatatype);
DefaultW.pDevMode = GdiConvertToDevmodeW(pDefault->pDevMode); DefaultW.pDevMode = pDefault->pDevMode ? GdiConvertToDevmodeW(pDefault->pDevMode) : NULL;
DefaultW.DesiredAccess = pDefault->DesiredAccess; DefaultW.DesiredAccess = pDefault->DesiredAccess;
pDefaultW = &DefaultW; pDefaultW = &DefaultW;
} }
......
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