Changed DynLib internal

Fixes the "Assimp32.dll not found" bug


Former-commit-id: 662adba33c5d9cfbd23c8b0af0670626070baaa9
This commit is contained in:
Lynix
2014-01-12 10:33:03 +01:00
parent 6545b919c5
commit 9389e1ea05
7 changed files with 21 additions and 22 deletions

View File

@@ -5,6 +5,7 @@
#include <Nazara/Core/Win32/DynLibImpl.hpp>
#include <Nazara/Core/DynLib.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/File.hpp>
#include <Nazara/Core/String.hpp>
#include <memory>
#include <Nazara/Core/Debug.hpp>
@@ -25,8 +26,12 @@ NzDynLibFunc NzDynLibImpl::GetSymbol(const NzString& symbol, NzString* errorMess
bool NzDynLibImpl::Load(const NzString& libraryPath, NzString* errorMessage)
{
std::unique_ptr<wchar_t[]> wPath(libraryPath.GetWideBuffer());
m_handle = LoadLibraryW(wPath.get());
NzString path = libraryPath;
if (!path.EndsWith(".dll"))
path += ".dll";
std::unique_ptr<wchar_t[]> wPath(path.GetWideBuffer());
m_handle = LoadLibraryExW(wPath.get(), nullptr, (NzFile::IsAbsolute(path)) ? LOAD_WITH_ALTERED_SEARCH_PATH : 0);
if (m_handle)
return true;