@@ -214,9 +214,6 @@ LoadHelperDll(
214214 goto done ;
215215 }
216216
217- // if (pEntry->Attributes.pfnStart)
218- // pEntry->Attributes.pfnStart(NULL, 0);
219-
220217 if (bRegister )
221218 RegisterHelperDll (pEntry );
222219
@@ -244,6 +241,24 @@ LoadHelperDll(
244241}
245242
246243
244+ DWORD
245+ CreateRootHelper (VOID )
246+ {
247+ PHELPER_ENTRY pHelper ;
248+
249+ pHelper = (PHELPER_ENTRY )HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY , sizeof (HELPER_ENTRY ));
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+
247262VOID
248263LoadHelpers (VOID )
249264{
@@ -389,6 +404,11 @@ RegisterHelper(
389404 goto done ;
390405 }
391406
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+
392412 CopyMemory (& pHelper -> Attributes , pHelperAttributes , sizeof (NS_HELPER_ATTRIBUTES ));
393413 pHelper -> pDllEntry = pCurrentDll ;
394414 DPRINT ("pHelper->pDllEntry: %p\n" , pHelper -> pDllEntry );
@@ -413,7 +433,7 @@ RegisterHelper(
413433 pParentHelper = FindHelper (pguidParentHelper , pHelperListHead );
414434 if (pParentHelper == NULL )
415435 {
416- DPRINT ("Parent helper not found!\n" );
436+ DPRINT ("Parent helper %lx not found!\n" , pguidParentHelper -> Data1 );
417437 return ERROR_INVALID_PARAMETER ;
418438 }
419439
@@ -543,6 +563,7 @@ PrintHelpers(
543563 PCONTEXT_ENTRY pContext ;
544564 WCHAR szIndent [22 ];
545565 DWORD i ;
566+ GUID RootGuid = NETSH_ROOT_GUID ;
546567
547568 for (i = 0 ; i < min (dwLevel , 10 ) * 2 ; i ++ )
548569 szIndent [i ] = L' ' ;
@@ -551,28 +572,37 @@ PrintHelpers(
551572 pHelper = pHelperListHead ;
552573 while (pHelper != NULL )
553574 {
554- pContext = FindContextByGuid (& pHelper -> Attributes .guidHelper );
555- if (pContext )
575+ DPRINT ("Helper GUID: %lx\n" , pHelper -> Attributes .guidHelper .Data1 );
576+
577+ if (!IsEqualGUID (& pHelper -> Attributes .guidHelper , & RootGuid ))
556578 {
557- ConPrintf (StdOut ,
558- L"{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X} %-16s %s%s\n" ,
559- pHelper -> Attributes .guidHelper .Data1 ,
560- pHelper -> Attributes .guidHelper .Data2 ,
561- pHelper -> Attributes .guidHelper .Data3 ,
562- pHelper -> Attributes .guidHelper .Data4 [0 ],
563- pHelper -> Attributes .guidHelper .Data4 [1 ],
564- pHelper -> Attributes .guidHelper .Data4 [2 ],
565- pHelper -> Attributes .guidHelper .Data4 [3 ],
566- pHelper -> Attributes .guidHelper .Data4 [4 ],
567- pHelper -> Attributes .guidHelper .Data4 [5 ],
568- pHelper -> Attributes .guidHelper .Data4 [6 ],
569- pHelper -> Attributes .guidHelper .Data4 [7 ],
570- pHelper -> pDllEntry -> pszShortName ,
571- szIndent ,
572- pContext -> pszContextName );
579+
580+ pContext = FindContextByGuid (& pHelper -> Attributes .guidHelper );
581+ DPRINT ("pContext: %p\n" , pContext );
582+ if (pContext )
583+ {
584+ ConPrintf (StdOut ,
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 ++ ;
573603 }
574604
575- PrintHelpers (pHelper -> pSubHelperHead , dwLevel + 1 );
605+ PrintHelpers (pHelper -> pSubHelperHead , dwLevel );
576606
577607 pHelper = pHelper -> pNext ;
578608 }
0 commit comments