Skip to content

Commit 500dcd3

Browse files
committed
[NETSH] Call a contexts connect function on a context change
1 parent 24e88af commit 500dcd3

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

base/applications/network/netsh/context.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,7 @@ RegisterContext(
947947
{
948948
pContext->pfnCommitFn = pChildContext->pfnCommitFn;
949949
pContext->pfnDumpFn = pChildContext->pfnDumpFn;
950+
pContext->pfnConnectFn = pChildContext->pfnConnectFn;
950951
pContext->ulPriority = (pChildContext->dwFlags & CMD_FLAG_PRIORITY) ?
951952
pChildContext->ulPriority : DEFAULT_CONTEXT_PRIORITY;
952953

base/applications/network/netsh/interpreter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ InterpretCommand(
276276
{
277277
DPRINT("Set current context\n");
278278
pCurrentContext = pTempSubContext;
279+
if (pCurrentContext->pfnConnectFn)
280+
dwError = pCurrentContext->pfnConnectFn(pszMachine);
279281
State = STATE_DONE;
280282
break;
281283
}

base/applications/network/netsh/precomp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ typedef struct _CONTEXT_ENTRY
115115
ULONG ulPriority;
116116
PNS_CONTEXT_COMMIT_FN pfnCommitFn;
117117
PNS_CONTEXT_DUMP_FN pfnDumpFn;
118+
PNS_CONTEXT_CONNECT_FN pfnConnectFn;
118119

119120
PCOMMAND_ENTRY pCommandListHead;
120121
PCOMMAND_ENTRY pCommandListTail;

0 commit comments

Comments
 (0)