WebKit2 clients fail to launch on Windows if client exe is in a different directory from WebKit
Created attachment 81284 [details] Patch
Attachment 81284 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1 Source/WebKit2/win/MainWin.cpp:26: Found other header before WebCore config.h. Should be: config.h, primary header, blank line, and then alphabetically sorted. [build/include_order] [4] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 81284 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=81284&action=review > Source/WebKit2/win/MainWin.cpp:50 > + ::GetModuleFileNameW(0, webKitPath, ARRAYSIZE(webKitPath)); You could also use _countof or WTF_ARRAY_LENGTH. Maybe the latter is best, since it can be used in cross-platform code, too? > Source/WebKit2/win/MainWin.cpp:57 > + // set to 0. We want both the WebKit client app DLL path and the WebKit directory DLL path in > + // the DLL search order, and we want the current directory set to the WebKit client app path. > + ::SetDllDirectoryW(webKitPath); How does this guarantee that the "client app DLL path" is in the DLL search order, or that the current directory is set to the WebKit client app path?
Since we're using ARRAYSIZE directly within a Win32 call, it seems ok to keep. The file doesn't use any WTF headers now, so this would be the only dependency. The client app path will be in the search order, since the default use of CreateProcess sets the working directory to the same directory as the launching app. The current directory will be set to that path in the client app by Windows Explorer when it launches that app.
Committed r77678: <http://trac.webkit.org/changeset/77678>
Attachment 81284 [details] did not build on win: Build output: http://queues.webkit.org/results/7698620