Some changes in DynLib internals

Former-commit-id: cfd8cbbdf30e2b0a6faa3a283c860001b07ae6de
This commit is contained in:
Lynix
2014-01-08 11:12:34 +01:00
parent 26a6158f8f
commit b85a5bd5d5
3 changed files with 11 additions and 13 deletions

View File

@@ -23,13 +23,9 @@ NzDynLibFunc NzDynLibImpl::GetSymbol(const NzString& symbol, NzString* errorMess
return sym;
}
bool NzDynLibImpl::Load(const NzString& libraryPath, bool appendExtension, NzString* errorMessage)
bool NzDynLibImpl::Load(const NzString& libraryPath, NzString* errorMessage)
{
NzString path = libraryPath;
if (appendExtension && !path.EndsWith(".dll"))
path += ".dll";
std::unique_ptr<wchar_t[]> wPath(path.GetWideBuffer());
std::unique_ptr<wchar_t[]> wPath(libraryPath.GetWideBuffer());
m_handle = LoadLibraryW(wPath.get());
if (m_handle)

View File

@@ -20,7 +20,7 @@ class NzDynLibImpl : NzNonCopyable
~NzDynLibImpl() = default;
NzDynLibFunc GetSymbol(const NzString& symbol, NzString* errorMessage) const;
bool Load(const NzString& libraryPath, bool appendExtension, NzString* errorMessage);
bool Load(const NzString& libraryPath, NzString* errorMessage);
void Unload();
private: