Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(windows): fix dependencies check on windows (#4076)

Darío Kondratiukff295d10e659
diff --git a/browser_patches/winldd/BUILD_NUMBER b/browser_patches/winldd/BUILD_NUMBER
index dd11724042..7d802a3e71 100644
--- a/browser_patches/winldd/BUILD_NUMBER
+++ b/browser_patches/winldd/BUILD_NUMBER
@@ -1 +1 @@
-1001
+1002
diff --git a/browser_patches/winldd/PrintDeps.cpp b/browser_patches/winldd/PrintDeps.cpp
index f7d68a08c6..e7e15e5ece 100644
--- a/browser_patches/winldd/PrintDeps.cpp
+++ b/browser_patches/winldd/PrintDeps.cpp
@@ -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];
@@ -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;