https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0483063b6932c779bc114…
commit 0483063b6932c779bc114948a0f1f3a7dc58d24f
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Tue May 25 20:17:43 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed May 26 01:42:11 2021 +0200
[MODE] Reset the current thread UI language and streams codepage after changing the console codepage. Add extra error handling.
CORE-17601
---
base/applications/cmdutils/mode/lang/de-DE.rc | 1 +
base/applications/cmdutils/mode/lang/en-US.rc | 1 +
base/applications/cmdutils/mode/lang/it-IT.rc | 1 +
base/applications/cmdutils/mode/lang/pl-PL.rc | 1 +
base/applications/cmdutils/mode/lang/ro-RO.rc | 1 +
base/applications/cmdutils/mode/lang/ru-RU.rc | 1 +
base/applications/cmdutils/mode/lang/tr-TR.rc | 1 +
base/applications/cmdutils/mode/lang/zh-CN.rc | 1 +
base/applications/cmdutils/mode/mode.c | 65 ++++++++++++++++++++-------
base/applications/cmdutils/mode/resource.h | 1 +
10 files changed, 58 insertions(+), 16 deletions(-)
diff --git a/base/applications/cmdutils/mode/lang/de-DE.rc b/base/applications/cmdutils/mode/lang/de-DE.rc
index 5355ac86e83..a2ccfcc4a06 100644
--- a/base/applications/cmdutils/mode/lang/de-DE.rc
+++ b/base/applications/cmdutils/mode/lang/de-DE.rc
@@ -68,4 +68,5 @@ BEGIN
IDS_ERROR_INVALID_STOP_BITS "ERROR: Invalid value for Stop Bits %d:\n"
IDS_ERROR_NO_MEMORY "ERROR: Not enough memory.\n"
IDS_ERROR_SCREEN_LINES_COL "The screen cannot be set to the number of lines and columns specified.\n"
+ IDS_ERROR_INVALID_CODEPAGE "The code page specified is not valid.\n"
END
diff --git a/base/applications/cmdutils/mode/lang/en-US.rc b/base/applications/cmdutils/mode/lang/en-US.rc
index ce84d5d0e5f..c0fc8055e47 100644
--- a/base/applications/cmdutils/mode/lang/en-US.rc
+++ b/base/applications/cmdutils/mode/lang/en-US.rc
@@ -68,4 +68,5 @@ BEGIN
IDS_ERROR_INVALID_STOP_BITS "ERROR: Invalid value for Stop Bits %d:\n"
IDS_ERROR_NO_MEMORY "ERROR: Not enough memory.\n"
IDS_ERROR_SCREEN_LINES_COL "The screen cannot be set to the number of lines and columns specified.\n"
+ IDS_ERROR_INVALID_CODEPAGE "The code page specified is not valid.\n"
END
diff --git a/base/applications/cmdutils/mode/lang/it-IT.rc b/base/applications/cmdutils/mode/lang/it-IT.rc
index 77a7b6360a3..e0d3010a7de 100644
--- a/base/applications/cmdutils/mode/lang/it-IT.rc
+++ b/base/applications/cmdutils/mode/lang/it-IT.rc
@@ -68,4 +68,5 @@ BEGIN
IDS_ERROR_INVALID_STOP_BITS "ERRORE: valore non valido per i bit di stop %d:\n"
IDS_ERROR_NO_MEMORY "ERRORE: memoria insufficiente.\n"
IDS_ERROR_SCREEN_LINES_COL "Lo schermo non può essere impostato con il numero di righe e colonne specificato.\n"
+ IDS_ERROR_INVALID_CODEPAGE "The code page specified is not valid.\n"
END
diff --git a/base/applications/cmdutils/mode/lang/pl-PL.rc b/base/applications/cmdutils/mode/lang/pl-PL.rc
index 0cd8d44268d..96e47961e1e 100644
--- a/base/applications/cmdutils/mode/lang/pl-PL.rc
+++ b/base/applications/cmdutils/mode/lang/pl-PL.rc
@@ -68,4 +68,5 @@ BEGIN
IDS_ERROR_INVALID_STOP_BITS "BŁĄD: Nieprawidłowa wartość dla bitów separatora %d:\n"
IDS_ERROR_NO_MEMORY "BŁĄD: Za mało pamięci.\n"
IDS_ERROR_SCREEN_LINES_COL "BŁĄD: Nie można ustawić ekranu na określoną liczbę wierszy i kolumn.\n"
+ IDS_ERROR_INVALID_CODEPAGE "The code page specified is not valid.\n"
END
diff --git a/base/applications/cmdutils/mode/lang/ro-RO.rc b/base/applications/cmdutils/mode/lang/ro-RO.rc
index 01c83e098b2..8c8c38e47d9 100644
--- a/base/applications/cmdutils/mode/lang/ro-RO.rc
+++ b/base/applications/cmdutils/mode/lang/ro-RO.rc
@@ -77,4 +77,5 @@ BEGIN
IDS_ERROR_INVALID_STOP_BITS "EROARE: Valoare eronată pentru biții delimitori %d:\n"
IDS_ERROR_NO_MEMORY "ERAORE: Nu există suficientă memorie.\n"
IDS_ERROR_SCREEN_LINES_COL "Ecranul nu poate fi stabilit cu numărul de linii sau coloane specificate.\n"
+ IDS_ERROR_INVALID_CODEPAGE "The code page specified is not valid.\n"
END
diff --git a/base/applications/cmdutils/mode/lang/ru-RU.rc b/base/applications/cmdutils/mode/lang/ru-RU.rc
index 81d2190c7d5..d79c2235757 100644
--- a/base/applications/cmdutils/mode/lang/ru-RU.rc
+++ b/base/applications/cmdutils/mode/lang/ru-RU.rc
@@ -68,4 +68,5 @@ BEGIN
IDS_ERROR_INVALID_STOP_BITS "ОШИБКА: Неверное значение стоповых битов %d:\n"
IDS_ERROR_NO_MEMORY "ОШИБКА: Недостаточно памяти.\n"
IDS_ERROR_SCREEN_LINES_COL "The screen cannot be set to the number of lines and columns specified.\n"
+ IDS_ERROR_INVALID_CODEPAGE "The code page specified is not valid.\n"
END
diff --git a/base/applications/cmdutils/mode/lang/tr-TR.rc b/base/applications/cmdutils/mode/lang/tr-TR.rc
index 31cfe37bfd9..9b93bf8c2d1 100644
--- a/base/applications/cmdutils/mode/lang/tr-TR.rc
+++ b/base/applications/cmdutils/mode/lang/tr-TR.rc
@@ -70,4 +70,5 @@ BEGIN
IDS_ERROR_INVALID_STOP_BITS "YANLIŞLIK: %d Durma İkilleri için geçersiz değer:\n"
IDS_ERROR_NO_MEMORY "YANLIŞLIK: Yeterli bellek yok.\n"
IDS_ERROR_SCREEN_LINES_COL "Görüntülük, belirtilen yataç ve dikeç sayısına ayarlanamıyor.\n"
+ IDS_ERROR_INVALID_CODEPAGE "The code page specified is not valid.\n"
END
diff --git a/base/applications/cmdutils/mode/lang/zh-CN.rc b/base/applications/cmdutils/mode/lang/zh-CN.rc
index 7e8e841dcdd..3a6ca30be63 100644
--- a/base/applications/cmdutils/mode/lang/zh-CN.rc
+++ b/base/applications/cmdutils/mode/lang/zh-CN.rc
@@ -68,4 +68,5 @@ BEGIN
IDS_ERROR_INVALID_STOP_BITS "错误: 终止位 %d 值无效:\n"
IDS_ERROR_NO_MEMORY "错误: 内存不足。\n"
IDS_ERROR_SCREEN_LINES_COL "屏幕无法被设置成指定的行数和列数。\n"
+ IDS_ERROR_INVALID_CODEPAGE "The code page specified is not valid.\n"
END
diff --git a/base/applications/cmdutils/mode/mode.c b/base/applications/cmdutils/mode/mode.c
index 054564e3ddb..8cb834b6c23 100644
--- a/base/applications/cmdutils/mode/mode.c
+++ b/base/applications/cmdutils/mode/mode.c
@@ -1,3 +1,10 @@
+/*
+ * PROJECT: ReactOS Mode Utility
+ * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
+ * PURPOSE: Provides fast mode setup for DOS devices.
+ * COPYRIGHT: Copyright 2002 Robert Dickenson
+ * Copyright 2016-2021 Hermes Belusca-Maito
+ */
/*
* ReactOS mode console command
*
@@ -19,14 +26,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS Mode Utility
- * FILE: base/applications/cmdutils/mode/mode.c
- * PURPOSE: Provides fast mode setup for DOS devices.
- * PROGRAMMERS: Robert Dickenson
- * Hermes Belusca-Maito
- */
#include <stdio.h>
#include <stdlib.h>
@@ -453,22 +452,18 @@ invalid_parameter:
int SetConsoleCPState(IN PCWSTR ArgStr)
{
PCWSTR argStr = ArgStr;
- DWORD CodePage = 0;
+ DWORD value = 0;
+ UINT uOldCodePage, uNewCodePage;
if ( (_wcsnicmp(argStr, L"SELECT=", 7) == 0 && (argStr += 7)) ||
(_wcsnicmp(argStr, L"SEL=", 4) == 0 && (argStr += 4)) )
{
- argStr = ParseNumber(argStr, &CodePage);
+ argStr = ParseNumber(argStr, &value);
if (!argStr) goto invalid_parameter;
/* This should be the end of the string */
while (*argStr == L' ') argStr++;
if (*argStr) goto invalid_parameter;
-
- SetConsoleCP(CodePage);
- SetConsoleOutputCP(CodePage);
- // "The code page specified is not valid."
- ShowConsoleCPStatus();
}
else
{
@@ -477,7 +472,45 @@ invalid_parameter:
return 1;
}
- return 0;
+ uNewCodePage = value;
+
+/**
+ ** IMPORTANT NOTE: This code must be kept synchronized with CHCP.COM
+ **/
+
+ /*
+ * Save the original console code page to be restored
+ * in case SetConsoleCP() or SetConsoleOutputCP() fails.
+ */
+ uOldCodePage = GetConsoleCP();
+
+ /*
+ * Try changing the console input and output code pages.
+ * If it succeeds, refresh the local code page information.
+ */
+ if (SetConsoleCP(uNewCodePage))
+ {
+ if (SetConsoleOutputCP(uNewCodePage))
+ {
+ /* Success, reset the current thread UI language
+ * and update the streams cached code page. */
+ ConSetThreadUILanguage(0);
+ ConStdStreamsSetCacheCodePage(uNewCodePage, uNewCodePage);
+
+ /* Display the current console status */
+ ShowConsoleStatus();
+ return 0;
+ }
+ else
+ {
+ /* Failure, restore the original console code page */
+ SetConsoleCP(uOldCodePage);
+ }
+ }
+
+ /* An error happened, display an error and bail out */
+ ConResPuts(StdErr, IDS_ERROR_INVALID_CODEPAGE);
+ return 1;
}
diff --git a/base/applications/cmdutils/mode/resource.h b/base/applications/cmdutils/mode/resource.h
index 2916e47c2c4..65b05fa8806 100644
--- a/base/applications/cmdutils/mode/resource.h
+++ b/base/applications/cmdutils/mode/resource.h
@@ -47,5 +47,6 @@
#define IDS_ERROR_INVALID_STOP_BITS 35
#define IDS_ERROR_NO_MEMORY 36
#define IDS_ERROR_SCREEN_LINES_COL 37
+#define IDS_ERROR_INVALID_CODEPAGE 38
#endif /* RESOURCE_H */
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a8ef85ad710a8a4825616…
commit a8ef85ad710a8a48256165a08dfb6b725433ab2f
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Tue May 25 20:04:01 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed May 26 01:42:11 2021 +0200
[CHCP] Reset the current thread UI language and streams codepage after changing the console codepage.
CORE-17601
---
base/applications/cmdutils/chcp/chcp.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/base/applications/cmdutils/chcp/chcp.c b/base/applications/cmdutils/chcp/chcp.c
index 56c13089edf..36f5291f42c 100644
--- a/base/applications/cmdutils/chcp/chcp.c
+++ b/base/applications/cmdutils/chcp/chcp.c
@@ -1,10 +1,9 @@
/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS Change CodePage Command
- * FILE: base/applications/cmdutils/chcp/chcp.c
- * PURPOSE: Displays or changes the active console input and output codepages.
- * PROGRAMMERS: Eric Kohl
- * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ * PROJECT: ReactOS Change CodePage Command
+ * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
+ * PURPOSE: Displays or changes the active console input and output code pages.
+ * COPYRIGHT: Copyright 1999 Eric Kohl
+ * Copyright 2017-2021 Hermes Belusca-Maito
*/
/*
* CHCP.C - chcp internal command.
@@ -64,27 +63,36 @@ int wmain(int argc, WCHAR* argv[])
return 1;
}
+/**
+ ** IMPORTANT NOTE: This code must be kept synchronized with MODE.COM!SetConsoleCPState()
+ **/
+
/*
- * Save the original console codepage to be restored in case
- * SetConsoleCP() or SetConsoleOutputCP() fails.
+ * Save the original console code page to be restored
+ * in case SetConsoleCP() or SetConsoleOutputCP() fails.
*/
uOldCodePage = GetConsoleCP();
/*
- * Try changing the console input codepage. If it works then also change
- * the console output codepage, and refresh our local codepage cache.
+ * Try changing the console input and output code pages.
+ * If it succeeds, refresh the local code page information.
*/
if (SetConsoleCP(uNewCodePage))
{
if (SetConsoleOutputCP(uNewCodePage))
{
+ /* Success, reset the current thread UI language
+ * and update the streams cached code page. */
+ ConSetThreadUILanguage(0);
+ ConStdStreamsSetCacheCodePage(uNewCodePage, uNewCodePage);
+
/* Display the active code page number */
ConResPrintf(StdOut, STRING_CHCP_ERROR1, GetConsoleOutputCP());
return 0;
}
else
{
- /* Failure, restore the original console codepage */
+ /* Failure, restore the original console code page */
SetConsoleCP(uOldCodePage);
}
}
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7c3aabc088e5c889bcdef…
commit 7c3aabc088e5c889bcdeffb38b0cf1896bdc5bfb
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed May 26 00:12:10 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed May 26 01:42:10 2021 +0200
[CONUTILS] Implement ConSetThreadUILanguage() as a wrapper for kernel32!SetThreadUILanguage().
CORE-17601
Dynamically load SetThreadUILanguage(), so as to support systems where this API is not present.
Hopefully implemented in a thread-safe manner.
---
sdk/lib/conutils/utils.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++--
sdk/lib/conutils/utils.h | 8 +++++--
2 files changed, 59 insertions(+), 4 deletions(-)
diff --git a/sdk/lib/conutils/utils.c b/sdk/lib/conutils/utils.c
index 31fe8951092..35f7f6b92d6 100644
--- a/sdk/lib/conutils/utils.c
+++ b/sdk/lib/conutils/utils.c
@@ -3,8 +3,8 @@
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: Base set of functions for loading string resources
* and message strings, and handle type identification.
- * COPYRIGHT: Copyright 2017-2018 ReactOS Team
- * Copyright 2017-2018 Hermes Belusca-Maito
+ * COPYRIGHT: Copyright 2017-2021 ReactOS Team
+ * Copyright 2017-2021 Hermes Belusca-Maito
*/
/**
@@ -320,6 +320,57 @@ FormatMessageSafeW(
return dwLength;
}
+/**
+ * @name ConSetThreadUILanguage
+ * Sets the current thread's user interface language.
+ * Mostly used by console applications for selecting a
+ * language identifier that best supports the NT Console.
+ * This function dynamically loads and calls kernel32!SetThreadUILanguage()
+ * so as to be able to work on older environments where this
+ * API is not supported.
+ * The FormatMessage() API also bases itself on the thread's
+ * current language for its default behaviour (unless an explicit
+ * language identifier has been provided).
+ *
+ * @param[in,opt] LangId
+ * (Vista+) A non-zero language identifier that specifies the
+ * current thread's user interface language to set.
+ * (XP/2003) Set the language identifier to 0 for selecting a
+ * language identifier that best supports the NT Console.
+ *
+ * @return
+ * Returns LangId in case of success, or 0 in case of failure.
+ * If LangId was set to 0, the function always succeeds and returns
+ * the language identifier that best supports the NT Console.
+ *
+ * @remark
+ * This function is thread-safe.
+ *
+ * @see <a href="https://docs.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-setthre…">SetThreadUILanguage() (on MSDN)</a>
+ **/
+LANGID
+ConSetThreadUILanguage(
+ IN LANGID LangId OPTIONAL)
+{
+ /* The function pointer is shared amongst all threads */
+ static volatile LANGID (WINAPI *pfnSetThreadUILanguage)(LANGID) = NULL;
+
+ if (!pfnSetThreadUILanguage)
+ {
+ /* Load the API from kernel32 */
+ PVOID pFunc = (PVOID)GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "SetThreadUILanguage");
+ if (!pFunc)
+ {
+ /* Fail since the API is not available */
+ return 0;
+ }
+ /* Set the function pointer in case it hasn't been already set by another thread */
+ InterlockedCompareExchangePointer((PVOID*)&pfnSetThreadUILanguage, pFunc, NULL);
+ // ASSERT(pfnSetThreadUILanguage);
+ }
+ return pfnSetThreadUILanguage(LangId);
+}
+
/**
* @name IsTTYHandle
* Checks whether a handle refers to a valid TTY object.
diff --git a/sdk/lib/conutils/utils.h b/sdk/lib/conutils/utils.h
index 798548056e9..7d613d996fd 100644
--- a/sdk/lib/conutils/utils.h
+++ b/sdk/lib/conutils/utils.h
@@ -3,8 +3,8 @@
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: Base set of functions for loading string resources
* and message strings, and handle type identification.
- * COPYRIGHT: Copyright 2017-2018 ReactOS Team
- * Copyright 2017-2018 Hermes Belusca-Maito
+ * COPYRIGHT: Copyright 2017-2021 ReactOS Team
+ * Copyright 2017-2021 Hermes Belusca-Maito
*/
/**
@@ -56,6 +56,10 @@ FormatMessageSafeW(
IN DWORD nSize,
IN va_list *Arguments OPTIONAL);
+LANGID
+ConSetThreadUILanguage(
+ IN LANGID LangId OPTIONAL);
+
BOOL
IsTTYHandle(IN HANDLE hHandle);
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f268430c053c46def90ab…
commit f268430c053c46def90ab399074ec02df9a79acd
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Tue May 25 23:34:01 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed May 26 01:42:09 2021 +0200
[CONUTILS] Update some documentation.
---
sdk/lib/conutils/outstream.c | 18 +++++++++---------
sdk/lib/conutils/utils.c | 4 ++--
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/sdk/lib/conutils/outstream.c b/sdk/lib/conutils/outstream.c
index 6a45630a9bb..9dd0dfa1207 100644
--- a/sdk/lib/conutils/outstream.c
+++ b/sdk/lib/conutils/outstream.c
@@ -831,7 +831,7 @@ ConResPrintf(
* Similarly to ConPuts(), no terminating new-line character is appended.
*
* @see ConPuts(), ConResPuts() and associated functions,
- * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).…">FormatMessage() (on MSDN)</a>
+ * <a href="https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-forma…">FormatMessage() (on MSDN)</a>
**/
INT
ConMsgPuts(
@@ -846,7 +846,7 @@ ConMsgPuts(
LPWSTR lpMsgBuf = NULL;
/*
- * Sanitize dwFlags. This version always ignore explicitely the inserts
+ * Sanitize dwFlags. This version always ignores explicitly the inserts
* as we emulate the behaviour of the (f)puts function.
*/
dwFlags |= FORMAT_MESSAGE_ALLOCATE_BUFFER; // Always allocate an internal buffer.
@@ -919,7 +919,7 @@ ConMsgPrintf2V(
LPWSTR lpMsgBuf = NULL;
/*
- * Sanitize dwFlags. This version always ignore explicitely the inserts.
+ * Sanitize dwFlags. This version always ignores explicitly the inserts.
* The string that we will return to the user will not be pre-formatted.
*/
dwFlags |= FORMAT_MESSAGE_ALLOCATE_BUFFER; // Always allocate an internal buffer.
@@ -1024,7 +1024,7 @@ ConMsgPrintf2V(
* Numbers of characters successfully written to @p Stream.
*
* @see ConPrintf(), ConResPrintf() and associated functions, ConMsgPrintf(),
- * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).…">FormatMessage() (on MSDN)</a>
+ * <a href="https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-forma…">FormatMessage() (on MSDN)</a>
**/
INT
ConMsgPrintfV(
@@ -1123,7 +1123,7 @@ ConMsgPrintfV(
* Numbers of characters successfully written to @p Stream.
*
* @see ConPrintf(), ConResPrintf() and associated functions, ConMsgPrintfV(),
- * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).…">FormatMessage() (on MSDN)</a>
+ * <a href="https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-forma…">FormatMessage() (on MSDN)</a>
**/
INT
__cdecl
@@ -1212,7 +1212,7 @@ ConMsgPrintf(
* Numbers of characters successfully written to @p Stream.
*
* @see ConPrintf(), ConResPrintf() and associated functions, ConMsgPrintf(),
- * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).…">FormatMessage() (on MSDN)</a>
+ * <a href="https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-forma…">FormatMessage() (on MSDN)</a>
**/
INT
ConResMsgPrintfExV(
@@ -1323,7 +1323,7 @@ ConResMsgPrintfExV(
* Numbers of characters successfully written to @p Stream.
*
* @see ConPrintf(), ConResPrintf() and associated functions, ConMsgPrintf(),
- * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).…">FormatMessage() (on MSDN)</a>
+ * <a href="https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-forma…">FormatMessage() (on MSDN)</a>
**/
INT
ConResMsgPrintfV(
@@ -1387,7 +1387,7 @@ ConResMsgPrintfV(
* Numbers of characters successfully written to @p Stream.
*
* @see ConPrintf(), ConResPrintf() and associated functions, ConMsgPrintf(),
- * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).…">FormatMessage() (on MSDN)</a>
+ * <a href="https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-forma…">FormatMessage() (on MSDN)</a>
**/
INT
__cdecl
@@ -1454,7 +1454,7 @@ ConResMsgPrintfEx(
* Numbers of characters successfully written to @p Stream.
*
* @see ConPrintf(), ConResPrintf() and associated functions, ConMsgPrintf(),
- * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).…">FormatMessage() (on MSDN)</a>
+ * <a href="https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-forma…">FormatMessage() (on MSDN)</a>
**/
INT
__cdecl
diff --git a/sdk/lib/conutils/utils.c b/sdk/lib/conutils/utils.c
index 15c7ac028f4..31fe8951092 100644
--- a/sdk/lib/conutils/utils.c
+++ b/sdk/lib/conutils/utils.c
@@ -247,7 +247,7 @@ K32LoadStringW(
* crash if a malformed source string is retrieved and then being used
* for formatting. It basically wraps calls to FormatMessage() within SEH.
*
- * @see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).…">FormatMessage() (on MSDN)</a>
+ * @see <a href="https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-forma…">FormatMessage() (on MSDN)</a>
**/
DWORD
WINAPI
@@ -290,7 +290,7 @@ FormatMessageSafeW(
* and we did not pass the flag FORMAT_MESSAGE_IGNORE_INSERTS, and the
* message string expected too many inserts.
* In this last case only, we can call again FormatMessage but ignore
- * explicitely the inserts. The string that we will return to the user
+ * explicitly the inserts. The string that we will return to the user
* will not be pre-formatted.
*/
if (((dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) || lpBuffer) &&