⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loadlibrary.cpp

📁 firtext搜索引擎源码
💻 CPP
字号:
#include "com/Com.h"
#include <dlfcn.h>
#include <stdio.h>
#include <wchar.h>
#include "com/linux/internal.h"

/***********************************************************************
 *           FX_CoLoadLibrary (OLE32.@)
 */
void* FX_STDAPICALLTYPE firtex::com::FX_CoLoadLibrary(wchar_t const* lpszLibName, uint16_t bAutoFree)
{
	// convert the text to ascii
	internal::zstr filename_( lpszLibName );
	if ( !filename_ ) return 0;
	char const* filename = filename_;

	// load the library
	void* ret = dlopen( filename, RTLD_LOCAL | RTLD_NOW );
	if ( !ret ) internal::log_printf( internal::ERROR, "Could not open library %s.\n%s\n", filename, dlerror() );
}

/***********************************************************************
 *           FX_CoFreeLibrary [OLE32.@]
 *
 * NOTES: don't believe the documentation
 */
void FX_STDAPICALLTYPE firtex::com::FX_CoFreeLibrary(void* hLibrary)
{
    int ret = dlclose( hLibrary );
	if ( ret ) {
		internal::log_printf( internal::ERROR, "Could not close library.\n%s\n", dlerror() );
	}
}

/***********************************************************************
 *           FX_CoFreeAllLibraries [OLE32.@]
 *
 * NOTES: don't believe the documentation
 */
void FX_STDAPICALLTYPE firtex::com::FX_CoFreeAllLibraries(void)
{
    /* NOP */
}

/***********************************************************************
 *           FX_CoFreeUnusedLibraries [COMPOBJ.17]
 *           FX_CoFreeUnusedLibraries [OLE32.@]
 *
 * FIXME: Calls to FX_CoFreeUnusedLibraries from any thread always route
 * through the main apartment's thread to call DllCanUnloadNow
 */
void FX_STDAPICALLTYPE firtex::com::FX_CoFreeUnusedLibraries(void)
{
	internal::FreeUnusedInprocServers();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -