[WinCairo] DLLLauncherMain should use SetDllDirectory
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Dec 2017 02:45:13 +0000 (02:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Dec 2017 02:45:13 +0000 (02:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180642

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-12-11
Reviewed by Alex Christensen.

Windows have icuuc.dll in the system directory. WebKit should find
one in WebKitLibraries directory, not one in the system directory.

Source/JavaScriptCore:

* shell/DLLLauncherMain.cpp:
(modifyPath): Use SetDllDirectory for WebKitLibraries directory instead of modifying path.

Tools:

* win/DLLLauncher/DLLLauncherMain.cpp:
(modifyPath): Use SetDllDirectory for WebKitLibraries directory instead of modifying path.
Do not add a path for GStreamer because nobody is using now.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225767 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/shell/DLLLauncherMain.cpp
Tools/ChangeLog
Tools/win/DLLLauncher/DLLLauncherMain.cpp

index 99d9b04..c1d7f17 100644 (file)
@@ -1,3 +1,16 @@
+2017-12-11  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [WinCairo] DLLLauncherMain should use SetDllDirectory
+        https://bugs.webkit.org/show_bug.cgi?id=180642
+
+        Reviewed by Alex Christensen.
+
+        Windows have icuuc.dll in the system directory. WebKit should find
+        one in WebKitLibraries directory, not one in the system directory.
+
+        * shell/DLLLauncherMain.cpp:
+        (modifyPath): Use SetDllDirectory for WebKitLibraries directory instead of modifying path.
+
 2017-12-11  Eric Carlson  <eric.carlson@apple.com>
 
         Web Inspector: Optionally log WebKit log parameters as JSON
index b883a32..1770e25 100644 (file)
@@ -124,12 +124,18 @@ static bool modifyPath(const wstring& programName)
 {
 #ifdef WIN_CAIRO
 
+    wstring pathWinCairo = copyEnvironmentVariable(L"WEBKIT_LIBRARIES");
+    if (!directoryExists(pathWinCairo))
+        return true;
 #if defined(_M_X64)
-    wstring pathWinCairo = copyEnvironmentVariable(L"WEBKIT_LIBRARIES") + L"\\bin64";
+    pathWinCairo += L"\\bin64";
 #else
-    wstring pathWinCairo = copyEnvironmentVariable(L"WEBKIT_LIBRARIES") + L"\\bin32";
+    pathWinCairo += L"\\bin32";
 #endif
-    prependPath(pathWinCairo);
+    if (!SetDllDirectory(pathWinCairo.c_str())) {
+        fatalError(programName, L"Failed to SetDllDirectory");
+        return false;
+    }
     return true;
 
 #else
index ef3d855..21b35e5 100644 (file)
@@ -1,3 +1,17 @@
+2017-12-11  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [WinCairo] DLLLauncherMain should use SetDllDirectory
+        https://bugs.webkit.org/show_bug.cgi?id=180642
+
+        Reviewed by Alex Christensen.
+
+        Windows have icuuc.dll in the system directory. WebKit should find
+        one in WebKitLibraries directory, not one in the system directory.
+
+        * win/DLLLauncher/DLLLauncherMain.cpp:
+        (modifyPath): Use SetDllDirectory for WebKitLibraries directory instead of modifying path.
+        Do not add a path for GStreamer because nobody is using now.
+
 2017-12-11  David Quesada  <david_quesada@apple.com>
 
         Turn on ENABLE_APPLICATION_MANIFEST
index 392119d..fcf1a87 100644 (file)
@@ -121,16 +121,18 @@ static bool modifyPath(const wstring& programName)
 {
 #ifdef WIN_CAIRO
 
+    wstring pathWinCairo = copyEnvironmentVariable(L"WEBKIT_LIBRARIES");
+    if (!directoryExists(pathWinCairo))
+        return true;
 #if defined(_M_X64)
-    wstring pathGStreamer = copyEnvironmentVariable(L"GSTREAMER_1_0_ROOT_X86_64") + L"bin";
-    wstring pathWinCairo = copyEnvironmentVariable(L"WEBKIT_LIBRARIES") + L"\\bin64";
+    pathWinCairo += L"\\bin64";
 #else
-    wstring pathGStreamer = copyEnvironmentVariable(L"GSTREAMER_1_0_ROOT_X86") + L"bin";
-    wstring pathWinCairo = copyEnvironmentVariable(L"WEBKIT_LIBRARIES") + L"\\bin32";
+    pathWinCairo += L"\\bin32";
 #endif
-    prependPath(pathWinCairo);
-    if (directoryExists(pathGStreamer))
-        prependPath(pathGStreamer);
+    if (!SetDllDirectory(pathWinCairo.c_str())) {
+        fatalError(programName, L"Failed to SetDllDirectory");
+        return false;
+    }
     return true;
 
 #else