当前位置: 首页>>代码示例>>C++>>正文


C++ LibraryLoader::GetName方法代码示例

本文整理汇总了C++中LibraryLoader::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ LibraryLoader::GetName方法的具体用法?C++ LibraryLoader::GetName怎么用?C++ LibraryLoader::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LibraryLoader的用法示例。


在下文中一共展示了LibraryLoader::GetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: xbp_dlclose

int xbp_dlclose(void *handle)
{
#ifdef HAS_PYTHON
  LibraryLoader *pDll = (LibraryLoader*)handle;
  CLog::Log(LOGDEBUG,"%s - releasing python library %s", __FUNCTION__, pDll->GetName());
  g_pythonParser.UnregisterExtensionLib(pDll);
  DllLoaderContainer::ReleaseModule(pDll);
  return 0;
#else
  CLog::Log(LOGDEBUG,"Cannot release python lib because python isnt being used!");
  return NULL;
#endif
}
开发者ID:Bobbin007,项目名称:xbmc,代码行数:13,代码来源:exports_python_linux.cpp

示例2: dllFreeLibrary

extern "C" BOOL __stdcall dllFreeLibrary(HINSTANCE hLibModule)
{
  LibraryLoader* dllhandle = DllLoaderContainer::GetModule(hLibModule);

  if( !dllhandle )
  {
    CLog::Log(LOGERROR, "%s - Invalid hModule specified",__FUNCTION__);
    return 1;
  }

  // to make sure systems dlls are never deleted
  if (dllhandle->IsSystemDll()) return 1;

  CLog::Log(LOGDEBUG, "FreeLibrary(%s) -> %p", dllhandle->GetName(), (void*)dllhandle);

  DllLoaderContainer::ReleaseModule(dllhandle);

  return 1;
}
开发者ID:Bobbin007,项目名称:xbmc,代码行数:19,代码来源:dll.cpp

示例3: if

extern "C" FARPROC __stdcall dllGetProcAddress(HMODULE hModule, LPCSTR function)
{
  uintptr_t loc = (uintptr_t)_ReturnAddress();

  void* address = NULL;
  LibraryLoader* dll = DllLoaderContainer::GetModule(hModule);

  if( !dll )
  {
    CLog::Log(LOGERROR, "%s - Invalid hModule specified",__FUNCTION__);
    return NULL;
  }

  /* how can somebody get the stupid idea to create such a stupid function */
  /* where you never know if the given pointer is a pointer or a value */
  if( HIGH_WORD(function) == 0 && LOW_WORD(function) < 1000)
  {
    if( dll->ResolveOrdinal(LOW_WORD(function), &address) )
    {
      CLog::Log(LOGDEBUG, "%s(%p(%s), %d) => %p", __FUNCTION__, hModule, dll->GetName(), LOW_WORD(function), address);
    }
    else if( dll->IsSystemDll() )
    {
      char ordinal[5];
      sprintf(ordinal, "%d", LOW_WORD(function));
      address = (void*)create_dummy_function(dll->GetName(), ordinal);

      /* add to tracklist if we are tracking this source dll */
      DllTrackInfo* track = tracker_get_dlltrackinfo(loc);
      if( track )
        tracker_dll_data_track(track->pDll, (uintptr_t)address);

      CLog::Log(LOGDEBUG, "%s - created dummy function %s!%s",__FUNCTION__, dll->GetName(), ordinal);
    }
    else
    {
      address = NULL;
      CLog::Log(LOGDEBUG, "%s(%p(%s), '%s') => %p",__FUNCTION__ , hModule, dll->GetName(), function, address);
    }
  }
  else
  {
    if( dll->ResolveExport(function, &address) )
    {
      CLog::Log(LOGDEBUG, "%s(%p(%s), '%s') => %p",__FUNCTION__ , hModule, dll->GetName(), function, address);
    }
    else
    {
      DllTrackInfo* track = tracker_get_dlltrackinfo(loc);
      /* some dll's require us to always return a function or it will fail, other's  */
      /* decide functionallity depending on if the functions exist and may fail      */
      if( dll->IsSystemDll() && track
       && stricmp(track->pDll->GetName(), "CoreAVCDecoder.ax") == 0 )
      {
        address = (void*)create_dummy_function(dll->GetName(), function);
        tracker_dll_data_track(track->pDll, (uintptr_t)address);
        CLog::Log(LOGDEBUG, "%s - created dummy function %s!%s", __FUNCTION__, dll->GetName(), function);
      }
      else
      {
        address = NULL;
        CLog::Log(LOGDEBUG, "%s(%p(%s), '%s') => %p", __FUNCTION__, hModule, dll->GetName(), function, address);
      }
    }
  }

  return (FARPROC)address;
}
开发者ID:Bobbin007,项目名称:xbmc,代码行数:68,代码来源:dll.cpp


注:本文中的LibraryLoader::GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。