From df8c52cd91ba71d1b778f749cae4f0cd1dfaf671 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 27 Sep 2019 13:22:18 +0800 Subject: [PATCH] winspool: Add support for level 1 printer info to GetPrinter. Signed-off-by: Dmitry Timoshkov Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/winspool.drv/info.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index d7e22111028..1ab5e43aefd 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -4435,6 +4435,24 @@ BOOL WINAPI GetPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter, } switch(Level) { + case 1: + { + PRINTER_INFO_1W *pi1 = (PRINTER_INFO_1W *)pPrinter; + + size = sizeof(PRINTER_INFO_1W); + if (size <= cbBuf) { + ptr = pPrinter + size; + cbBuf -= size; + memset(pPrinter, 0, size); + } else { + pi1 = NULL; + cbBuf = 0; + } + ret = WINSPOOL_GetPrinter_1(hkeyPrinter, pi1, ptr, cbBuf, &needed); + needed += size; + break; + } + case 2: { PRINTER_INFO_2W *pi2 = (PRINTER_INFO_2W *)pPrinter;