z/OS Open Cryptographic Services Facility Service Provider Module Developer's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


DLLMain

z/OS Open Cryptographic Services Facility Service Provider Module Developer's Guide and Reference
SC14-7514-00

#include<cssm.h>
CSSM_GUID dl_guid = 
{ 0x5fc43dc1, 0x732, 0x11d0, { 0xbb, 0x14, 0x0, 0xaa, 0x0, 0x36, 0x67, 0x2d } };
CSSM_FUNCTIONTABLE FunctionTable;
CSSM_SPI_FUNC_TBL_PTR UpcallTable;
 
BOOL  DllMain ( HANDLE hInstance, DWORD dwReason, LPVOID lpReserved)
{
     switch (dwReason)
     {
     case DLL_PROCESS_ATTACH:
        {
 
        /* Fill in FunctionTable with function pointers */
        FunctionTable.Authenticate = DL_Authenticate;
        FunctionTable.DbOpen = DL_DbOpen;
        FunctionTable.DbClose = DL_DbClose;
        FunctionTable.DbCreate = DL_DbCreate;
        FunctionTable.DbDelete = DL_DbDelete;
        FunctionTable.DbImport = DL_DbImport;
        FunctionTable.DbExport = DL_DbExport;
        FunctionTable.DbSetRecordParsingFunctions = 
           DL_DbSetRecordParsingFunctions;
        FunctionTable.DbGetRecordParsingFunctions = 
           DL_DbGetRecordParsingFunctions;
        FunctionTable.GetDbNameFromHandle = DL_GetDbNameFromHandle;
FunctionTable.DataInsert = DL_DataInsert;
FunctionTable.DataDelete = DL_DataDelete;
FunctionTable.DataGetFirst = DL_DataGetFirst;
FunctionTable.DataGetNext = DL_DataGetNext;
FunctionTable.DataAbortQuery = DL_DataAbortQuery;
FunctionTable.FreeUniqueRecord = DL_FreeUniqueRecord;
FunctionTable.PassThrough = DL_PassThrough;
 
* Call CSSM_RegisterServices to register the FunctionTable */
/* with CSSM and to receive the application's memory upcall table */
if (CSSM_RegisterServices (&dl_guid, FunctionTable, &UpcallTable) != CSSM_OK)
                 return FALSE;
 
 /* Make the upcall table available to all functions in this library */
 
 break;
   }
case DLL_THREAD_ATTACH:
   break;
case DLL_THREAD_DETACH:
   break;
case DLL_PROCESS_DETACH:
   if (CSSM_DeregisterServices (&dl_guid) != CSSM_OK)
      return FALSE;
   break;
   }
return TRUE;
}

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014