mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 17:10:22 +00:00
[NET] Improve displaying status message (#4096)
- Simplify conditions - Add application error translation function [NET][MC] Add missing Russian (ru-RU) translation
This commit is contained in:
parent
cde6339155
commit
073607c237
4 changed files with 30 additions and 13 deletions
|
@ -1218,13 +1218,13 @@ cmdUser(
|
||||||
if (lpUserName == NULL && lpPassword == NULL)
|
if (lpUserName == NULL && lpPassword == NULL)
|
||||||
{
|
{
|
||||||
Status = EnumerateUsers();
|
Status = EnumerateUsers();
|
||||||
ConPrintf(StdOut, L"Status: %lu\n", Status);
|
PrintMessageString(TranslateAppMessage(Status));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (lpUserName != NULL && lpPassword == NULL && argc == 3)
|
else if (lpUserName != NULL && lpPassword == NULL && argc == 3)
|
||||||
{
|
{
|
||||||
Status = DisplayUser(lpUserName);
|
Status = DisplayUser(lpUserName);
|
||||||
ConPrintf(StdOut, L"Status: %lu\n", Status);
|
PrintMessageString(TranslateAppMessage(Status));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1250,12 +1250,12 @@ cmdUser(
|
||||||
(LPBYTE*)&pUserInfo);
|
(LPBYTE*)&pUserInfo);
|
||||||
if (Status != NERR_Success)
|
if (Status != NERR_Success)
|
||||||
{
|
{
|
||||||
ConPrintf(StdOut, L"Status: %lu\n", Status);
|
PrintMessageString(TranslateAppMessage(Status));
|
||||||
result = 1;
|
result = 1;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (bAdd && !bDelete)
|
else if (bAdd)
|
||||||
{
|
{
|
||||||
/* Add the user */
|
/* Add the user */
|
||||||
ZeroMemory(&UserInfo, sizeof(USER_INFO_4));
|
ZeroMemory(&UserInfo, sizeof(USER_INFO_4));
|
||||||
|
@ -1410,7 +1410,7 @@ cmdUser(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ConPrintf(StdOut, L"Status %lu\n\n", Status);
|
PrintMessageString(TranslateAppMessage(Status));
|
||||||
result = 1;
|
result = 1;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -1426,25 +1426,24 @@ cmdUser(
|
||||||
4,
|
4,
|
||||||
(LPBYTE)pUserInfo,
|
(LPBYTE)pUserInfo,
|
||||||
NULL);
|
NULL);
|
||||||
ConPrintf(StdOut, L"Status: %lu\n", Status);
|
|
||||||
}
|
}
|
||||||
else if (bAdd && !bDelete)
|
else if (bAdd)
|
||||||
{
|
{
|
||||||
/* Add the user */
|
/* Add the user */
|
||||||
Status = NetUserAdd(NULL,
|
Status = NetUserAdd(NULL,
|
||||||
4,
|
4,
|
||||||
(LPBYTE)pUserInfo,
|
(LPBYTE)pUserInfo,
|
||||||
NULL);
|
NULL);
|
||||||
ConPrintf(StdOut, L"Status: %lu\n", Status);
|
|
||||||
}
|
}
|
||||||
else if (!bAdd && bDelete)
|
else if (bDelete)
|
||||||
{
|
{
|
||||||
/* Delete the user */
|
/* Delete the user */
|
||||||
Status = NetUserDel(NULL,
|
Status = NetUserDel(NULL,
|
||||||
lpUserName);
|
lpUserName);
|
||||||
ConPrintf(StdOut, L"Status: %lu\n", Status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PrintMessageString(TranslateAppMessage(Status));
|
||||||
|
|
||||||
if (Status == NERR_Success &&
|
if (Status == NERR_Success &&
|
||||||
lpPassword != NULL &&
|
lpPassword != NULL &&
|
||||||
bRandomPassword == TRUE)
|
bRandomPassword == TRUE)
|
||||||
|
|
|
@ -75,6 +75,20 @@ PrintPadding(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DWORD
|
||||||
|
TranslateAppMessage(
|
||||||
|
DWORD dwMessage)
|
||||||
|
{
|
||||||
|
switch (dwMessage)
|
||||||
|
{
|
||||||
|
case NERR_Success:
|
||||||
|
return 3500; // APPERR_3500
|
||||||
|
case ERROR_MORE_DATA:
|
||||||
|
return 3513; // APPERR_3513
|
||||||
|
}
|
||||||
|
return dwMessage;
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
PrintMessageStringV(
|
PrintMessageStringV(
|
||||||
DWORD dwMessage,
|
DWORD dwMessage,
|
||||||
|
|
|
@ -38,6 +38,10 @@ PrintPadding(
|
||||||
WCHAR chr,
|
WCHAR chr,
|
||||||
INT nPaddedLength);
|
INT nPaddedLength);
|
||||||
|
|
||||||
|
DWORD
|
||||||
|
TranslateAppMessage(
|
||||||
|
DWORD dwMessage);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
PrintMessageString(
|
PrintMessageString(
|
||||||
DWORD dwMessage);
|
DWORD dwMessage);
|
||||||
|
|
|
@ -2409,7 +2409,7 @@ Language=Romanian
|
||||||
The user name could not be found.
|
The user name could not be found.
|
||||||
.
|
.
|
||||||
Language=Russian
|
Language=Russian
|
||||||
The user name could not be found.
|
Не найдено имя пользователя.
|
||||||
.
|
.
|
||||||
Language=Spanish
|
Language=Spanish
|
||||||
The user name could not be found.
|
The user name could not be found.
|
||||||
|
@ -2467,7 +2467,7 @@ Language=Romanian
|
||||||
The group already exists.
|
The group already exists.
|
||||||
.
|
.
|
||||||
Language=Russian
|
Language=Russian
|
||||||
The group already exists.
|
Указанная группа уже существует.
|
||||||
.
|
.
|
||||||
Language=Spanish
|
Language=Spanish
|
||||||
The group already exists.
|
The group already exists.
|
||||||
|
@ -2496,7 +2496,7 @@ Language=Romanian
|
||||||
The account already exists.
|
The account already exists.
|
||||||
.
|
.
|
||||||
Language=Russian
|
Language=Russian
|
||||||
The account already exists.
|
Учётная запись уже существует.
|
||||||
.
|
.
|
||||||
Language=Spanish
|
Language=Spanish
|
||||||
The account already exists.
|
The account already exists.
|
||||||
|
|
Loading…
Reference in a new issue