ReactOS 0.4.16-dev-1946-g52006dd
helper.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 helper dll management and support functions
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
19
22
24
25/* FUNCTIONS ******************************************************************/
26
27static
28VOID
30 PHELPER_ENTRY pHelper)
31{
32 PHELPER_ENTRY pSubHelper;
33 DWORD dwError;
34
35 while (pHelper != NULL)
36 {
37 if (pHelper->bStarted == FALSE)
38 {
39 if (pHelper->Attributes.pfnStart)
40 {
41 dwError = pHelper->Attributes.pfnStart(NULL, 0);
42 if (dwError == ERROR_SUCCESS)
43 pHelper->bStarted = TRUE;
44 }
45 }
46
47 pSubHelper = pHelper->pSubHelperHead;
48 while (pSubHelper != NULL)
49 {
50 StartHelpers(pSubHelper);
51 pSubHelper = pSubHelper->pNext;
52 }
53
54 pHelper = pHelper->pNext;
55 }
56}
57
58
59static
60VOID
63{
64 PWSTR pszValueName = NULL;
65 HKEY hKey;
66 DWORD dwError;
67
70 0,
71 NULL,
74 NULL,
75 &hKey,
76 NULL);
77 if (dwError == ERROR_SUCCESS)
78 {
80 pEntry->pszValueName,
81 0,
82 REG_SZ,
83 (PBYTE)pEntry->pszDllName,
84 (wcslen(pEntry->pszDllName) + 1) * sizeof(WCHAR));
85
87 }
88
89 HeapFree(GetProcessHeap(), 0, pszValueName);
90}
91
92
93static
94VOID
97{
98 if (pEntry->hModule)
99 FreeLibrary(pEntry->hModule);
100
101 if (pEntry->pszValueName)
102 HeapFree(GetProcessHeap(), 0, pEntry->pszValueName);
103
104 if (pEntry->pszShortName)
105 HeapFree(GetProcessHeap(), 0, pEntry->pszShortName);
106
107 if (pEntry->pszDllName)
108 HeapFree(GetProcessHeap(), 0, pEntry->pszDllName);
109
111}
112
113
114static
115DWORD
118 _In_ BOOL bRegister)
119{
120 PNS_DLL_INIT_FN pInitHelperDll;
122 PWSTR pszStart, pszEnd;
123 BOOL bInserted = FALSE;
124 DWORD dwError;
125
127 if (pEntry == NULL)
128 {
129 return ERROR_OUTOFMEMORY;
130 }
131
132 pEntry->pszDllName = HeapAlloc(GetProcessHeap(),
134 (wcslen(pszDllName) + 1) * sizeof(WCHAR));
135 if (pEntry->pszDllName == NULL)
136 {
137 dwError = ERROR_OUTOFMEMORY;
138 goto done;
139 }
140
141 wcscpy(pEntry->pszDllName, pszDllName);
142
143 pszStart = wcsrchr(pszDllName, L'\\');
144 if (pszStart == NULL)
145 pszStart = pszDllName;
146
147 pEntry->pszShortName = HeapAlloc(GetProcessHeap(),
149 (wcslen(pszStart) + 1) * sizeof(WCHAR));
150 if (pEntry->pszShortName == NULL)
151 {
152 dwError = ERROR_OUTOFMEMORY;
153 goto done;
154 }
155
156 wcscpy(pEntry->pszShortName, pszStart);
157
158 pEntry->pszValueName = HeapAlloc(GetProcessHeap(),
160 (wcslen(pEntry->pszShortName) + 1) * sizeof(WCHAR));
161 if (pEntry->pszValueName == NULL)
162 {
163 dwError = ERROR_OUTOFMEMORY;
164 goto done;
165 }
166
167 wcscpy(pEntry->pszValueName, pEntry->pszShortName);
168
169 pszEnd = wcsrchr(pEntry->pszValueName, L'.');
170 if (pszEnd != NULL)
171 *pszEnd = UNICODE_NULL;
172
173 if (pDllListTail == NULL)
174 {
175 pEntry->pPrev = NULL;
176 pEntry->pNext = NULL;
179 }
180 else
181 {
182 pEntry->pPrev = NULL;
183 pEntry->pNext = pDllListHead;
186 }
187
188 bInserted = TRUE;
189
190 pEntry->hModule = LoadLibraryW(pEntry->pszDllName);
191 if (pEntry->hModule == NULL)
192 {
193 dwError = GetLastError();
194 DPRINT1("Could not load the helper dll %S (Error: %lu)\n", pEntry->pszDllName, dwError);
195 goto done;
196 }
197
198 pInitHelperDll = (PNS_DLL_INIT_FN)GetProcAddress(pEntry->hModule, "InitHelperDll");
199 if (pInitHelperDll == NULL)
200 {
201 dwError = GetLastError();
202 DPRINT1("Could not find 'InitHelperDll' (Error: %lu)\n", dwError);
203 goto done;
204 }
205
207 dwError = pInitHelperDll(5, NULL);
209
210 DPRINT1("InitHelperDll returned %lu\n", dwError);
211 if (dwError != ERROR_SUCCESS)
212 {
213 DPRINT1("Call to InitHelperDll failed (Error: %lu)\n", dwError);
214 goto done;
215 }
216
217 if (bRegister)
219
220done:
221 if (dwError != ERROR_SUCCESS)
222 {
223 if (bInserted)
224 {
225 if (pEntry->pPrev != NULL)
226 pEntry->pPrev->pNext = pEntry->pNext;
227 if (pEntry->pNext != NULL)
228 pEntry->pNext->pPrev = pEntry->pPrev;
229 if (pDllListTail == pEntry)
230 pDllListTail = pEntry->pPrev;
231 if (pDllListHead == pEntry)
232 pDllListHead = pEntry->pNext;
233 pEntry->pPrev = NULL;
234 pEntry->pNext = NULL;
235 }
236
238 }
239
240 return dwError;
241}
242
243
244DWORD
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}
260
261
262VOID
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}
337
338
339VOID
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}
357
358
361 _In_ const GUID *pguidHelper,
362 _In_ PHELPER_ENTRY pHelper)
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}
381
382
383DWORD
384WINAPI
386 _In_ const GUID *pguidParentHelper,
387 _In_ const NS_HELPER_ATTRIBUTES *pHelperAttributes)
388{
389 PHELPER_ENTRY pHelper = NULL, pParentHelper;
390 DWORD dwError = ERROR_SUCCESS;
391
392 DPRINT("RegisterHelper(%p %p)\n", pguidParentHelper, pHelperAttributes);
393
394 if (FindHelper(&pHelperAttributes->guidHelper, pHelperListHead) != NULL)
395 {
396 DPRINT1("The Helper has already been registered!\n");
398 }
399
401 if (pHelper == NULL)
402 {
403 dwError = ERROR_OUTOFMEMORY;
404 goto done;
405 }
406
407 DPRINT("Guid: %lx\n", pHelperAttributes->guidHelper.Data1);
408 DPRINT("dwVersion: %lu\n", pHelperAttributes->dwVersion);
409 DPRINT("pfnStart: %p\n", pHelperAttributes->pfnStart);
410 DPRINT("pfnStop: %p\n", pHelperAttributes->pfnStop);
411
412 CopyMemory(&pHelper->Attributes, pHelperAttributes, sizeof(NS_HELPER_ATTRIBUTES));
413 pHelper->pDllEntry = pCurrentDll;
414 DPRINT("pHelper->pDllEntry: %p\n", pHelper->pDllEntry);
415
416 if (pguidParentHelper == NULL)
417 {
418 if ((pHelperListHead == NULL) && (pHelperListTail == NULL))
419 {
420 pHelperListHead = pHelper;
421 pHelperListTail = pHelper;
422 }
423 else
424 {
425 pHelper->pNext = pHelperListHead;
426 pHelperListHead->pPrev = pHelper;
427 pHelperListHead = pHelper;
428 }
429 }
430 else
431 {
432 CopyMemory(&pHelper->ParentHelperGuid, pguidParentHelper, sizeof(GUID));
433 pParentHelper = FindHelper(pguidParentHelper, pHelperListHead);
434 if (pParentHelper == NULL)
435 {
436 DPRINT("Parent helper %lx not found!\n", pguidParentHelper->Data1);
438 }
439
440 if ((pParentHelper->pSubHelperHead == NULL) && (pParentHelper->pSubHelperTail == NULL))
441 {
442 pParentHelper->pSubHelperHead = pHelper;
443 pParentHelper->pSubHelperTail = pHelper;
444 }
445 else
446 {
447 pHelper->pPrev = pParentHelper->pSubHelperTail;
448 pParentHelper->pSubHelperTail->pNext = pHelper;
449 pParentHelper->pSubHelperTail = pHelper;
450 }
451 }
452
453done:
454
455 return dwError;
456}
457
458
459DWORD
460WINAPI
462 LPCWSTR pwszMachine,
468 BOOL *pbDone)
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}
489
490
491DWORD
492WINAPI
494 LPCWSTR pwszMachine,
500 BOOL *pbDone)
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}
554
555
556static
557VOID
560 _In_ DWORD dwLevel)
561{
562 PHELPER_ENTRY pHelper;
563 PCONTEXT_ENTRY pContext;
564 WCHAR szIndent[22];
565 DWORD i;
566 GUID RootGuid = NETSH_ROOT_GUID;
567
568 for (i = 0; i < min(dwLevel, 10) * 2; i++)
569 szIndent[i] = L' ';
570 szIndent[dwLevel * 2] = UNICODE_NULL;
571
572 pHelper = pHelperListHead;
573 while (pHelper != NULL)
574 {
575 DPRINT("Helper GUID: %lx\n", pHelper->Attributes.guidHelper.Data1);
576
577 if (!IsEqualGUID(&pHelper->Attributes.guidHelper, &RootGuid))
578 {
579
580 pContext = FindContextByGuid(&pHelper->Attributes.guidHelper);
581 DPRINT("pContext: %p\n", pContext);
582 if (pContext)
583 {
585 L"{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X} %-16s %s%s\n",
586 pHelper->Attributes.guidHelper.Data1,
587 pHelper->Attributes.guidHelper.Data2,
588 pHelper->Attributes.guidHelper.Data3,
589 pHelper->Attributes.guidHelper.Data4[0],
590 pHelper->Attributes.guidHelper.Data4[1],
591 pHelper->Attributes.guidHelper.Data4[2],
592 pHelper->Attributes.guidHelper.Data4[3],
593 pHelper->Attributes.guidHelper.Data4[4],
594 pHelper->Attributes.guidHelper.Data4[5],
595 pHelper->Attributes.guidHelper.Data4[6],
596 pHelper->Attributes.guidHelper.Data4[7],
597 pHelper->pDllEntry->pszShortName,
598 szIndent,
599 pContext->pszContextName);
600 }
601
602 dwLevel++;
603 }
604
605 PrintHelpers(pHelper->pSubHelperHead, dwLevel);
606
607 pHelper = pHelper->pNext;
608 }
609}
610
611
612DWORD
613WINAPI
615 LPCWSTR pwszMachine,
621 BOOL *pbDone)
622{
623 DPRINT("ShowHelperCommand()\n");
624
625 ConPrintf(StdOut, L"Helper GUID DLL Name Command\n");
626 ConPrintf(StdOut, L"-------------------------------------- ---------------- --------\n");
627
628 if (pRootContext == NULL)
629 return ERROR_SUCCESS;
630
632
633 return ERROR_SUCCESS;
634}
void ConPrintf(FILE *fp, LPCWSTR psz,...)
Definition: fc.c:20
#define StdOut
Definition: fc.c:14
PCONTEXT_ENTRY FindContextByGuid(const GUID *pGuid)
Definition: context.c:898
PCONTEXT_ENTRY pRootContext
Definition: context.c:26
#define REG_NETSH_PATH
Definition: precomp.h:43
struct _HELPER_ENTRY * PHELPER_ENTRY
struct _HELPER_ENTRY HELPER_ENTRY
#define DPRINT1
Definition: precomp.h:8
#define RegCloseKey(hKey)
Definition: registry.h:49
wcscpy
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#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
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
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 GetProcessHeap()
Definition: compat.h:736
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define wcsrchr
Definition: compat.h:16
#define GetProcAddress(x, y)
Definition: compat.h:753
#define HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
#define HeapFree(x, y, z)
Definition: compat.h:735
#define LoadLibraryW(x)
Definition: compat.h:747
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
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
PDLL_LIST_ENTRY pDllListHead
Definition: helper.c:17
DWORD CreateRootHelper(VOID)
Definition: helper.c:245
VOID LoadHelpers(VOID)
Definition: helper.c:263
PHELPER_ENTRY FindHelper(_In_ const GUID *pguidHelper, _In_ PHELPER_ENTRY pHelper)
Definition: helper.c:360
DWORD WINAPI ShowHelperCommand(LPCWSTR pwszMachine, LPWSTR *ppwcArguments, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
Definition: helper.c:614
VOID UnloadHelpers(VOID)
Definition: helper.c:340
static VOID PrintHelpers(_In_ PHELPER_ENTRY pHelperListHead, _In_ DWORD dwLevel)
Definition: helper.c:558
DWORD WINAPI RegisterHelper(_In_ const GUID *pguidParentHelper, _In_ const NS_HELPER_ATTRIBUTES *pHelperAttributes)
Definition: helper.c:385
static VOID StartHelpers(PHELPER_ENTRY pHelper)
Definition: helper.c:29
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
static VOID FreeHelperDll(_In_ PDLL_LIST_ENTRY pEntry)
Definition: helper.c:95
PDLL_LIST_ENTRY pCurrentDll
Definition: helper.c:23
PDLL_LIST_ENTRY pDllListTail
Definition: helper.c:18
static VOID RegisterHelperDll(_In_ PDLL_LIST_ENTRY pEntry)
Definition: helper.c:61
PHELPER_ENTRY pHelperListHead
Definition: helper.c:20
static DWORD LoadHelperDll(_In_ PWSTR pszDllName, _In_ BOOL bRegister)
Definition: helper.c:116
PHELPER_ENTRY pHelperListTail
Definition: helper.c:21
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define REG_SZ
Definition: layer.c:22
#define CopyMemory
Definition: minwinbase.h:29
CONST void * LPCVOID
Definition: minwindef.h:164
#define min(a, b)
Definition: monoChain.cc:55
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
NS_DLL_INIT_FN * PNS_DLL_INIT_FN
Definition: netsh.h:79
_In_ LPWSTR _In_ DWORD _In_ LPCVOID pvData
Definition: netsh.h:116
_In_ LPWSTR * ppwcArguments
Definition: netsh.h:114
#define NETSH_ROOT_GUID
Definition: netsh.h:62
_In_ LPWSTR _In_ DWORD dwArgCount
Definition: netsh.h:115
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD _In_ LPCVOID _Out_ BOOL * pbDone
Definition: netsh.h:143
_In_ LPWSTR _In_ DWORD dwCurrentIndex
Definition: netsh.h:139
#define _In_
Definition: no_sal2.h:158
#define KEY_READ
Definition: nt_native.h:1026
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1060
#define KEY_WRITE
Definition: nt_native.h:1034
#define UNICODE_NULL
BYTE * PBYTE
Definition: pedump.c:66
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define DPRINT
Definition: sndvol32.h:73
char * pszDllName
Definition: spec2def.c:74
Definition: precomp.h:105
PWSTR pszContextName
Definition: precomp.h:112
Definition: precomp.h:49
PWSTR pszShortName
Definition: precomp.h:54
struct _DLL_LIST_ENTRY * pPrev
Definition: precomp.h:50
Definition: precomp.h:62
struct _HELPER_ENTRY * pSubHelperTail
Definition: precomp.h:73
NS_HELPER_ATTRIBUTES Attributes
Definition: precomp.h:66
struct _HELPER_ENTRY * pSubHelperHead
Definition: precomp.h:72
PDLL_LIST_ENTRY pDllEntry
Definition: precomp.h:69
BOOL bStarted
Definition: precomp.h:70
GUID ParentHelperGuid
Definition: precomp.h:67
struct _HELPER_ENTRY * pNext
Definition: precomp.h:64
struct _HELPER_ENTRY * pPrev
Definition: precomp.h:63
PNS_HELPER_START_FN pfnStart
Definition: netsh.h:179
uint16_t * PWSTR
Definition: typedefs.h:56
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WINAPI
Definition: msvc.h:6
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define RegDeleteValue
Definition: winreg.h:515
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184