Some changes in DynLib internals
Former-commit-id: cfd8cbbdf30e2b0a6faa3a283c860001b07ae6de
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user