ReactOS  0.4.13-dev-99-g7e18b6d
net.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <wincon.h>
#include <winsvc.h>
#include <winnetwk.h>
#include <lm.h>
#include <ndk/rtlfuncs.h>
#include <conutils.h>
#include <net_msg.h>
#include "resource.h"
Include dependency graph for net.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 

Functions

VOID PrintPaddedResourceString (UINT uID, INT nPaddedLength)
 
VOID PrintPadding (WCHAR chr, INT nPaddedLength)
 
VOID PrintMessageString (DWORD dwMessage)
 
VOID PrintMessageStringV (DWORD dwMessage,...)
 
VOID PrintPaddedMessageString (DWORD dwMessage, INT nPaddedLength)
 
VOID PrintErrorMessage (DWORD dwError)
 
VOID PrintNetMessage (DWORD dwMessage)
 
VOID ReadFromConsole (LPWSTR lpInput, DWORD dwLength, BOOL bEcho)
 
VOID help (VOID)
 
INT unimplemented (INT argc, WCHAR **argv)
 
INT cmdAccounts (INT argc, WCHAR **argv)
 
INT cmdComputer (INT argc, WCHAR **argv)
 
INT cmdConfig (INT argc, WCHAR **argv)
 
INT cmdContinue (INT argc, WCHAR **argv)
 
INT cmdGroup (INT argc, WCHAR **argv)
 
INT cmdHelp (INT argc, WCHAR **argv)
 
INT cmdHelpMsg (INT argc, WCHAR **argv)
 
INT cmdLocalGroup (INT argc, WCHAR **argv)
 
INT cmdPause (INT argc, WCHAR **argv)
 
INT cmdStart (INT argc, WCHAR **argv)
 
INT cmdStatistics (INT argc, WCHAR **argv)
 
INT cmdStop (INT argc, WCHAR **argv)
 
INT cmdSyntax (INT argc, WCHAR **argv)
 
INT cmdUse (INT argc, WCHAR **argv)
 
INT cmdUser (INT argc, WCHAR **argv)
 

Variables

HMODULE hModuleNetMsg
 

Macro Definition Documentation

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 15 of file net.h.

Function Documentation

◆ cmdAccounts()

INT cmdAccounts ( INT  argc,
WCHAR **  argv 
)

Definition at line 13 of file cmdAccounts.c.

16 {
17  PUSER_MODALS_INFO_0 Info0 = NULL;
18  PUSER_MODALS_INFO_1 Info1 = NULL;
19  PUSER_MODALS_INFO_3 Info3 = NULL;
20  NT_PRODUCT_TYPE ProductType;
21  LPWSTR p;
22  LPWSTR endptr;
23  DWORD ParamErr;
24  ULONG value;
25  INT i;
26  BOOL Modified = FALSE;
27 #if 0
28  BOOL Domain = FALSE;
29 #endif
30  INT nPaddedLength = 58;
32  INT result = 0;
33 
34  for (i = 2; i < argc; i++)
35  {
36  if (_wcsicmp(argv[i], L"help") == 0)
37  {
38  /* Print short syntax help */
39  PrintMessageString(4381);
40  ConPuts(StdOut, L"\n");
41  PrintNetMessage(MSG_ACCOUNTS_SYNTAX);
42  return 0;
43  }
44 
45  if (_wcsicmp(argv[i], L"/help") == 0)
46  {
47  /* Print full help text*/
48  PrintMessageString(4381);
49  ConPuts(StdOut, L"\n");
50  PrintNetMessage(MSG_ACCOUNTS_SYNTAX);
51  PrintNetMessage(MSG_ACCOUNTS_HELP);
52  return 0;
53  }
54 
55  if (_wcsicmp(argv[i], L"/domain") == 0)
56  {
57  ConPuts(StdErr, L"The /DOMAIN option is not supported yet.\n");
58 #if 0
59  Domain = TRUE;
60 #endif
61  }
62  }
63 
64  Status = NetUserModalsGet(NULL, 0, (LPBYTE*)&Info0);
65  if (Status != NERR_Success)
66  goto done;
67 
68  for (i = 2; i < argc; i++)
69  {
70  if (_wcsnicmp(argv[i], L"/forcelogoff:", 13) == 0)
71  {
72  p = &argv[i][13];
73  if (wcsicmp(p, L"no") == 0)
74  {
76  Modified = TRUE;
77  }
78  else
79  {
80  value = wcstoul(p, &endptr, 10);
81  if (*endptr != 0)
82  {
83  PrintMessageStringV(3952, L"/FORCELOGOFF");
84  result = 1;
85  goto done;
86  }
87 
88  Info0->usrmod0_force_logoff = value * 60;
89  Modified = TRUE;
90  }
91  }
92  else if (_wcsnicmp(argv[i], L"/minpwlen:", 10) == 0)
93  {
94  p = &argv[i][10];
95  value = wcstoul(p, &endptr, 10);
96  if (*endptr != 0)
97  {
98  PrintMessageStringV(3952, L"/MINPWLEN");
99  result = 1;
100  goto done;
101  }
102 
103  Info0->usrmod0_min_passwd_len = value;
104  Modified = TRUE;
105  }
106  else if (_wcsnicmp(argv[i], L"/maxpwage:", 10) == 0)
107  {
108  p = &argv[i][10];
109 
110  if (wcsicmp(p, L"unlimited"))
111  {
113  Modified = TRUE;
114  }
115  else
116  {
117  value = wcstoul(p, &endptr, 10);
118  if (*endptr != 0)
119  {
120  PrintMessageStringV(3952, L"/MAXPWLEN");
121  result = 1;
122  goto done;
123  }
124 
125  Info0->usrmod0_max_passwd_age = value * 86400;
126  Modified = TRUE;
127  }
128  }
129  else if (_wcsnicmp(argv[i], L"/minpwage:", 10) == 0)
130  {
131  p = &argv[i][10];
132  value = wcstoul(p, &endptr, 10);
133  if (*endptr != 0)
134  {
135  PrintMessageStringV(3952, L"/MINPWAGE");
136  result = 1;
137  goto done;
138  }
139 
140  Info0->usrmod0_min_passwd_age = value * 86400;
141  Modified = TRUE;
142  }
143  else if (_wcsnicmp(argv[i], L"/uniquepw:", 10) == 0)
144  {
145  p = &argv[i][10];
146  value = wcstoul(p, &endptr, 10);
147  if (*endptr != 0)
148  {
149  PrintMessageStringV(3952, L"/UNIQUEPW");
150  result = 1;
151  goto done;
152  }
153 
155  Modified = TRUE;
156  }
157  }
158 
159  if (Modified == TRUE)
160  {
161  Status = NetUserModalsSet(NULL, 0, (LPBYTE)Info0, &ParamErr);
162  if (Status != NERR_Success)
163  goto done;
164  }
165  else
166  {
167  Status = NetUserModalsGet(NULL, 1, (LPBYTE*)&Info1);
168  if (Status != NERR_Success)
169  goto done;
170 
171  Status = NetUserModalsGet(NULL, 3, (LPBYTE*)&Info3);
172  if (Status != NERR_Success)
173  goto done;
174 
175  RtlGetNtProductType(&ProductType);
176 
178  if (Info0->usrmod0_force_logoff == TIMEQ_FOREVER)
179  PrintMessageString(4305);
180  else
182  ConPuts(StdOut, L"\n");
183 
184  PrintPaddedMessageString(4572, nPaddedLength);
185  ConPrintf(StdOut, L"%lu\n", Info0->usrmod0_min_passwd_age / 86400);
186 
187  PrintPaddedMessageString(4573, nPaddedLength);
188  ConPrintf(StdOut, L"%lu\n", Info0->usrmod0_max_passwd_age / 86400);
189 
190  PrintPaddedMessageString(4574, nPaddedLength);
191  ConPrintf(StdOut, L"%lu\n", Info0->usrmod0_min_passwd_len);
192 
193  PrintPaddedMessageString(4575, nPaddedLength);
194  if (Info0->usrmod0_password_hist_len == 0)
195  PrintMessageString(4303);
196  else
198  ConPuts(StdOut, L"\n");
199 
200  PrintPaddedMessageString(4578, nPaddedLength);
201  if (Info3->usrmod3_lockout_threshold == 0)
202  PrintMessageString(4305);
203  else
205  ConPuts(StdOut, L"\n");
206 
207  PrintPaddedMessageString(4579, nPaddedLength);
208  ConPrintf(StdOut, L"%lu\n", Info3->usrmod3_lockout_duration / 60);
209 
210  PrintPaddedMessageString(4580, nPaddedLength);
212 
213  PrintPaddedMessageString(4576, nPaddedLength);
214  if (Info1->usrmod1_role == UAS_ROLE_PRIMARY)
215  {
216  if (ProductType == NtProductLanManNt)
217  {
219  }
220  else if (ProductType == NtProductServer)
221  {
223  }
224  else
225  {
227  }
228  }
229  else
230  {
232  }
233  ConPuts(StdOut, L"\n");
234  }
235 
236 done:
237  if (Info3 != NULL)
238  NetApiBufferFree(Info3);
239 
240  if (Info1 != NULL)
241  NetApiBufferFree(Info1);
242 
243  if (Info0 != NULL)
244  NetApiBufferFree(Info0);
245 
246  return result;
247 }
static int argc
Definition: ServiceArgs.c:12
#define IDS_ACCOUNTS_LOGOFF_SECONDS
Definition: resource.h:4
#define IDS_ACCOUNTS_PRIMARY_SERVER
Definition: resource.h:5
#define TRUE
Definition: types.h:120
VOID PrintMessageStringV(DWORD dwMessage,...)
Definition: main.c:82
#define IDS_ACCOUNTS_WORKSTATION
Definition: resource.h:8
DWORD usrmod3_lockout_threshold
Definition: lmaccess.h:450
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define IDS_ACCOUNTS_STANDALONE_SERVER
Definition: resource.h:7
DWORD usrmod3_lockout_duration
Definition: lmaccess.h:448
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
#define NERR_Success
Definition: lmerr.h:5
DWORD usrmod0_min_passwd_len
Definition: lmaccess.h:433
#define IDS_ACCOUNTS_BACKUP_SERVER
Definition: resource.h:6
BOOLEAN NTAPI RtlGetNtProductType(PNT_PRODUCT_TYPE ProductType)
Definition: version.c:96
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD usrmod0_max_passwd_age
Definition: lmaccess.h:434
NET_API_STATUS WINAPI NetUserModalsGet(LPCWSTR servername, DWORD level, LPBYTE *bufptr)
Definition: user.c:3676
INT __cdecl ConPrintf(IN PCON_STREAM Stream, IN LPWSTR szStr,...)
Definition: outstream.c:520
smooth NULL
Definition: ftsmooth.c:416
#define IDS_ACCOUNTS_FORCE_LOGOFF
Definition: resource.h:3
INT __cdecl ConResPrintf(IN PCON_STREAM Stream, IN UINT uID,...)
Definition: outstream.c:781
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
NET_API_STATUS WINAPI NetUserModalsSet(IN LPCWSTR servername, IN DWORD level, IN LPBYTE buf, OUT LPDWORD parm_err)
Definition: user.c:3960
#define UAS_ROLE_PRIMARY
Definition: lmaccess.h:53
unsigned long DWORD
Definition: ntddk_ex.h:95
#define StdErr
Definition: stream.h:77
DWORD usrmod0_password_hist_len
Definition: lmaccess.h:437
DWORD usrmod0_min_passwd_age
Definition: lmaccess.h:435
INT ConResPuts(IN PCON_STREAM Stream, IN UINT uID)
Definition: outstream.c:610
static const WCHAR L[]
Definition: oid.c:1250
GLsizei const GLfloat * value
Definition: glext.h:6069
#define wcsicmp
Definition: string.h:1152
Status
Definition: gdiplustypes.h:24
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
VOID PrintPaddedMessageString(DWORD dwMessage, INT nPaddedLength)
Definition: main.c:132
VOID PrintPaddedResourceString(UINT uID, INT nPaddedLength)
Definition: main.c:53
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
DWORD usrmod0_force_logoff
Definition: lmaccess.h:436
DWORD usrmod3_lockout_observation_window
Definition: lmaccess.h:449
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define TIMEQ_FOREVER
Definition: lmaccess.h:110
#define StdOut
Definition: stream.h:76
enum _NT_PRODUCT_TYPE NT_PRODUCT_TYPE
unsigned int ULONG
Definition: retypes.h:1
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLuint64EXT * result
Definition: glext.h:11304
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define ULONG_MAX
Definition: limits.h:44

◆ cmdComputer()

INT cmdComputer ( INT  argc,
WCHAR **  argv 
)

Definition at line 11 of file cmdComputer.c.

14 {
15  WCHAR ComputerAccountName[MAX_PATH + 2];
16  WCHAR ComputerPassword[LM20_PWLEN + 1];
17  USER_INFO_1 UserInfo;
18  INT i, result = 0;
19  BOOL bAdd = FALSE;
20  BOOL bDelete = FALSE;
21  PWSTR pComputerName = NULL;
23 /*
24  OSVERSIONINFOEX VersionInfo;
25 
26  VersionInfo.dwOSVersionInfoSize = sizeof(VersionInfo);
27  if (!GetVersionEx((LPOSVERSIONINFO)&VersionInfo))
28  {
29  PrintErrorMessage(GetLastError());
30  return 1;
31  }
32 
33  if (VersionInfo.wProductType != VER_NT_DOMAIN_CONTROLLER)
34  {
35  PrintErrorMessage(3515);
36  return 1;
37  }
38 */
39 
40  i = 2;
41  if (argc > 2 && argv[i][0] == L'\\' && argv[i][1] == L'\\')
42  {
43  pComputerName = argv[i];
44  i++;
45  }
46 
47  for (; i < argc; i++)
48  {
49  if (_wcsicmp(argv[i], L"help") == 0)
50  {
51  /* Print short syntax help */
52  PrintMessageString(4381);
53  ConPuts(StdOut, L"\n");
54  PrintNetMessage(MSG_COMPUTER_SYNTAX);
55  return 0;
56  }
57 
58  if (_wcsicmp(argv[i], L"/help") == 0)
59  {
60  /* Print full help text*/
61  PrintMessageString(4381);
62  ConPuts(StdOut, L"\n");
63  PrintNetMessage(MSG_COMPUTER_SYNTAX);
64  PrintNetMessage(MSG_COMPUTER_HELP);
65  return 0;
66  }
67 
68  if (_wcsicmp(argv[i], L"/add") == 0)
69  {
70  bAdd = TRUE;
71  continue;
72  }
73  else if (_wcsicmp(argv[i], L"/del") == 0)
74  {
75  bDelete = TRUE;
76  continue;
77  }
78  else
79  {
80  PrintErrorMessage(3506/*, argv[i]*/);
81  return 1;
82  }
83  }
84 
85  if (pComputerName == NULL ||
86  (bAdd == FALSE && bDelete == FALSE) ||
87  (bAdd == TRUE && bDelete == TRUE))
88  {
89  PrintMessageString(4381);
90  ConPuts(StdOut, L"\n");
91  PrintNetMessage(MSG_COMPUTER_SYNTAX);
92  return 1;
93  }
94 
95  /*
96  * Create the computer account name:
97  * Skip the leading '\\' and appand a '$'.
98  */
99  wcscpy(ComputerAccountName, &pComputerName[2]);
100  wcscat(ComputerAccountName, L"$");
101 
102  if (bAdd)
103  {
104  /*
105  * Create the computer password:
106  * Skip the leading '\\', shorten to a maximum of 14 characters
107  * and convert to lower case
108  */
109  wcsncpy(ComputerPassword, &pComputerName[2], LM20_PWLEN);
110  ComputerPassword[LM20_PWLEN] = UNICODE_NULL;
111  _wcslwr(ComputerPassword);
112 
113  /* Set the account data */
114  UserInfo.usri1_name = ComputerAccountName;
115  UserInfo.usri1_password = ComputerPassword;
116  UserInfo.usri1_password_age = 0;
117  UserInfo.usri1_priv = USER_PRIV_USER;
118  UserInfo.usri1_home_dir = NULL;
119  UserInfo.usri1_comment = NULL;
121  UserInfo.usri1_script_path = NULL;
122 
123  /* Add the computer account */
125  1,
126  (LPBYTE)&UserInfo,
127  NULL);
128  }
129  else if (bDelete)
130  {
131  /* Delete the coputer account */
133  ComputerAccountName);
134  }
135 
136  if (Status == NERR_Success)
137  {
139  }
140  else
141  {
143  result = 1;
144  }
145 
146  return result;
147 }
DWORD usri1_password_age
Definition: lmaccess.h:205
static int argc
Definition: ServiceArgs.c:12
LPWSTR usri1_password
Definition: lmaccess.h:204
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
uint16_t * PWSTR
Definition: typedefs.h:54
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
#define NERR_Success
Definition: lmerr.h:5
#define USER_PRIV_USER
Definition: lmaccess.h:117
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned char * LPBYTE
Definition: typedefs.h:52
#define UNICODE_NULL
unsigned int BOOL
Definition: ntddk_ex.h:94
NET_API_STATUS WINAPI NetUserAdd(LPCWSTR servername, DWORD level, LPBYTE bufptr, LPDWORD parm_err)
Definition: user.c:2290
smooth NULL
Definition: ftsmooth.c:416
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
__wchar_t WCHAR
Definition: xmlstorage.h:180
LPWSTR usri1_comment
Definition: lmaccess.h:208
#define MAX_PATH
Definition: compat.h:26
LPWSTR usri1_name
Definition: lmaccess.h:203
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
NET_API_STATUS WINAPI NetUserDel(LPCWSTR servername, LPCWSTR username)
Definition: user.c:2560
static const WCHAR L[]
Definition: oid.c:1250
#define UF_WORKSTATION_TRUST_ACCOUNT
Definition: lmaccess.h:32
LPWSTR usri1_script_path
Definition: lmaccess.h:210
Status
Definition: gdiplustypes.h:24
_CRTIMP wchar_t *__cdecl _wcslwr(_Inout_z_ wchar_t *_String)
static VOID PrintErrorMessage(DWORD dwError)
Definition: at.c:308
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
DWORD usri1_priv
Definition: lmaccess.h:206
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define LM20_PWLEN
Definition: lmcons.h:38
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
DWORD usri1_flags
Definition: lmaccess.h:209
GLuint64EXT * result
Definition: glext.h:11304
LPWSTR usri1_home_dir
Definition: lmaccess.h:207
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define UF_SCRIPT
Definition: lmaccess.h:23

◆ cmdConfig()

INT cmdConfig ( INT  argc,
WCHAR **  argv 
)

Definition at line 165 of file cmdConfig.c.

168 {
169  INT i, result = 0;
170  BOOL bServer = FALSE;
171  BOOL bWorkstation = FALSE;
172  PWSTR p, endptr;
173  BOOL bModify = FALSE;
174  LONG lValue;
175  PSERVER_INFO_102 ServerInfo = NULL;
177 
178  for (i = 2; i < argc; i++)
179  {
180  if (_wcsicmp(argv[i], L"server") == 0)
181  {
182  if (bWorkstation == FALSE)
183  bServer = TRUE;
184  continue;
185  }
186 
187  if (_wcsicmp(argv[i], L"workstation") == 0)
188  {
189  if (bServer == FALSE)
190  bWorkstation = TRUE;
191  continue;
192  }
193 
194  if (_wcsicmp(argv[i], L"help") == 0)
195  {
196  /* Print short syntax help */
197  if (bServer == TRUE)
198  {
199  PrintMessageString(4381);
200  ConPuts(StdOut, L"\n");
201  PrintNetMessage(MSG_CONFIG_SERVER_SYNTAX);
202  }
203  else
204  {
205  PrintMessageString(4381);
206  ConPuts(StdOut, L"\n");
207  PrintNetMessage(MSG_CONFIG_SYNTAX);
208  }
209  return 0;
210  }
211 
212  if (_wcsicmp(argv[i], L"/help") == 0)
213  {
214  /* Print full help text*/
215  if (bServer == TRUE)
216  {
217  PrintMessageString(4381);
218  ConPuts(StdOut, L"\n");
219  PrintNetMessage(MSG_CONFIG_SERVER_SYNTAX);
220  PrintNetMessage(MSG_CONFIG_SERVER_HELP);
221  }
222  else
223  {
224  PrintMessageString(4381);
225  ConPuts(StdOut, L"\n");
226  PrintNetMessage(MSG_CONFIG_SYNTAX);
227  PrintNetMessage(MSG_CONFIG_HELP);
228  }
229  return 0;
230  }
231  }
232 
233  if (bServer)
234  {
235  Status = NetServerGetInfo(NULL, 102, (PBYTE*)&ServerInfo);
236  if (Status != NERR_Success)
237  goto done;
238 
239  for (i = 2; i < argc; i++)
240  {
241  if (argv[i][0] != L'/')
242  continue;
243 
244  if (_wcsnicmp(argv[i], L"/autodisconnect:", 16) == 0)
245  {
246  p = &argv[i][16];
247  lValue = wcstol(p, &endptr, 10);
248  if (*endptr != 0)
249  {
250  PrintMessageStringV(3952, L"/AUTODISCONNECT");
251  result = 1;
252  goto done;
253  }
254 
255  if (lValue < -1 || lValue > 65535)
256  {
257  PrintMessageStringV(3952, L"/AUTODISCONNECT");
258  result = 1;
259  goto done;
260  }
261 
262  ServerInfo->sv102_disc = lValue;
263  bModify = TRUE;
264  }
265  else if (_wcsnicmp(argv[i], L"/srvcomment:", 12) == 0)
266  {
267  ServerInfo->sv102_comment = &argv[i][12];
268  bModify = TRUE;
269  }
270  else if (_wcsnicmp(argv[i], L"/hidden:", 8) == 0)
271  {
272  p = &argv[i][8];
273  if (_wcsicmp(p, L"yes") != 0 && _wcsicmp(p, L"no") != 0)
274  {
275  PrintMessageStringV(3952, L"/HIDDEN");
276  result = 1;
277  goto done;
278  }
279 
280  ServerInfo->sv102_hidden = (_wcsicmp(p, L"yes") == 0) ? TRUE : FALSE;
281  bModify = TRUE;
282  }
283  else
284  {
285  PrintMessageString(4381);
286  ConPuts(StdOut, L"\n");
287  PrintNetMessage(MSG_CONFIG_SERVER_SYNTAX);
288  result = 1;
289  goto done;
290  }
291  }
292 
293  if (bModify)
294  {
295  Status = NetServerSetInfo(NULL, 102, (PBYTE)&ServerInfo, NULL);
296  if (Status != NERR_Success)
297  result = 1;
298  }
299  else
300  {
301  result = DisplayServerConfig(ServerInfo);
302  }
303  }
304  else if (bWorkstation)
305  {
307  }
308  else
309  {
310  PrintMessageString(4378);
311  ConPuts(StdOut, L"\n");
312  ConPuts(StdOut, L" Server\n");
313  ConPuts(StdOut, L" Workstation\n");
314  ConPuts(StdOut, L"\n");
315  }
316 
317 done:
318  if (ServerInfo != NULL)
319  NetApiBufferFree(ServerInfo);
320 
321  if (result == 0)
323 
324  return result;
325 }
static int argc
Definition: ServiceArgs.c:12
NET_API_STATUS WINAPI NetServerSetInfo(_In_ LPWSTR servername, _In_ DWORD level, _In_ LPBYTE buf, _Out_ LPDWORD parm_err)
Definition: srvsvc.c:399
#define TRUE
Definition: types.h:120
VOID PrintMessageStringV(DWORD dwMessage,...)
Definition: main.c:82
#define ERROR_SUCCESS
Definition: deptool.c:10
uint16_t * PWSTR
Definition: typedefs.h:54
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
LPWSTR sv102_comment
Definition: lmserver.h:31
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
static INT DisplayServerConfig(PSERVER_INFO_102 ServerInfo)
Definition: cmdConfig.c:12
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
#define NERR_Success
Definition: lmerr.h:5
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
BOOL sv102_hidden
Definition: lmserver.h:34
smooth NULL
Definition: ftsmooth.c:416
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
static const WCHAR L[]
Definition: oid.c:1250
NET_API_STATUS WINAPI NetServerGetInfo(LMSTR servername, DWORD level, LPBYTE *bufptr)
Definition: srvsvc.c:369
Status
Definition: gdiplustypes.h:24
static VOID PrintErrorMessage(DWORD dwError)
Definition: at.c:308
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
static INT DisplayWorkstationConfig(VOID)
Definition: cmdConfig.c:75
GLfloat GLfloat p
Definition: glext.h:8902
GLuint64EXT * result
Definition: glext.h:11304
BYTE * PBYTE
Definition: pedump.c:66
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

◆ cmdContinue()

INT cmdContinue ( INT  argc,
WCHAR **  argv 
)

Definition at line 12 of file cmdContinue.c.

13 {
14  SC_HANDLE hManager = NULL;
15  SC_HANDLE hService = NULL;
17  INT nError = 0;
18  INT i;
19 
20  if (argc != 3)
21  {
22  PrintMessageString(4381);
23  ConPuts(StdOut, L"\n");
24  PrintNetMessage(MSG_CONTINUE_SYNTAX);
25  return 1;
26  }
27 
28  for (i = 2; i < argc; i++)
29  {
30  if (_wcsicmp(argv[i], L"/help") == 0)
31  {
32  PrintMessageString(4381);
33  ConPuts(StdOut, L"\n");
34  PrintNetMessage(MSG_CONTINUE_SYNTAX);
35  PrintNetMessage(MSG_CONTINUE_HELP);
36  return 1;
37  }
38  }
39 
41  if (hManager == NULL)
42  {
43  ConPrintf(StdErr, L"[OpenSCManager] Error: %ld\n", GetLastError());
44  nError = 1;
45  goto done;
46  }
47 
48  hService = OpenService(hManager, argv[2], SERVICE_PAUSE_CONTINUE);
49  if (hService == NULL)
50  {
51  ConPrintf(StdErr, L"[OpenService] Error: %ld\n", GetLastError());
52  nError = 1;
53  goto done;
54  }
55 
57  {
58  ConPrintf(StdErr, L"[ControlService] Error: %ld\n", GetLastError());
59  nError = 1;
60  }
61 
62 done:
63  if (hService != NULL)
64  CloseServiceHandle(hService);
65 
66  if (hManager != NULL)
67  CloseServiceHandle(hManager);
68 
69  return nError;
70 }
static int argc
Definition: ServiceArgs.c:12
#define SC_MANAGER_ENUMERATE_SERVICE
Definition: winsvc.h:16
#define SERVICES_ACTIVE_DATABASE
Definition: winsvc.h:564
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
#define OpenService
Definition: winsvc.h:576
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
INT __cdecl ConPrintf(IN PCON_STREAM Stream, IN LPWSTR szStr,...)
Definition: outstream.c:520
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:577
smooth NULL
Definition: ftsmooth.c:416
#define OpenSCManager
Definition: winsvc.h:575
#define StdErr
Definition: stream.h:77
static const WCHAR L[]
Definition: oid.c:1250
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
#define SERVICE_CONTROL_CONTINUE
Definition: winsvc.h:38
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
Definition: scm.c:619
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
static SERVICE_STATUS status
Definition: service.c:31
#define SERVICE_PAUSE_CONTINUE
Definition: winsvc.h:59
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
Definition: ps.c:97

◆ cmdGroup()

INT cmdGroup ( INT  argc,
WCHAR **  argv 
)

Definition at line 154 of file cmdGroup.c.

157 {
158  INT i, j;
159  INT result = 0;
160  ULONG dwUserCount = 0;
161  BOOL bAdd = FALSE;
162  BOOL bDelete = FALSE;
163 #if 0
164  BOOL bDomain = FALSE;
165 #endif
166  PWSTR pGroupName = NULL;
167  PWSTR pComment = NULL;
168  PWSTR *pUsers = NULL;
169  GROUP_INFO_0 Info0;
170  GROUP_INFO_1 Info1;
171  GROUP_INFO_1002 Info1002;
173 
174  if (argc == 2)
175  {
177  ConPrintf(StdOut, L"Status: %lu\n", Status);
178  return 0;
179  }
180  else if (argc == 3)
181  {
182  Status = DisplayGroup(argv[2]);
183  ConPrintf(StdOut, L"Status: %lu\n", Status);
184  return 0;
185  }
186 
187  i = 2;
188  if (argv[i][0] != L'/')
189  {
190  pGroupName = argv[i];
191  i++;
192  }
193 
194  for (j = i; j < argc; j++)
195  {
196  if (argv[j][0] == L'/')
197  break;
198 
199  dwUserCount++;
200  }
201 
202  if (dwUserCount > 0)
203  {
204  pUsers = RtlAllocateHeap(RtlGetProcessHeap(),
206  dwUserCount * sizeof(PGROUP_USERS_INFO_0));
207  if (pUsers == NULL)
208  return 0;
209  }
210 
211  j = 0;
212  for (; i < argc; i++)
213  {
214  if (argv[i][0] == L'/')
215  break;
216 
217  pUsers[j] = argv[i];
218  j++;
219  }
220 
221  for (; i < argc; i++)
222  {
223  if (_wcsicmp(argv[i], L"/help") == 0)
224  {
225  PrintMessageString(4381);
226  ConPuts(StdOut, L"\n");
227  PrintNetMessage(MSG_GROUP_SYNTAX);
228  PrintNetMessage(MSG_GROUP_HELP);
229  return 0;
230  }
231  else if (_wcsicmp(argv[i], L"/add") == 0)
232  {
233  bAdd = TRUE;
234  }
235  else if (_wcsicmp(argv[i], L"/delete") == 0)
236  {
237  bDelete = TRUE;
238  }
239  else if (_wcsnicmp(argv[i], L"/comment:", 9) == 0)
240  {
241  pComment = &argv[i][9];
242  }
243  else if (_wcsicmp(argv[i], L"/domain") == 0)
244  {
245  ConPuts(StdErr, L"The /DOMAIN option is not supported yet.\n");
246 #if 0
247  bDomain = TRUE;
248 #endif
249  }
250  else
251  {
252  PrintErrorMessage(3506/*, argv[i]*/);
253  result = 1;
254  goto done;
255  }
256  }
257 
258  if (pGroupName == NULL)
259  {
260  result = 1;
261  goto done;
262  }
263 
264  if (bAdd && bDelete)
265  {
266  result = 1;
267  goto done;
268  }
269 
270  if (pUsers == NULL)
271  {
272  if (!bAdd && !bDelete && pComment != NULL)
273  {
274  /* Set group comment */
275  Info1002.grpi1002_comment = pComment;
277  pGroupName,
278  1002,
279  (LPBYTE)&Info1002,
280  NULL);
281  ConPrintf(StdOut, L"Status: %lu\n", Status);
282  }
283  else if (bAdd && !bDelete)
284  {
285  /* Add the group */
286  if (pComment == NULL)
287  {
288  Info0.grpi0_name = pGroupName;
289  }
290  else
291  {
292  Info1.grpi1_name = pGroupName;
293  Info1.grpi1_comment = pComment;
294  }
295 
297  (pComment == NULL) ? 0 : 1,
298  (pComment == NULL) ? (LPBYTE)&Info0 : (LPBYTE)&Info1,
299  NULL);
300  ConPrintf(StdOut, L"Status: %lu\n", Status);
301  }
302  else if (!bAdd && bDelete && pComment == NULL)
303  {
304  /* Delete the group */
306  pGroupName);
307  ConPrintf(StdOut, L"Status: %lu\n", Status);
308  }
309  else
310  {
311  result = 1;
312  }
313  }
314  else
315  {
316  if (bAdd && !bDelete && pComment == NULL)
317  {
318  /* Add group user */
319  for (i = 0; i < dwUserCount; i++)
320  {
322  pGroupName,
323  pUsers[i]);
324  if (Status != NERR_Success)
325  break;
326  }
327  ConPrintf(StdOut, L"Status: %lu\n", Status);
328  }
329  else if (!bAdd && bDelete && pComment == NULL)
330  {
331  /* Delete group members */
332  for (i = 0; i < dwUserCount; i++)
333  {
335  pGroupName,
336  pUsers[i]);
337  if (Status != NERR_Success)
338  break;
339  }
340  ConPrintf(StdOut, L"Status: %lu\n", Status);
341  }
342  else
343  {
344  result = 1;
345  }
346  }
347 
348 done:
349  if (pUsers != NULL)
350  RtlFreeHeap(RtlGetProcessHeap(), 0, pUsers);
351 
352  if (result != 0)
353  {
354  PrintMessageString(4381);
355  ConPuts(StdOut, L"\n");
356  PrintNetMessage(MSG_GROUP_SYNTAX);
357  }
358 
359  return result;
360 }
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
uint16_t * PWSTR
Definition: typedefs.h:54
LPWSTR grpi0_name
Definition: lmaccess.h:474
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:603
LPWSTR grpi1002_comment
Definition: lmaccess.h:493
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
NET_API_STATUS WINAPI NetGroupSetInfo(_In_opt_ LPCWSTR servername, _In_ LPCWSTR groupname, _In_ DWORD level, _In_ LPBYTE buf, _Out_opt_ LPDWORD parm_err)
Definition: group_new.c:1382
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
#define NERR_Success
Definition: lmerr.h:5
static NET_API_STATUS EnumerateGroups(VOID)
Definition: cmdGroup.c:23
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
static NET_API_STATUS DisplayGroup(LPWSTR lpGroupName)
Definition: cmdGroup.c:75
INT __cdecl ConPrintf(IN PCON_STREAM Stream, IN LPWSTR szStr,...)
Definition: outstream.c:520
smooth NULL
Definition: ftsmooth.c:416
NET_API_STATUS WINAPI NetGroupAddUser(_In_opt_ LPCWSTR servername, _In_ LPCWSTR groupname, _In_ LPCWSTR username)
Definition: group_new.c:466
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:585
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define StdErr
Definition: stream.h:77
static const WCHAR L[]
Definition: oid.c:1250
LPWSTR grpi1_comment
Definition: lmaccess.h:478
LPWSTR grpi1_name
Definition: lmaccess.h:477
Status
Definition: gdiplustypes.h:24
NET_API_STATUS WINAPI NetGroupAdd(_In_opt_ LPCWSTR servername, _In_ DWORD level, _In_ LPBYTE buf, _Out_opt_ LPDWORD parm_err)
Definition: group_new.c:286
static VOID PrintErrorMessage(DWORD dwError)
Definition: at.c:308
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
NET_API_STATUS WINAPI NetGroupDelUser(_In_opt_ LPCWSTR servername, _In_ LPCWSTR groupname, _In_ LPCWSTR username)
Definition: group_new.c:665
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
unsigned int ULONG
Definition: retypes.h:1
GLuint64EXT * result
Definition: glext.h:11304
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
NET_API_STATUS WINAPI NetGroupDel(_In_opt_ LPCWSTR servername, _In_ IN LPCWSTR groupname)
Definition: group_new.c:582

◆ cmdHelp()

INT cmdHelp ( INT  argc,
WCHAR **  argv 
)

Definition at line 12 of file cmdHelp.c.

13 {
14  PrintMessageString(4381);
15  ConPuts(StdOut, L"\n");
16 
17  if (argc != 3)
18  {
19  PrintNetMessage(MSG_HELP_SYNTAX);
20  PrintNetMessage(MSG_HELP_HELP);
21  return 0;
22  }
23 
24  if (_wcsicmp(argv[2], L"ACCOUNTS") == 0)
25  {
26  PrintNetMessage(MSG_ACCOUNTS_SYNTAX);
27  PrintNetMessage(MSG_ACCOUNTS_HELP);
28  return 0;
29  }
30 
31  if (_wcsicmp(argv[2], L"COMPUTER") == 0)
32  {
33  PrintNetMessage(MSG_COMPUTER_SYNTAX);
34  PrintNetMessage(MSG_COMPUTER_HELP);
35  return 0;
36  }
37 
38  if (_wcsicmp(argv[2], L"CONFIG") == 0)
39  {
40  if ((argc > 3) && (_wcsicmp(argv[3], L"SERVER") == 0))
41  {
42  PrintNetMessage(MSG_CONFIG_SERVER_SYNTAX);
43  PrintNetMessage(MSG_CONFIG_SERVER_HELP);
44  return 0;
45  }
46  else
47  {
48  PrintNetMessage(MSG_CONFIG_SYNTAX);
49  PrintNetMessage(MSG_CONFIG_HELP);
50  return 0;
51  }
52  }
53 
54  if (_wcsicmp(argv[2], L"CONTINUE") == 0)
55  {
56  PrintNetMessage(MSG_CONTINUE_SYNTAX);
57  PrintNetMessage(MSG_CONTINUE_HELP);
58  return 0;
59  }
60 
61  if (_wcsicmp(argv[2], L"FILE") == 0)
62  {
63  PrintNetMessage(MSG_FILE_SYNTAX);
64  PrintNetMessage(MSG_FILE_HELP);
65  return 0;
66  }
67 
68  if (_wcsicmp(argv[2], L"GROUP") == 0)
69  {
70  PrintNetMessage(MSG_GROUP_SYNTAX);
71  PrintNetMessage(MSG_GROUP_HELP);
72  return 0;
73  }
74 
75  if (_wcsicmp(argv[2], L"HELPMSG") == 0)
76  {
77  PrintNetMessage(MSG_HELPMSG_SYNTAX);
78  PrintNetMessage(MSG_HELPMSG_HELP);
79  return 0;
80  }
81 
82  if (_wcsicmp(argv[2], L"LOCALGROUP") == 0)
83  {
84  PrintNetMessage(MSG_LOCALGROUP_SYNTAX);
85  PrintNetMessage(MSG_LOCALGROUP_HELP);
86  return 0;
87  }
88 
89  if (_wcsicmp(argv[2], L"NAME") == 0)
90  {
91  PrintNetMessage(MSG_NAME_SYNTAX);
92  PrintNetMessage(MSG_NAME_HELP);
93  return 0;
94  }
95 
96  if (_wcsicmp(argv[2], L"PAUSE") == 0)
97  {
98  PrintNetMessage(MSG_PAUSE_SYNTAX);
99  PrintNetMessage(MSG_PAUSE_HELP);
100  return 0;
101  }
102 
103  if (_wcsicmp(argv[2], L"PRINT") == 0)
104  {
105  PrintNetMessage(MSG_PRINT_SYNTAX);
106  PrintNetMessage(MSG_PRINT_HELP);
107  return 0;
108  }
109 
110  if (_wcsicmp(argv[2], L"SEND") == 0)
111  {
112  PrintNetMessage(MSG_SEND_SYNTAX);
113  PrintNetMessage(MSG_SEND_HELP);
114  return 0;
115  }
116 
117  if (_wcsicmp(argv[2], L"SESSION") == 0)
118  {
119  PrintNetMessage(MSG_SESSION_SYNTAX);
120  PrintNetMessage(MSG_SESSION_HELP);
121  return 0;
122  }
123 
124  if (_wcsicmp(argv[2], L"SHARE") == 0)
125  {
126  PrintNetMessage(MSG_SHARE_SYNTAX);
127  PrintNetMessage(MSG_SHARE_HELP);
128  return 0;
129  }
130 
131  if (_wcsicmp(argv[2], L"START") == 0)
132  {
133  PrintNetMessage(MSG_START_SYNTAX);
134  PrintNetMessage(MSG_START_HELP);
135  return 0;
136  }
137 
138  if (_wcsicmp(argv[2], L"STATISTICS") == 0)
139  {
140  PrintNetMessage(MSG_STATISTICS_SYNTAX);
141  PrintNetMessage(MSG_STATISTICS_HELP);
142  return 0;
143  }
144 
145  if (_wcsicmp(argv[2], L"STOP") == 0)
146  {
147  PrintNetMessage(MSG_STOP_SYNTAX);
148  PrintNetMessage(MSG_STOP_HELP);
149  return 0;
150  }
151 
152  if (_wcsicmp(argv[2], L"TIME") == 0)
153  {
154  PrintNetMessage(MSG_TIME_SYNTAX);
155  PrintNetMessage(MSG_TIME_HELP);
156  return 0;
157  }
158 
159  if (_wcsicmp(argv[2], L"USE") == 0)
160  {
161  PrintNetMessage(MSG_USE_SYNTAX);
162  PrintNetMessage(MSG_USE_HELP);
163  return 0;
164  }
165 
166  if (_wcsicmp(argv[2], L"USER") == 0)
167  {
168  PrintNetMessage(MSG_USER_SYNTAX);
169  PrintNetMessage(MSG_USER_HELP);
170  return 0;
171  }
172 
173  if (_wcsicmp(argv[2], L"VIEW") == 0)
174  {
175  PrintNetMessage(MSG_VIEW_SYNTAX);
176  PrintNetMessage(MSG_VIEW_HELP);
177  return 0;
178  }
179 
180 #if 0
181  if (_wcsicmp(argv[2], L"SERVICES") == 0)
182  {
183  return 0;
184  }
185 #endif
186 
187  if (_wcsicmp(argv[2], L"SYNTAX") == 0)
188  {
189  PrintNetMessage(MSG_SYNTAX_HELP);
190  return 0;
191  }
192 
193  PrintNetMessage(MSG_HELP_SYNTAX);
194  PrintNetMessage(MSG_HELP_HELP);
195 
196  return 0;
197 }
static int argc
Definition: ServiceArgs.c:12
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
#define argv
Definition: mplay32.c:18
static const WCHAR L[]
Definition: oid.c:1250
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

◆ cmdHelpMsg()

INT cmdHelpMsg ( INT  argc,
WCHAR **  argv 
)

Definition at line 14 of file cmdHelpMsg.c.

15 {
16  INT i;
17  LONG errNum;
18  PWSTR endptr;
19  PWSTR pBuffer;
20  PWSTR pInserts[10] = {L"***", L"***", L"***", L"***",
21  L"***", L"***", L"***", L"***",
22  L"***", NULL};
23 
24  if (argc < 3)
25  {
26  PrintMessageString(4381);
27  ConPuts(StdOut, L"\n");
28  PrintNetMessage(MSG_HELPMSG_SYNTAX);
29  return 1;
30  }
31 
32  for (i = 2; i < argc; i++)
33  {
34  if (_wcsicmp(argv[i], L"/help") == 0)
35  {
36  PrintMessageString(4381);
37  ConPuts(StdOut, L"\n");
38  PrintNetMessage(MSG_HELPMSG_SYNTAX);
39  PrintNetMessage(MSG_HELPMSG_HELP);
40  return 1;
41  }
42  }
43 
44  errNum = wcstol(argv[2], &endptr, 10);
45  if (*endptr != 0)
46  {
47  PrintMessageString(4381);
48  ConPuts(StdOut, L"\n");
49  PrintNetMessage(MSG_HELPMSG_SYNTAX);
50  return 1;
51  }
52 
53  if (errNum >= MIN_LANMAN_MESSAGE_ID && errNum <= MAX_LANMAN_MESSAGE_ID)
54  {
58  errNum,
60  (LPWSTR)&pBuffer,
61  0,
62  (va_list *)pInserts);
63  if (pBuffer)
64  {
65  ConPrintf(StdOut, L"\n%s\n", pBuffer);
67  }
68  else
69  {
70  PrintErrorMessage(3871);
71  }
72  }
73  else
74  {
75  /* Retrieve the message string without appending extra newlines */
78  NULL,
79  errNum,
81  (LPWSTR)&pBuffer,
82  0,
83  (va_list *)pInserts);
84  if (pBuffer)
85  {
86  ConPrintf(StdOut, L"\n%s\n", pBuffer);
88  }
89  else
90  {
91  PrintErrorMessage(3871);
92  }
93  }
94 
95  return 0;
96 }
static int argc
Definition: ServiceArgs.c:12
uint16_t * PWSTR
Definition: typedefs.h:54
#define FORMAT_MESSAGE_ARGUMENT_ARRAY
Definition: winbase.h:405
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define argv
Definition: mplay32.c:18
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
long LONG
Definition: pedump.c:60
#define MIN_LANMAN_MESSAGE_ID
Definition: lmcons.h:10
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
INT __cdecl ConPrintf(IN PCON_STREAM Stream, IN LPWSTR szStr,...)
Definition: outstream.c:520
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
char * va_list
Definition: acmsvcex.h:78
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
#define FORMAT_MESSAGE_FROM_HMODULE
Definition: winbase.h:403
#define MAX_LANMAN_MESSAGE_ID
Definition: lmcons.h:11
static const WCHAR L[]
Definition: oid.c:1250
static VOID PrintErrorMessage(DWORD dwError)
Definition: at.c:308
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
HMODULE hModuleNetMsg
Definition: main.c:49
WCHAR * LPWSTR
Definition: xmlstorage.h:184
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50

◆ cmdLocalGroup()

INT cmdLocalGroup ( INT  argc,
WCHAR **  argv 
)

Definition at line 172 of file cmdLocalGroup.c.

175 {
176  INT i, j;
177  INT result = 0;
178  ULONG dwMemberCount = 0;
179  BOOL bAdd = FALSE;
180  BOOL bDelete = FALSE;
181 #if 0
182  BOOL bDomain = FALSE;
183 #endif
184  LPWSTR lpGroupName = NULL;
185  LPWSTR lpComment = NULL;
186  LPLOCALGROUP_MEMBERS_INFO_3 lpMembers = NULL;
187  LOCALGROUP_INFO_0 Info0;
188  LOCALGROUP_INFO_1 Info1;
189  LOCALGROUP_INFO_1002 Info1002;
191 
192  if (argc == 2)
193  {
195  ConPrintf(StdOut, L"Status: %lu\n", Status);
196  return 0;
197  }
198  else if (argc == 3)
199  {
201  ConPrintf(StdOut, L"Status: %lu\n", Status);
202  return 0;
203  }
204 
205  i = 2;
206  if (argv[i][0] != L'/')
207  {
208  lpGroupName = argv[i];
209  i++;
210  }
211 
212  for (j = i; j < argc; j++)
213  {
214  if (argv[j][0] == L'/')
215  break;
216 
217  dwMemberCount++;
218  }
219 
220  ConPrintf(StdOut, L"Member count: %lu\n", dwMemberCount);
221 
222  if (dwMemberCount > 0)
223  {
224  lpMembers = RtlAllocateHeap(RtlGetProcessHeap(),
226  dwMemberCount * sizeof(LPLOCALGROUP_MEMBERS_INFO_3));
227  if (lpMembers == NULL)
228  return 0;
229  }
230 
231  j = 0;
232  for (; i < argc; i++)
233  {
234  if (argv[i][0] == L'/')
235  break;
236 
237  lpMembers[j].lgrmi3_domainandname = argv[i];
238  j++;
239  }
240 
241  for (; i < argc; i++)
242  {
243  if (_wcsicmp(argv[i], L"/help") == 0)
244  {
245  PrintMessageString(4381);
246  ConPuts(StdOut, L"\n");
247  PrintNetMessage(MSG_LOCALGROUP_SYNTAX);
248  PrintNetMessage(MSG_LOCALGROUP_HELP);
249  return 0;
250  }
251  else if (_wcsicmp(argv[i], L"/add") == 0)
252  {
253  bAdd = TRUE;
254  }
255  else if (_wcsicmp(argv[i], L"/delete") == 0)
256  {
257  bDelete = TRUE;
258  }
259  else if (_wcsnicmp(argv[i], L"/comment:", 9) == 0)
260  {
261  lpComment = &argv[i][9];
262  }
263  else if (_wcsicmp(argv[i], L"/domain") == 0)
264  {
265  ConPuts(StdErr, L"The /DOMAIN option is not supported yet.\n");
266 #if 0
267  bDomain = TRUE;
268 #endif
269  }
270  else
271  {
272  PrintErrorMessage(3506/*, argv[i]*/);
273  result = 1;
274  goto done;
275  }
276  }
277 
278  if (lpGroupName == NULL)
279  {
280  result = 1;
281  goto done;
282  }
283 
284  if (bAdd && bDelete)
285  {
286  result = 1;
287  goto done;
288  }
289 
290 #if 0
291  ConPrintf(StdOut, L"Group:\n %s\n", lpGroupName);
292 
293  if (lpMembers != NULL)
294  {
295  ConPuts(StdOut, L"\nMembers:\n");
296  for (i = 0; i < dwMemberCount; i++)
297  ConPrintf(StdOut, L" %s\n", lpMembers[i].lgrmi3_domainandname);
298  }
299 
300  if (lpComment != NULL)
301  {
302  ConPrintf(StdOut, L"\nComment:\n %s\n", lpComment);
303  }
304 #endif
305 
306  if (lpMembers == NULL)
307  {
308  if (!bAdd && !bDelete && lpComment != NULL)
309  {
310  /* Set group comment */
311  Info1002.lgrpi1002_comment = lpComment;
313  lpGroupName,
314  1002,
315  (LPBYTE)&Info1002,
316  NULL);
317  ConPrintf(StdOut, L"Status: %lu\n", Status);
318  }
319  else if (bAdd && !bDelete)
320  {
321  /* Add the group */
322  if (lpComment == NULL)
323  {
324  Info0.lgrpi0_name = lpGroupName;
325  }
326  else
327  {
328  Info1.lgrpi1_name = lpGroupName;
329  Info1.lgrpi1_comment = lpComment;
330  }
331 
333  (lpComment == NULL) ? 0 : 1,
334  (lpComment == NULL) ? (LPBYTE)&Info0 : (LPBYTE)&Info1,
335  NULL);
336  ConPrintf(StdOut, L"Status: %lu\n", Status);
337  }
338  else if (!bAdd && bDelete && lpComment == NULL)
339  {
340  /* Delete the group */
342  lpGroupName);
343  ConPrintf(StdOut, L"Status: %lu\n", Status);
344  }
345  else
346  {
347  result = 1;
348  }
349  }
350  else
351  {
352  if (bAdd && !bDelete && lpComment == NULL)
353  {
354  /* Add group members */
356  lpGroupName,
357  3,
358  (LPBYTE)lpMembers,
359  dwMemberCount);
360  ConPrintf(StdOut, L"Status: %lu\n", Status);
361  }
362  else if (!bAdd && bDelete && lpComment == NULL)
363  {
364  /* Delete group members */
366  lpGroupName,
367  3,
368  (LPBYTE)lpMembers,
369  dwMemberCount);
370  ConPrintf(StdOut, L"Status: %lu\n", Status);
371  }
372  else
373  {
374  result = 1;
375  }
376  }
377 
378 done:
379  if (lpMembers != NULL)
380  RtlFreeHeap(RtlGetProcessHeap(), 0, lpMembers);
381 
382  if (result != 0)
383  {
384  PrintMessageString(4381);
385  ConPuts(StdOut, L"\n");
386  PrintNetMessage(MSG_LOCALGROUP_SYNTAX);
387  }
388 
389  return result;
390 }
NET_API_STATUS WINAPI NetLocalGroupDelMembers(LPCWSTR servername, LPCWSTR groupname, DWORD level, LPBYTE buf, DWORD totalentries)
Definition: local_group.c:817
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
NET_API_STATUS WINAPI NetLocalGroupAddMembers(LPCWSTR servername, LPCWSTR groupname, DWORD level, LPBYTE buf, DWORD totalentries)
Definition: local_group.c:520
NET_API_STATUS WINAPI NetLocalGroupAdd(LPCWSTR servername, DWORD level, LPBYTE buf, LPDWORD parm_err)
Definition: local_group.c:334
static NET_API_STATUS EnumerateLocalGroups(VOID)
Definition: cmdLocalGroup.c:25
static NET_API_STATUS DisplayLocalGroup(LPWSTR lpGroupName)
Definition: cmdLocalGroup.c:78
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:603
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
LPWSTR lgrpi1_comment
Definition: lmaccess.h:510
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
NET_API_STATUS WINAPI NetLocalGroupSetInfo(LPCWSTR servername, LPCWSTR groupname, DWORD level, LPBYTE buf, LPDWORD parm_err)
Definition: local_group.c:1732
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
INT __cdecl ConPrintf(IN PCON_STREAM Stream, IN LPWSTR szStr,...)
Definition: outstream.c:520
smooth NULL
Definition: ftsmooth.c:416
LPWSTR lgrpi1002_comment
Definition: lmaccess.h:513
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:585
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define StdErr
Definition: stream.h:77
LPWSTR lgrpi0_name
Definition: lmaccess.h:506
static const WCHAR L[]
Definition: oid.c:1250
LPWSTR lgrpi1_name
Definition: lmaccess.h:509
Status
Definition: gdiplustypes.h:24
static VOID PrintErrorMessage(DWORD dwError)
Definition: at.c:308
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
NET_API_STATUS WINAPI NetLocalGroupDel(LPCWSTR servername, LPCWSTR groupname)
Definition: local_group.c:677
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLuint64EXT * result
Definition: glext.h:11304
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

◆ cmdPause()

INT cmdPause ( INT  argc,
WCHAR **  argv 
)

Definition at line 12 of file cmdPause.c.

13 {
14  SC_HANDLE hManager = NULL;
15  SC_HANDLE hService = NULL;
17  INT nError = 0;
18  INT i;
19 
20  if (argc != 3)
21  {
22  PrintMessageString(4381);
23  ConPuts(StdOut, L"\n");
24  PrintNetMessage(MSG_PAUSE_SYNTAX);
25  return 1;
26  }
27 
28  for (i = 2; i < argc; i++)
29  {
30  if (_wcsicmp(argv[i], L"/help") == 0)
31  {
32  PrintMessageString(4381);
33  ConPuts(StdOut, L"\n");
34  PrintNetMessage(MSG_PAUSE_SYNTAX);
35  PrintNetMessage(MSG_PAUSE_HELP);
36  return 1;
37  }
38  }
39 
41  if (hManager == NULL)
42  {
43  ConPrintf(StdErr, L"[OpenSCManager] Error: %ld\n", GetLastError());
44  nError = 1;
45  goto done;
46  }
47 
48  hService = OpenService(hManager, argv[2], SERVICE_PAUSE_CONTINUE);
49  if (hService == NULL)
50  {
51  ConPrintf(StdErr, L"[OpenService] Error: %ld\n", GetLastError());
52  nError = 1;
53  goto done;
54  }
55 
57  {
58  ConPrintf(StdErr, L"[ControlService] Error: %ld\n", GetLastError());
59  }
60 
61 done:
62  if (hService != NULL)
63  CloseServiceHandle(hService);
64 
65  if (hManager != NULL)
66  CloseServiceHandle(hManager);
67 
68  return nError;
69 }
static int argc
Definition: ServiceArgs.c:12
#define SC_MANAGER_ENUMERATE_SERVICE
Definition: winsvc.h:16
#define SERVICES_ACTIVE_DATABASE
Definition: winsvc.h:564
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
#define OpenService
Definition: winsvc.h:576
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
INT __cdecl ConPrintf(IN PCON_STREAM Stream, IN LPWSTR szStr,...)
Definition: outstream.c:520
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:577
smooth NULL
Definition: ftsmooth.c:416
#define OpenSCManager
Definition: winsvc.h:575
#define StdErr
Definition: stream.h:77
#define SERVICE_CONTROL_PAUSE
Definition: winsvc.h:37
static const WCHAR L[]
Definition: oid.c:1250
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
Definition: scm.c:619
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
static SERVICE_STATUS status
Definition: service.c:31
#define SERVICE_PAUSE_CONTINUE
Definition: winsvc.h:59
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
Definition: ps.c:97

◆ cmdStart()

INT cmdStart ( INT  argc,
WCHAR **  argv 
)

Definition at line 163 of file cmdStart.c.

164 {
165  INT i;
166 
167  if (argc == 2)
168  {
169  return EnumerateRunningServices();
170  }
171 
172  for (i = 2; i < argc; i++)
173  {
174  if (_wcsicmp(argv[i], L"/help") == 0)
175  {
176  PrintMessageString(4381);
177  ConPuts(StdOut, L"\n");
178  PrintNetMessage(MSG_START_SYNTAX);
179  PrintNetMessage(MSG_START_HELP);
180  return 1;
181  }
182  }
183 
184  return StartOneService(argc, argv);
185 }
static int argc
Definition: ServiceArgs.c:12
static INT StartOneService(INT argc, WCHAR **argv)
Definition: cmdStart.c:91
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const WCHAR L[]
Definition: oid.c:1250
static INT EnumerateRunningServices(VOID)
Definition: cmdStart.c:15
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by CommandShell().

◆ cmdStatistics()

INT cmdStatistics ( INT  argc,
WCHAR **  argv 
)

Definition at line 248 of file cmdStatistics.c.

251 {
252  INT i, result = 0;
253  BOOL bServer = FALSE;
254  BOOL bWorkstation = FALSE;
255 
256  for (i = 2; i < argc; i++)
257  {
258  if (_wcsicmp(argv[i], L"server") == 0)
259  {
260  if (bWorkstation == FALSE)
261  bServer = TRUE;
262  continue;
263  }
264 
265  if (_wcsicmp(argv[i], L"workstation") == 0)
266  {
267  if (bServer == FALSE)
268  bWorkstation = TRUE;
269  continue;
270  }
271 
272  if (_wcsicmp(argv[i], L"help") == 0)
273  {
274  /* Print short syntax help */
275  PrintMessageString(4381);
276  ConPuts(StdOut, L"\n");
277  PrintNetMessage(MSG_STATISTICS_SYNTAX);
278  return 0;
279  }
280 
281  if (_wcsicmp(argv[i], L"/help") == 0)
282  {
283  /* Print full help text*/
284  PrintMessageString(4381);
285  ConPuts(StdOut, L"\n");
286  PrintNetMessage(MSG_STATISTICS_SYNTAX);
287  PrintNetMessage(MSG_STATISTICS_HELP);
288  return 0;
289  }
290  }
291 
292  if (bServer)
293  {
295  }
296  else if (bWorkstation)
297  {
299  }
300  else
301  {
302  PrintMessageString(4379);
303  ConPuts(StdOut, L"\n");
304  ConPuts(StdOut, L" Server\n");
305  ConPuts(StdOut, L" Workstation\n");
306  ConPuts(StdOut, L"\n");
307  }
308 
309  if (result == 0)
311 
312  return result;
313 }
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
static INT DisplayWorkstationStatistics(VOID)
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
static const WCHAR L[]
Definition: oid.c:1250
static VOID PrintErrorMessage(DWORD dwError)
Definition: at.c:308
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
static INT DisplayServerStatistics(VOID)
Definition: cmdStatistics.c:14
#define StdOut
Definition: stream.h:76
GLuint64EXT * result
Definition: glext.h:11304
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

◆ cmdStop()

INT cmdStop ( INT  argc,
WCHAR **  argv 
)

Definition at line 12 of file cmdStop.c.

13 {
14  SC_HANDLE hManager = NULL;
15  SC_HANDLE hService = NULL;
17  DWORD dwError = ERROR_SUCCESS;
18  INT nError = 0;
19  INT i;
20 
21  if (argc != 3)
22  {
23  PrintMessageString(4381);
24  ConPuts(StdOut, L"\n");
25  PrintNetMessage(MSG_STOP_SYNTAX);
26  return 1;
27  }
28 
29  for (i = 2; i < argc; i++)
30  {
31  if (_wcsicmp(argv[i], L"/help") == 0)
32  {
33  PrintMessageString(4381);
34  ConPuts(StdOut, L"\n");
35  PrintNetMessage(MSG_STOP_SYNTAX);
36  PrintNetMessage(MSG_STOP_HELP);
37  return 1;
38  }
39  }
40 
41  hManager = OpenSCManagerW(NULL,
44  if (hManager == NULL)
45  {
46  dwError = GetLastError();
47  nError = 1;
48  goto done;
49  }
50 
51  hService = OpenServiceW(hManager,
52  argv[2],
53  SERVICE_STOP);
54  if (hService == NULL)
55  {
56  dwError = GetLastError();
57  nError = 1;
58  goto done;
59  }
60 
62  {
63  dwError = GetLastError();
64  nError = 1;
65  goto done;
66  }
67 
68 done:
69  if (hService != NULL)
70  CloseServiceHandle(hService);
71 
72  if (hManager != NULL)
73  CloseServiceHandle(hManager);
74 
75  if (dwError != ERROR_SUCCESS)
76  {
77  /* FIXME: Print proper error message */
78  ConPrintf(StdErr, L"Error: %lu\n", dwError);
79  }
80 
81  return nError;
82 }
static int argc
Definition: ServiceArgs.c:12
#define SC_MANAGER_ENUMERATE_SERVICE
Definition: winsvc.h:16
#define ERROR_SUCCESS
Definition: deptool.c:10
#define SERVICES_ACTIVE_DATABASE
Definition: winsvc.h:564
static SERVICE_STATUS ServiceStatus
Definition: dcomlaunch.c:27
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2103
INT __cdecl ConPrintf(IN PCON_STREAM Stream, IN LPWSTR szStr,...)
Definition: outstream.c:520
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:577
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
#define StdErr
Definition: stream.h:77
static const WCHAR L[]
Definition: oid.c:1250
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2011
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
#define SERVICE_STOP
Definition: winsvc.h:58
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
Definition: scm.c:619
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
#define SERVICE_CONTROL_STOP
Definition: winsvc.h:36
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by CommandShell().

◆ cmdSyntax()

INT cmdSyntax ( INT  argc,
WCHAR **  argv 
)

Definition at line 201 of file cmdHelp.c.

202 {
203  PrintMessageString(4381);
204  ConPuts(StdOut, L"\n");
205  PrintNetMessage(MSG_SYNTAX_HELP);
206  return 0;
207 }
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
static const WCHAR L[]
Definition: oid.c:1250
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76

◆ cmdUse()

INT cmdUse ( INT  argc,
WCHAR **  argv 
)

Definition at line 104 of file cmdUse.c.

107 {
109 
110  if (argc == 2)
111  {
113  if (Status == NO_ERROR)
115  else
117 
118  return 0;
119  }
120  else if (argc == 3)
121  {
122  if (!ValidateDeviceName(argv[2]))
123  {
124  PrintMessageStringV(3952, L"DeviceName");
125  return 1;
126  }
127 
129  if (Status == NO_ERROR)
131  else
133 
134  return 0;
135  }
136 
137  Delete = 0;
138  if (wcsicmp(argv[2], L"/DELETE") == 0)
139  {
140  Delete = 3;
141  }
142  else
143  {
144  if ((argv[2][0] != '*' && argv[2][1] != 0) &&
146  {
147  PrintMessageStringV(3952, L"DeviceName");
148  return 1;
149  }
150  }
151 
152  if (wcsicmp(argv[3], L"/DELETE") == 0)
153  {
154  Delete = 2;
155  }
156 
157  if (Delete != 0)
158  {
159  if (!ValidateDeviceName(argv[Delete]) || argv[Delete][0] == L'*')
160  {
161  PrintMessageStringV(3952, L"DeviceName");
162  return 1;
163  }
164 
166  if (Status != NO_ERROR)
168 
169  return Status;
170  }
171  else
172  {
173  BOOL Persist = FALSE;
174  NETRESOURCE lpNet;
175  WCHAR Access[256];
176  DWORD OutFlags = 0, Size = ARRAYSIZE(Access);
177 
178  Len = wcslen(argv[3]);
179  if (Len < 4)
180  {
181  PrintMessageStringV(3952, L"Name");
182  return 1;
183  }
184 
185  if (argv[3][0] != L'\\' || argv[3][1] != L'\\')
186  {
187  PrintMessageStringV(3952, L"Name");
188  return 1;
189  }
190 
191  if (argc > 4)
192  {
193  LPWSTR Cpy;
194  Len = wcslen(argv[4]);
195  if (Len > 12)
196  {
197  Cpy = HeapAlloc(GetProcessHeap(), 0, (Len + 1) * sizeof(WCHAR));
198  if (Cpy)
199  {
200  INT i;
201  for (i = 0; i < Len; ++i)
202  Cpy[i] = towupper(argv[4][i]);
203 
204  if (wcsstr(Cpy, L"/PERSISTENT:") == Cpy)
205  {
206  LPWSTR Arg = Cpy + 12;
207  if (Len == 14 && Arg[0] == 'N' && Arg[1] == 'O')
208  {
209  Persist = FALSE;
210  }
211  else if (Len == 15 && Arg[0] == 'Y' && Arg[1] == 'E' && Arg[2] == 'S')
212  {
213  Persist = TRUE;
214  }
215  else
216  {
217  HeapFree(GetProcessHeap(), 0, Cpy);
218  PrintMessageStringV(3952, L"Persistent");
219  return 1;
220  }
221  }
222  HeapFree(GetProcessHeap(), 0, Cpy);
223  }
224  }
225 
226  }
227 
228  lpNet.dwType = RESOURCETYPE_DISK;
229  lpNet.lpLocalName = (argv[2][0] != L'*') ? argv[2] : NULL;
230  lpNet.lpRemoteName = argv[3];
231  lpNet.lpProvider = NULL;
232 
233  Status = WNetUseConnection(NULL, &lpNet, NULL, NULL, CONNECT_REDIRECT | (Persist ? CONNECT_UPDATE_PROFILE : 0), Access, &Size, &OutFlags);
234  if (argv[2][0] == L'*' && Status == NO_ERROR && OutFlags == CONNECT_LOCALDRIVE)
236  else if (Status != NO_ERROR)
238 
239  return Status;
240  }
241 }
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
VOID PrintMessageStringV(DWORD dwMessage,...)
Definition: main.c:82
DWORD dwType
Definition: winnetwk.h:168
#define CONNECT_UPDATE_PROFILE
Definition: winnetwk.h:87
#define ERROR_SUCCESS
Definition: deptool.c:10
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define WNetCancelConnection2
Definition: winnetwk.h:607
LPSTR lpLocalName
Definition: winnetwk.h:171
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define WNetUseConnection
Definition: winnetwk.h:609
#define argv
Definition: mplay32.c:18
#define NO_ERROR
Definition: dderror.h:5
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
static IPersist Persist
Definition: atl.c:503
smooth NULL
Definition: ftsmooth.c:416
LPSTR lpProvider
Definition: winnetwk.h:174
INT __cdecl ConResPrintf(IN PCON_STREAM Stream, IN UINT uID,...)
Definition: outstream.c:781
static DWORD EnumerateConnections(LPCWSTR Local)
Definition: cmdUse.c:14
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CONNECT_REDIRECT
Definition: winnetwk.h:94
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static VOID PrintError(DWORD Status)
Definition: cmdUse.c:68
#define Len
Definition: deflate.h:82
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_USE_NOW_CONNECTED
Definition: resource.h:10
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define wcsicmp
Definition: string.h:1152
#define RESOURCETYPE_DISK
Definition: winnetwk.h:64
Status
Definition: gdiplustypes.h:24
static BOOL ValidateDeviceName(PWSTR DevName)
Definition: cmdUse.c:85
static VOID PrintErrorMessage(DWORD dwError)
Definition: at.c:308
LPSTR lpRemoteName
Definition: winnetwk.h:172
#define CONNECT_LOCALDRIVE
Definition: winnetwk.h:95
#define StdOut
Definition: stream.h:76
#define towupper(c)
Definition: wctype.h:99
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL Delete(LPCTSTR ServiceName)
Definition: delete.c:12
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ cmdUser()

INT cmdUser ( INT  argc,
WCHAR **  argv 
)

Definition at line 684 of file cmdUser.c.

687 {
688  INT i, j;
689  INT result = 0;
690  BOOL bAdd = FALSE;
691  BOOL bDelete = FALSE;
692 #if 0
693  BOOL bDomain = FALSE;
694 #endif
695  BOOL bRandomPassword = FALSE;
696  LPWSTR lpUserName = NULL;
697  LPWSTR lpPassword = NULL;
698  PUSER_INFO_4 pUserInfo = NULL;
699  USER_INFO_4 UserInfo;
700  LPWSTR pWorkstations = NULL;
701  LPWSTR p;
702  LPWSTR endptr;
703  DWORD value;
704  BOOL bPasswordAllocated = FALSE;
706 
707  i = 2;
708  if ((i < argc) && (argv[i][0] != L'/'))
709  {
710  lpUserName = argv[i];
711 // ConPrintf(StdOut, L"User: %s\n", lpUserName);
712  i++;
713  }
714 
715  if ((i < argc) && (argv[i][0] != L'/'))
716  {
717  lpPassword = argv[i];
718 // ConPrintf(StdOut, L"Password: %s\n", lpPassword);
719  i++;
720  }
721 
722  for (j = i; j < argc; j++)
723  {
724  if (_wcsicmp(argv[j], L"/help") == 0)
725  {
726  PrintNetMessage(MSG_USER_HELP);
727  return 0;
728  }
729  else if (_wcsicmp(argv[j], L"/add") == 0)
730  {
731  bAdd = TRUE;
732  }
733  else if (_wcsicmp(argv[j], L"/delete") == 0)
734  {
735  bDelete = TRUE;
736  }
737  else if (_wcsicmp(argv[j], L"/domain") == 0)
738  {
739  ConPuts(StdErr, L"The /DOMAIN option is not supported yet.\n");
740 #if 0
741  bDomain = TRUE;
742 #endif
743  }
744  else if (_wcsicmp(argv[j], L"/random") == 0)
745  {
746  bRandomPassword = TRUE;
747  GenerateRandomPassword(&lpPassword,
748  &bPasswordAllocated);
749  }
750  }
751 
752  if (lpUserName == NULL && lpPassword == NULL)
753  {
755  ConPrintf(StdOut, L"Status: %lu\n", Status);
756  return 0;
757  }
758  else if (lpUserName != NULL && lpPassword == NULL)
759  {
760  Status = DisplayUser(lpUserName);
761  ConPrintf(StdOut, L"Status: %lu\n", Status);
762  return 0;
763  }
764 
765  if (bAdd && bDelete)
766  {
767  result = 1;
768  goto done;
769  }
770 
771  /* Interactive password input */
772  if (lpPassword != NULL && wcscmp(lpPassword, L"*") == 0)
773  {
774  ReadPassword(&lpPassword,
775  &bPasswordAllocated);
776  }
777 
778  if (!bAdd && !bDelete)
779  {
780  /* Modify the user */
782  lpUserName,
783  4,
784  (LPBYTE*)&pUserInfo);
785  if (Status != NERR_Success)
786  {
787  ConPrintf(StdOut, L"Status: %lu\n", Status);
788  result = 1;
789  goto done;
790  }
791  }
792  else if (bAdd && !bDelete)
793  {
794  /* Add the user */
795  ZeroMemory(&UserInfo, sizeof(USER_INFO_4));
796 
797  UserInfo.usri4_name = lpUserName;
798  UserInfo.usri4_password = lpPassword;
802 
803  pUserInfo = &UserInfo;
804  }
805 
806  for (j = i; j < argc; j++)
807  {
808  if (_wcsnicmp(argv[j], L"/active:", 8) == 0)
809  {
810  p = &argv[i][8];
811  if (_wcsicmp(p, L"yes") == 0)
812  {
813  pUserInfo->usri4_flags &= ~UF_ACCOUNTDISABLE;
814  }
815  else if (_wcsicmp(p, L"no") == 0)
816  {
817  pUserInfo->usri4_flags |= UF_ACCOUNTDISABLE;
818  }
819  else
820  {
821  PrintMessageStringV(3952, L"/ACTIVE");
822  result = 1;
823  goto done;
824  }
825  }
826  else if (_wcsnicmp(argv[j], L"/comment:", 9) == 0)
827  {
828  pUserInfo->usri4_comment = &argv[j][9];
829  }
830  else if (_wcsnicmp(argv[j], L"/countrycode:", 13) == 0)
831  {
832  p = &argv[i][13];
833  value = wcstoul(p, &endptr, 10);
834  if (*endptr != 0)
835  {
836  PrintMessageStringV(3952, L"/COUNTRYCODE");
837  result = 1;
838  goto done;
839  }
840 
841  /* Verify the country code */
843  pUserInfo->usri4_country_code = value;
844  }
845  else if (_wcsnicmp(argv[j], L"/expires:", 9) == 0)
846  {
847  p = &argv[i][9];
848  if (_wcsicmp(p, L"never") == 0)
849  {
850  pUserInfo->usri4_acct_expires = TIMEQ_FOREVER;
851  }
852  else if (!ParseDate(p, &pUserInfo->usri4_acct_expires))
853  {
854  PrintMessageStringV(3952, L"/EXPIRES");
855  result = 1;
856  goto done;
857  }
858  }
859  else if (_wcsnicmp(argv[j], L"/fullname:", 10) == 0)
860  {
861  pUserInfo->usri4_full_name = &argv[j][10];
862  }
863  else if (_wcsnicmp(argv[j], L"/homedir:", 9) == 0)
864  {
865  pUserInfo->usri4_home_dir = &argv[j][9];
866  }
867  else if (_wcsnicmp(argv[j], L"/passwordchg:", 13) == 0)
868  {
869  p = &argv[i][13];
870  if (_wcsicmp(p, L"yes") == 0)
871  {
872  pUserInfo->usri4_flags &= ~UF_PASSWD_CANT_CHANGE;
873  }
874  else if (_wcsicmp(p, L"no") == 0)
875  {
876  pUserInfo->usri4_flags |= UF_PASSWD_CANT_CHANGE;
877  }
878  else
879  {
880  PrintMessageStringV(3952, L"/PASSWORDCHG");
881  result = 1;
882  goto done;
883  }
884  }
885  else if (_wcsnicmp(argv[j], L"/passwordreq:", 13) == 0)
886  {
887  p = &argv[i][13];
888  if (_wcsicmp(p, L"yes") == 0)
889  {
890  pUserInfo->usri4_flags &= ~UF_PASSWD_NOTREQD;
891  }
892  else if (_wcsicmp(p, L"no") == 0)
893  {
894  pUserInfo->usri4_flags |= UF_PASSWD_NOTREQD;
895  }
896  else
897  {
898  PrintMessageStringV(3952, L"/PASSWORDREQ");
899  result = 1;
900  goto done;
901  }
902  }
903  else if (_wcsnicmp(argv[j], L"/profilepath:", 13) == 0)
904  {
905  pUserInfo->usri4_profile = &argv[j][13];
906  }
907  else if (_wcsnicmp(argv[j], L"/scriptpath:", 12) == 0)
908  {
909  pUserInfo->usri4_script_path = &argv[j][12];
910  }
911  else if (_wcsnicmp(argv[j], L"/times:", 7) == 0)
912  {
913  /* FIXME */
914  ConPuts(StdErr, L"The /TIMES option is not supported yet.\n");
915  }
916  else if (_wcsnicmp(argv[j], L"/usercomment:", 13) == 0)
917  {
918  pUserInfo->usri4_usr_comment = &argv[j][13];
919  }
920  else if (_wcsnicmp(argv[j], L"/workstations:", 14) == 0)
921  {
922  p = &argv[i][14];
923  if (wcscmp(p, L"*") == 0 || wcscmp(p, L"") == 0)
924  {
925  pUserInfo->usri4_workstations = NULL;
926  }
927  else
928  {
929  Status = BuildWorkstationsList(&pWorkstations, p);
930  if (Status == NERR_Success)
931  {
932  pUserInfo->usri4_workstations = pWorkstations;
933  }
934  else
935  {
936  ConPrintf(StdOut, L"Status %lu\n\n", Status);
937  result = 1;
938  goto done;
939  }
940  }
941  }
942  }
943 
944  if (!bAdd && !bDelete)
945  {
946  /* Modify the user */
948  lpUserName,
949  4,
950  (LPBYTE)pUserInfo,
951  NULL);
952  ConPrintf(StdOut, L"Status: %lu\n", Status);
953  }
954  else if (bAdd && !bDelete)
955  {
956  /* Add the user */
958  4,
959  (LPBYTE)pUserInfo,
960  NULL);
961  ConPrintf(StdOut, L"Status: %lu\n", Status);
962  }
963  else if (!bAdd && bDelete)
964  {
965  /* Delete the user */
967  lpUserName);
968  ConPrintf(StdOut, L"Status: %lu\n", Status);
969  }
970 
971  if (Status == NERR_Success &&
972  lpPassword != NULL &&
973  bRandomPassword == TRUE)
974  {
975  PrintMessageStringV(3968, lpUserName, lpPassword);
976  }
977 
978 done:
979  if (pWorkstations != NULL)
980  HeapFree(GetProcessHeap(), 0, pWorkstations);
981 
982  if ((bPasswordAllocated == TRUE) && (lpPassword != NULL))
983  HeapFree(GetProcessHeap(), 0, lpPassword);
984 
985  if (!bAdd && !bDelete && pUserInfo != NULL)
986  NetApiBufferFree(pUserInfo);
987 
988  if (result != 0)
989  {
990  PrintMessageString(4381);
991  ConPuts(StdOut, L"\n");
992  PrintNetMessage(MSG_USER_SYNTAX);
993  }
994 
995  return result;
996 }
static NET_API_STATUS DisplayUser(LPWSTR lpUserName)
Definition: cmdUser.c:201
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
VOID PrintMessageStringV(DWORD dwMessage,...)
Definition: main.c:82
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
LPWSTR usri4_home_dir
Definition: lmaccess.h:274
#define ZeroMemory
Definition: winbase.h:1635
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:228
DWORD usri4_flags
Definition: lmaccess.h:276
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
#define NERR_Success
Definition: lmerr.h:5
DWORD usri4_country_code
Definition: lmaccess.h:292
#define UF_PASSWD_CANT_CHANGE
Definition: lmaccess.h:28
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static NET_API_STATUS EnumerateUsers(VOID)
Definition: cmdUser.c:60
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
LPWSTR usri4_workstations
Definition: lmaccess.h:282
LPWSTR usri4_full_name
Definition: lmaccess.h:279
INT __cdecl ConPrintf(IN PCON_STREAM Stream, IN LPWSTR szStr,...)
Definition: outstream.c:520
NET_API_STATUS WINAPI NetUserAdd(LPCWSTR servername, DWORD level, LPBYTE bufptr, LPDWORD parm_err)
Definition: user.c:2290
DWORD usri4_primary_group_id
Definition: lmaccess.h:295
LPWSTR usri4_password
Definition: lmaccess.h:271
smooth NULL
Definition: ftsmooth.c:416
#define UF_PASSWD_NOTREQD
Definition: lmaccess.h:27
NET_API_STATUS WINAPI NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE *bufptr)
Definition: user.c:3164
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define GetProcessHeap()
Definition: compat.h:395
DWORD usri4_acct_expires
Definition: lmaccess.h:285
static VOID ReadPassword(LPWSTR *lpPassword, LPBOOL lpAllocated)
Definition: cmdUser.c:385
LPWSTR usri4_profile
Definition: lmaccess.h:296
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL ParseDate(PWSTR s, PULONG pSeconds)
Definition: cmdUser.c:595
#define StdErr
Definition: stream.h:77
NET_API_STATUS WINAPI NetUserDel(LPCWSTR servername, LPCWSTR username)
Definition: user.c:2560
static const WCHAR L[]
Definition: oid.c:1250
LPWSTR usri4_comment
Definition: lmaccess.h:275
GLsizei const GLfloat * value
Definition: glext.h:6069
static NET_API_STATUS BuildWorkstationsList(_Out_ PWSTR *pWorkstationsList, _In_ PWSTR pRaw)
Definition: cmdUser.c:460
Status
Definition: gdiplustypes.h:24
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
NET_API_STATUS WINAPI NetUserSetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE buf, LPDWORD parm_err)
Definition: user.c:3992
static VOID GenerateRandomPassword(LPWSTR *lpPassword, LPBOOL lpAllocated)
Definition: cmdUser.c:431
LPWSTR usri4_usr_comment
Definition: lmaccess.h:280
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
Definition: apibuf.c:43
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:109
#define UF_ACCOUNTDISABLE
Definition: lmaccess.h:24
#define DOMAIN_GROUP_RID_USERS
Definition: setypes.h:612
#define UF_NORMAL_ACCOUNT
Definition: lmaccess.h:30
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define TIMEQ_FOREVER
Definition: lmaccess.h:110
#define StdOut
Definition: stream.h:76
LPWSTR usri4_name
Definition: lmaccess.h:270
LPWSTR usri4_script_path
Definition: lmaccess.h:277
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLuint64EXT * result
Definition: glext.h:11304
#define HeapFree(x, y, z)
Definition: compat.h:394
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
static BOOL GetCountryFromCountryCode(_In_ DWORD dwCountryCode, _In_ DWORD dwCountryLength, _Out_ PWSTR szCountryBuffer)
Definition: cmdUser.c:169
#define UF_SCRIPT
Definition: lmaccess.h:23

◆ help()

VOID help ( VOID  )

Definition at line 27 of file cat.c.

28 {
30  "\n"
31  "ReactOS File Concatenation Tool\n"
32  "\n"
33  "Usage: cat [options] [file [...]]\n"
34  "options - Currently ignored\n");
35 }
FILE * stdout
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)

Referenced by main().

◆ PrintErrorMessage()

VOID PrintErrorMessage ( DWORD  dwError)

Definition at line 123 of file common.c.

124 {
125  TCHAR * String;
126 
127  /* Try to get textual error */
129  NULL, Error, 0, (TCHAR *)&String, 0, NULL) != 0)
130  {
131  /* And print it */
132  _ftprintf(stderr, _T("Error: %s\n"), String);
133  LocalFree(String);
134  }
135  else
136  {
137  /* Otherwise, just print the error number */
138  _ftprintf(stderr, _T("Error: %d\n"), Error);
139  }
140 
141  return Error;
142 }
static WCHAR String[]
Definition: stringtable.c:55
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
#define _ftprintf
Definition: tchar.h:518
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
BOOL Error
Definition: chkdsk.c:66
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
FILE * stderr

Referenced by OpenVolume().

◆ PrintMessageString()

VOID PrintMessageString ( DWORD  dwMessage)

Definition at line 109 of file main.c.

111 {
112  PWSTR pBuffer;
113 
117  dwMessage,
119  (LPWSTR)&pBuffer,
120  0,
121  NULL);
122  if (pBuffer)
123  {
126  pBuffer = NULL;
127  }
128 }
uint16_t * PWSTR
Definition: typedefs.h:54
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
#define FORMAT_MESSAGE_FROM_HMODULE
Definition: winbase.h:403
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:401
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
HMODULE hModuleNetMsg
Definition: main.c:49
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50

Referenced by cmdAccounts(), cmdComputer(), cmdConfig(), cmdContinue(), cmdGroup(), cmdHelp(), cmdHelpMsg(), cmdLocalGroup(), cmdPause(), cmdStart(), cmdStatistics(), cmdStop(), cmdSyntax(), cmdUser(), DisplayGroup(), DisplayLocalGroup(), DisplayServerConfig(), DisplayServerStatistics(), DisplayUser(), DisplayWorkstationStatistics(), ReadPassword(), and wmain().

◆ PrintMessageStringV()

VOID PrintMessageStringV ( DWORD  dwMessage,
  ... 
)

Definition at line 82 of file main.c.

85 {
86  PWSTR pBuffer;
87  va_list args = NULL;
88 
89  va_start(args, dwMessage);
90 
93  dwMessage,
95  (LPWSTR)&pBuffer,
96  0,
97  &args);
98  va_end(args);
99 
100  if (pBuffer)
101  {
104  pBuffer = NULL;
105  }
106 }
uint16_t * PWSTR
Definition: typedefs.h:54
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
Definition: match.c:390
#define va_end(ap)
Definition: acmsvcex.h:90
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
char * va_list
Definition: acmsvcex.h:78
#define FORMAT_MESSAGE_FROM_HMODULE
Definition: winbase.h:403
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define va_start(ap, A)
Definition: acmsvcex.h:91
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
HMODULE hModuleNetMsg
Definition: main.c:49
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50

Referenced by cmdAccounts(), cmdConfig(), cmdUse(), cmdUser(), DisplayServerStatistics(), DisplayWorkstationStatistics(), EnumerateGroups(), EnumerateLocalGroups(), EnumerateUsers(), and PrintError().

◆ PrintNetMessage()

VOID PrintNetMessage ( DWORD  dwMessage)

Definition at line 228 of file main.c.

230 {
231  PWSTR pBuffer;
232 
237  dwMessage,
239  (LPWSTR)&pBuffer,
240  0,
241  NULL);
242  if (pBuffer)
243  {
245  ConPuts(StdOut, L"\n");
247  pBuffer = NULL;
248  }
249 }
uint16_t * PWSTR
Definition: typedefs.h:54
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
#define FORMAT_MESSAGE_FROM_HMODULE
Definition: winbase.h:403
static const WCHAR L[]
Definition: oid.c:1250
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:401
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:845
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50

Referenced by cmdAccounts(), cmdComputer(), cmdConfig(), cmdContinue(), cmdGroup(), cmdHelp(), cmdHelpMsg(), cmdLocalGroup(), cmdPause(), cmdStart(), cmdStatistics(), cmdStop(), cmdSyntax(), cmdUser(), and wmain().

◆ PrintPaddedMessageString()

VOID PrintPaddedMessageString ( DWORD  dwMessage,
INT  nPaddedLength 
)

Definition at line 132 of file main.c.

135 {
136  PWSTR pBuffer;
137  DWORD dwLength;
138 
142  dwMessage,
144  (LPWSTR)&pBuffer,
145  0,
146  NULL);
147  if (pBuffer)
148  {
151  pBuffer = NULL;
152  }
153 
154  if (dwLength < (DWORD)nPaddedLength)
155  PrintPadding(L' ', (DWORD)nPaddedLength - dwLength);
156 }
uint16_t * PWSTR
Definition: typedefs.h:54
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
#define FORMAT_MESSAGE_FROM_HMODULE
Definition: winbase.h:403
static DWORD DWORD * dwLength
Definition: fusion.c:83
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:401
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
VOID PrintPadding(WCHAR chr, INT nPaddedLength)
Definition: main.c:66
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76
HMODULE hModuleNetMsg
Definition: main.c:49
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50

Referenced by cmdAccounts(), DisplayGroup(), DisplayLocalGroup(), DisplayServerConfig(), DisplayServerStatistics(), DisplayUser(), DisplayWorkstationConfig(), and DisplayWorkstationStatistics().

◆ PrintPaddedResourceString()

VOID PrintPaddedResourceString ( UINT  uID,
INT  nPaddedLength 
)

Definition at line 53 of file main.c.

56 {
57  INT nLength;
58 
59  nLength = ConResPuts(StdOut, uID);
60  if (nLength < nPaddedLength)
61  PrintPadding(L' ', nPaddedLength - nLength);
62 }
_In_ DWORD nLength
Definition: wincon.h:461
int32_t INT
Definition: typedefs.h:56
INT ConResPuts(IN PCON_STREAM Stream, IN UINT uID)
Definition: outstream.c:610
static const WCHAR L[]
Definition: oid.c:1250
VOID PrintPadding(WCHAR chr, INT nPaddedLength)
Definition: main.c:66
#define StdOut
Definition: stream.h:76

Referenced by cmdAccounts().

◆ PrintPadding()

VOID PrintPadding ( WCHAR  chr,
INT  nPaddedLength 
)

Definition at line 66 of file main.c.

69 {
70  INT i;
71  WCHAR szMsgBuffer[MAX_BUFFER_SIZE];
72 
73  for (i = 0; i < nPaddedLength; i++)
74  szMsgBuffer[i] = chr;
75  szMsgBuffer[nPaddedLength] = UNICODE_NULL;
76 
77  ConPuts(StdOut, szMsgBuffer);
78 }
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define UNICODE_NULL
#define MAX_BUFFER_SIZE
Definition: main.c:12
__wchar_t WCHAR
Definition: xmlstorage.h:180
int chr(char *serport)
Definition: gdblib.c:152
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76

Referenced by DisplayGroup(), DisplayLocalGroup(), DisplayUser(), EnumerateGroups(), EnumerateLocalGroups(), EnumerateUsers(), PrintPaddedMessageString(), and PrintPaddedResourceString().

◆ ReadFromConsole()

VOID ReadFromConsole ( LPWSTR  lpInput,
DWORD  dwLength,
BOOL  bEcho 
)

Definition at line 253 of file main.c.

257 {
258  DWORD dwOldMode;
259  DWORD dwRead = 0;
260  HANDLE hFile;
261  LPWSTR p;
262  PCHAR pBuf;
263 
264  pBuf = HeapAlloc(GetProcessHeap(), 0, dwLength - 1);
265  ZeroMemory(lpInput, dwLength * sizeof(WCHAR));
267  GetConsoleMode(hFile, &dwOldMode);
268 
270 
271  ReadFile(hFile, (PVOID)pBuf, dwLength - 1, &dwRead, NULL);
272 
273  MultiByteToWideChar(CP_OEMCP, 0, pBuf, dwRead, lpInput, dwLength - 1);
274  HeapFree(GetProcessHeap(), 0, pBuf);
275 
276  for (p = lpInput; *p; p++)
277  {
278  if (*p == L'\x0d')
279  {
280  *p = L'\0';
281  break;
282  }
283  }
284 
285  SetConsoleMode(hFile, dwOldMode);
286 }
signed char * PCHAR
Definition: retypes.h:7
BOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle, LPDWORD lpMode)
Definition: console.c:1571
BOOL bEcho
Definition: batch.c:68
#define ZeroMemory
Definition: winbase.h:1635
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:152
#define ENABLE_ECHO_INPUT
Definition: wincon.h:77
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
Definition: console.c:1608
smooth NULL
Definition: ftsmooth.c:416
#define STD_INPUT_HANDLE
Definition: winbase.h:264
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD DWORD * dwLength
Definition: fusion.c:83
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ENABLE_LINE_INPUT
Definition: wincon.h:76
static const WCHAR L[]
Definition: oid.c:1250
_In_ HANDLE hFile
Definition: mswsock.h:90
#define MultiByteToWideChar
Definition: compat.h:100
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL WINAPI ReadFile(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead, OUT LPDWORD lpNumberOfBytesRead OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:123
#define CP_OEMCP
Definition: winnls.h:228
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by ReadPassword().

◆ unimplemented()

INT unimplemented ( INT  argc,
WCHAR **  argv 
)

Definition at line 341 of file main.c.

342 {
343  ConPuts(StdOut, L"This command is not implemented yet\n");
344  return 1;
345 }
static const WCHAR L[]
Definition: oid.c:1250
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define StdOut
Definition: stream.h:76

Variable Documentation

◆ hModuleNetMsg