BOOL SimpleKfwEvent::LoadLogMgr(const GUID& iid, void** pInterface ) { static KSDll logDll; static BOOL b = FALSE; if (!b) { WCHAR wszProxy[MAX_PATH + 1] = { 0 }; GetModuleFileName(NULL, wszProxy, MAX_PATH); *(wcsrchr(wszProxy, L'\\')) = 0L; wcscat_s(wszProxy, MAX_PATH, L"\\kislog.dll"); if (S_OK == logDll.Open(wszProxy)) b = TRUE; } if (!b) return FALSE; return logDll.GetClassObject(iid, iid, pInterface) == S_OK; }
BOOL KTdiDriverProxy::LoadInterface(const GUID& iid, void** pInterface ) { static KSDll dll; static BOOL b = FALSE; if (!b) { WCHAR wszProxy[MAX_PATH + 1] = { 0 }; GetModuleFileName(NULL, wszProxy, MAX_PATH); *(wcsrchr(wszProxy, L'\\')) = 0L; wcscat_s(wszProxy, MAX_PATH, L"\\fwproxy.dll"); if (S_OK == dll.Open(wszProxy)) b = TRUE; } if (!b) return FALSE; return dll.GetClassObject(iid, iid, pInterface) == S_OK; }