/*----------------------------------------------------------------------- * File: DUMMYMULTI.C * * Copyright (c) 1995-2000 Intel Corporation. All rights reserved. *----------------------------------------------------------------------- */ /* A Dummy Multi-Service Module: dummymulti * * This module provides stub functions for the services in all the service categories. */ #define CSSM_LEAN #include "cssm.h" #include "cssmport.h" #include "cssmlock.h" #include "cssmspi.h" #include "maf_config.h" #include "maf_integ.h" #include "maf_collectn.h" #include "maf_util.h" #include "maf_interface.h" #include "dmyemmtype.h" /* Declare the custom attach functions for each service category. */ CSSM_RETURN dummy_emmaddin_ModuleAttach(CSSM_MODULE_FUNCS_PTR *FuncTbl); /*----------------------------------------------------------------------------- * Name: Addin_callout_Initialize * * Description: * Preforms initialization that takes places when the module is loaded into * the process space * * Parameters: * None * * Return Code: * CSSM_OK if successful, otherwise CSSM_FAIL *---------------------------------------------------------------------------*/ CSSM_RETURN Addin_callout_Initialize(void) { return CSSM_OK; } /*----------------------------------------------------------------------------- * Name: Addin_callout_Terminate * * Description: * Terminates state before the module is unloaded from the process space * * Parameters: * None. * * Return Code: * CSSM_OK if successful, otherwise CSSM_FAIL *---------------------------------------------------------------------------*/ CSSM_RETURN Addin_callout_Terminate(void) { return CSSM_OK; } /*------------------------------------------------------------------------- * Name: Addin_callout_ModuleLoad * * Description: * Call used to indicate that the application has requested a module load * * Parameters: * pLoadTracker (input/output) : The load tracker node that was created. * This node may be writen to. * CssmNotifyCallback (input) : Callback function to indicate to CSSM that * a subservice is ready for attach (must be called before an attach can * occurr). * CssmNotifyCallbackCtx (input) : Opaque data to pass to the callback * function. * * Return Code: * CSSM_OK if successful, otherwise CSSM_FAIL *------------------------------------------------------------------------- */ CSSM_RETURN Addin_callout_ModuleLoad( MAF_MODULE_LOAD_TRACKER_PTR pLoadTracker, CSSM_SPI_ModuleEventHandler CssmNotifyCallback, const void* CssmNotifyCallbackCtx ) { CSSM_RETURN ret = CSSM_OK; if (CssmNotifyCallback) { ret = CssmNotifyCallback(&ADDIN_GUID, (void *)CssmNotifyCallbackCtx, 0, CSSM_SERVICE_EMM_DUMMY, CSSM_NOTIFY_INSERT); } return ret; } /*------------------------------------------------------------------------- * Name: Addin_callout_ModuleUnload * * Description: * Function is called as part of the unload process to give indication to * the addin. * * Parameters: * pLoadTracker (input/output) : The load tracker node that was created. * This node may be written to. * CssmNotifyCallback (input) : Identifies the corresponding ModuleLoad * call CssmNotifyCallbackCtx (input) : Identifies the corresponding * ModuleLoad call * * Note: * There is no need to call the callback function on unload. * * Return Code: * CSSM_OK if successful, otherwise CSSM_FAIL *------------------------------------------------------------------------- */ CSSM_RETURN Addin_callout_ModuleUnload( MAF_MODULE_LOAD_TRACKER_PTR pLoadTracker, CSSM_SPI_ModuleEventHandler CssmNotifyCallback, const void* CssmNotifyCallbackCtx ) { return CSSM_OK; } /*------------------------------------------------------------------------- * Name: Addin_callout_ModuleAttach * * Description: * Functions is called to indicate that a module attach has been reqested. * * Parameters: * pLoadTracker (input/output) : An initialized load tracker, the * ADDIN_LOAD_DATA structure can be modified * pAttachTracker (input/output) : An construcuted attach tracker, the * ADDIN_ATTACH_DATA structure can be modified * FuncTbl (outpt) : Buffer to hold the SPI functions that the addin wants * to register with CSSM * * Return Code: * CSSM_OK if successful, otherwise CSSM_FAIL *------------------------------------------------------------------------- */ CSSM_RETURN Addin_callout_ModuleAttach( MAF_MODULE_LOAD_TRACKER_PTR pLoadTracker, MAF_MODULE_ATTACH_TRACKER_PTR pAttachTracker, CSSM_MODULE_FUNCS_PTR *FuncTbl ) { if (!pAttachTracker) { return CSSMERR_CSSM_INVALID_POINTER; } switch (pAttachTracker->SubServiceType) { case CSSM_SERVICE_EMM_DUMMY: return dummy_emmaddin_ModuleAttach(FuncTbl); default: return CSSMERR_CSSM_INVALID_SUBSERVICEID; } }