From cab720aa2c338db407c4240a90c339f61633997e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 26 Mar 2026 21:14:18 +0100 Subject: [PATCH] [CMDUTILS][NETWORK][LOGOFF][RUNAS][CMD][SYSTEM] Improve imports and headers for some tools --- .../applications/cmdutils/chcp/CMakeLists.txt | 4 +-- .../applications/cmdutils/clip/CMakeLists.txt | 4 +-- base/applications/cmdutils/fc/CMakeLists.txt | 5 ++- .../applications/cmdutils/fc/conutils_noros.h | 33 +++++++++++++++++ base/applications/cmdutils/fc/fc.c | 36 +++---------------- base/applications/cmdutils/fc/fc.h | 18 +++++----- base/applications/cmdutils/fc/resource.h | 2 ++ base/applications/cmdutils/fc/text.h | 2 +- .../applications/cmdutils/help/CMakeLists.txt | 4 +-- base/applications/cmdutils/help/help.c | 1 - .../applications/cmdutils/mode/CMakeLists.txt | 4 +-- base/applications/cmdutils/mode/mode.c | 2 +- base/applications/cmdutils/mode/resource.h | 5 +-- .../cmdutils/timeout/CMakeLists.txt | 4 +-- base/applications/cmdutils/timeout/timeout.c | 2 +- .../applications/cmdutils/tree/CMakeLists.txt | 4 +-- base/applications/cmdutils/tree/tree.rc | 6 ++-- .../cmdutils/where/CMakeLists.txt | 3 +- base/applications/cmdutils/where/resource.h | 2 ++ base/applications/logoff/CMakeLists.txt | 6 ++-- base/applications/logoff/logoff.rc | 6 ++-- .../network/netstat/CMakeLists.txt | 6 ++-- base/applications/network/netstat/netstat.c | 2 -- base/applications/network/netstat/netstat.h | 2 +- .../applications/network/route/CMakeLists.txt | 6 ++-- base/applications/network/route/route.c | 11 +++--- base/applications/network/route/route.rc | 8 ++--- base/applications/rapps/CMakeLists.txt | 9 +++-- base/applications/runas/CMakeLists.txt | 6 ++-- base/applications/runas/resource.h | 2 ++ base/applications/runas/runas.c | 7 ---- base/applications/runas/runas.rc | 6 ++-- base/applications/shutdown/CMakeLists.txt | 8 ++--- base/applications/shutdown/precomp.h | 11 +++--- base/applications/shutdown/shutdown.rc | 6 ++-- base/shell/cmd/CMakeLists.txt | 8 ++--- base/system/chkdsk/CMakeLists.txt | 5 ++- base/system/chkdsk/chkdsk.c | 2 +- base/system/chkdsk/resource.h | 4 +-- base/system/subst/CMakeLists.txt | 6 ++-- base/system/subst/subst.c | 1 - 41 files changed, 121 insertions(+), 148 deletions(-) create mode 100644 base/applications/cmdutils/fc/conutils_noros.h diff --git a/base/applications/cmdutils/chcp/CMakeLists.txt b/base/applications/cmdutils/chcp/CMakeLists.txt index 245b5e0fe2e..3e23bab0f1a 100644 --- a/base/applications/cmdutils/chcp/CMakeLists.txt +++ b/base/applications/cmdutils/chcp/CMakeLists.txt @@ -1,9 +1,7 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(chcp chcp.c chcp.rc) set_module_type(chcp win32cui UNICODE) -target_link_libraries(chcp conutils ${PSEH_LIB}) +target_link_libraries(chcp conutils) add_importlibs(chcp msvcrt kernel32) set_target_properties(chcp PROPERTIES SUFFIX ".com") add_cd_file(TARGET chcp DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/clip/CMakeLists.txt b/base/applications/cmdutils/clip/CMakeLists.txt index f15c2e93101..3a0ecbb9972 100644 --- a/base/applications/cmdutils/clip/CMakeLists.txt +++ b/base/applications/cmdutils/clip/CMakeLists.txt @@ -1,8 +1,6 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(clip clip.c clip.rc) set_module_type(clip win32cui UNICODE) -target_link_libraries(clip conutils ${PSEH_LIB}) +target_link_libraries(clip conutils) add_importlibs(clip advapi32 user32 msvcrt kernel32) add_cd_file(TARGET clip DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/fc/CMakeLists.txt b/base/applications/cmdutils/fc/CMakeLists.txt index 5b91a3bdc7d..d5b3355c557 100644 --- a/base/applications/cmdutils/fc/CMakeLists.txt +++ b/base/applications/cmdutils/fc/CMakeLists.txt @@ -1,7 +1,6 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) add_executable(fc fc.c texta.c textw.c fc.rc) set_module_type(fc win32cui UNICODE) -target_link_libraries(fc conutils ${PSEH_LIB}) -add_importlibs(fc msvcrt shlwapi user32 kernel32) +target_link_libraries(fc conutils) +add_importlibs(fc shlwapi msvcrt kernel32) add_cd_file(TARGET fc DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/fc/conutils_noros.h b/base/applications/cmdutils/fc/conutils_noros.h new file mode 100644 index 00000000000..f00dd685cbb --- /dev/null +++ b/base/applications/cmdutils/fc/conutils_noros.h @@ -0,0 +1,33 @@ + +#pragma once + +#include +#define ConInitStdStreams() /* empty */ +#define StdOut stdout +#define StdErr stderr +void ConPuts(FILE *fp, LPCWSTR psz) +{ + fputws(psz, fp); +} +void ConPrintf(FILE *fp, LPCWSTR psz, ...) +{ + va_list va; + va_start(va, psz); + vfwprintf(fp, psz, va); + va_end(va); +} +void ConResPuts(FILE *fp, UINT nID) +{ + WCHAR sz[MAX_PATH]; + LoadStringW(NULL, nID, sz, _countof(sz)); + fputws(sz, fp); +} +void ConResPrintf(FILE *fp, UINT nID, ...) +{ + va_list va; + WCHAR sz[MAX_PATH]; + va_start(va, nID); + LoadStringW(NULL, nID, sz, _countof(sz)); + vfwprintf(fp, sz, va); + va_end(va); +} diff --git a/base/applications/cmdutils/fc/fc.c b/base/applications/cmdutils/fc/fc.c index 5bcf81d59f6..562cf61994a 100644 --- a/base/applications/cmdutils/fc/fc.c +++ b/base/applications/cmdutils/fc/fc.c @@ -2,43 +2,15 @@ * PROJECT: ReactOS FC Command * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) * PURPOSE: Comparing files - * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com) + * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ */ + #include "fc.h" #ifdef __REACTOS__ - #include +#include #else - #include - #define ConInitStdStreams() /* empty */ - #define StdOut stdout - #define StdErr stderr - void ConPuts(FILE *fp, LPCWSTR psz) - { - fputws(psz, fp); - } - void ConPrintf(FILE *fp, LPCWSTR psz, ...) - { - va_list va; - va_start(va, psz); - vfwprintf(fp, psz, va); - va_end(va); - } - void ConResPuts(FILE *fp, UINT nID) - { - WCHAR sz[MAX_PATH]; - LoadStringW(NULL, nID, sz, _countof(sz)); - fputws(sz, fp); - } - void ConResPrintf(FILE *fp, UINT nID, ...) - { - va_list va; - WCHAR sz[MAX_PATH]; - va_start(va, nID); - LoadStringW(NULL, nID, sz, _countof(sz)); - vfwprintf(fp, sz, va); - va_end(va); - } +#include "conutils_noros.h" #endif #include #include diff --git a/base/applications/cmdutils/fc/fc.h b/base/applications/cmdutils/fc/fc.h index 3d8772e78c7..94678fd863a 100644 --- a/base/applications/cmdutils/fc/fc.h +++ b/base/applications/cmdutils/fc/fc.h @@ -2,20 +2,20 @@ * PROJECT: ReactOS FC Command * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) * PURPOSE: Comparing files - * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com) + * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ */ + #pragma once + #include #include #include -#ifdef __REACTOS__ - #include - #include - #include - #include -#else - #include -#endif + +#include +#include +#include +#include + #include #include "resource.h" diff --git a/base/applications/cmdutils/fc/resource.h b/base/applications/cmdutils/fc/resource.h index d784a77c0de..ae4fdfd10bc 100644 --- a/base/applications/cmdutils/fc/resource.h +++ b/base/applications/cmdutils/fc/resource.h @@ -1,3 +1,5 @@ +#pragma once + #define IDS_USAGE 1000 #define IDS_NO_DIFFERENCE 1001 #define IDS_LONGER_THAN 1002 diff --git a/base/applications/cmdutils/fc/text.h b/base/applications/cmdutils/fc/text.h index 3feb9f79b13..a79c74c2d01 100644 --- a/base/applications/cmdutils/fc/text.h +++ b/base/applications/cmdutils/fc/text.h @@ -2,7 +2,7 @@ * PROJECT: ReactOS FC Command * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) * PURPOSE: Comparing text files - * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com) + * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ */ #include "fc.h" diff --git a/base/applications/cmdutils/help/CMakeLists.txt b/base/applications/cmdutils/help/CMakeLists.txt index 0ffad38fc79..27dd3808bae 100644 --- a/base/applications/cmdutils/help/CMakeLists.txt +++ b/base/applications/cmdutils/help/CMakeLists.txt @@ -1,9 +1,7 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(cmd_help help.c help.rc) set_module_type(cmd_help win32cui UNICODE) -target_link_libraries(cmd_help conutils ${PSEH_LIB}) +target_link_libraries(cmd_help conutils) add_importlibs(cmd_help msvcrt kernel32) set_target_properties(cmd_help PROPERTIES OUTPUT_NAME "help") add_cd_file(TARGET cmd_help DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/help/help.c b/base/applications/cmdutils/help/help.c index 9e6b38c3c91..c4f8a5a4b67 100644 --- a/base/applications/cmdutils/help/help.c +++ b/base/applications/cmdutils/help/help.c @@ -9,7 +9,6 @@ #include -#define WIN32_NO_STATUS #include #include diff --git a/base/applications/cmdutils/mode/CMakeLists.txt b/base/applications/cmdutils/mode/CMakeLists.txt index e5bcbc07f7e..815de5afe81 100644 --- a/base/applications/cmdutils/mode/CMakeLists.txt +++ b/base/applications/cmdutils/mode/CMakeLists.txt @@ -1,9 +1,7 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(mode mode.c mode.rc) set_module_type(mode win32cui UNICODE) -target_link_libraries(mode conutils ${PSEH_LIB}) +target_link_libraries(mode conutils) add_importlibs(mode user32 msvcrt kernel32) set_target_properties(mode PROPERTIES SUFFIX ".com") add_cd_file(TARGET mode DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/mode/mode.c b/base/applications/cmdutils/mode/mode.c index 8cb834b6c23..ef94cd15568 100644 --- a/base/applications/cmdutils/mode/mode.c +++ b/base/applications/cmdutils/mode/mode.c @@ -32,8 +32,8 @@ #include #include -#include #include +#include #include diff --git a/base/applications/cmdutils/mode/resource.h b/base/applications/cmdutils/mode/resource.h index 65b05fa8806..8acb770ddfe 100644 --- a/base/applications/cmdutils/mode/resource.h +++ b/base/applications/cmdutils/mode/resource.h @@ -1,5 +1,4 @@ -#ifndef RESOURCE_H -#define RESOURCE_H +#pragma once #define IDS_USAGE 0 @@ -48,5 +47,3 @@ #define IDS_ERROR_NO_MEMORY 36 #define IDS_ERROR_SCREEN_LINES_COL 37 #define IDS_ERROR_INVALID_CODEPAGE 38 - -#endif /* RESOURCE_H */ diff --git a/base/applications/cmdutils/timeout/CMakeLists.txt b/base/applications/cmdutils/timeout/CMakeLists.txt index c1eb31d927f..a3d8aa8db24 100644 --- a/base/applications/cmdutils/timeout/CMakeLists.txt +++ b/base/applications/cmdutils/timeout/CMakeLists.txt @@ -1,8 +1,6 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(timeout timeout.c timeout.rc) set_module_type(timeout win32cui UNICODE) -target_link_libraries(timeout conutils ${PSEH_LIB}) +target_link_libraries(timeout conutils) add_importlibs(timeout msvcrt kernel32) add_cd_file(TARGET timeout DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/timeout/timeout.c b/base/applications/cmdutils/timeout/timeout.c index 7aaddfbf5ad..c19c194e480 100644 --- a/base/applications/cmdutils/timeout/timeout.c +++ b/base/applications/cmdutils/timeout/timeout.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include diff --git a/base/applications/cmdutils/tree/CMakeLists.txt b/base/applications/cmdutils/tree/CMakeLists.txt index a92572c122d..5e2ffd56c8e 100644 --- a/base/applications/cmdutils/tree/CMakeLists.txt +++ b/base/applications/cmdutils/tree/CMakeLists.txt @@ -1,9 +1,7 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(tree tree.c tree.rc) set_module_type(tree win32cui UNICODE) -target_link_libraries(tree conutils ${PSEH_LIB}) +target_link_libraries(tree conutils) add_importlibs(tree msvcrt kernel32) set_target_properties(tree PROPERTIES SUFFIX ".com") add_cd_file(TARGET tree DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/tree/tree.rc b/base/applications/cmdutils/tree/tree.rc index 506578e6f63..8b08e0a2247 100644 --- a/base/applications/cmdutils/tree/tree.rc +++ b/base/applications/cmdutils/tree/tree.rc @@ -4,9 +4,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Tree Walk Utility" -#define REACTOS_STR_INTERNAL_NAME "tree" -#define REACTOS_STR_ORIGINAL_FILENAME "tree.com" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Tree Walk Utility" +#define REACTOS_STR_INTERNAL_NAME "tree" +#define REACTOS_STR_ORIGINAL_FILENAME "tree.com" #include /* UTF-8 */ diff --git a/base/applications/cmdutils/where/CMakeLists.txt b/base/applications/cmdutils/where/CMakeLists.txt index 790187f06de..bc060c921ca 100644 --- a/base/applications/cmdutils/where/CMakeLists.txt +++ b/base/applications/cmdutils/where/CMakeLists.txt @@ -1,7 +1,6 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) add_executable(where where.c where.rc) set_module_type(where win32cui UNICODE) -target_link_libraries(where conutils ${PSEH_LIB}) +target_link_libraries(where conutils) add_importlibs(where msvcrt kernel32) add_cd_file(TARGET where DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/where/resource.h b/base/applications/cmdutils/where/resource.h index a1dc35e828b..0465b0bd6ea 100644 --- a/base/applications/cmdutils/where/resource.h +++ b/base/applications/cmdutils/where/resource.h @@ -1,3 +1,5 @@ +#pragma once + #define IDS_USAGE 100 #define IDS_BAD_ARG 101 #define IDS_NOT_FOUND 103 diff --git a/base/applications/logoff/CMakeLists.txt b/base/applications/logoff/CMakeLists.txt index 798d0e1d60a..344975f2165 100644 --- a/base/applications/logoff/CMakeLists.txt +++ b/base/applications/logoff/CMakeLists.txt @@ -1,8 +1,6 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(logoff logoff.c logoff.rc) set_module_type(logoff win32cui UNICODE) -target_link_libraries(logoff conutils ${PSEH_LIB}) -add_importlibs(logoff advapi32 user32 msvcrt kernel32) +target_link_libraries(logoff conutils) +add_importlibs(logoff user32 msvcrt kernel32) add_cd_file(TARGET logoff DESTINATION reactos/system32 FOR all) diff --git a/base/applications/logoff/logoff.rc b/base/applications/logoff/logoff.rc index acbc5e64530..2ed111afa58 100644 --- a/base/applications/logoff/logoff.rc +++ b/base/applications/logoff/logoff.rc @@ -2,9 +2,9 @@ #include "resource.h" -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Logoff Utility" -#define REACTOS_STR_INTERNAL_NAME "logoff" -#define REACTOS_STR_ORIGINAL_FILENAME "logoff.exe" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Logoff Utility" +#define REACTOS_STR_INTERNAL_NAME "logoff" +#define REACTOS_STR_ORIGINAL_FILENAME "logoff.exe" #include /* UTF-8 */ diff --git a/base/applications/network/netstat/CMakeLists.txt b/base/applications/network/netstat/CMakeLists.txt index de2a8dbb4a8..12624fe592e 100644 --- a/base/applications/network/netstat/CMakeLists.txt +++ b/base/applications/network/netstat/CMakeLists.txt @@ -1,8 +1,6 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(netstat netstat.c netstat.rc) set_module_type(netstat win32cui UNICODE) -target_link_libraries(netstat conutils ${PSEH_LIB}) -add_importlibs(netstat user32 ws2_32 snmpapi iphlpapi msvcrt kernel32) +target_link_libraries(netstat conutils) +add_importlibs(netstat ws2_32 snmpapi iphlpapi msvcrt kernel32) add_cd_file(TARGET netstat DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/netstat/netstat.c b/base/applications/network/netstat/netstat.c index 22ab9385c09..b248d81592d 100644 --- a/base/applications/network/netstat/netstat.c +++ b/base/applications/network/netstat/netstat.c @@ -14,10 +14,8 @@ #include #include -#define WIN32_NO_STATUS #include #include -#define _INC_WINDOWS #include #include diff --git a/base/applications/network/netstat/netstat.h b/base/applications/network/netstat/netstat.h index 2b9458cd36f..f4a25829751 100644 --- a/base/applications/network/netstat/netstat.h +++ b/base/applications/network/netstat/netstat.h @@ -3,7 +3,7 @@ /* Maximum string lengths for ASCII ip address and port names */ #define HOSTNAMELEN 256 #define PORTNAMELEN 256 -#define ADDRESSLEN HOSTNAMELEN+PORTNAMELEN +#define ADDRESSLEN (HOSTNAMELEN + PORTNAMELEN) /* command line options */ BOOL bNoOptions = FALSE; // print default diff --git a/base/applications/network/route/CMakeLists.txt b/base/applications/network/route/CMakeLists.txt index 0a5a04fc2e3..69d894dfcb2 100644 --- a/base/applications/network/route/CMakeLists.txt +++ b/base/applications/network/route/CMakeLists.txt @@ -1,8 +1,6 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(route route.c route.rc) set_module_type(route win32cui UNICODE) -target_link_libraries(route conutils ${PSEH_LIB}) -add_importlibs(route ws2_32 iphlpapi msvcrt advapi32 kernel32 ntdll) +target_link_libraries(route conutils) +add_importlibs(route ws2_32 iphlpapi advapi32 msvcrt kernel32 ntdll) ## ntdll for RtlIpv* add_cd_file(TARGET route DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/route/route.c b/base/applications/network/route/route.c index 948239487c5..1706a55fee0 100644 --- a/base/applications/network/route/route.c +++ b/base/applications/network/route/route.c @@ -11,19 +11,19 @@ * Flexible, simple */ -#define WIN32_NO_STATUS #include +#include #include +#include + #include #include #include -#include -#include -#define _INC_WINDOWS #include #include #include #include + #include #include "resource.h" @@ -299,6 +299,9 @@ FormatIPv4Address( if (Ptr->Address.lpSockaddr->sa_family == AF_INET) { struct sockaddr_in *si = (struct sockaddr_in *)(Ptr->Address.lpSockaddr); + // DWORD dwStrLen = IPV4_ADDR_STRING_MAX_LEN; + // WSAAddressToStringW(Ptr->Address.lpSockaddr, (DWORD)Ptr->Address.iSockaddrLength, NULL, pBuffer, &dwStrLen); + // (void)InetNtopW(AF_INET, &(si->sin_addr), pBuffer, IPV4_ADDR_STRING_MAX_LEN); RtlIpv4AddressToStringW(&(si->sin_addr), pBuffer); return; } diff --git a/base/applications/network/route/route.rc b/base/applications/network/route/route.rc index d4a5aeca965..e6aad4c70c1 100644 --- a/base/applications/network/route/route.rc +++ b/base/applications/network/route/route.rc @@ -2,10 +2,10 @@ #include "resource.h" -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS TCP/IPv4 Win32 Route" -#define REACTOS_STR_INTERNAL_NAME "route" -#define REACTOS_STR_ORIGINAL_FILENAME "route.exe" -#define REACTOS_STR_ORIGINAL_COPYRIGHT "Art Yerkes (arty@users.sourceforge.net)" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS TCP/IPv4 Win32 Route" +#define REACTOS_STR_INTERNAL_NAME "route" +#define REACTOS_STR_ORIGINAL_FILENAME "route.exe" +#define REACTOS_STR_ORIGINAL_COPYRIGHT "Art Yerkes (arty@users.sourceforge.net)" #include /* UTF-8 */ diff --git a/base/applications/rapps/CMakeLists.txt b/base/applications/rapps/CMakeLists.txt index dc082c60803..de364395b6c 100644 --- a/base/applications/rapps/CMakeLists.txt +++ b/base/applications/rapps/CMakeLists.txt @@ -1,8 +1,7 @@ project(rapps) -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/cryptlib) -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) include_directories( + ${REACTOS_SOURCE_DIR}/sdk/lib/cryptlib ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib ${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/zlib/contrib) include_directories(include) @@ -48,10 +47,10 @@ add_definitions( file(GLOB_RECURSE rapps_rc_deps res/*.*) add_rc_deps(rapps.rc ${rapps_rc_deps}) add_executable(rapps ${SOURCE} rapps.rc) -set_module_type(rapps win32gui UNICODE) -target_link_libraries(rapps conutils ${PSEH_LIB} uuid cpprt atl_classes minizip zlib) -add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi ole32 setupapi gdiplus msvcrt kernel32 ntdll) add_pch(rapps include/rapps.h SOURCE) +set_module_type(rapps win32gui UNICODE) +target_link_libraries(rapps conutils uuid cpprt atl_classes minizip zlib) +add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi ole32 setupapi gdiplus msvcrt kernel32 ntdll) add_dependencies(rapps rappsmsg) add_message_headers(ANSI rappsmsg.mc) add_cd_file(TARGET rapps DESTINATION reactos/system32 FOR all) diff --git a/base/applications/runas/CMakeLists.txt b/base/applications/runas/CMakeLists.txt index 0bc636230f3..fde0319a721 100644 --- a/base/applications/runas/CMakeLists.txt +++ b/base/applications/runas/CMakeLists.txt @@ -1,8 +1,6 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(runas runas.c runas.rc) set_module_type(runas win32cui UNICODE) -target_link_libraries(runas conutils ${PSEH_LIB}) -add_importlibs(runas advapi32 msvcrt kernel32 ntdll) +target_link_libraries(runas conutils) +add_importlibs(runas advapi32 msvcrt kernel32) add_cd_file(TARGET runas DESTINATION reactos/system32 FOR all) diff --git a/base/applications/runas/resource.h b/base/applications/runas/resource.h index 2248cf31188..95cf266791f 100644 --- a/base/applications/runas/resource.h +++ b/base/applications/runas/resource.h @@ -1,3 +1,5 @@ +#pragma once + #define IDS_USAGE01 7000 #define IDS_USAGE02 7001 #define IDS_USAGE03 7002 diff --git a/base/applications/runas/runas.c b/base/applications/runas/runas.c index 4291a1d9621..2f645649116 100644 --- a/base/applications/runas/runas.c +++ b/base/applications/runas/runas.c @@ -20,9 +20,6 @@ #include "resource.h" -#define NDEBUG -#include - #define MAX_PASSWORD_LENGTH 64 static @@ -257,10 +254,6 @@ wmain( dwLogonFlags &= ~LOGON_WITH_PROFILE; } - DPRINT("User: %S\n", pszUserName); - DPRINT("Domain: %S\n", pszDomain); - DPRINT("CommandLine: %S\n", pszCommandLine); - if (pszDomain == NULL) { DWORD dwLength = MAX_COMPUTERNAME_LENGTH + 1; diff --git a/base/applications/runas/runas.rc b/base/applications/runas/runas.rc index c438b657ae1..9905027e043 100644 --- a/base/applications/runas/runas.rc +++ b/base/applications/runas/runas.rc @@ -6,9 +6,9 @@ /* Define language neutral resources */ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#define REACTOS_STR_FILE_DESCRIPTION "Run As Utility" -#define REACTOS_STR_INTERNAL_NAME "runas" -#define REACTOS_STR_ORIGINAL_FILENAME "runas.exe" +#define REACTOS_STR_FILE_DESCRIPTION "Run As Utility" +#define REACTOS_STR_INTERNAL_NAME "runas" +#define REACTOS_STR_ORIGINAL_FILENAME "runas.exe" #include #include diff --git a/base/applications/shutdown/CMakeLists.txt b/base/applications/shutdown/CMakeLists.txt index 7f91d250ba5..05379e0da30 100644 --- a/base/applications/shutdown/CMakeLists.txt +++ b/base/applications/shutdown/CMakeLists.txt @@ -1,6 +1,4 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - list(APPEND SOURCE gui.c misc.c @@ -8,8 +6,8 @@ list(APPEND SOURCE precomp.h) add_executable(shutdown ${SOURCE} shutdown.rc) -set_module_type(shutdown win32cui UNICODE) -target_link_libraries(shutdown conutils ${PSEH_LIB}) -add_importlibs(shutdown advapi32 user32 powrprof msvcrt kernel32) add_pch(shutdown precomp.h SOURCE) +set_module_type(shutdown win32cui UNICODE) +target_link_libraries(shutdown conutils) +add_importlibs(shutdown advapi32 powrprof user32 msvcrt kernel32) add_cd_file(TARGET shutdown DESTINATION reactos/system32 FOR all) diff --git a/base/applications/shutdown/precomp.h b/base/applications/shutdown/precomp.h index a63cc470a5c..57ce3233380 100644 --- a/base/applications/shutdown/precomp.h +++ b/base/applications/shutdown/precomp.h @@ -1,5 +1,10 @@ -#ifndef __SHUTDOWN_PRECOMP_H -#define __SHUTDOWN_PRECOMP_H +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS shutdown/logoff utility + * PURPOSE: Precompiled header + */ + +#pragma once /* INCLUDES ******************************************************************/ @@ -57,5 +62,3 @@ VOID DisplayError(DWORD dwError); /* gui.c */ BOOL ShutdownGuiMain(struct CommandLineOptions opts); - -#endif /* __SHUTDOWN_PRECOMP_H */ diff --git a/base/applications/shutdown/shutdown.rc b/base/applications/shutdown/shutdown.rc index 18cb3105c0a..19b99f534e9 100644 --- a/base/applications/shutdown/shutdown.rc +++ b/base/applications/shutdown/shutdown.rc @@ -6,9 +6,9 @@ /* Define language neutral resources */ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Shutdown Utility" -#define REACTOS_STR_INTERNAL_NAME "shutdown" -#define REACTOS_STR_ORIGINAL_FILENAME "shutdown.exe" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Shutdown Utility" +#define REACTOS_STR_INTERNAL_NAME "shutdown" +#define REACTOS_STR_ORIGINAL_FILENAME "shutdown.exe" #include #include diff --git a/base/shell/cmd/CMakeLists.txt b/base/shell/cmd/CMakeLists.txt index 991bb758c8f..17fa1b61b4a 100644 --- a/base/shell/cmd/CMakeLists.txt +++ b/base/shell/cmd/CMakeLists.txt @@ -1,6 +1,4 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - list(APPEND SOURCE alias.c assoc.c @@ -65,7 +63,7 @@ add_rc_deps(cmd.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/terminal.ico) add_executable(cmd ${SOURCE} cmd.rc) add_pch(cmd precomp.h SOURCE) set_module_type(cmd win32cui UNICODE) -target_link_libraries(cmd wine) -target_link_libraries(cmd conutils ${PSEH_LIB}) -add_importlibs(cmd advapi32 user32 msvcrt kernel32 ntdll) +target_link_libraries(cmd conutils wine) +add_importlibs(cmd advapi32 msvcrt kernel32 ntdll) +add_delay_importlibs(cmd user32) add_cd_file(TARGET cmd DESTINATION reactos/system32 FOR all) diff --git a/base/system/chkdsk/CMakeLists.txt b/base/system/chkdsk/CMakeLists.txt index c89a29cdcf4..6de5d302d33 100644 --- a/base/system/chkdsk/CMakeLists.txt +++ b/base/system/chkdsk/CMakeLists.txt @@ -1,9 +1,8 @@ include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/fmifs) -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) add_executable(chkdsk chkdsk.c chkdsk.rc) set_module_type(chkdsk win32cui UNICODE) -target_link_libraries(chkdsk conutils ${PSEH_LIB}) -add_importlibs(chkdsk fmifs msvcrt kernel32 ntdll) +target_link_libraries(chkdsk conutils) +add_importlibs(chkdsk fmifs msvcrt kernel32) add_cd_file(TARGET chkdsk DESTINATION reactos/system32 FOR all) diff --git a/base/system/chkdsk/chkdsk.c b/base/system/chkdsk/chkdsk.c index 6fc25f7268d..644f5f55da1 100644 --- a/base/system/chkdsk/chkdsk.c +++ b/base/system/chkdsk/chkdsk.c @@ -88,7 +88,7 @@ PCHKDSK Chkdsk; // Takes the win32 error code and prints the text version. // //---------------------------------------------------------------------- -static VOID PrintWin32Error(int Message, DWORD ErrorCode) +static VOID PrintWin32Error(UINT Message, DWORD ErrorCode) { ConResPuts(StdErr, Message); ConMsgPuts(StdErr, FORMAT_MESSAGE_FROM_SYSTEM, diff --git a/base/system/chkdsk/resource.h b/base/system/chkdsk/resource.h index a5597ddbeb1..e44abe9754b 100644 --- a/base/system/chkdsk/resource.h +++ b/base/system/chkdsk/resource.h @@ -1,12 +1,12 @@ -/* General IDs */ +#pragma once +/* General IDs */ #define IDS_USAGE 101 #define IDS_PERCENT_COMPL 102 #define IDS_ABOUT 103 #define IDS_FILE_SYSTEM 104 /* Failure IDs */ - #define IDS_VOLUME_IN_USE 200 #define IDS_CHKDSK_FAIL 201 #define IDS_NO_ENTRY_POINT 202 diff --git a/base/system/subst/CMakeLists.txt b/base/system/subst/CMakeLists.txt index 7531f5daa03..42b4ff33b50 100644 --- a/base/system/subst/CMakeLists.txt +++ b/base/system/subst/CMakeLists.txt @@ -1,8 +1,6 @@ -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(subst subst.c subst.rc) set_module_type(subst win32cui UNICODE) -target_link_libraries(subst conutils ${PSEH_LIB}) -add_importlibs(subst msvcrt kernel32 ntdll) +target_link_libraries(subst conutils) +add_importlibs(subst msvcrt kernel32) add_cd_file(TARGET subst DESTINATION reactos/system32 FOR all) diff --git a/base/system/subst/subst.c b/base/system/subst/subst.c index d8b62e1e569..ab7e4b7e82e 100644 --- a/base/system/subst/subst.c +++ b/base/system/subst/subst.c @@ -12,7 +12,6 @@ #include -#define WIN32_NO_STATUS #include #include