本文整理汇总了C++中LibraryLoader::GetFileName方法的典型用法代码示例。如果您正苦于以下问题:C++ LibraryLoader::GetFileName方法的具体用法?C++ LibraryLoader::GetFileName怎么用?C++ LibraryLoader::GetFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibraryLoader
的用法示例。
在下文中一共展示了LibraryLoader::GetFileName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetModuleFileNameA
extern "C" DWORD WINAPI dllGetModuleFileNameA(HMODULE hModule, LPSTR lpFilename, DWORD nSize)
{
if (NULL == hModule)
{
#ifdef _WIN32
return GetModuleFileNameA(hModule, lpFilename, nSize);
#else
CLog::Log(LOGDEBUG, "%s - No hModule specified", __FUNCTION__);
return 0;
#endif
}
LibraryLoader* dll = DllLoaderContainer::GetModule(hModule);
if( !dll )
{
CLog::Log(LOGERROR, "%s - Invalid hModule specified", __FUNCTION__);
return 0;
}
char* sName = dll->GetFileName();
if (sName)
{
strncpy(lpFilename, sName, nSize);
return strlen(lpFilename);
}
return 0;
}
示例2: strlen
extern "C" DWORD WINAPI dllGetModuleFileNameA(HMODULE hModule, LPSTR lpFilename, DWORD nSize)
{
if (NULL == hModule)
{
strncpy(lpFilename, "xbmc.xbe", nSize);
CLog::Log(LOGDEBUG, "GetModuleFileNameA(%p, %p, %u) => '%s'\n",
hModule, lpFilename, nSize, lpFilename);
return 8;
}
LibraryLoader* dll = DllLoaderContainer::GetModule(hModule);
if( !dll )
{
CLog::Log(LOGERROR, "%s - Invalid hModule specified", __FUNCTION__);
return 0;
}
char* sName = dll->GetFileName();
if (sName)
{
strncpy(lpFilename, sName, nSize);
return strlen(lpFilename);
}
return 0;
}
示例3: lock
extern "C" void tracker_library_free_all(DllTrackInfo* pInfo)
{
// unloading unloaded dll's
if (!pInfo->dllList.empty())
{
CSingleLock lock(g_trackerLock);
CLog::Log(LOGDEBUG,"%s: Detected %"PRIdS" unloaded dll's", pInfo->pDll->GetFileName(), pInfo->dllList.size());
for (DllListIter it = pInfo->dllList.begin(); it != pInfo->dllList.end(); ++it)
{
LibraryLoader* pDll = DllLoaderContainer::GetModule((HMODULE)*it);
if( !pDll)
{
CLog::Log(LOGERROR, "%s - Invalid module in tracker", __FUNCTION__);
return;
}
if (!pDll->IsSystemDll())
{
if (strlen(pDll->GetFileName()) > 0) CLog::Log(LOGDEBUG," : %s", pDll->GetFileName());
}
}
// now unload the dlls
for (DllListIter it = pInfo->dllList.begin(); it != pInfo->dllList.end(); ++it)
{
LibraryLoader* pDll = DllLoaderContainer::GetModule((HMODULE)*it);
if( !pDll)
{
CLog::Log(LOGERROR, "%s - Invalid module in tracker", __FUNCTION__);
return;
}
if (!pDll->IsSystemDll())
{
dllFreeLibrary((HMODULE)pDll->GetHModule());
}
}
}
}