Beispiel #1
0
LOAD_RESULT CArchiver7ZIP::LoadDLL(CConfigManager &ConfMan,CString &strErr)
{
	FreeDLL();

	//基底クラスのメソッドを呼ぶ
	LOAD_RESULT res=CArchiverDLL::LoadDLL(ConfMan,strErr);
	if(LOAD_RESULT_OK!=res){
		return res;
	}

	//UNICODEモード設定用
	CStringA strFunctionName;
	strFunctionName=m_AstrPrefix+"SetUnicodeMode";
	ArchiverSetUnicodeMode=(COMMON_ARCHIVER_SETUNICODEMODE)GetProcAddress(m_hInstDLL,strFunctionName);
	if(NULL==ArchiverSetUnicodeMode){
		strErr.Format(IDS_ERROR_DLL_FUNCTION_GET,m_strDllName,(LPCTSTR)CA2T(strFunctionName));
		FreeDLL();
		TRACE(_T("%s\n"),(LPCTSTR)strErr);
		return LOAD_RESULT_INVALID;
	}
	//ここでUNICODEモードに設定
	if(!ArchiverSetUnicodeMode(TRUE)){
		//UNICODEにできなかったら失敗とする
		return LOAD_RESULT_INVALID;
	}

	//アーカイブ種別判定用
	strFunctionName=m_AstrPrefix+"GetArchiveType";
	ArchiverGetArchiveType=(COMMON_ARCHIVER_GETARCHIVETYPE)GetProcAddress(m_hInstDLL,strFunctionName);
	if(NULL==ArchiverGetArchiveType){
		strErr.Format(IDS_ERROR_DLL_FUNCTION_GET,m_strDllName,(LPCTSTR)CA2T(strFunctionName));
		FreeDLL();
		TRACE(_T("%s\n"),(LPCTSTR)strErr);
		return LOAD_RESULT_INVALID;
	}
	return LOAD_RESULT_OK;
}
Beispiel #2
0
CArchiverUNISO::~CArchiverUNISO()
{
	FreeDLL();
}
Beispiel #3
0
int leedll()
{
	TYPEOF_ExportaFuncs *ExportaFuncs;
#ifdef _WIN32
	HINSTANCE hDLL;

	/* Carga la DLL */
	hDLL=LoadDLL(fichdll);

	if(hDLL==NULL) {
		printf(translate(46),fichdll); /* no puedo cargar libreria */
		return 1;
	}

	/* Inicializa y ejecuta la funcion ExportaFuncs de la DLL */
	ExportaFuncs=NULL;
	ExportaFuncs=(TYPEOF_ExportaFuncs *)GetDLLProcAddress(hDLL,"ExportaFuncs");

	if(ExportaFuncs==NULL) {
		printf(translate(47),fichdll); /* exportafuncs no encontrado */
		FreeDLL(hDLL);
		return 1;
	}

	#ifdef DEBUG_DLL
		printf("dbg: ExportaFuncs encontrado!! :D\n");
	#endif

	ExportaFuncs(EXPORTAFUNCS_PARAMS);

	FreeDLL(hDLL);

#else   /* Linux */
    void *hDLL;
    char *errordll;

	/* Carga la DLL */
	hDLL=dlopen(fichdll,RTLD_NOW);

	if(!hDLL) {
		printf(translate(46),fichdll,dlerror()); /* no puedo cargar libreria */
		return 1;
	}

	/* Inicializa y ejecuta la funcion ExportaFuncs de la DLL */

	ExportaFuncs=NULL;

	ExportaFuncs=(TYPEOF_ExportaFuncs *) dlsym(hDLL,"ExportaFuncs");

	if((errordll=dlerror())!=NULL) {
		printf(translate(47),fichdll,errordll); /* exportafuncs no encontrado */
		dlclose(hDLL);
		return 1;
	}

	#ifdef DEBUG_DLL
		printf("dbg: ExportaFuncs encontrado!! :D\n");
	#endif

	ExportaFuncs(EXPORTAFUNCS_PARAMS);
	dlclose(hDLL);
#endif

	return 0;
}
Beispiel #4
0
void
_bmlw_finalize (void)
{
  FreeDLL (emu_dll);
  Restore_LDT_Keeper (ldt_fs);
}
Beispiel #5
0
CArchiverUNARJ::~CArchiverUNARJ()
{
	FreeDLL();
}
Beispiel #6
0
CArchiverUNGCA::~CArchiverUNGCA()
{
	FreeDLL();
}
Beispiel #7
0
CArchiver7ZIP::~CArchiver7ZIP()
{
	FreeDLL();
}
Beispiel #8
0
Piccolo_Gimic::~Piccolo_Gimic()
{
	Cleanup();
	FreeDLL();
}
Beispiel #9
0
CArchiverJACK::~CArchiverJACK()
{
	FreeDLL();
}
Beispiel #10
0
CArchiverUNACE::~CArchiverUNACE()
{
	FreeDLL();
}