https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3031de8eeda1cb368cc03…
commit 3031de8eeda1cb368cc037018f30a5d5d5ec2654
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Mon Apr 2 23:13:50 2018 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Mon Apr 2 23:13:50 2018 +0200
[NET] Implement the NET CONFIG WORKSTATION command
---
base/applications/network/net/cmdConfig.c | 76 ++++++++++++++++++++++++++++-
base/applications/network/net/lang/en-US.rc | 9 +++-
base/applications/network/net/lang/es-ES.rc | 9 +++-
base/applications/network/net/lang/ro-RO.rc | 9 +++-
base/applications/network/net/lang/ru-RU.rc | 9 +++-
base/applications/network/net/lang/tr-TR.rc | 9 +++-
base/applications/network/net/lang/zh-CN.rc | 9 +++-
base/applications/network/net/lang/zh-TW.rc | 9 +++-
base/applications/network/net/resource.h | 25 ++++++----
9 files changed, 146 insertions(+), 18 deletions(-)
diff --git a/base/applications/network/net/cmdConfig.c
b/base/applications/network/net/cmdConfig.c
index bc84a877af..e4f65cfc23 100644
--- a/base/applications/network/net/cmdConfig.c
+++ b/base/applications/network/net/cmdConfig.c
@@ -36,10 +36,13 @@ DisplayServerConfig(VOID)
ConPrintf(StdOut, L"%s\n\n", ServerInfo->sv102_comment);
PrintPaddedResourceString(IDS_CONFIG_SERVER_VERSION, nPaddedLength);
- ConPuts(StdOut, L"...\n");
+ ConPrintf(StdOut, L"%lu.%lu\n",
+ ServerInfo->sv102_version_major,
+ ServerInfo->sv102_version_minor);
ConResPuts(StdOut, IDS_CONFIG_SERVER_ACTIVE);
- for (i = 0; i < dwTotal; i++)
+ ConPuts(StdOut, L"\n");
+ for (i = 0; i < dwRead; i++)
{
ConPrintf(StdOut, L" %s (%s)\n",
&TransportInfo[i].svti0_transportname[8],
@@ -78,6 +81,75 @@ static
INT
DisplayWorkstationConfig(VOID)
{
+ PWKSTA_INFO_100 WorkstationInfo = NULL;
+ PWKSTA_USER_INFO_1 UserInfo = NULL;
+ PWKSTA_TRANSPORT_INFO_0 TransportInfo = NULL;
+ DWORD dwRead = 0, dwTotal = 0, i;
+ INT nPaddedLength = 38;
+ NET_API_STATUS Status;
+
+ Status = NetWkstaGetInfo(NULL, 100, (PBYTE*)&WorkstationInfo);
+ if (Status != NERR_Success)
+ goto done;
+
+ Status = NetWkstaUserGetInfo(NULL, 1, (PBYTE*)&UserInfo);
+ if (Status != NERR_Success)
+ goto done;
+
+ Status = NetWkstaTransportEnum(NULL,
+ 0,
+ (PBYTE*)&TransportInfo,
+ MAX_PREFERRED_LENGTH,
+ &dwRead,
+ &dwTotal,
+ NULL);
+ if (Status != NERR_Success)
+ goto done;
+
+ PrintPaddedResourceString(IDS_CONFIG_WORKSTATION_NAME, nPaddedLength);
+ ConPrintf(StdOut, L"\\\\%s\n", WorkstationInfo->wki100_computername);
+
+ PrintPaddedResourceString(IDS_CONFIG_WORKSTATION_FULLNAME, nPaddedLength);
+ ConPuts(StdOut, L"...\n");
+
+ PrintPaddedResourceString(IDS_CONFIG_WORKSTATION_USERNAME, nPaddedLength);
+ ConPrintf(StdOut, L"%s\n", UserInfo->wkui1_username);
+
+ ConPuts(StdOut, L"\n");
+
+ ConResPuts(StdOut, IDS_CONFIG_WORKSTATION_ACTIVE);
+ ConPuts(StdOut, L"\n");
+ for (i = 0; i < dwRead; i++)
+ {
+ ConPrintf(StdOut, L" %s (%s)\n",
+ &TransportInfo[i].wkti0_transport_name[8],
+ TransportInfo[i].wkti0_transport_address);
+ }
+ ConPuts(StdOut, L"\n");
+
+ PrintPaddedResourceString(IDS_CONFIG_WORKSTATION_VERSION, nPaddedLength);
+ ConPrintf(StdOut, L"%lu.%lu\n",
+ WorkstationInfo->wki100_ver_major,
+ WorkstationInfo->wki100_ver_minor);
+
+ ConPuts(StdOut, L"\n");
+
+ PrintPaddedResourceString(IDS_CONFIG_WORKSTATION_DOMAIN, nPaddedLength);
+ ConPrintf(StdOut, L"%s\n", WorkstationInfo->wki100_langroup);
+
+ PrintPaddedResourceString(IDS_CONFIG_WORKSTATION_LOGON, nPaddedLength);
+ ConPrintf(StdOut, L"%s\n", UserInfo->wkui1_logon_domain);
+
+done:
+ if (TransportInfo != NULL)
+ NetApiBufferFree(TransportInfo);
+
+ if (UserInfo != NULL)
+ NetApiBufferFree(UserInfo);
+
+ if (WorkstationInfo != NULL)
+ NetApiBufferFree(WorkstationInfo);
+
return 0;
}
diff --git a/base/applications/network/net/lang/en-US.rc
b/base/applications/network/net/lang/en-US.rc
index 23d498a194..3b89b498a7 100644
--- a/base/applications/network/net/lang/en-US.rc
+++ b/base/applications/network/net/lang/en-US.rc
@@ -168,11 +168,18 @@ service can stop others. Some services cannot be stopped.\n\n"
IDS_CONFIG_SERVER_NAME "Server Name"
IDS_CONFIG_SERVER_COMMENT "Server Comment"
IDS_CONFIG_SERVER_VERSION "Software version"
- IDS_CONFIG_SERVER_ACTIVE "Server is active on\n"
+ IDS_CONFIG_SERVER_ACTIVE "Server is active on"
IDS_CONFIG_SERVER_HIDDEN "Server hidden"
IDS_CONFIG_SERVER_USERS "Maximum Logged On Users"
IDS_CONFIG_SERVER_FILES "Maximum open files per session"
IDS_CONFIG_SERVER_IDLE "Idle session time (min)"
+ IDS_CONFIG_WORKSTATION_NAME "Computer name"
+ IDS_CONFIG_WORKSTATION_FULLNAME "Full Computer name"
+ IDS_CONFIG_WORKSTATION_USERNAME "User name"
+ IDS_CONFIG_WORKSTATION_ACTIVE "Workstation is active on"
+ IDS_CONFIG_WORKSTATION_VERSION "Software version"
+ IDS_CONFIG_WORKSTATION_DOMAIN "Workstation domain"
+ IDS_CONFIG_WORKSTATION_LOGON "Logon domain"
IDS_LOCALGROUP_ALIASES "Aliases for \\\\%s"
IDS_LOCALGROUP_ALIAS_NAME "Alias name"
diff --git a/base/applications/network/net/lang/es-ES.rc
b/base/applications/network/net/lang/es-ES.rc
index 718250baa1..9db547f02e 100644
--- a/base/applications/network/net/lang/es-ES.rc
+++ b/base/applications/network/net/lang/es-ES.rc
@@ -170,11 +170,18 @@ service can stop others. Some services cannot be stopped.\n\n"
IDS_CONFIG_SERVER_NAME "Server Name"
IDS_CONFIG_SERVER_COMMENT "Server Comment"
IDS_CONFIG_SERVER_VERSION "Software version"
- IDS_CONFIG_SERVER_ACTIVE "Server is active on\n"
+ IDS_CONFIG_SERVER_ACTIVE "Server is active on"
IDS_CONFIG_SERVER_HIDDEN "Server hidden"
IDS_CONFIG_SERVER_USERS "Maximum Logged On Users"
IDS_CONFIG_SERVER_FILES "Maximum open files per session"
IDS_CONFIG_SERVER_IDLE "Idle session time (min)"
+ IDS_CONFIG_WORKSTATION_NAME "Computer name"
+ IDS_CONFIG_WORKSTATION_FULLNAME "Full Computer name"
+ IDS_CONFIG_WORKSTATION_USERNAME "User name"
+ IDS_CONFIG_WORKSTATION_ACTIVE "Workstation is active on"
+ IDS_CONFIG_WORKSTATION_VERSION "Software version"
+ IDS_CONFIG_WORKSTATION_DOMAIN "Workstation domain"
+ IDS_CONFIG_WORKSTATION_LOGON "Logon domain"
IDS_LOCALGROUP_ALIASES "Alias de \\\\%s"
IDS_LOCALGROUP_ALIAS_NAME "Nombre del alias"
diff --git a/base/applications/network/net/lang/ro-RO.rc
b/base/applications/network/net/lang/ro-RO.rc
index eae85bcd36..4f0e3e2456 100644
--- a/base/applications/network/net/lang/ro-RO.rc
+++ b/base/applications/network/net/lang/ro-RO.rc
@@ -173,11 +173,18 @@ service can stop others. Some services cannot be stopped.\n\n"
IDS_CONFIG_SERVER_NAME "Server Name"
IDS_CONFIG_SERVER_COMMENT "Server Comment"
IDS_CONFIG_SERVER_VERSION "Software version"
- IDS_CONFIG_SERVER_ACTIVE "Server is active on\n"
+ IDS_CONFIG_SERVER_ACTIVE "Server is active on"
IDS_CONFIG_SERVER_HIDDEN "Server hidden"
IDS_CONFIG_SERVER_USERS "Maximum Logged On Users"
IDS_CONFIG_SERVER_FILES "Maximum open files per session"
IDS_CONFIG_SERVER_IDLE "Idle session time (min)"
+ IDS_CONFIG_WORKSTATION_NAME "Computer name"
+ IDS_CONFIG_WORKSTATION_FULLNAME "Full Computer name"
+ IDS_CONFIG_WORKSTATION_USERNAME "User name"
+ IDS_CONFIG_WORKSTATION_ACTIVE "Workstation is active on"
+ IDS_CONFIG_WORKSTATION_VERSION "Software version"
+ IDS_CONFIG_WORKSTATION_DOMAIN "Workstation domain"
+ IDS_CONFIG_WORKSTATION_LOGON "Logon domain"
IDS_LOCALGROUP_ALIASES "Alias pentru \\\\%s"
IDS_LOCALGROUP_ALIAS_NAME "Nume alias"
diff --git a/base/applications/network/net/lang/ru-RU.rc
b/base/applications/network/net/lang/ru-RU.rc
index 7466edaf34..f60c5ad118 100644
--- a/base/applications/network/net/lang/ru-RU.rc
+++ b/base/applications/network/net/lang/ru-RU.rc
@@ -169,11 +169,18 @@ service can stop others. Some services cannot be stopped.\n\n"
IDS_CONFIG_SERVER_NAME "Server Name"
IDS_CONFIG_SERVER_COMMENT "Server Comment"
IDS_CONFIG_SERVER_VERSION "Software version"
- IDS_CONFIG_SERVER_ACTIVE "Server is active on\n"
+ IDS_CONFIG_SERVER_ACTIVE "Server is active on"
IDS_CONFIG_SERVER_HIDDEN "Server hidden"
IDS_CONFIG_SERVER_USERS "Maximum Logged On Users"
IDS_CONFIG_SERVER_FILES "Maximum open files per session"
IDS_CONFIG_SERVER_IDLE "Idle session time (min)"
+ IDS_CONFIG_WORKSTATION_NAME "Computer name"
+ IDS_CONFIG_WORKSTATION_FULLNAME "Full Computer name"
+ IDS_CONFIG_WORKSTATION_USERNAME "User name"
+ IDS_CONFIG_WORKSTATION_ACTIVE "Workstation is active on"
+ IDS_CONFIG_WORKSTATION_VERSION "Software version"
+ IDS_CONFIG_WORKSTATION_DOMAIN "Workstation domain"
+ IDS_CONFIG_WORKSTATION_LOGON "Logon domain"
IDS_LOCALGROUP_ALIASES "Псевдонимы для \\\\%s"
IDS_LOCALGROUP_ALIAS_NAME "Имя псевдонима"
diff --git a/base/applications/network/net/lang/tr-TR.rc
b/base/applications/network/net/lang/tr-TR.rc
index 2fd0e2f4d7..a9a3863424 100644
--- a/base/applications/network/net/lang/tr-TR.rc
+++ b/base/applications/network/net/lang/tr-TR.rc
@@ -169,11 +169,18 @@ service can stop others. Some services cannot be stopped.\n\n"
IDS_CONFIG_SERVER_NAME "Server Name"
IDS_CONFIG_SERVER_COMMENT "Server Comment"
IDS_CONFIG_SERVER_VERSION "Software version"
- IDS_CONFIG_SERVER_ACTIVE "Server is active on\n"
+ IDS_CONFIG_SERVER_ACTIVE "Server is active on"
IDS_CONFIG_SERVER_HIDDEN "Server hidden"
IDS_CONFIG_SERVER_USERS "Maximum Logged On Users"
IDS_CONFIG_SERVER_FILES "Maximum open files per session"
IDS_CONFIG_SERVER_IDLE "Idle session time (min)"
+ IDS_CONFIG_WORKSTATION_NAME "Computer name"
+ IDS_CONFIG_WORKSTATION_FULLNAME "Full Computer name"
+ IDS_CONFIG_WORKSTATION_USERNAME "User name"
+ IDS_CONFIG_WORKSTATION_ACTIVE "Workstation is active on"
+ IDS_CONFIG_WORKSTATION_VERSION "Software version"
+ IDS_CONFIG_WORKSTATION_DOMAIN "Workstation domain"
+ IDS_CONFIG_WORKSTATION_LOGON "Logon domain"
IDS_LOCALGROUP_ALIASES "\\\\%s için başka adlar"
IDS_LOCALGROUP_ALIAS_NAME "Başka ad"
diff --git a/base/applications/network/net/lang/zh-CN.rc
b/base/applications/network/net/lang/zh-CN.rc
index 471b102b13..a8946a0005 100644
--- a/base/applications/network/net/lang/zh-CN.rc
+++ b/base/applications/network/net/lang/zh-CN.rc
@@ -169,11 +169,18 @@ service can stop others. Some services cannot be stopped.\n\n"
IDS_CONFIG_SERVER_NAME "Server Name"
IDS_CONFIG_SERVER_COMMENT "Server Comment"
IDS_CONFIG_SERVER_VERSION "Software version"
- IDS_CONFIG_SERVER_ACTIVE "Server is active on\n"
+ IDS_CONFIG_SERVER_ACTIVE "Server is active on"
IDS_CONFIG_SERVER_HIDDEN "Server hidden"
IDS_CONFIG_SERVER_USERS "Maximum Logged On Users"
IDS_CONFIG_SERVER_FILES "Maximum open files per session"
IDS_CONFIG_SERVER_IDLE "Idle session time (min)"
+ IDS_CONFIG_WORKSTATION_NAME "Computer name"
+ IDS_CONFIG_WORKSTATION_FULLNAME "Full Computer name"
+ IDS_CONFIG_WORKSTATION_USERNAME "User name"
+ IDS_CONFIG_WORKSTATION_ACTIVE "Workstation is active on"
+ IDS_CONFIG_WORKSTATION_VERSION "Software version"
+ IDS_CONFIG_WORKSTATION_DOMAIN "Workstation domain"
+ IDS_CONFIG_WORKSTATION_LOGON "Logon domain"
IDS_LOCALGROUP_ALIASES "\\\\%s 的别名"
IDS_LOCALGROUP_ALIAS_NAME "别名名称"
diff --git a/base/applications/network/net/lang/zh-TW.rc
b/base/applications/network/net/lang/zh-TW.rc
index 0eba14dc92..8f400f4be0 100644
--- a/base/applications/network/net/lang/zh-TW.rc
+++ b/base/applications/network/net/lang/zh-TW.rc
@@ -169,11 +169,18 @@ service can stop others. Some services cannot be stopped.\n\n"
IDS_CONFIG_SERVER_NAME "Server Name"
IDS_CONFIG_SERVER_COMMENT "Server Comment"
IDS_CONFIG_SERVER_VERSION "Software version"
- IDS_CONFIG_SERVER_ACTIVE "Server is active on\n"
+ IDS_CONFIG_SERVER_ACTIVE "Server is active on"
IDS_CONFIG_SERVER_HIDDEN "Server hidden"
IDS_CONFIG_SERVER_USERS "Maximum Logged On Users"
IDS_CONFIG_SERVER_FILES "Maximum open files per session"
IDS_CONFIG_SERVER_IDLE "Idle session time (min)"
+ IDS_CONFIG_WORKSTATION_NAME "Computer name"
+ IDS_CONFIG_WORKSTATION_FULLNAME "Full Computer name"
+ IDS_CONFIG_WORKSTATION_USERNAME "User name"
+ IDS_CONFIG_WORKSTATION_ACTIVE "Workstation is active on"
+ IDS_CONFIG_WORKSTATION_VERSION "Software version"
+ IDS_CONFIG_WORKSTATION_DOMAIN "Workstation domain"
+ IDS_CONFIG_WORKSTATION_LOGON "Logon domain"
IDS_LOCALGROUP_ALIASES "別名 \\\\%s"
IDS_LOCALGROUP_ALIAS_NAME "別名名稱"
diff --git a/base/applications/network/net/resource.h
b/base/applications/network/net/resource.h
index 10e01d1906..edcb94c7fe 100644
--- a/base/applications/network/net/resource.h
+++ b/base/applications/network/net/resource.h
@@ -86,15 +86,22 @@
#define IDS_ACCOUNTS_STANDALONE_SERVER 212
#define IDS_ACCOUNTS_WORKSTATION 213
-#define IDS_CONFIG_TEXT 230
-#define IDS_CONFIG_SERVER_NAME 231
-#define IDS_CONFIG_SERVER_COMMENT 232
-#define IDS_CONFIG_SERVER_VERSION 233
-#define IDS_CONFIG_SERVER_ACTIVE 234
-#define IDS_CONFIG_SERVER_HIDDEN 235
-#define IDS_CONFIG_SERVER_USERS 236
-#define IDS_CONFIG_SERVER_FILES 237
-#define IDS_CONFIG_SERVER_IDLE 238
+#define IDS_CONFIG_TEXT 230
+#define IDS_CONFIG_SERVER_NAME 231
+#define IDS_CONFIG_SERVER_COMMENT 232
+#define IDS_CONFIG_SERVER_VERSION 233
+#define IDS_CONFIG_SERVER_ACTIVE 234
+#define IDS_CONFIG_SERVER_HIDDEN 235
+#define IDS_CONFIG_SERVER_USERS 236
+#define IDS_CONFIG_SERVER_FILES 237
+#define IDS_CONFIG_SERVER_IDLE 238
+#define IDS_CONFIG_WORKSTATION_NAME 239
+#define IDS_CONFIG_WORKSTATION_FULLNAME 240
+#define IDS_CONFIG_WORKSTATION_USERNAME 241
+#define IDS_CONFIG_WORKSTATION_ACTIVE 242
+#define IDS_CONFIG_WORKSTATION_VERSION 243
+#define IDS_CONFIG_WORKSTATION_DOMAIN 244
+#define IDS_CONFIG_WORKSTATION_LOGON 245
#define IDS_LOCALGROUP_ALIASES 300