File tree Expand file tree Collapse file tree 5 files changed +15
-18
lines changed
base/applications/network/netsh Expand file tree Collapse file tree 5 files changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -436,7 +436,7 @@ CreateRootContext(VOID)
436436{
437437 PCOMMAND_GROUP pGroup ;
438438
439- pRootContext = AddContext (NULL , NULL , NULL );
439+ pRootContext = AddContext (NULL , L"netsh" , NULL );
440440 DPRINT ("pRootContext: %p\n" , pRootContext );
441441 if (pRootContext == NULL )
442442 return FALSE;
Original file line number Diff line number Diff line change @@ -21,15 +21,15 @@ GetContextFullName(
2121 _Inout_ LPWSTR pszBuffer ,
2222 _In_ DWORD cchLength )
2323{
24- if (pContext -> pParentContext != NULL )
24+ if (pContext != pRootContext )
2525 {
2626 GetContextFullName (pContext -> pParentContext , pszBuffer , cchLength );
2727 wcscat (pszBuffer , L" " );
2828 wcscat (pszBuffer , pContext -> pszContextName );
2929 }
3030 else
3131 {
32- wcscpy (pszBuffer , L"netsh" );
32+ wcscpy (pszBuffer , pContext -> pszContextName );
3333 }
3434}
3535
@@ -43,16 +43,12 @@ PrintCurrentContextHeader(
4343
4444 if (pContext == pCurrentContext )
4545 {
46- ConPrintf (StdOut , L"\nCommands in this context:\n" );
47- }
48- else if (pContext == pRootContext )
49- {
50- ConPrintf (StdOut , L"\nCommands in the netsh-context:\n" );
46+ ConResPrintf (StdOut , IDS_THIS_COMMANDS );
5147 }
5248 else
5349 {
5450 GetContextFullName (pContext , szBuffer , 80 );
55- ConPrintf (StdOut , L"\nCommands in the %s-context:\n" , szBuffer );
51+ ConResPrintf (StdOut , IDS_CONTEXT_COMMANDS , szBuffer );
5652 }
5753}
5854
Original file line number Diff line number Diff line change @@ -224,16 +224,13 @@ VOID
224224PrintPrompt (
225225 PCONTEXT_ENTRY pContext )
226226{
227- if (pContext == pRootContext )
228- {
229- ConPuts (StdOut , L"netsh" );
230- }
231- else
227+ if (pContext != pRootContext )
232228 {
233229 PrintPrompt (pContext -> pParentContext );
234230 ConPuts (StdOut , L" " );
235- ConPuts (StdOut , pContext -> pszContextName );
236231 }
232+
233+ ConPuts (StdOut , pContext -> pszContextName );
237234}
238235
239236
Original file line number Diff line number Diff line change @@ -12,9 +12,11 @@ STRINGTABLE
1212BEGIN
1313 IDS_APP_USAGE "\nUsage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] \
1414\n [Command | -f ScriptFile]\n"
15- IDS_INVALID_COMMAND "The following command was not found: %ls.\n"
16- IDS_OPEN_FAILED "The file %ls could not be openend.\n"
17- IDS_INVALID_SYNTAX "The syntax supplied for this command is not valid. Check help for the correct syntax.\n\n"
15+ IDS_INVALID_COMMAND "The following command was not found: %ls.\n"
16+ IDS_OPEN_FAILED "The file %ls could not be openend.\n"
17+ IDS_INVALID_SYNTAX "The syntax supplied for this command is not valid. Check help for the correct syntax.\n\n"
18+ IDS_THIS_COMMANDS "\nCommands in this context:\n"
19+ IDS_CONTEXT_COMMANDS "\nCommands in the %s-context:\n"
1820END
1921
2022STRINGTABLE
Original file line number Diff line number Diff line change 1414#define IDS_INVALID_COMMAND 102
1515#define IDS_OPEN_FAILED 103
1616#define IDS_INVALID_SYNTAX 104
17+ #define IDS_THIS_COMMANDS 105
18+ #define IDS_CONTEXT_COMMANDS 106
1719
1820#define IDS_HELP_HEADER 200
1921#define IDS_HELP_FOOTER 201
You can’t perform that action at this time.
0 commit comments