Skip to content

Latest commit

 

History

History
90 lines (67 loc) · 3.36 KB

nc-netsh-ns_context_connect_fn.md

File metadata and controls

90 lines (67 loc) · 3.36 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NC:netsh.NS_CONTEXT_CONNECT_FN
NS_CONTEXT_CONNECT_FN (netsh.h)
Is the connect function for helpers.
NS_CONTEXT_CONNECT_FN
NS_CONTEXT_CONNECT_FN callback
NS_CONTEXT_CONNECT_FN callback function [NetShell]
SampleConnect
_netsh_ns_context_connect_fn
netsh/NS_CONTEXT_CONNECT_FN
netshell.ns_context_connect_fn
netshell\ns_context_connect_fn.htm
netshell
bbdc4a1c-4deb-44d0-bd87-0f3fce4d9883
12/05/2018
NS_CONTEXT_CONNECT_FN, NS_CONTEXT_CONNECT_FN callback, NS_CONTEXT_CONNECT_FN callback function [NetShell], SampleConnect, _netsh_ns_context_connect_fn, netsh/NS_CONTEXT_CONNECT_FN, netshell.ns_context_connect_fn
netsh.h
Windows
Windows XP [desktop apps only]
Windows Server 2003 [desktop apps only]
Windows
19H1
NS_CONTEXT_CONNECT_FN
netsh/NS_CONTEXT_CONNECT_FN
c++
APIRef
kbSyntax
UserDefined
Netsh.h
NS_CONTEXT_CONNECT_FN

NS_CONTEXT_CONNECT_FN callback function

-description

The NS_CONTEXT_CONNECT_FN command is the connect function for helpers. Helpers expose a connect function that enables NetShell to connect to the helper. NetShell calls a helper connect function before calling other helper functions.

The connect function is registered with NetShell using the RegisterContext function. The following is an example of a connect function. Be aware that SampleConnect is a placeholder for the application-defined function name.

-parameters

-param pwszMachine [in]

The computer on which to perform the command, or null if the command applies to the local computer. The default value is null.

-returns

Returns NO_ERROR upon success. Any other return value indicates an error.

-remarks

A helper connect function is called by NetShell before NetShell calls the context dump function, if one exists, and before any command function. Two operations should be carried out during a connect function call.

If the context is remotable, specified by absence of the CMD_FLAG_LOCAL flag, the connect function should accept the computer name on which the function should operate next, and attempt to validate its ability to communicate with that computer.

If the context commands are dynamic, the context should call RegisterContext again with its latest set of commands.

Each helper is responsible for maintaining its own connection to remote computers. If access is not possible, a helper should display an appropriate error message, and must fail on the connect function.

-see-also

NS_HELPER_ATTRIBUTES

NetShell Flags

RegisterContext