MprAdminInitializeDllEx entry point

When the Routing and Remote Access Service (RRAS) starts, it calls the MprAdminInitializeDll function that is exported by the administration DLL. Use this function to perform any required initialization for the DLL and call the callback functions. This serves as a placeholder for the callback functions.

Syntax


DWORD APIENTRY MprAdminInitializeDll(
  PMPRAPI_ADMIN_DLL_CALLBACKS pAdminCallbacks
);

Parameters

pAdminCallbacks

A pointer to a MPRAPI_ADMIN_DLL_CALLBACKS structure that contains the function pointers of the callbacks being registered.

Return value

If the function succeeds, the return value is NO_ERROR.

If the function returns any value other than NO_ERROR, RRAS will fail to start.

Examples

The following example illustrates how to implement this function on Windows 7:


DWORD MprAdminInitializeDllEx(PMPRAPI_ADMIN_DLL_CALLBACKS  pAdminCallbacks){

    UNREFERENCED_PARAMETER(pAdminCallbacks);

    DWORD   dwErr = NO_ERROR;
    WORD    WinsockVer = MAKEWORD(2, 0);
    WSADATA WinsockData;

    Trace(L"MprAdminInitializeDllEx called\n");

    hEventLog = RegisterEventSource(NULL,TEXT("TestAdminDll"));
    if(!hEventLog){    
        dwErr=GetLastError();
        Trace(L"RegisterEventSource failed %d\n",dwErr);
        goto done;
    }

    if(WSAStartup(WinsockVer, &WinsockData)){
        Trace(L"WSAStartup failed %d\n",WSAGetLastError());
    }

    //set callbacks
    pAdminCallbacks->revision=MPRAPI_ADMIN_DLL_VERSION_2;
    pAdminCallbacks->lpfnMprAdminGetIpAddressForUser=NULL;
    pAdminCallbacks->lpfnMprAdminReleaseIpAddress=NULL;
    pAdminCallbacks->lpfnMprAdminGetIpv6AddressForUser=NULL;
    pAdminCallbacks->lpfnMprAdminReleaseIpV6AddressForUser=NULL;

    pAdminCallbacks->lpfnRasAdminAcceptNewLink=MprAdminAcceptNewLink;
    pAdminCallbacks->lpfnRasAdminLinkHangupNotification=MprAdminLinkHangupNotification;
    pAdminCallbacks->lpfnRasAdminTerminateDll=MprAdminTerminateDll;

    pAdminCallbacks->lpfnRasAdminAcceptNewConnectionEx=MprAdminAcceptNewConnectionEx;
    pAdminCallbacks->lpfnRasAdminAcceptReauthenticationEx=NULL;
    pAdminCallbacks->lpfnRasAdminConnectionHangupNotificationEx=MprAdminConnectionHangupNotificationEx;
    pAdminCallbacks->lpfnRASValidatePreAuthenticatedConnectionEx = MprAdminRASValidatePreAuthenticatedConnectionEx;

    ReportEvent(hEventLog,EVENTLOG_INFORMATION_TYPE,0,MprAdminInitializeDllExMsgId,NULL,0,0,NULL,(PVOID)NULL) ;   
    
    done:  
        return dwErr;
}



Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Mprapi.h

See also

Remote Access Service Administration Reference
RAS Administration Functions
RAS Administration DLL
MprAdminInitializeDll
MprAdminTerminateDll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft