NS_DLL_INIT_FN callback function (netsh.h)

The InitHelperDll function is called by NetShell to perform an initial loading of a helper.

Syntax

NS_DLL_INIT_FN NsDllInitFn;

DWORD NsDllInitFn(
  [in] DWORD dwNetshVersion,
       PVOID pReserved
)
{...}

Parameters

[in] dwNetshVersion

The version of NetShell.

pReserved

Reserved for future use.

Return value

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

Remarks

The InitHelperDll function is the only function NetShell helpers are required to export. Helpers typically call the RegisterHelper function from within the InitHelperDll function, as shown in the following example:

DWORD
WINAPI
InitHelperDll(
    DWORD      dwNetshVersion,
    PVOID      pReserved
)
{
    NS_HELPER_ATTRIBUTES attMyAttributes;

    attMyAttributes.guidHelper = g_MyGuid;
    attMyAttributes.dwVersion  = 1;
    attMyAttributes.pfnStart   = NetshStartHelper;
    RegisterHelper( NULL, &attMyAttributes );

    return NO_ERROR;
}

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header netsh.h

See also

NS_HELPER_ATTRIBUTES

RegisterHelper