Some applications call SetDefaultDllDirectories(0xc00) which will override directory of xul and let xul can't find its dependence. So let's add xul's path by AddDllDirectory() before calling LoadLibraryEx().
Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- dlls/mshtml/nsembed.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 9acb0d29e8..a157afc3e9 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -488,6 +488,7 @@ static BOOL load_xul(const PRUnichar *gre_path) { static const WCHAR xul_dllW[] = {'\','x','u','l','.','d','l','l',0}; WCHAR file_name[MAX_PATH]; + DLL_DIRECTORY_COOKIE cookie;
strcpyW(file_name, gre_path); strcatW(file_name, xul_dllW); @@ -496,7 +497,9 @@ static BOOL load_xul(const PRUnichar *gre_path)
set_environment(gre_path);
+ cookie = AddDllDirectory(gre_path); xul_handle = LoadLibraryExW(file_name, 0, LOAD_WITH_ALTERED_SEARCH_PATH); + RemoveDllDirectory(cookie); if(!xul_handle) { WARN("Could not load XUL: %d\n", GetLastError()); return FALSE;
Hi Jactry,
On 11/28/18 3:17 PM, Jactry Zeng wrote:
Some applications call SetDefaultDllDirectories(0xc00) which will override directory of xul and let xul can't find its dependence. So let's add xul's path by AddDllDirectory() before calling LoadLibraryEx().
Looking at all those "new" LoadLibrary flags, I wonder if we could just use LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR instead. Does using LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR instead of LOAD_WITH_ALTERED_SEARCH_PATH solve your problem?
Thanks,
Jacek
Hi Jacek, Jacek Caban jacek@codeweavers.com 于2018年11月30日周五 上午12:00写道:
Looking at all those "new" LoadLibrary flags, I wonder if we could just use LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR instead. Does using LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR instead of LOAD_WITH_ALTERED_SEARCH_PATH solve your problem?
Yes, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR works too. I sent a new patch.
Thanks!