fix(windows): fix dependencies check on windows (#4076)
This commit is contained in:
parent
08024c82e8
commit
ff295d10e6
|
|
@ -1 +1 @@
|
||||||
1001
|
1002
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,8 @@ const DepsMap getDependencies(const HMODULE hMod)
|
||||||
while (pImportDesc->Name)
|
while (pImportDesc->Name)
|
||||||
{
|
{
|
||||||
LPCSTR dllName = (LPCSTR)((BYTE*)hMod + pImportDesc->Name);
|
LPCSTR dllName = (LPCSTR)((BYTE*)hMod + pImportDesc->Name);
|
||||||
std::string dllPath = "not found";
|
std::string dllPath = "not found";
|
||||||
HMODULE hModDep = LoadLibraryEx(dllName, NULL, DONT_RESOLVE_DLL_REFERENCES);
|
HMODULE hModDep = LoadLibraryEx(dllName, NULL, DONT_RESOLVE_DLL_REFERENCES | LOAD_LIBRARY_SEARCH_USER_DIRS | LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||||
if (hModDep != NULL)
|
if (hModDep != NULL)
|
||||||
{
|
{
|
||||||
TCHAR pathBuffer[_MAX_PATH];
|
TCHAR pathBuffer[_MAX_PATH];
|
||||||
|
|
@ -95,8 +95,9 @@ const DepsMap getDependencies(const HMODULE hMod)
|
||||||
}
|
}
|
||||||
|
|
||||||
int printDependencies(const char* library)
|
int printDependencies(const char* library)
|
||||||
{
|
{
|
||||||
HMODULE hMod = LoadLibraryEx(library, NULL, DONT_RESOLVE_DLL_REFERENCES);
|
SetDllDirectoryA(".");
|
||||||
|
HMODULE hMod = LoadLibraryEx(library, NULL, DONT_RESOLVE_DLL_REFERENCES | LOAD_LIBRARY_SEARCH_USER_DIRS | LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||||
if (hMod == NULL)
|
if (hMod == NULL)
|
||||||
{
|
{
|
||||||
std::cerr << "Failed to load " << library << " Error: " << getLastErrorString() << std::endl;
|
std::cerr << "Failed to load " << library << " Error: " << getLastErrorString() << std::endl;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue