IBM Security Access Manager for Enterprise Single Sign-On, Version 8.2

Loading the EncVcClient library

The EncVcClient library is not provided in the AccessAgent Terminal Services SDK. The EncVcClient library is dynamically loaded within the client connector DLL file. Perform a dynamic loading of EncVcClient library for AccessAgent.

Procedure

  1. Include the following codes in the client connector:
    //Typedef of EncVcClient function pointers
    typedef E_VCCError	(*PF_InitEncVcClient)();
    typedef E_VCCError	(*PF_FinalizeEncVcClient)();
    typedef E_VCCError	(*PF_ProcessServerMessage)(const STsMessage* pMessage);
    typedef E_VCCError	(*PF_GetNextClientMessage)(STsMessage* pMessage);
    typedef E_VCCError	(*PF_ReleaseMessage)(STsMessage* pMessage);
    typedef void		(*PF_AADebugLog)(E_VCCLogLevel logLevel, 
    const wchar_t* wszMethodName, const wchar_t* wszMessage);
    
    HINSTANCE			g_hEncVcLib = NULL;
    PF_InitEncVcClient		g_pfInitEncVcClient = NULL;
    PF_FinalizeEncVcClient	g_pfFinalizeEncVcClient = NULL;
    PF_ProcessServerMessage	g_pfProcessServerMessage = NULL;
    PF_GetNextClientMessage	g_pfGetNextClientMessage = NULL;
    PF_ReleaseMessage		g_pfReleaseMessage = NULL;
    PF_AADebugLog		g_pfAADebugLog = NULL;
    
    /**
    * \brief Initalization of dynamic run time loading for EncVcClient.dll
    */
    BOOL LoadEncVcClientLib()
    {
    	g_hEncVcLib = LoadLibrary(L"EncVcClient.dll"); 
    	if(g_hEncVcLib == NULL)
    	{
    		::OutputDebugString(L"::LoadEncVcClientLib , 
                                Error: EncVcClient.dll NOT found");
    		return FALSE;
    	}
    
    	g_pfInitEncVcClient = (PF_InitEncVcClient)::GetProcAddress 
                                (g_hEncVcLib, "InitEncVcClient");
    	g_pfFinalizeEncVcClient	= (PF_FinalizeEncVcClient)::GetProcAddress
    																(g_hEncVcLib, "FinalizeEncVcClient");
    	g_pfProcessServerMessage	= (PF_ProcessServerMessage)::GetProcAddress
    															(g_hEncVcLib, "ProcessServerMessage");
    	g_pfGetNextClientMessage	= (PF_GetNextClientMessage)::GetProcAddress
    															(g_hEncVcLib, "GetNextClientMessage");
    	g_pfReleaseMessage		= (PF_ReleaseMessage)::GetProcAddress
    															(g_hEncVcLib, "ReleaseMessage");
    	g_pfAADebugLog		= (PF_AADebugLog)::GetProcAddress
    															(g_hEncVcLib, "AADebugLog");
    
    	if(!g_pfInitEncVcClient || !g_pfFinalizeEncVcClient || 
    !g_pfProcessServerMessage || !g_pfGetNextClientMessage || 
    !g_pfReleaseMessage || !g_pfAADebugLog)
    	{
    		::OutputDebugString(L"::LoadEncVcClientLib , 
    		Error: Required APIs NOT found in EncVcClient.dll");
    		FreeLibrary(g_hEncVcLib);
    		g_hEncVcLib = NULL;
    		return FALSE;
    	}
    	g_pfAADebugLog(E_VCC_LOG_MOREINFO, L"::LoadEncVcClientLib", 
    	L"Load library successful");
    	return TRUE;
    }
    
    /**
    * \brief Free EncVcClient library
    */
    BOOL FreeEncVcClientLib()
    {
    	BOOL bRet = FreeLibrary(g_hEncVcLib);
    	g_pfInitEncVcClient = NULL;
    	g_pfFinalizeEncVcClient = NULL;
    	g_pfProcessServerMessage = NULL;
    	g_pfGetNextClientMessage = NULL;
    	g_pfReleaseMessage = NULL;
    	g_pfAADebugLog = NULL;
    	g_hEncVcLib = NULL;
    	return bRet;
    }/**
    * \brief Below are API functions for ESSO TS SDK
    */
    
    E_VCCError InitEncVcClient()
    {
    	return g_pfInitEncVcClient();
    }
    
    E_VCCError FinalizeEncVcClient()
    {
    	return g_pfFinalizeEncVcClient();
    }
    
    E_VCCError ProcessServerMessage(const STsMessage* pMessage)
    {
    	return g_pfProcessServerMessage(pMessage);
    }
    
    E_VCCError GetNextClientMessage(STsMessage* pMessage)
    {
    	return g_pfGetNextClientMessage(pMessage);
    }
    
    E_VCCError ReleaseMessage(STsMessage* pMessage)
    {
    	return g_pfReleaseMessage(pMessage);
    }
    
    void AADebugLog(E_VCCLogLevel logLevel, const wchar_t* wszMethodName, 
    const wchar_t* wszMessage)
    {
    	g_pfAADebugLog(logLevel, wszMethodName, wszMessage);
    }
  2. Call the LoadEncVcClientLib() function
    • only once during the opening of the driver
    • before calling of any of the functions listed
  3. Call the FreeEncVcClientLib() function
    • only once during the closing of the driver
    • as the last function call before the driver closes
  4. Save and recompile the connector DLL file.
    Note: Check the level 3 log. If the loading of library is successful, there is an entry that state LoadEncVcClientLib, Load library successful in the AccessAgent log file. See "Log policies" in the IBM® Security Access Manager for Enterprise Single Sign-On Policies Definition Guide.


Feedback