ReactOS 0.4.17-dev-470-gf9e3448
netsh.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS NetSh
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Network Shell main file
5 * COPYRIGHT: Copyright 2023 Eric Kohl <eric.kohl@reactos.org>
6 */
7
8/* INCLUDES *******************************************************************/
9
10#include "precomp.h"
11
12#define NDEBUG
13#include <debug.h>
14
15/* GLOBALS ********************************************************************/
16
18
19/* FUNCTIONS ******************************************************************/
20
24{
25 WCHAR tmp_string[MAX_STRING_SIZE];
26 FILE *script;
27 DWORD dwError = ERROR_SUCCESS;
28
29 /* Open the file for processing */
30 script = _wfopen(filename, L"r");
31 if (script == NULL)
32 {
35 }
36
37 /* Read and process the script */
38 while (fgetws(tmp_string, MAX_STRING_SIZE, script) != NULL)
39 {
40 dwError = InterpretLine(tmp_string);
41 if (dwError != ERROR_SUCCESS)
42 break;
43 }
44
45 /* Close the file */
47
48 return dwError;
49}
50
51
54 _In_ LPWSTR pszStringArray[],
55 _In_ UINT nCount)
56{
57 LPWSTR pszOutString = NULL;
58 size_t nLength;
59 UINT i;
60
61 if ((pszStringArray == NULL) || (nCount == 0))
62 return NULL;
63
64 nLength = 0;
65 for (i = 0; i < nCount; i++)
66 nLength += wcslen(pszStringArray[i]);
67
68 if (nLength > 0)
69 nLength += nCount; /* Space characters and terminating zero */
70
71 pszOutString = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength * sizeof(WCHAR));
72 if (pszOutString == NULL)
73 return NULL;
74
75 for (i = 0; i < nCount; i++)
76 {
77 if (i != 0)
78 wcscat(pszOutString, L" ");
79 wcscat(pszOutString, pszStringArray[i]);
80 }
81
82 return pszOutString;
83}
84
85
86/*
87 * wmain():
88 * Main entry point of the application.
89 */
90int
92 _In_ int argc,
93 _In_ const LPWSTR argv[])
94{
95 LPCWSTR pszScriptFileName = NULL;
96 LPCWSTR pszAliasFileName = NULL;
97 LPCWSTR pszContext = NULL;
98 LPWSTR pszCommand = NULL;
99 int index;
100 DWORD dwError = ERROR_SUCCESS;
101
102 DPRINT("wmain(%S)\n", GetCommandLineW());
103
105
107
108 /* Initialize the Console Standard Streams */
110
111 /* FIXME: Init code goes here */
112 InitAliases();
115 LoadHelpers();
116
117 /* Process the command arguments */
118 for (index = 1; index < argc; index++)
119 {
120 if ((_wcsicmp(argv[index], L"-?") == 0) ||
121 (_wcsicmp(argv[index], L"/?") == 0) ||
122 (_wcsicmp(argv[index], L"?") == 0))
123 {
124 /* Help option */
126 dwError = ERROR_SUCCESS;
127 goto done;
128 }
129 else if ((_wcsicmp(argv[index], L"-a") == 0) ||
130 (_wcsicmp(argv[index], L"/a") == 0))
131 {
132 /* Aliasfile option */
133 if ((index + 1) < argc)
134 {
135 index++;
136 ConPuts(StdOut, L"\nThe -a option is not implemented yet\n");
137 pszAliasFileName = argv[index];
138 }
139 else
140 {
142 dwError = ERROR_INVALID_SYNTAX;
143 goto done;
144 }
145 }
146 else if ((_wcsicmp(argv[index], L"-c") == 0) ||
147 (_wcsicmp(argv[index], L"/c") == 0))
148 {
149 /* Context option */
150 if ((index + 1) < argc)
151 {
152 index++;
153 pszContext = argv[index];
154 }
155 else
156 {
158 dwError = ERROR_INVALID_SYNTAX;
159 goto done;
160 }
161 }
162 else if ((_wcsicmp(argv[index], L"-f") == 0) ||
163 (_wcsicmp(argv[index], L"/f") == 0))
164 {
165 /* File option */
166 if ((index + 1) < argc)
167 {
168 index++;
169 pszScriptFileName = argv[index];
170 }
171 else
172 {
174 dwError = ERROR_INVALID_SYNTAX;
175 goto done;
176 }
177 }
178 else if ((_wcsicmp(argv[index], L"-r") == 0) ||
179 (_wcsicmp(argv[index], L"/r") == 0))
180 {
181 /* Remote option */
182 if ((index + 1) < argc)
183 {
184 index++;
185 pszMachine = HeapAlloc(GetProcessHeap(), 0, (wcslen(argv[index]) + 1) * sizeof(WCHAR));
186 if (pszMachine == NULL)
187 {
188 dwError = ERROR_NOT_ENOUGH_MEMORY;
189 PrintError(g_hModule, dwError);
190 goto done;
191 }
192
194 }
195 else
196 {
198 dwError = ERROR_INVALID_SYNTAX;
199 goto done;
200 }
201 }
202 else
203 {
204 if (pszScriptFileName != NULL)
205 {
207 dwError = ERROR_INVALID_SYNTAX;
208 goto done;
209 }
210 else if (pszCommand == NULL)
211 {
212 pszCommand = MergeStrings((LPWSTR*)&argv[index], argc - index);
213 if (pszCommand == NULL)
214 {
215 dwError = ERROR_NOT_ENOUGH_MEMORY;
216 PrintError(g_hModule, dwError);
217 goto done;
218 }
219
220 break;
221 }
222 }
223 }
224
225 /* Run the alias file */
226 if (pszAliasFileName != NULL)
227 {
228 dwError = RunScript(pszAliasFileName);
229 if (dwError != ERROR_SUCCESS)
230 goto done;
231 }
232
233 /* Set a context */
234 if (pszContext)
235 {
236 dwError = InterpretLine((LPWSTR)pszContext);
237 if (dwError != ERROR_SUCCESS)
238 goto done;
239 }
240
241 /* Run a script, the command line instruction or the interactive interpeter */
242 if (pszScriptFileName != NULL)
243 {
244 dwError = RunScript(pszScriptFileName);
245 }
246 else if (pszCommand != NULL)
247 {
248 dwError = InterpretLine(pszCommand);
249 }
250 else
251 {
253 }
254
255done:
256 /* FIXME: Cleanup code goes here */
257 if (pszMachine != NULL)
259
260 if (pszCommand != NULL)
261 HeapFree(GetProcessHeap(), 0, pszCommand);
262
266
267 return (dwError == ERROR_SUCCESS) ? EXIT_SUCCESS : EXIT_FAILURE;
268}
269
270VOID
271WINAPI
273 _In_ LPWSTR pszQuotedString)
274{
275 DPRINT("FreeQuotedString(%S)\n", pszQuotedString);
276 HeapFree(GetProcessHeap(), 0, pszQuotedString);
277}
278
279VOID
280WINAPI
282 _In_ LPWSTR pszString)
283{
284 DPRINT("FreeString(%S)\n", pszString);
285 LocalFree(pszString);
286}
287
288LPWSTR
289WINAPI
291 _In_ LPWSTR pszString)
292{
293 LPWSTR pszQuotedString;
294
295 DPRINT("MakeQuotedString(%S)\n", pszString);
296
297 pszQuotedString = HeapAlloc(GetProcessHeap(), 0, (wcslen(pszString) + 3) * sizeof(WCHAR));
298 if (pszQuotedString == NULL)
299 return NULL;
300
301 _swprintf(pszQuotedString, L"\"%s\"", pszString);
302
303 return pszQuotedString;
304}
305
306LPWSTR
307CDECL
310 _In_ DWORD dwMsgId,
311 ...)
312{
313 LPCWSTR pszStr;
314 LPWSTR pszInBuffer, pszOutBuffer = NULL;
316 va_list ap;
317
318 DPRINT("MakeString(%p %lu ...)\n", hModule, dwMsgId);
319
320 dwLength = LoadStringW(hModule, dwMsgId, (LPWSTR)&pszStr, 0);
321 if (dwLength == 0)
322 return NULL;
323
324 /* Allocate and copy the resource string, NUL-terminated */
325 pszInBuffer = HeapAlloc(GetProcessHeap(), 0, (dwLength + 1) * sizeof(WCHAR));
326 if (pszInBuffer == NULL)
327 return NULL;
328 CopyMemory(pszInBuffer, pszStr, dwLength * sizeof(WCHAR));
329 pszInBuffer[dwLength] = UNICODE_NULL;
330
331 va_start(ap, dwMsgId);
333 pszInBuffer,
334 0,
335 0,
336 (LPWSTR)&pszOutBuffer,
337 0,
338 &ap);
339 va_end(ap);
340
341 HeapFree(GetProcessHeap(), 0, pszInBuffer);
342
343 return pszOutBuffer;
344}
345
346DWORD
347WINAPI
350 _In_ LPCWSTR pwcArg,
351 _In_ DWORD dwNumArg,
352 _In_ const TOKEN_VALUE *pEnumTable,
353 _Out_ PDWORD pdwValue)
354{
355 DWORD i;
356
357 DPRINT("MatchEnumTag(%p %p %lu %p %p)\n", hModule, pwcArg, dwNumArg, pEnumTable, pdwValue);
358
359 if ((pEnumTable == NULL) || (pdwValue == NULL))
361
362 for (i = 0; i < dwNumArg; i++)
363 {
364 DPRINT("%S -- %S\n", pwcArg, pEnumTable[i].pwszToken);
365 if (MatchToken(pwcArg, pEnumTable[i].pwszToken))
366 {
367 *pdwValue = pEnumTable[i].dwValue;
368 return ERROR_SUCCESS;
369 }
370 }
371
372 return ERROR_NOT_FOUND;
373}
374
375DWORD
376WINAPI
382 _Inout_ TAG_TYPE *pttTags,
383 _In_ DWORD dwTagCount,
384 _Out_ DWORD *pdwTagType)
385{
386 PWSTR pszEqual;
387 DWORD i, j, dwTagLength;
388
389 DPRINT1("MatchTagsInCmdLine(%p %p %lu %lu %p %lu %p)\n",
391 pttTags, dwTagCount, pdwTagType);
392
393 /* Identify tagged arguments (tag=value) */
394 for (i = dwCurrentIndex; i < dwArgCount; i++)
395 {
396 DPRINT("Argument %lu: %S\n", i, ppwcArguments[i]);
397 pdwTagType[i - dwCurrentIndex] = (DWORD)-1;
398
399 /* Skip arguments that do not have a tag */
400 pszEqual = wcschr(ppwcArguments[i], L'=');
401 if (pszEqual == NULL)
402 continue;
403
404 dwTagLength = pszEqual - ppwcArguments[i];
405 DPRINT("Tag length %lu\n", dwTagLength);
406 DPRINT("Value length %lu\n", wcslen(pszEqual + 1));
407
408 pdwTagType[i - dwCurrentIndex] = (DWORD)-1;
409 for (j = 0; j < dwTagCount; j++)
410 {
411 DPRINT("Test tag %S -- %S\n", pttTags[j].pwszTag, ppwcArguments[i]);
412 if ((wcslen(pttTags[j].pwszTag) == dwTagLength) &&
413 (_wcsnicmp(ppwcArguments[i], pttTags[j].pwszTag, dwTagLength) == 0))
414 {
415 DPRINT("Found tag %S\n", pttTags[j].pwszTag);
416 pttTags[j].bPresent = TRUE;
417 pdwTagType[i - dwCurrentIndex] = j;
418
419 /* Remove the tag name from the argument */
420 wcscpy(ppwcArguments[i], pszEqual + 1);
421 break;
422 }
423 }
424 }
425
426 /* Identify un-tagged arguments (value) */
427 for (i = dwCurrentIndex; i < dwArgCount; i++)
428 {
429 if (pdwTagType[i - dwCurrentIndex] != (DWORD)-1)
430 continue;
431
432 for (j = 0; j < dwTagCount; j++)
433 {
434 DPRINT("Test tag %S\n", pttTags[j].pwszTag);
435 if (pttTags[j].bPresent == FALSE)
436 {
437 DPRINT("Found tag %S\n", pttTags[j].pwszTag);
438 pttTags[j].bPresent = TRUE;
439 pdwTagType[i - dwCurrentIndex] = j;
440 break;
441 }
442 }
443 }
444
445 return ERROR_SUCCESS;
446}
447
448BOOL
449WINAPI
451 _In_ LPCWSTR pwszUserToken,
452 _In_ LPCWSTR pwszCmdToken)
453{
454 DPRINT("MatchToken(%S %S)\n", pwszUserToken, pwszCmdToken);
455
456 if ((pwszUserToken == NULL) || (pwszCmdToken == NULL))
457 return FALSE;
458
459 return (_wcsnicmp(pwszUserToken, pwszCmdToken, wcslen(pwszUserToken)) == 0) ? TRUE : FALSE;
460}
461
462DWORD
463WINAPI
465 _In_ DWORD dwUnknown1,
466 _In_ PWSTR pszIfName,
467 _Inout_ PWSTR pszFriendlyName,
468 _Inout_ PDWORD pdwFriendlyName)
469{
470 UNICODE_STRING UnicodeIfName;
473 DWORD ret;
474
475 DPRINT("NsGetFriendlyNameFromIfName(%lx %S %p %p)\n",
476 dwUnknown1, pszIfName, pszFriendlyName, pdwFriendlyName);
477
478 RtlInitUnicodeString(&UnicodeIfName, pszIfName);
479 Status = RtlGUIDFromString(&UnicodeIfName,
481 if (!NT_SUCCESS(Status))
482 {
483 DPRINT1("RtlGUIDFromString failed 0x%08lx\n", Status);
485 }
486
488 pszFriendlyName,
489 pdwFriendlyName,
490 0, 0);
491 if (ret != ERROR_SUCCESS)
492 {
493 DPRINT1("NhGetInterfaceNameFromDeviceGuid() failed %lu\n", ret);
494 }
495
496 return ret;
497}
498
499DWORD
500WINAPI
502 _In_ DWORD dwUnknown1,
503 _In_ PWSTR pszFriendlyName,
504 _Inout_ PWSTR pszIfName,
505 _Inout_ PDWORD pdwIfName)
506{
507 UNICODE_STRING UnicodeIfName;
510 DWORD ret;
511
512 DPRINT("NsGetIfNameFromFriendlyName(%lx %S %p %p)\n",
513 dwUnknown1, pszFriendlyName, pszIfName, pdwIfName);
514
515 ret = NhGetGuidFromInterfaceName(pszFriendlyName,
517 0, 0);
518 if (ret != ERROR_SUCCESS)
519 {
520 DPRINT1("NhGetGuidFromInterfaceName failed %lu\n", ret);
521 return ret;
522 }
523
524 RtlInitUnicodeString(&UnicodeIfName, NULL);
526 &UnicodeIfName);
527 if (!NT_SUCCESS(Status))
528 {
529 DPRINT1("RtlStringFromGUID failed 0x%08lx\n", Status);
531 }
532
533 if (*pdwIfName >= UnicodeIfName.MaximumLength)
534 {
535 CopyMemory(pszIfName, UnicodeIfName.Buffer, UnicodeIfName.MaximumLength);
536 *pdwIfName = UnicodeIfName.MaximumLength;
537 }
538
539 RtlFreeUnicodeString(&UnicodeIfName);
540
541 return ret;
542}
543
544DWORD
545WINAPI
551 _Inout_ TAG_TYPE *pttTags,
552 _In_ DWORD dwTagCount,
553 _In_ DWORD dwMinArgs,
554 _In_ DWORD dwMaxArgs,
555 _Out_ DWORD *pdwTagType)
556{
557 DWORD i;
558 DWORD dwError = ERROR_SUCCESS;
559
560 DPRINT("PreprocessCommand()\n");
561
562 if ((ppwcArguments == NULL) || (pttTags == NULL) || (pdwTagType == NULL))
564
565 if (((dwArgCount - dwCurrentIndex) < dwMinArgs) || ((dwArgCount - dwCurrentIndex) > dwMaxArgs))
567
568 for (i = 0; i < dwTagCount; i++)
569 {
570 pttTags[i].bPresent = FALSE;
571 }
572
573 if ((dwArgCount - dwCurrentIndex) > 0)
574 {
575 dwError = MatchTagsInCmdLine(hModule,
579 pttTags,
580 dwTagCount,
581 pdwTagType);
582 if (dwError != ERROR_SUCCESS)
583 {
584 return dwError;
585 }
586 }
587
588 /* Fail, if a required tag is missing */
589 for (i = 0; i < dwTagCount; i++)
590 {
591 if ((pttTags[i].dwRequired & NS_REQ_PRESENT) && (pttTags[i].bPresent == FALSE))
593 }
594
595 return 0;
596}
597
598DWORD
599CDECL
602 _In_ DWORD dwErrId,
603 ...)
604{
605 INT Length;
606 va_list ap;
607
608 va_start(ap, dwErrId);
609
610 if (hModule)
611 {
614 }
615 else
616 {
617 if ((dwErrId > NETSH_ERROR_BASE) && (dwErrId < NETSH_ERROR_END))
618 {
621 }
622 else
623 {
625 NULL, dwErrId,
627 }
628 }
629
630 va_end(ap);
631
632 return (DWORD)Length;
633}
634
635DWORD
636CDECL
639 _In_ DWORD dwMsgId,
640 ...)
641{
642 INT Length;
643 va_list ap;
644
645 va_start(ap, dwMsgId);
648 va_end(ap);
649
650 return (DWORD)Length;
651}
652
653DWORD
654CDECL
656 _In_ LPCWSTR pwszFormat,
657 ...)
658{
659 INT Length;
660 va_list ap;
661
662 va_start(ap, pwszFormat);
663 Length = ConPrintfV(StdOut, pwszFormat, ap);
664 va_end(ap);
665
666 return (DWORD)Length;
667}
LONG NTSTATUS
Definition: precomp.h:26
#define index(s, c)
Definition: various.h:29
VOID DestroyAliases(VOID)
Definition: alias.c:103
VOID InitAliases(VOID)
Definition: alias.c:95
BOOL CreateRootContext(VOID)
Definition: context.c:811
VOID CleanupContext(VOID)
Definition: context.c:1016
PWSTR pszMachine
Definition: context.c:32
DWORD InterpretLine(_In_ LPWSTR pszInputLine)
Definition: interpreter.c:357
VOID InterpretInteractive(VOID)
Definition: interpreter.c:429
#define MAX_STRING_SIZE
Definition: precomp.h:36
HRESULT GetWmiVersionInfo(VOID)
Definition: wmi.c:246
#define IDS_OPEN_FAILED
Definition: resource.h:14
#define IDS_APP_USAGE
Definition: resource.h:12
#define DPRINT1
Definition: precomp.h:8
void ConPuts(FILE *fp, LPCWSTR psz)
Definition: conutils_noros.h:8
#define ConInitStdStreams()
Definition: conutils_noros.h:5
#define StdOut
Definition: conutils_noros.h:6
void ConResPrintf(FILE *fp, UINT nID,...)
#define StdErr
Definition: conutils_noros.h:7
void ConResPuts(FILE *fp, UINT nID)
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
HMODULE hModule
Definition: animate.c:44
#define CDECL
Definition: compat.h:29
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static DWORD DWORD * dwLength
Definition: fusion.c:86
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
LPWSTR WINAPI GetCommandLineW(void)
Definition: process.c:1338
MonoAssembly int argc
Definition: metahost.c:107
int CDECL fclose(FILE *file)
Definition: file.c:3757
wchar_t *CDECL fgetws(wchar_t *s, int size, FILE *file)
Definition: file.c:4043
FILE *CDECL _wfopen(const wchar_t *path, const wchar_t *mode)
Definition: file.c:4335
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:164
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
_ACRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t)
Definition: wcs.c:200
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
char * va_list
Definition: vadefs.h:50
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:24
GLuint index
Definition: glext.h:6031
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
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
unsigned int UINT
Definition: sysinfo.c:13
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
DWORD CreateRootHelper(VOID)
Definition: helper.c:245
VOID LoadHelpers(VOID)
Definition: helper.c:263
VOID UnloadHelpers(VOID)
Definition: helper.c:340
const char * filename
Definition: ioapi.h:137
DWORD WINAPI NhGetGuidFromInterfaceName(_In_ PWCHAR pInterfaceName, _Out_ GUID *pInterfaceGUID, DWORD dwUnknown3, DWORD dwUnknown4)
DWORD WINAPI NhGetInterfaceNameFromDeviceGuid(_In_ const GUID *pInterfaceGUID, _Out_writes_bytes_to_(*pOutBufLen, *pOutBufLen) PWCHAR pInterfaceName, _Inout_ PULONG pOutBufLen, DWORD dwUnknown4, DWORD dwUnknown5)
#define EXIT_FAILURE
Definition: jerror.c:33
#define CopyMemory
Definition: minwinbase.h:29
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
#define argv
Definition: mplay32.c:18
script
Definition: msipriv.h:383
VOID WINAPI FreeQuotedString(_In_ LPWSTR pszQuotedString)
Definition: netsh.c:272
DWORD WINAPI MatchEnumTag(_In_ HANDLE hModule, _In_ LPCWSTR pwcArg, _In_ DWORD dwNumArg, _In_ const TOKEN_VALUE *pEnumTable, _Out_ PDWORD pdwValue)
Definition: netsh.c:348
VOID WINAPI FreeString(_In_ LPWSTR pszString)
Definition: netsh.c:281
DWORD CDECL PrintError(_In_opt_ HANDLE hModule, _In_ DWORD dwErrId,...)
Definition: netsh.c:600
LPWSTR CDECL MakeString(_In_ HANDLE hModule, _In_ DWORD dwMsgId,...)
Definition: netsh.c:308
DWORD CDECL PrintMessage(_In_ LPCWSTR pwszFormat,...)
Definition: netsh.c:655
DWORD RunScript(_In_ LPCWSTR filename)
Definition: netsh.c:22
DWORD WINAPI MatchTagsInCmdLine(_In_ HANDLE hModule, _Inout_ LPWSTR *ppwcArguments, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _Inout_ TAG_TYPE *pttTags, _In_ DWORD dwTagCount, _Out_ DWORD *pdwTagType)
Definition: netsh.c:377
DWORD WINAPI NsGetIfNameFromFriendlyName(_In_ DWORD dwUnknown1, _In_ PWSTR pszFriendlyName, _Inout_ PWSTR pszIfName, _Inout_ PDWORD pdwIfName)
Definition: netsh.c:501
BOOL WINAPI MatchToken(_In_ LPCWSTR pwszUserToken, _In_ LPCWSTR pwszCmdToken)
Definition: netsh.c:450
LPWSTR MergeStrings(_In_ LPWSTR pszStringArray[], _In_ UINT nCount)
Definition: netsh.c:53
HMODULE g_hModule
Definition: netsh.c:17
DWORD WINAPI NsGetFriendlyNameFromIfName(_In_ DWORD dwUnknown1, _In_ PWSTR pszIfName, _Inout_ PWSTR pszFriendlyName, _Inout_ PDWORD pdwFriendlyName)
Definition: netsh.c:464
DWORD CDECL PrintMessageFromModule(_In_ HANDLE hModule, _In_ DWORD dwMsgId,...)
Definition: netsh.c:637
LPWSTR WINAPI MakeQuotedString(_In_ LPWSTR pszString)
Definition: netsh.c:290
DWORD WINAPI PreprocessCommand(_In_ HANDLE hModule, _Inout_ LPWSTR *ppwcArguments, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _Inout_ TAG_TYPE *pttTags, _In_ DWORD dwTagCount, _In_ DWORD dwMinArgs, _In_ DWORD dwMaxArgs, _Out_ DWORD *pdwTagType)
Definition: netsh.c:546
@ NS_REQ_PRESENT
Definition: netsh.h:35
#define NETSH_ERROR_BASE
Definition: netsh.h:8
#define ERROR_INVALID_SYNTAX
Definition: netsh.h:10
_In_ LPWSTR * ppwcArguments
Definition: netsh.h:114
_In_ LPWSTR _In_ DWORD dwArgCount
Definition: netsh.h:115
_In_ LPWSTR _In_ DWORD dwCurrentIndex
Definition: netsh.h:139
#define NETSH_ERROR_END
Definition: netsh.h:30
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define DWORD
Definition: nt_native.h:44
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
INT ConResMsgPrintfExV(IN PCON_STREAM Stream, IN HINSTANCE hInstance OPTIONAL, IN DWORD dwFlags, IN UINT uID, IN LANGID LanguageId, IN va_list *Arguments OPTIONAL)
Definition: outstream.c:1216
INT ConPrintfV(IN PCON_STREAM Stream, IN PCWSTR szStr, IN va_list args)
Definition: outstream.c:465
INT ConMsgPrintfV(IN PCON_STREAM Stream, IN DWORD dwFlags, IN LPCVOID lpSource OPTIONAL, IN DWORD dwMessageId, IN DWORD dwLanguageId, IN va_list *Arguments OPTIONAL)
Definition: outstream.c:1028
short WCHAR
Definition: pedump.c:58
DWORD * PDWORD
Definition: pedump.c:68
int wmain()
#define EXIT_SUCCESS
Definition: rdjpgcom.c:55
wcscat
wcscpy
#define LoadStringW
Definition: utils.h:64
#define DPRINT
Definition: sndvol32.h:73
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:398
#define GetModuleHandle
Definition: winbase.h:3548
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:400
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:396
WINBASEAPI _In_ DWORD nLength
Definition: wincon.h:682
#define WINAPI
Definition: msvc.h:6
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define ERROR_NOT_FOUND
Definition: winerror.h:1014
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36
static const GUID InterfaceGuid
Definition: wlanapi.c:25