Skip to content

Commit

Permalink
fix(windows): fix dependencies check on windows (#4076)
Browse files Browse the repository at this point in the history
  • Loading branch information
kblok authored Oct 8, 2020
1 parent 08024c8 commit ff295d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion browser_patches/winldd/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1001
1002
9 changes: 5 additions & 4 deletions browser_patches/winldd/PrintDeps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ const DepsMap getDependencies(const HMODULE hMod)
while (pImportDesc->Name)
{
LPCSTR dllName = (LPCSTR)((BYTE*)hMod + pImportDesc->Name);
std::string dllPath = "not found";
HMODULE hModDep = LoadLibraryEx(dllName, NULL, DONT_RESOLVE_DLL_REFERENCES);
std::string dllPath = "not found";
HMODULE hModDep = LoadLibraryEx(dllName, NULL, DONT_RESOLVE_DLL_REFERENCES | LOAD_LIBRARY_SEARCH_USER_DIRS | LOAD_LIBRARY_SEARCH_SYSTEM32);
if (hModDep != NULL)
{
TCHAR pathBuffer[_MAX_PATH];
Expand All @@ -95,8 +95,9 @@ const DepsMap getDependencies(const HMODULE hMod)
}

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)
{
std::cerr << "Failed to load " << library << " Error: " << getLastErrorString() << std::endl;
Expand Down

0 comments on commit ff295d1

Please sign in to comment.