ReactOS 0.4.16-dev-1946-g52006dd
precomp.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ndk/rtlfuncs.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wincon.h>
#include <winuser.h>
#include <iphlpapi_undoc.h>
#include <errno.h>
#include <conutils.h>
#include <netsh.h>
#include <netsh_undoc.h>
#include "resource.h"
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DLL_LIST_ENTRY
 
struct  _HELPER_ENTRY
 
struct  _COMMAND_ENTRY
 
struct  _COMMAND_GROUP
 
struct  _CONTEXT_ENTRY
 

Macros

#define WIN32_NO_STATUS
 
#define HUGE_BUFFER_SIZE   2048
 
#define MAX_STRING_SIZE   1024
 
#define MAX_ARGS_COUNT   256
 
#define REG_NETSH_PATH   L"Software\\Microsoft\\NetSh"
 

Typedefs

typedef struct _DLL_LIST_ENTRY DLL_LIST_ENTRY
 
typedef struct _DLL_LIST_ENTRYPDLL_LIST_ENTRY
 
typedef struct _HELPER_ENTRY HELPER_ENTRY
 
typedef struct _HELPER_ENTRYPHELPER_ENTRY
 
typedef struct _COMMAND_ENTRY COMMAND_ENTRY
 
typedef struct _COMMAND_ENTRYPCOMMAND_ENTRY
 
typedef struct _COMMAND_GROUP COMMAND_GROUP
 
typedef struct _COMMAND_GROUPPCOMMAND_GROUP
 
typedef struct _CONTEXT_ENTRY CONTEXT_ENTRY
 
typedef struct _CONTEXT_ENTRYPCONTEXT_ENTRY
 

Functions

VOID InitAliases (VOID)
 
VOID DestroyAliases (VOID)
 
DWORD WINAPI AliasCommand (LPCWSTR pwszMachine, LPWSTR *argv, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
 
DWORD WINAPI ShowAliasCommand (LPCWSTR pwszMachine, LPWSTR *argv, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
 
DWORD WINAPI UnaliasCommand (LPCWSTR pwszMachine, LPWSTR *argv, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
 
BOOL CreateRootContext (VOID)
 
VOID CleanupContext (VOID)
 
PCONTEXT_ENTRY FindContextByGuid (_In_ const GUID *pGuid)
 
VOID PrintCommandHelp (_In_ PCONTEXT_ENTRY pContext, _In_ PCOMMAND_GROUP pGroup, _In_ PCOMMAND_ENTRY pCommand)
 
VOID PrintGroupHelp (_In_ PCONTEXT_ENTRY pContext, _In_ LPWSTR pszGroupName, _In_ BOOL bRecurse)
 
VOID PrintContextHelp (_In_ PCONTEXT_ENTRY pContext)
 
DWORD CreateRootHelper (VOID)
 
VOID LoadHelpers (VOID)
 
VOID UnloadHelpers (VOID)
 
PHELPER_ENTRY FindHelper (_In_ const GUID *pguidHelper, _In_ PHELPER_ENTRY pHelper)
 
DWORD WINAPI AddHelperCommand (LPCWSTR pwszMachine, LPWSTR *ppwcArguments, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
 
DWORD WINAPI DeleteHelperCommand (LPCWSTR pwszMachine, LPWSTR *ppwcArguments, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
 
DWORD WINAPI ShowHelperCommand (LPCWSTR pwszMachine, PWSTR *ppwcArguments, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
 
DWORD InterpretLine (_In_ LPWSTR pszFileName)
 
VOID InterpretInteractive (VOID)
 
DWORD RunScript (_In_ LPCWSTR filename)
 
LPWSTR MergeStrings (_In_ LPWSTR pszStringArray[], _In_ INT nCount)
 

Variables

PCONTEXT_ENTRY pRootContext
 
PCONTEXT_ENTRY pCurrentContext
 
PHELPER_ENTRY pHelperListHead
 
HMODULE hModule
 
PWSTR pszMachine
 

Macro Definition Documentation

◆ HUGE_BUFFER_SIZE

#define HUGE_BUFFER_SIZE   2048

Definition at line 38 of file precomp.h.

◆ MAX_ARGS_COUNT

#define MAX_ARGS_COUNT   256

Definition at line 41 of file precomp.h.

◆ MAX_STRING_SIZE

#define MAX_STRING_SIZE   1024

Definition at line 40 of file precomp.h.

◆ REG_NETSH_PATH

#define REG_NETSH_PATH   L"Software\\Microsoft\\NetSh"

Definition at line 43 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 19 of file precomp.h.

Typedef Documentation

◆ COMMAND_ENTRY

◆ COMMAND_GROUP

◆ CONTEXT_ENTRY

◆ DLL_LIST_ENTRY

◆ HELPER_ENTRY

◆ PCOMMAND_ENTRY

◆ PCOMMAND_GROUP

◆ PCONTEXT_ENTRY

◆ PDLL_LIST_ENTRY

◆ PHELPER_ENTRY

Function Documentation

◆ AddHelperCommand()

DWORD WINAPI AddHelperCommand ( LPCWSTR  pwszMachine,
LPWSTR ppwcArguments,
DWORD  dwCurrentIndex,
DWORD  dwArgCount,
DWORD  dwFlags,
LPCVOID  pvData,
BOOL pbDone 
)

Definition at line 461 of file helper.c.

469{
470 DWORD dwError = ERROR_SUCCESS;
471
472 DPRINT("AddHelperCommand()\n");
473
474 if (dwArgCount == 2)
475 {
476// ConResPrintf(StdErr, IDS_INVALID_SYNTAX);
477// ConResPrintf(StdErr, IDS_HLP_ADD_HELPER_EX);
478 return 1;
479 }
480
481 dwError = LoadHelperDll(ppwcArguments[2], TRUE);
482 if (dwError != ERROR_SUCCESS)
483 return dwError;
484
486
487 return ERROR_SUCCESS;
488}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
unsigned long DWORD
Definition: ntddk_ex.h:95
static VOID StartHelpers(PHELPER_ENTRY pHelper)
Definition: helper.c:29
PHELPER_ENTRY pHelperListHead
Definition: helper.c:20
static DWORD LoadHelperDll(_In_ PWSTR pszDllName, _In_ BOOL bRegister)
Definition: helper.c:116
_In_ LPWSTR * ppwcArguments
Definition: netsh.h:114
_In_ LPWSTR _In_ DWORD dwArgCount
Definition: netsh.h:115
#define DPRINT
Definition: sndvol32.h:73

Referenced by CreateRootContext().

◆ AliasCommand()

DWORD WINAPI AliasCommand ( LPCWSTR  pwszMachine,
LPWSTR argv,
DWORD  dwCurrentIndex,
DWORD  dwArgCount,
DWORD  dwFlags,
LPCVOID  pvData,
BOOL pbDone 
)

Definition at line 123 of file alias.c.

131{
132 PALIAS_ENTRY pAliasEntry = NULL;
133 PWSTR pszAlias;
134
135 DPRINT("AliasCommand(dwCurrentIndex %lu dwArgCount %lu)\n",
137
138 /* Show aliases */
139 if (dwArgCount - dwCurrentIndex == 0)
140 {
141 ShowAliases();
142 return ERROR_SUCCESS;
143 }
144
145 if (dwArgCount - dwCurrentIndex == 1)
146 {
148 return ERROR_SUCCESS;
149 }
150
151
152 /* TODO: Check builtin commands */
153
154
155 pAliasEntry = GetAliasEntry(argv[dwCurrentIndex]);
156 if (pAliasEntry)
157 {
159 DPRINT("Alias: %S\n", pszAlias);
160 if (pszAlias == NULL)
162
163 if (pAliasEntry->pszAlias)
164 HeapFree(GetProcessHeap(), 0, pAliasEntry->pszAlias);
165
166 pAliasEntry->pszAlias = pszAlias;
167 }
168 else
169 {
170 pAliasEntry = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ALIAS_ENTRY));
171 if (pAliasEntry == NULL)
173
174 pAliasEntry->pszAliasName = HeapAlloc(GetProcessHeap(), 0,
175 (wcslen(argv[dwCurrentIndex]) + 1) * sizeof(WCHAR));
176 if (pAliasEntry->pszAliasName == NULL)
177 {
178 HeapFree(GetProcessHeap(), 0, pAliasEntry);
180 }
181
182 wcscpy(pAliasEntry->pszAliasName, argv[dwCurrentIndex]);
183 DPRINT("AliasName: %S\n", pAliasEntry->pszAliasName);
184
186 DPRINT("Alias: %S\n", pAliasEntry->pszAlias);
187 if (pAliasEntry->pszAlias == NULL)
188 {
189 HeapFree(GetProcessHeap(), 0, pAliasEntry->pszAliasName);
190 HeapFree(GetProcessHeap(), 0, pAliasEntry);
192 }
193
194 if (AliasListHead == NULL)
195 {
196 AliasListHead = pAliasEntry;
197 AliasListTail = pAliasEntry;
198 }
199 else
200 {
201 pAliasEntry->pPrev = AliasListTail;
202 AliasListTail->pNext = pAliasEntry;
203 AliasListTail = pAliasEntry;
204 }
205 }
206
207 DPRINT("Done\n");
208
209 return ERROR_OKAY;
210}
static PALIAS_ENTRY GetAliasEntry(PWSTR pszAliasName)
Definition: alias.c:76
PALIAS_ENTRY AliasListHead
Definition: alias.c:26
PALIAS_ENTRY AliasListTail
Definition: alias.c:27
static VOID ShowAliases(VOID)
Definition: alias.c:34
static VOID ShowAlias(PWSTR pszAliasName)
Definition: alias.c:51
wcscpy
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define argv
Definition: mplay32.c:18
LPWSTR MergeStrings(_In_ LPWSTR pszStringArray[], _In_ INT nCount)
Definition: netsh.c:53
#define ERROR_OKAY
Definition: netsh.h:24
_In_ LPWSTR _In_ DWORD dwCurrentIndex
Definition: netsh.h:139
Definition: alias.c:18
PWSTR pszAliasName
Definition: alias.c:22
struct _ALIAS_ENTRY * pNext
Definition: alias.c:20
struct _ALIAS_ENTRY * pPrev
Definition: alias.c:19
PWSTR pszAlias
Definition: alias.c:23
uint16_t * PWSTR
Definition: typedefs.h:56
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CreateRootContext().

◆ CleanupContext()

VOID CleanupContext ( VOID  )

Definition at line 999 of file context.c.

1000{
1001 /* Delete the context stack */
1002
1003}

Referenced by wmain().

◆ CreateRootContext()

BOOL CreateRootContext ( VOID  )

Definition at line 805 of file context.c.

806{
807 PCOMMAND_GROUP pGroup;
808
809 pRootContext = AddContext(NULL, L"netsh", NULL);
810 DPRINT("pRootContext: %p\n", pRootContext);
811 if (pRootContext == NULL)
812 return FALSE;
813
815
832
834 if (pGroup)
835 {
837 }
838
839 pGroup = AddCommandGroup(pRootContext, L"delete", IDS_HLP_GROUP_DELETE, 0);
840 if (pGroup)
841 {
843 }
844
846 if (pGroup)
847 {
850 }
851
853 if (pGroup)
854 {
858 }
859
861
862 return TRUE;
863}
DWORD WINAPI ShowAliasCommand(LPCWSTR pwszMachine, LPWSTR *argv, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
Definition: alias.c:215
DWORD WINAPI UnaliasCommand(LPCWSTR pwszMachine, LPWSTR *argv, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
Definition: alias.c:234
DWORD WINAPI AliasCommand(LPCWSTR pwszMachine, LPWSTR *argv, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
Definition: alias.c:123
PCOMMAND_GROUP AddCommandGroup(PCONTEXT_ENTRY pContext, LPCWSTR pwszCmdGroupToken, DWORD dwShortCmdHelpToken, DWORD dwFlags)
Definition: context.c:152
DWORD WINAPI SetModeCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:751
PCOMMAND_ENTRY AddContextCommand(PCONTEXT_ENTRY pContext, LPCWSTR pwszCmdToken, PFN_HANDLE_CMD pfnCmdHandler, DWORD dwShortCmdHelpToken, DWORD dwCmdHlpToken, DWORD dwFlags)
Definition: context.c:101
PCOMMAND_ENTRY AddGroupCommand(PCOMMAND_GROUP pGroup, LPCWSTR pwszCmdToken, PFN_HANDLE_CMD pfnCmdHandler, DWORD dwShortCmdHelpToken, DWORD dwCmdHlpToken, DWORD dwFlags)
Definition: context.c:197
PCONTEXT_ENTRY pRootContext
Definition: context.c:26
DWORD WINAPI ExecCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:549
DWORD WINAPI CommitCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:511
DWORD WINAPI ShowModeCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:789
DWORD WINAPI AbortCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:494
DWORD WINAPI OnlineCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:621
DWORD WINAPI UpCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:476
DWORD WINAPI SetMachineCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:714
PCONTEXT_ENTRY pCurrentContext
Definition: context.c:27
DWORD WINAPI DumpCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *ppwcArguments, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:528
DWORD WINAPI PopdCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:639
PCONTEXT_ENTRY AddContext(PCONTEXT_ENTRY pParentContext, PWSTR pszName, GUID *pGuid)
Definition: context.c:39
DWORD WINAPI OfflineCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:603
DWORD WINAPI PushdCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:678
DWORD WINAPI ExitCommand(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *argv, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: context.c:569
#define IDS_HLP_POPD
Definition: resource.h:29
#define IDS_HLP_DEL_HELPER
Definition: resource.h:52
#define IDS_HLP_SHOW_MODE
Definition: resource.h:62
#define IDS_HLP_SHOW_ALIAS_EX
Definition: resource.h:59
#define IDS_HLP_GROUP_SET
Definition: resource.h:67
#define IDS_HLP_GROUP_ADD
Definition: resource.h:65
#define IDS_HLP_SHOW_ALIAS
Definition: resource.h:58
#define IDS_HLP_HELP
Definition: resource.h:25
#define IDS_HLP_DUMP
Definition: resource.h:35
#define IDS_HLP_PUSHD_EX
Definition: resource.h:32
#define IDS_HLP_EXEC_EX
Definition: resource.h:34
#define IDS_HLP_POPD_EX
Definition: resource.h:30
#define IDS_HLP_UNALIAS_EX
Definition: resource.h:48
#define IDS_HLP_DUMP_EX
Definition: resource.h:36
#define IDS_HLP_GROUP_SHOW
Definition: resource.h:68
#define IDS_HLP_EXIT
Definition: resource.h:23
#define IDS_HLP_COMMIT
Definition: resource.h:43
#define IDS_HLP_DEL_HELPER_EX
Definition: resource.h:53
#define IDS_HLP_SET_MACHINE
Definition: resource.h:54
#define IDS_HLP_OFFLINE_EX
Definition: resource.h:38
#define IDS_HLP_SET_MODE_EX
Definition: resource.h:57
#define IDS_HLP_COMMIT_EX
Definition: resource.h:44
#define IDS_HLP_ALIAS
Definition: resource.h:45
#define IDS_HLP_ONLINE
Definition: resource.h:39
#define IDS_HLP_GROUP_DELETE
Definition: resource.h:66
#define IDS_HLP_SHOW_MODE_EX
Definition: resource.h:63
#define IDS_HLP_HELP_EX
Definition: resource.h:26
#define IDS_HLP_EXEC
Definition: resource.h:33
#define IDS_HLP_UNALIAS
Definition: resource.h:47
#define IDS_HLP_PUSHD
Definition: resource.h:31
#define IDS_HLP_ONLINE_EX
Definition: resource.h:40
#define IDS_HLP_UP_EX
Definition: resource.h:28
#define IDS_HLP_SHOW_HELPER
Definition: resource.h:60
#define IDS_HLP_SET_MACHINE_EX
Definition: resource.h:55
#define IDS_HLP_ABORT_EX
Definition: resource.h:42
#define IDS_HLP_SET_MODE
Definition: resource.h:56
#define IDS_HLP_EXIT_EX
Definition: resource.h:24
#define IDS_HLP_OFFLINE
Definition: resource.h:37
#define IDS_HLP_ADD_HELPER_EX
Definition: resource.h:51
#define IDS_HLP_ALIAS_EX
Definition: resource.h:46
#define IDS_HLP_ABORT
Definition: resource.h:41
#define IDS_HLP_SHOW_HELPER_EX
Definition: resource.h:61
#define IDS_HLP_ADD_HELPER
Definition: resource.h:50
#define IDS_HLP_UP
Definition: resource.h:27
#define FALSE
Definition: types.h:117
#define L(x)
Definition: resources.c:13
DWORD WINAPI ShowHelperCommand(LPCWSTR pwszMachine, LPWSTR *ppwcArguments, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
Definition: helper.c:614
DWORD WINAPI AddHelperCommand(LPCWSTR pwszMachine, LPWSTR *ppwcArguments, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
Definition: helper.c:461
DWORD WINAPI DeleteHelperCommand(LPCWSTR pwszMachine, LPWSTR *ppwcArguments, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
Definition: helper.c:493
HMODULE hModule
Definition: netsh.c:17
HMODULE hModule
Definition: precomp.h:114

Referenced by wmain().

◆ CreateRootHelper()

DWORD CreateRootHelper ( VOID  )

Definition at line 245 of file helper.c.

246{
247 PHELPER_ENTRY pHelper;
248
250 if (pHelper == NULL)
251 return ERROR_OUTOFMEMORY;
252
253 /* FIXME: More to initialize here? */
254
255 pHelperListHead = pHelper;
256 pHelperListTail = pHelper;
257
258 return ERROR_SUCCESS;
259}
struct _HELPER_ENTRY * PHELPER_ENTRY
struct _HELPER_ENTRY HELPER_ENTRY
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
PHELPER_ENTRY pHelperListTail
Definition: helper.c:21
Definition: precomp.h:62

Referenced by wmain().

◆ DeleteHelperCommand()

DWORD WINAPI DeleteHelperCommand ( LPCWSTR  pwszMachine,
LPWSTR ppwcArguments,
DWORD  dwCurrentIndex,
DWORD  dwArgCount,
DWORD  dwFlags,
LPCVOID  pvData,
BOOL pbDone 
)

Definition at line 493 of file helper.c.

501{
503 HKEY hKey;
504 DWORD dwError;
505
506 DPRINT("DeleteHelper()\n");
507
508 if (dwArgCount == 2)
509 {
510// ConResPrintf(StdErr, IDS_INVALID_SYNTAX);
511// ConResPrintf(StdErr, IDS_HLP_DEL_HELPER_EX);
512 return 1;
513 }
514
516 while (pEntry != NULL)
517 {
518 if (wcscmp(pEntry->pszShortName, ppwcArguments[2]) == 0)
519 {
520 DPRINT1("remove %S\n", pEntry->pszShortName);
521
522 if (pEntry->pPrev != NULL)
523 pEntry->pPrev->pNext = pEntry->pNext;
524 if (pEntry->pNext != NULL)
525 pEntry->pNext->pPrev = pEntry->pPrev;
526 if (pDllListTail == pEntry)
527 pDllListTail = pEntry->pPrev;
528 if (pDllListHead == pEntry)
529 pDllListHead = pEntry->pNext;
530 pEntry->pPrev = NULL;
531 pEntry->pNext = NULL;
532
535 0,
536 KEY_WRITE,
537 &hKey);
538 if (dwError == ERROR_SUCCESS)
539 {
540 RegDeleteValue(hKey, pEntry->pszValueName);
542 }
543
545
546 return 1;
547 }
548
549 pEntry = pEntry->pNext;
550 }
551
552 return ERROR_SUCCESS;
553}
#define REG_NETSH_PATH
Definition: precomp.h:43
#define DPRINT1
Definition: precomp.h:8
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
FxAutoRegKey hKey
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
PDLL_LIST_ENTRY pDllListHead
Definition: helper.c:17
static VOID FreeHelperDll(_In_ PDLL_LIST_ENTRY pEntry)
Definition: helper.c:95
PDLL_LIST_ENTRY pDllListTail
Definition: helper.c:18
#define KEY_WRITE
Definition: nt_native.h:1034
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
Definition: precomp.h:49
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define RegDeleteValue
Definition: winreg.h:515

Referenced by CreateRootContext().

◆ DestroyAliases()

VOID DestroyAliases ( VOID  )

Definition at line 103 of file alias.c.

104{
105 PALIAS_ENTRY pAliasEntry;
106
107 while (AliasListHead != NULL)
108 {
109 pAliasEntry = AliasListHead;
111
112 HeapFree(GetProcessHeap(), 0, pAliasEntry->pszAliasName);
113 HeapFree(GetProcessHeap(), 0, pAliasEntry->pszAlias);
114 HeapFree(GetProcessHeap(), 0, pAliasEntry);
115 }
116
118}

Referenced by wmain().

◆ FindContextByGuid()

PCONTEXT_ENTRY FindContextByGuid ( _In_ const GUID pGuid)

◆ FindHelper()

PHELPER_ENTRY FindHelper ( _In_ const GUID pguidHelper,
_In_ PHELPER_ENTRY  pHelper 
)

Definition at line 360 of file helper.c.

363{
364 PHELPER_ENTRY pFoundHelper;
365
366// pHelper = pHelperListHead;
367 while (pHelper != NULL)
368 {
369 if (IsEqualGUID(pguidHelper, &pHelper->Attributes.guidHelper))
370 return pHelper;
371
372 pFoundHelper = FindHelper(pguidHelper, pHelper->pSubHelperHead);
373 if (pFoundHelper)
374 return pFoundHelper;
375
376 pHelper = pHelper->pNext;
377 }
378
379 return NULL;
380}
PHELPER_ENTRY FindHelper(_In_ const GUID *pguidHelper, _In_ PHELPER_ENTRY pHelper)
Definition: helper.c:360
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
struct _HELPER_ENTRY * pNext
Definition: precomp.h:64

Referenced by FindHelper(), RegisterContext(), and RegisterHelper().

◆ InitAliases()

VOID InitAliases ( VOID  )

Definition at line 95 of file alias.c.

96{
99}

Referenced by wmain().

◆ InterpretInteractive()

VOID InterpretInteractive ( VOID  )

Definition at line 385 of file interpreter.c.

386{
387 WCHAR input_line[MAX_STRING_SIZE];
388 LPWSTR args_vector[MAX_ARGS_COUNT];
389 DWORD dwArgCount = 0;
390 BOOL bWhiteSpace = TRUE;
391 BOOL bDone = FALSE;
392 LPWSTR ptr;
393 DWORD dwError = ERROR_SUCCESS;
394
395 for (;;)
396 {
397 dwArgCount = 0;
398 memset(args_vector, 0, sizeof(args_vector));
399
400 /* Shown just before the input where the user places commands */
401 if (pszMachine)
402 ConPrintf(StdOut, L"[%s] ", pszMachine);
404 ConPuts(StdOut, L">");
405
406 /* Get input from the user. */
407 fgetws(input_line, MAX_STRING_SIZE, stdin);
408
409 ptr = input_line;
410 while (*ptr != 0)
411 {
412 if (iswspace(*ptr) || *ptr == L'\n')
413 {
414 *ptr = 0;
415 bWhiteSpace = TRUE;
416 }
417 else
418 {
419 if ((bWhiteSpace != FALSE) && (dwArgCount < MAX_ARGS_COUNT))
420 {
421 args_vector[dwArgCount] = ptr;
422 dwArgCount++;
423 }
424 bWhiteSpace = FALSE;
425 }
426 ptr++;
427 }
428
429 dwError = InterpretCommand(args_vector, dwArgCount, &bDone);
430 if ((dwError != ERROR_SUCCESS) && (dwError != ERROR_SUPPRESS_OUTPUT))
431 {
432 PWSTR pszCommandString = MergeStrings(args_vector, dwArgCount);
433 PrintError(NULL, dwError, pszCommandString);
434 HeapFree(GetProcessHeap(), 0, pszCommandString);
435 }
436 if (dwError != ERROR_SUPPRESS_OUTPUT)
437 ConPuts(StdOut, L"\n");
438
439 if (bDone)
440 break;
441 }
442}
void ConPuts(FILE *fp, LPCWSTR psz)
Definition: fc.c:16
void ConPrintf(FILE *fp, LPCWSTR psz,...)
Definition: fc.c:20
#define StdOut
Definition: fc.c:14
PWSTR pszMachine
Definition: context.c:32
static DWORD InterpretCommand(_In_ LPWSTR *argv, _In_ DWORD dwArgCount, _Inout_ PBOOL bDone)
Definition: interpreter.c:134
VOID PrintPrompt(_In_ PCONTEXT_ENTRY pContext)
Definition: interpreter.c:371
#define MAX_STRING_SIZE
Definition: precomp.h:40
#define MAX_ARGS_COUNT
Definition: precomp.h:41
static VOID PrintError(DWORD dwError)
Definition: cacls.c:37
unsigned int BOOL
Definition: ntddk_ex.h:94
#define iswspace(_c)
Definition: ctype.h:669
#define stdin
Definition: stdio.h:98
static PVOID ptr
Definition: dispmode.c:27
#define ERROR_SUPPRESS_OUTPUT
Definition: netsh.h:26
#define memset(x, y, z)
Definition: compat.h:39
wchar_t * fgetws(wchar_t *buf, int bufsize, FILE *file)
Definition: wmain.c:22
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by wmain().

◆ InterpretLine()

DWORD InterpretLine ( _In_ LPWSTR  pszFileName)

Definition at line 333 of file interpreter.c.

335{
336 LPWSTR args_vector[MAX_ARGS_COUNT];
337 DWORD dwArgCount = 0;
338 BOOL bWhiteSpace = TRUE;
339 BOOL bDone = FALSE;
340 LPWSTR ptr;
341
342 memset(args_vector, 0, sizeof(args_vector));
343
344 ptr = pszInputLine;
345 while (*ptr != 0)
346 {
347 if (iswspace(*ptr) || *ptr == L'\n')
348 {
349 *ptr = 0;
350 bWhiteSpace = TRUE;
351 }
352 else
353 {
354 if ((bWhiteSpace != FALSE) && (dwArgCount < MAX_ARGS_COUNT))
355 {
356 args_vector[dwArgCount] = ptr;
357 dwArgCount++;
358 }
359
360 bWhiteSpace = FALSE;
361 }
362
363 ptr++;
364 }
365
366 return InterpretCommand(args_vector, dwArgCount, &bDone);
367}

Referenced by RunScript(), and wmain().

◆ LoadHelpers()

VOID LoadHelpers ( VOID  )

Definition at line 263 of file helper.c.

264{
265 PWSTR pszNameBuffer = NULL;
266 PWSTR pszValueBuffer = NULL;
267 HKEY hKey;
268 DWORD dwValueCount, dwMaxNameLength, dwMaxValueLength;
269 DWORD dwNameLength, dwValueLength, dwType;
270 DWORD dwIndex, dwError;
271
272 DPRINT1("LoadHelpers()\n");
273
276 0,
277 KEY_READ,
278 &hKey);
279 if (dwError != ERROR_SUCCESS)
280 return;
281
282 dwError = RegQueryInfoKeyW(hKey,
283 NULL,
284 NULL,
285 NULL,
286 NULL,
287 NULL,
288 NULL,
289 &dwValueCount,
290 &dwMaxNameLength,
291 &dwMaxValueLength,
292 NULL,
293 NULL);
294 if (dwError != ERROR_SUCCESS)
295 goto done;
296
297 pszNameBuffer = HeapAlloc(GetProcessHeap(), 0,
298 (dwMaxNameLength + 1) * sizeof(WCHAR));
299 if (pszNameBuffer == NULL)
300 goto done;
301
302 pszValueBuffer = HeapAlloc(GetProcessHeap(), 0,
303 dwMaxValueLength + sizeof(WCHAR));
304 if (pszValueBuffer == NULL)
305 goto done;
306
307 for (dwIndex = 0; dwIndex < dwValueCount; dwIndex++)
308 {
309 dwNameLength = dwMaxNameLength + 1;
310 dwValueLength = dwMaxValueLength + sizeof(WCHAR);
311 dwError = RegEnumValueW(hKey,
312 dwIndex,
313 pszNameBuffer,
314 &dwNameLength,
315 NULL,
316 &dwType,
317 (PBYTE)pszValueBuffer,
318 &dwValueLength);
319 if (dwError != ERROR_SUCCESS)
320 break;
321
322 DPRINT1("Dll: %S --> %S %lu\n", pszNameBuffer, pszValueBuffer, dwError);
323 LoadHelperDll(pszValueBuffer, FALSE);
324 }
325
326done:
327 if (pszValueBuffer)
328 HeapFree(GetProcessHeap(), 0, pszValueBuffer);
329
330 if (pszNameBuffer)
331 HeapFree(GetProcessHeap(), 0, pszNameBuffer);
332
334
336}
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2830
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3662
#define KEY_READ
Definition: nt_native.h:1026
BYTE * PBYTE
Definition: pedump.c:66

Referenced by wmain().

◆ MergeStrings()

LPWSTR MergeStrings ( _In_ LPWSTR  pszStringArray[],
_In_ INT  nCount 
)

Definition at line 53 of file netsh.c.

56{
57 LPWSTR pszOutString = NULL;
58 INT i, nLength;
59
60 if ((pszStringArray == NULL) || (nCount == 0))
61 return NULL;
62
63 nLength = 0;
64 for (i = 0; i < nCount; i++)
65 nLength += wcslen(pszStringArray[i]);
66
67 if (nLength > 0)
68 nLength += nCount; /* Space characters and terminating zero */
69
70 pszOutString = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength * sizeof(WCHAR));
71 if (pszOutString == NULL)
72 return NULL;
73
74 for (i = 0; i < nCount; i++)
75 {
76 if (i != 0)
77 wcscat(pszOutString, L" ");
78 wcscat(pszOutString, pszStringArray[i]);
79 }
80
81 return pszOutString;
82}
wcscat
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
int32_t INT
Definition: typedefs.h:58
WINBASEAPI _In_ DWORD nLength
Definition: wincon.h:682

Referenced by AliasCommand(), InterpretInteractive(), and wmain().

◆ PrintCommandHelp()

VOID PrintCommandHelp ( _In_ PCONTEXT_ENTRY  pContext,
_In_ PCOMMAND_GROUP  pGroup,
_In_ PCOMMAND_ENTRY  pCommand 
)

Definition at line 278 of file help.c.

282{
283 LPWSTR pszInBuffer = NULL, pszOutBuffer = NULL, pszCommandBuffer = NULL;
284 DWORD_PTR Args[2];
285
286 DPRINT("PrintCommandHelp(%p %p %p)\n", pContext, pGroup, pCommand);
287
288 pszInBuffer = HeapAlloc(GetProcessHeap(), 0, HUGE_HELP_BUFFER_SIZE * sizeof(WCHAR));
289 if (pszInBuffer == NULL)
290 goto done;
291
292 pszOutBuffer = HeapAlloc(GetProcessHeap(), 0, HUGE_HELP_BUFFER_SIZE * sizeof(WCHAR));
293 if (pszOutBuffer == NULL)
294 goto done;
295
296 pszCommandBuffer = HeapAlloc(GetProcessHeap(), 0, TINY_HELP_BUFFER_SIZE * sizeof(WCHAR));
297 if (pszCommandBuffer == NULL)
298 goto done;
299
300 wcscpy(pszCommandBuffer, pCommand->pwszCmdToken);
301 if (pGroup)
302 {
303 wcscat(pszCommandBuffer, L" ");
304 wcscat(pszCommandBuffer, pGroup->pwszCmdGroupToken);
305 }
306
307 LoadStringW(pContext->hModule, pCommand->dwCmdHlpToken, pszInBuffer, HUGE_HELP_BUFFER_SIZE);
308
309 Args[0] = (DWORD_PTR)pszCommandBuffer;
310 Args[1] = (DWORD_PTR)NULL;
311
313 pszInBuffer,
314 0,
315 0,
316 pszOutBuffer,
318 (va_list *)&Args);
319
320 ConPuts(StdOut, pszOutBuffer);
321 ConPuts(StdOut, L"\n");
322
323done:
324 if (pszCommandBuffer)
325 HeapFree(GetProcessHeap(), 0, pszCommandBuffer);
326
327 if (pszOutBuffer)
328 HeapFree(GetProcessHeap(), 0, pszOutBuffer);
329
330 if (pszInBuffer)
331 HeapFree(GetProcessHeap(), 0, pszInBuffer);
332}
char ** Args
Definition: acdebug.h:353
char * va_list
Definition: acmsvcex.h:78
#define HUGE_HELP_BUFFER_SIZE
Definition: help.c:15
#define TINY_HELP_BUFFER_SIZE
Definition: help.c:17
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
Definition: string.c:1220
#define DWORD_PTR
Definition: treelist.c:76
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:398
#define FORMAT_MESSAGE_ARGUMENT_ARRAY
Definition: winbase.h:401

Referenced by InterpretCommand().

◆ PrintContextHelp()

VOID PrintContextHelp ( _In_ PCONTEXT_ENTRY  pContext)

Definition at line 363 of file help.c.

365{
367 PrintContext(pContext);
368 PrintSubcontexts(pContext);
370}
void ConResPrintf(FILE *fp, UINT nID,...)
Definition: fc.c:33
static VOID PrintSubcontexts(_In_ PCONTEXT_ENTRY pContext)
Definition: help.c:234
static VOID PrintContext(_In_ PCONTEXT_ENTRY pContext)
Definition: help.c:115
#define IDS_HELP_FOOTER
Definition: resource.h:20
#define IDS_HELP_HEADER
Definition: resource.h:19

Referenced by InterpretCommand().

◆ PrintGroupHelp()

VOID PrintGroupHelp ( _In_ PCONTEXT_ENTRY  pContext,
_In_ LPWSTR  pszGroupName,
_In_ BOOL  bRecurse 
)

Definition at line 336 of file help.c.

340{
341 PCOMMAND_GROUP pGroup;
342
343 if (bRecurse)
344 {
345 if (pContext != pRootContext)
346 PrintGroupHelp(pContext->pParentContext, pszGroupName, bRecurse);
347 }
348
349 pGroup = pContext->pGroupListHead;
350 while (pGroup != NULL)
351 {
352 if (_wcsicmp(pszGroupName, pGroup->pwszCmdGroupToken) == 0)
353 {
355 PrintShortGroupCommands(pContext, pGroup);
356 }
357 pGroup = pGroup->pNext;
358 }
359}
static VOID PrintShortGroupCommands(_In_ PCONTEXT_ENTRY pContext, _In_ PCOMMAND_GROUP pGroup)
Definition: help.c:83
static VOID PrintCurrentContextHeader(_In_ PCONTEXT_ENTRY pContext)
Definition: help.c:64
VOID PrintGroupHelp(_In_ PCONTEXT_ENTRY pContext, _In_ LPWSTR pszGroupName, _In_ BOOL bRecurse)
Definition: help.c:336
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
struct _COMMAND_GROUP * pNext
Definition: precomp.h:94
PWSTR pwszCmdGroupToken
Definition: precomp.h:96

Referenced by InterpretCommand(), and PrintGroupHelp().

◆ RunScript()

DWORD RunScript ( _In_ LPCWSTR  filename)

Definition at line 22 of file netsh.c.

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}
#define StdErr
Definition: fc.c:15
DWORD InterpretLine(_In_ LPWSTR pszInputLine)
Definition: interpreter.c:333
#define IDS_OPEN_FAILED
Definition: resource.h:14
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
const char * filename
Definition: ioapi.h:137
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
script
Definition: msipriv.h:383

Referenced by ExecCommand(), and wmain().

◆ ShowAliasCommand()

DWORD WINAPI ShowAliasCommand ( LPCWSTR  pwszMachine,
LPWSTR argv,
DWORD  dwCurrentIndex,
DWORD  dwArgCount,
DWORD  dwFlags,
LPCVOID  pvData,
BOOL pbDone 
)

Definition at line 215 of file alias.c.

223{
224 DPRINT("ShowAliasCommand()\n");
225
226 ShowAliases();
227
228 return ERROR_SUCCESS;
229}

Referenced by CreateRootContext().

◆ ShowHelperCommand()

DWORD WINAPI ShowHelperCommand ( LPCWSTR  pwszMachine,
PWSTR ppwcArguments,
DWORD  dwCurrentIndex,
DWORD  dwArgCount,
DWORD  dwFlags,
LPCVOID  pvData,
BOOL pbDone 
)

◆ UnaliasCommand()

DWORD WINAPI UnaliasCommand ( LPCWSTR  pwszMachine,
LPWSTR argv,
DWORD  dwCurrentIndex,
DWORD  dwArgCount,
DWORD  dwFlags,
LPCVOID  pvData,
BOOL pbDone 
)

Definition at line 234 of file alias.c.

242{
243 PALIAS_ENTRY pAliasEntry = NULL;
244
245 DPRINT("UnaliasCommand()\n");
246
247 if (dwArgCount - dwCurrentIndex != 1)
249
250 DPRINT("Alias %S\n", argv[dwCurrentIndex]);
251
252 pAliasEntry = AliasListHead;
253 while (pAliasEntry)
254 {
255 if (wcscmp(pAliasEntry->pszAliasName, argv[dwCurrentIndex]) == 0)
256 {
257 DPRINT("Alias found %S\n", argv[dwCurrentIndex]);
258
259 if (pAliasEntry->pNext != NULL)
260 pAliasEntry->pNext->pPrev = pAliasEntry->pPrev;
261 else
262 AliasListTail = pAliasEntry->pPrev;
263
264 if (pAliasEntry->pPrev != NULL)
265 pAliasEntry->pPrev->pNext = pAliasEntry->pNext;
266 else
267 AliasListHead = pAliasEntry->pNext;
268
269 HeapFree(GetProcessHeap(), 0, pAliasEntry->pszAliasName);
270 HeapFree(GetProcessHeap(), 0, pAliasEntry->pszAlias);
271 HeapFree(GetProcessHeap(), 0, pAliasEntry);
272
273 return ERROR_SUCCESS;
274 }
275
276 pAliasEntry = pAliasEntry->pNext;
277 }
278
280
281 return ERROR_SUCCESS;
282}
#define IDS_ALIAS_NOT_FOUND
Definition: resource.h:17
#define ERROR_INVALID_SYNTAX
Definition: netsh.h:10

Referenced by CreateRootContext().

◆ UnloadHelpers()

VOID UnloadHelpers ( VOID  )

Definition at line 340 of file helper.c.

341{
343
344 while (pDllListHead != NULL)
345 {
347 pDllListHead = pEntry->pNext;
348
349// if (pEntry->Attributes.pfnStop)
350// pEntry->Attributes.pfnStop(0);
351
353 }
354
356}

Referenced by wmain().

Variable Documentation

◆ hModule

HMODULE hModule
extern

Definition at line 17 of file netsh.c.

Referenced by __acrt_GetModuleFileNameA(), __wine_msi_call_dll_function(), _getdllprocaddr(), _Success_(), AddScreenSaver(), AddSfcNotification(), APIHook_GetProcAddress(), AVrfpGetProcAddress(), BasepGetModuleHandleExW(), BasepLoadLibraryAsDatafile(), BasepMapModuleHandle(), ClearUserApiHook(), co_IntCallLoadMenu(), Control_FillCache_RunDLLA(), Control_FillCache_RunDLLW(), CClassNode::ConvertResourceDescriptorToString(), CreateRootContext(), CryptInstallOIDFunctionAddress(), CURSORICON_CopyImage(), DllMain(), DRIVER_GetNumberOfModuleRefs(), DRIVER_TryOpenDriver32(), EndUserApiHook(), EngFindImageProcAddress(), EngUnloadImage(), EngUnmapFile(), EnumPickIconResourceProc(), EnumResNameProc(), find_resourceA(), find_resourceW(), FindModule(), FindResourceA(), FindResourceExA(), FindResourceExW(), FindResourceW(), FreeLibrary(), get_manifest_in_module(), GetDriverModuleHandle(), GetDriverVersion(), GetFileVersionInfoExW(), GetFileVersionInfoSizeExW(), GetFunctionPointer(), GetModuleBaseNameA(), GetModuleBaseNameW(), GetModuleFileNameA(), GetModuleFileNameExA(), GetModuleFileNameExW(), GetModuleFileNameW(), GetModuleHandleW(), GetModuleInformation(), GetMonitorUI(), GetNotificationHandler(), GetProcAddress(), GetSeconds(), GetServiceDllFunction(), GPNotificationThreadProc(), init_functions(), InstallSoftwareBusPnpEnumerator(), is_module_registered(), load_mui_string(), load_string(), LoadDialog(), LoadDialogResource(), LoadLibraryList(), LoadNotifyDll(), LoadResource(), LookupThreadProc(), MakeString(), MatchEnumTag(), MLFreeLibrary(), MSACM_GetNumberOfModuleRefs(), MSACM_RegisterLocalDriver(), NotifyLogon(), PrintError(), printm(), PrintMessageFromModule(), RegLoadMUIStringW(), CDeviceView::RunAddHardwareWizard(), search_res_tlb(), SeiGetModuleFromAddress(), SetupDiGetClassDevPropertySheetsW(), SRSetRestorePointA(), SRSetRestorePointW(), START_TEST(), StubGetProcAddress(), test_pack_ACTCTXA(), test_pack_ACTCTXW(), testLayout(), testLoadLibraryA(), testLoadLibraryA_Wrong(), UnloadAppInitDlls(), UserSignalProc(), WinMain(), wmain(), Ws2HelpDllMain(), and wWinMain().

◆ pCurrentContext

◆ pHelperListHead

◆ pRootContext

◆ pszMachine

PWSTR pszMachine
extern