https://git.reactos.org/?p=reactos.git;a=commitdiff;h=45b9b5c1ef203b6de89d8…
commit 45b9b5c1ef203b6de89d8561008ab52843f3086c
Author: Colin Finck <colin(a)reactos.org>
AuthorDate: Sat Dec 9 10:59:40 2017 +0100
[WINSPOOL] Convert the returned Unicode string back to ANSI in GetDefaultPrinterA.
Thanks to Mark for the hint in CORE-14072!
---
win32ss/printing/base/winspool/printers.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/win32ss/printing/base/winspool/printers.c b/win32ss/printing/base/winspool/printers.c
index 0441ff36ad..2abd5c3d0c 100644
--- a/win32ss/printing/base/winspool/printers.c
+++ b/win32ss/printing/base/winspool/printers.c
@@ -449,6 +449,9 @@ GetDefaultPrinterA(LPSTR pszBuffer, LPDWORD pcchBuffer)
goto Cleanup;
}
+ // We successfully got a string in pwszBuffer, so convert the Unicode string to ANSI.
+ WideCharToMultiByte(CP_ACP, 0, pwszBuffer, -1, pszBuffer, *pcchBuffer, NULL, NULL);
+
dwErrorCode = ERROR_SUCCESS;
Cleanup: