From 14bb74cc109edeb26949800cd5c335c676d97e25 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Thu, 28 Apr 2022 11:22:40 +0200 Subject: [PATCH] uninstaller: Use OEM code page for output. Signed-off-by: Eric Pouech Signed-off-by: Alexandre Julliard --- programs/uninstaller/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/programs/uninstaller/main.c b/programs/uninstaller/main.c index 68d0dfe49f9..027937ba255 100644 --- a/programs/uninstaller/main.c +++ b/programs/uninstaller/main.c @@ -51,20 +51,20 @@ static const WCHAR PathUninstallW[] = L"Software\\Microsoft\\Windows\\CurrentVer static void output_writeconsole(const WCHAR *str, DWORD len) { - DWORD written, ret, lenA; + DWORD written, lenA; char *strA; - ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, len, &written, NULL); - if (ret) return; + if (WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, len, &written, NULL)) + return; /* WriteConsole fails if its output is redirected to a file. * If this occurs, we should use an OEM codepage and call WriteFile. */ - lenA = WideCharToMultiByte(GetConsoleOutputCP(), 0, str, len, NULL, 0, NULL, NULL); + lenA = WideCharToMultiByte(GetOEMCP(), 0, str, len, NULL, 0, NULL, NULL); strA = HeapAlloc(GetProcessHeap(), 0, lenA); if (strA) { - WideCharToMultiByte(GetConsoleOutputCP(), 0, str, len, strA, lenA, NULL, NULL); + WideCharToMultiByte(GetOEMCP(), 0, str, len, strA, lenA, NULL, NULL); WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), strA, lenA, &written, FALSE); HeapFree(GetProcessHeap(), 0, strA); }