Eric Pouech : uninstaller: Use OEM code page for output.
Alexandre Julliard
julliard at winehq.org
Mon May 2 16:02:10 CDT 2022
Module: wine
Branch: master
Commit: 14bb74cc109edeb26949800cd5c335c676d97e25
URL: https://source.winehq.org/git/wine.git/?a=commit;h=14bb74cc109edeb26949800cd5c335c676d97e25
Author: Eric Pouech <eric.pouech at gmail.com>
Date: Thu Apr 28 11:22:40 2022 +0200
uninstaller: Use OEM code page for output.
Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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);
}
More information about the wine-cvs
mailing list