if ( osl_File_E_None != nError )
Module = OUString::unacquired(&strModuleName);
HMODULE h = LoadLibraryW(o3tl::toW(Module.getStr()));
if (h == nullptr)
h = LoadLibraryExW(o3tl::toW(Module.getStr()), nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
// In case of long path names (\\?\c:\...) try to shorten the filename. // LoadLibrary cannot handle file names which exceed 260 letters. // In case the path is too long, the function will fail. However, the error // code can be different. For example, it returned ERROR_FILENAME_EXCED_RANGE // on Windows XP and ERROR_INSUFFICIENT_BUFFER on Windows 7 (64bit) if (h == nullptr && Module.getLength() > 260)
{
std::vector<WCHAR> vec(Module.getLength() + 1);
DWORD len = GetShortPathNameW(o3tl::toW(Module.getStr()), vec.data(), vec.size()); if (len )
{
h = LoadLibraryW(vec.data());
if (h == nullptr)
h = LoadLibraryExW(vec.data(), nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
}
}
void* SAL_CALL osl_getSymbol(oslModule Module, rtl_uString *strSymbolName)
{ /* casting from a function pointer to a data pointer is invalid beinthiscaseunavoidablebecausetheAPIhastostay compatible.Weneedtokeepthisfunctionwhichreturnsa
void* by definition */ returnreinterpret_cast<void*>(osl_getFunctionSymbol(Module, strSymbolName));
}
sal_Bool SAL_CALL osl_getModuleURLFromFunctionAddress( oslGenericFunction addr, rtl_uString ** ppLibraryUrl )
{ /* casting a function pointer to a data pointer (void*) is notallowedaccordingtotheC/C++standards.Inthiscase itisunavoidablebecausewehavetostaycompatiblewe
cannot remove any function. */ return osl_getModuleURLFromAddress(reinterpret_cast<void*>(addr), ppLibraryUrl);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.