Revert "[host] simplify dll loading"

This reverts commit b89a8fee04.
This commit is contained in:
Geoffrey McRae committed 2017-12-17 04:04:25 +11:00
1 parent b77a34b8b6
commit bf85358715
2 files changed
+39 -3

No files matched your search

+4 -3
View File
@@ -61,10 +61,11 @@ bool NvFBC::Initialize(CaptureOptions * options)
if (_strcmpi(*it, "nowait") == 0) { m_optNoWait = true ; continue; }
}
m_hDLL = LoadLibraryA(NVFBC_LIBRARY_NAME);
std::string nvfbc = Util::GetSystemRoot() + "\\" + NVFBC_LIBRARY_NAME;
m_hDLL = LoadLibraryA(nvfbc.c_str());
if (!m_hDLL)
{
DEBUG_ERROR("Failed to load the NvFBC library: %d - %s", GetLastError(), NVFBC_LIBRARY_NAME);
DEBUG_ERROR("Failed to load the NvFBC library: %d - %s", GetLastError(), nvfbc.c_str());
return false;
}
@@ -75,7 +76,7 @@ bool NvFBC::Initialize(CaptureOptions * options)
if (!m_fnCreateEx || !m_fnSetGlobalFlags || !m_fnGetStatusEx || !m_fnEnable)
{
DEBUG_ERROR("Unable to locate required entry points in %s", NVFBC_LIBRARY_NAME);
DEBUG_ERROR("Unable to locate required entry points in %s", nvfbc.c_str());
DeInitialize();
return false;
}