Bazaar developer reference

CvDllGameContext::SetDLLIFace(ICvEngineUtility1 *)

Defined in
CvDllContext.cpp, line 875
Class
CvDllGameContext
Hook name
CivHooks::CvDllGameContext_SetDLLIFace

Hooks

static bool BeforeCvDllGameContext_SetDLLIFace(CvDllGameContext* self, ICvEngineUtility1* pDll, bool& result);static void AfterCvDllGameContext_SetDLLIFace(CvDllGameContext* self, ICvEngineUtility1* pDll, bool& result);static bool ReplaceCvDllGameContext_SetDLLIFace(bool (*original)(CvDllGameContext*, ICvEngineUtility1*), CvDllGameContext* self, ICvEngineUtility1* pDll);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvDllGameContext_SetDLLIFace::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvDllGameContext_SetDLLIFace);host->RegisterHook(host->pluginIndex, CivHooks::CvDllGameContext_SetDLLIFace::ID, CIV_HOOK_AFTER, (void*)&AfterCvDllGameContext_SetDLLIFace);host->RegisterHook(host->pluginIndex, CivHooks::CvDllGameContext_SetDLLIFace::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvDllGameContext_SetDLLIFace);

Code

875bool CvDllGameContext::SetDLLIFace(ICvEngineUtility1* pDll)876{877	//Since we're using QueryInterface to allocate a new instance, we need to explicitly clean up the old reference.878	ICvEngineUtility4* pOldDll = GC.getDLLIFace();879	if(pOldDll != NULL)880	{881		delete pOldDll;882	}883884	ICvEngineUtility4* pDllInterface = (pDll != NULL)? pDll->QueryInterface<ICvEngineUtility4>() : NULL;885	GC.setDLLIFace(pDllInterface);	//GameCore will claim ownership.886887	return pDllInterface != NULL;888}

Calls