https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3647f6a5eb633b52ef4bf…
commit 3647f6a5eb633b52ef4bf1db6e43fc2b3fc72969
Author: Vitaly Orekhov <7opex0(a)mail.ru>
AuthorDate: Wed Sep 14 15:10:37 2022 +0300
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Sep 14 15:10:37 2022 +0300
[LOGONUI] Make Logon UI compilable again (#4684)
Logon UI was excluded from CMake build, probably for not being compliant
with 'warnings are errors' standard introduced at some point.
In the future, I would probably try to make Logon UI usable
alongside with the classic msgina interface.
- Add logonui back to CMakeLists
- Replace 'wcscpy_s' Vista+ function with StringCchCopyW
- Exclude some unused functions
Signed-off-by: Vitaly Orekhov <crce2000(a)mail.ru>
Reviewed-by: Stanislav Motylkov <x86corez(a)gmail.com>
Reviewed-by: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
---
base/system/CMakeLists.txt | 1 +
base/system/logonui/CMakeLists.txt | 5 +++++
base/system/logonui/NT5design.c | 5 ++---
base/system/logonui/logonui.c | 2 ++
4 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/base/system/CMakeLists.txt b/base/system/CMakeLists.txt
index e8372153e04..8e82b217bae 100644
--- a/base/system/CMakeLists.txt
+++ b/base/system/CMakeLists.txt
@@ -6,6 +6,7 @@ add_subdirectory(diskpart)
add_subdirectory(dllhost)
add_subdirectory(expand)
add_subdirectory(format)
+add_subdirectory(logonui)
add_subdirectory(lsass)
add_subdirectory(msiexec)
add_subdirectory(regsvr32)
diff --git a/base/system/logonui/CMakeLists.txt b/base/system/logonui/CMakeLists.txt
new file mode 100644
index 00000000000..e3221cc065d
--- /dev/null
+++ b/base/system/logonui/CMakeLists.txt
@@ -0,0 +1,5 @@
+
+add_executable(logonui logonui.c NT5design.c logonui.rc)
+set_module_type(logonui win32gui UNICODE)
+add_importlibs(logonui gdi32 user32 msimg32 shell32 msvcrt kernel32)
+add_cd_file(TARGET logonui DESTINATION reactos/system32 FOR all)
diff --git a/base/system/logonui/NT5design.c b/base/system/logonui/NT5design.c
index abf385c4eab..df9c3bf5a3b 100644
--- a/base/system/logonui/NT5design.c
+++ b/base/system/logonui/NT5design.c
@@ -6,6 +6,7 @@
*/
#include "logonui.h"
+#include <strsafe.h>
/* GLOBALS ******************************************************************/
@@ -30,7 +31,7 @@ NT5_DrawLogoffCaptionText(LPWSTR lpText,
LogFont.lfCharSet = DEFAULT_CHARSET;
LogFont.lfHeight = 22;
LogFont.lfWeight = 109; // From WinXP disassembly
- wcscpy_s(LogFont.lfFaceName, LF_FACESIZE, L"Arial");
+ StringCchCopyW(LogFont.lfFaceName, _countof(LogFont.lfFaceName),
L"Arial");
/* Create it */
hFont = CreateFontIndirectW(&LogFont);
@@ -136,8 +137,6 @@ NT5_DrawBaseBackground(HDC hdcDesktop)
{
HBITMAP hBitmap = NULL;
HDC hdcMem = NULL;
- BOOL bRet = FALSE;
-
/* Create an an off screen DC to match the desktop DC */
hdcMem = CreateCompatibleDC(hdcDesktop);
diff --git a/base/system/logonui/logonui.c b/base/system/logonui/logonui.c
index ad4a1eecc9f..483c5111f19 100644
--- a/base/system/logonui/logonui.c
+++ b/base/system/logonui/logonui.c
@@ -37,6 +37,7 @@ DrawLogoffScreen(HDC hdcMem)
NT5_CreateLogoffScreen(L"Saving your settings...", hdcMem);
}
+#if 0
static ULONG
GetULONG(LPWSTR String)
{
@@ -81,6 +82,7 @@ GetULONG2(LPWSTR String1, LPWSTR String2, PINT i)
return Value;
}
+#endif
static BOOL
ParseCmdline(int argc, WCHAR* argv[])