- Add the context stack including the PUSHD and POPD commands. - Add the required changes to the HELP command and command execution to support the context stack. - Add support for sub helpers.
···19192020STRINGTABLE
2121BEGIN
2222- IDS_HELP_HEADER "\nThe following commands are available:\n"
2222+ IDS_HELP_HEADER "\nThe following commands are available:\n"
2323+ IDS_HELP_FOOTER "\nHelp Footer\n\n"
2324 IDS_SUBCONTEXT_HEADER "\nThe following sub-contexts are available:\n"
2525+2426 IDS_HLP_UP "Goes up one context level."
2527 IDS_HLP_UP_EX "Syntax: ..\n\n Goes up one context level.\n\n"
2628 IDS_HLP_EXIT "Exits the program."
2729 IDS_HLP_EXIT_EX "Syntax: exit\n\n Exits the program.\n\n"
2830 IDS_HLP_HELP "Displays a list of commands."
2931 IDS_HLP_HELP_EX "Syntax: help\n\n Displays a list of commands.\n\n"
3232+ IDS_HLP_POPD "Changes to the context on the stack."
3333+ IDS_HLP_POPD_EX "Syntax: popd\n\n Changes to the context on the stack.\n\n"
3434+ IDS_HLP_PUSHD "Stores the current context on the stack."
3535+ IDS_HLP_PUSHD_EX "Syntax: pushd\n\n Stores the current context on the stack.\n\n"
30363137 IDS_HLP_ADD_HELPER "Installs a helper DLL."
3238 IDS_HLP_ADD_HELPER_EX "Syntax: add helper <dll file name>\n\n Installs the specified helper DLL in netsh.\n\n"
+5-3
base/applications/network/netsh/netsh.c
···5858 LPCWSTR pszFileName = NULL;
5959 int index;
6060 int result = EXIT_SUCCESS;
6161+ BOOL bDone = FALSE;
61626262- DPRINT("main()\n");
6363+ DPRINT("wmain(%S)\n", GetCommandLineW());
63646465 /* Initialize the Console Standard Streams */
6566 ConInitStdStreams();
···9394 }
94959596 /* Run a command from the command line */
9696- if (InterpretCommand((LPWSTR*)&argv[index], argc - index) == FALSE)
9797+ if (InterpretCommand((LPWSTR*)&argv[index], argc - index, &bDone) != ERROR_SUCCESS)
9798 result = EXIT_FAILURE;
9899 goto done;
99100 }
···186187187188done:
188189 /* FIXME: Cleanup code goes here */
190190+ CleanupContext();
189191 UnloadHelpers();
190192191193 return result;
···247249 va_list ap;
248250249251 va_start(ap, pwszFormat);
250250- Length = ConPrintf(StdOut, pwszFormat);
252252+ Length = ConPrintfV(StdOut, pwszFormat, ap);
251253 va_end(ap);
252254253255 return Length;