mod_loader.cpp (Firebird-3.0.2.32703-0.tar.bz2) | : | mod_loader.cpp (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 191 | skipping to change at line 191 | |||
} | } | |||
void ModuleLoader::doctorModuleExtension(PathName& name) | void ModuleLoader::doctorModuleExtension(PathName& name) | |||
{ | { | |||
const PathName::size_type pos = name.rfind(".dll"); | const PathName::size_type pos = name.rfind(".dll"); | |||
if (pos != PathName::npos && pos == name.length() - 4) | if (pos != PathName::npos && pos == name.length() - 4) | |||
return; | return; | |||
name += ".dll"; | name += ".dll"; | |||
} | } | |||
ModuleLoader::Module* ModuleLoader::loadModule(const PathName& modPath) | ModuleLoader::Module* ModuleLoader::loadModule(ISC_STATUS* status, const PathNam e& modPath) | |||
{ | { | |||
ContextActivator ctx; | ContextActivator ctx; | |||
// supress error message box if it is not done yet | // supress error message box if it is not done yet | |||
const UINT oldErrorMode = | const UINT oldErrorMode = | |||
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM _NOOPENFILEERRORBOX); | SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM _NOOPENFILEERRORBOX); | |||
HMODULE module = 0; | HMODULE module = 0; | |||
if (PathUtils::isRelative(modPath)) | if (PathUtils::isRelative(modPath)) | |||
{ | { | |||
skipping to change at line 214 | skipping to change at line 214 | |||
PathName fullName; | PathName fullName; | |||
PathUtils::concatPath(fullName, baseDir, modPath); | PathUtils::concatPath(fullName, baseDir, modPath); | |||
module = LoadLibraryEx(fullName.c_str(), 0, LOAD_WITH_ALTERED_SEA RCH_PATH); | module = LoadLibraryEx(fullName.c_str(), 0, LOAD_WITH_ALTERED_SEA RCH_PATH); | |||
} | } | |||
if (!module) | if (!module) | |||
module = LoadLibraryEx(modPath.c_str(), 0, LOAD_WITH_ALTERED_SEAR CH_PATH); | module = LoadLibraryEx(modPath.c_str(), 0, LOAD_WITH_ALTERED_SEAR CH_PATH); | |||
if (!module && status) | ||||
{ | ||||
status[0] = isc_arg_win32; | ||||
status[1] = GetLastError(); | ||||
status[2] = isc_arg_end; | ||||
} | ||||
// Restore old mode in case we are embedded into user application | // Restore old mode in case we are embedded into user application | |||
SetErrorMode(oldErrorMode); | SetErrorMode(oldErrorMode); | |||
if (!module) | if (!module) | |||
return 0; | return 0; | |||
char fileName[MAX_PATH]; | char fileName[MAX_PATH]; | |||
GetModuleFileName(module, fileName, sizeof(fileName)); | GetModuleFileName(module, fileName, sizeof(fileName)); | |||
return FB_NEW_POOL(*getDefaultMemoryPool()) Win32Module(*getDefaultMemory Pool(), fileName, module); | return FB_NEW_POOL(*getDefaultMemoryPool()) Win32Module(*getDefaultMemory Pool(), fileName, module); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 8 lines changed or added |