https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f07741e6316f0ae677c11e...
commit f07741e6316f0ae677c11e1db008b8c84e6cfe5b Author: Kyle Katarn 112266950+KRosUser@users.noreply.github.com AuthorDate: Sat Sep 3 17:19:41 2022 +0200 Commit: GitHub noreply@github.com CommitDate: Sat Sep 3 17:19:41 2022 +0200
[USRMGR] Replace old (leftover) debug MessageBox with Wine trace macros (#4640)
Remove leftover of debug code. CORE-18276 --- dll/cpl/usrmgr/CMakeLists.txt | 1 + dll/cpl/usrmgr/groupprops.c | 5 ++--- dll/cpl/usrmgr/misc.c | 14 -------------- dll/cpl/usrmgr/userprops.c | 6 +++--- dll/cpl/usrmgr/usrmgr.h | 12 +++++++++--- 5 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/dll/cpl/usrmgr/CMakeLists.txt b/dll/cpl/usrmgr/CMakeLists.txt index 7d5ce655493..4606e8a1eff 100644 --- a/dll/cpl/usrmgr/CMakeLists.txt +++ b/dll/cpl/usrmgr/CMakeLists.txt @@ -21,6 +21,7 @@ add_library(usrmgr MODULE ${CMAKE_CURRENT_BINARY_DIR}/usrmgr.def)
set_module_type(usrmgr cpl UNICODE) +target_link_libraries(usrmgr wine) add_importlibs(usrmgr advapi32 user32 gdi32 comctl32 netapi32 msvcrt kernel32 ntdll) add_pch(usrmgr usrmgr.h SOURCE) add_cd_file(TARGET usrmgr DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/usrmgr/groupprops.c b/dll/cpl/usrmgr/groupprops.c index ea693ee9380..ec82e1e1d2a 100644 --- a/dll/cpl/usrmgr/groupprops.c +++ b/dll/cpl/usrmgr/groupprops.c @@ -173,8 +173,7 @@ AddSelectedUsersToGroup(HWND hwndDlg, nItem, 0, szUserName, UNLEN + 1); - - DebugPrintf(_TEXT("Selected user: %s"), szUserName); + TRACE("Selected user: %s", dbgstrx(szUserName));
memberInfo.lgrmi3_domainandname = szUserName;
@@ -516,7 +515,7 @@ SetGeneralGroupData(HWND hwndDlg, status = NetLocalGroupSetInfo(NULL, pGroupData->szGroupName, 1, (LPBYTE)&groupInfo, &dwIndex); if (status != NERR_Success) { - DebugPrintf(_T("Status: %lu Index: %lu"), status, dwIndex); + ERR("NetLocalGroupSetInfo failed. Status: %lu Index: %lu", status, dwIndex); }
if (pszComment) diff --git a/dll/cpl/usrmgr/misc.c b/dll/cpl/usrmgr/misc.c index 0cc56a8dc9a..c6f9bd30191 100644 --- a/dll/cpl/usrmgr/misc.c +++ b/dll/cpl/usrmgr/misc.c @@ -9,20 +9,6 @@
#include "usrmgr.h"
-VOID -DebugPrintf(LPTSTR szFormat, ...) -{ - TCHAR szOut[512]; - va_list arg_ptr; - - - va_start (arg_ptr, szFormat); - _vstprintf (szOut, szFormat, arg_ptr); - va_end (arg_ptr); - - MessageBox(NULL, szOut, _T("Debug"), MB_OK); -} - BOOL CheckAccountName(HWND hwndDlg, INT nIdDlgItem, diff --git a/dll/cpl/usrmgr/userprops.c b/dll/cpl/usrmgr/userprops.c index 0e213276e99..bc013522714 100644 --- a/dll/cpl/usrmgr/userprops.c +++ b/dll/cpl/usrmgr/userprops.c @@ -167,7 +167,7 @@ SetUserProfileData(HWND hwndDlg, status = NetUserSetInfo(NULL, pUserData->szUserName, 3, (LPBYTE)pUserInfo, &dwIndex); if (status != NERR_Success) { - DebugPrintf(_T("Status: %lu Index: %lu"), status, dwIndex); + ERR("NetUserSetInfo failed. Status: %lu Index: %lu", status, dwIndex); }
if (pszProfilePath) @@ -476,7 +476,7 @@ AddSelectedGroupsToUser(HWND hwndDlg, (LPBYTE)&memberInfo, 1); if (status == NERR_Success) { - DebugPrintf(_TEXT("Selected group: %s"), szGroupName); + TRACE("Selected group: %s", dbgstrx(szGroupName)); bResult = TRUE; } else @@ -784,7 +784,7 @@ SetUserGeneralData(HWND hwndDlg, status = NetUserSetInfo(NULL, pUserData->szUserName, 3, (LPBYTE)pUserInfo, &dwIndex); if (status != NERR_Success) { - DebugPrintf(_T("Status: %lu Index: %lu"), status, dwIndex); + ERR("NetUserSetInfo failed. Status: %lu Index: %lu", status, dwIndex); }
if (pszFullName) diff --git a/dll/cpl/usrmgr/usrmgr.h b/dll/cpl/usrmgr/usrmgr.h index f212eac9615..5f9c12ea191 100644 --- a/dll/cpl/usrmgr/usrmgr.h +++ b/dll/cpl/usrmgr/usrmgr.h @@ -2,6 +2,15 @@ #define _USRMGR_H
#include <stdarg.h> +#include <wine/debug.h> + +WINE_DEFAULT_DEBUG_CHANNEL(usrmgr); + +#ifdef UNICODE +#define dbgstrx(x) wine_dbgstr_w(x) +#else +#define dbgstrx(x) (const char*)(x) +#endif
#define WIN32_NO_STATUS #include <windef.h> @@ -36,9 +45,6 @@ BOOL GroupProperties(HWND hwndDlg);
/* misc.c */ -VOID -DebugPrintf(LPTSTR szFormat, ...); - BOOL CheckAccountName(HWND hwndDlg, INT nIdDlgItem,