From: "Hao Peng" Subject: [PATCH] svchost: Add LOAD_WITH_ALTERED_SEARCH_PATH flags to LoadLibraryEx in AddServiceElem Message-Id: Date: Wed, 17 Sep 2014 17:39:40 +0800 try to fix up bug 36800. svchost.exe try to load a dll type service. but the dll depends on some other dll files in the same path, but due to current code, these dlls will not be found by the loader. So I add LOAD_WITH_ALTERED_SEARCH_PATH flags with LoadLibraryEx in AddServiceElem. --- programs/svchost/svchost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/svchost/svchost.c b/programs/svchost/svchost.c index 8713b4a..7045104 100644 --- a/programs/svchost/svchost.c +++ b/programs/svchost/svchost.c @@ -204,7 +204,7 @@ static BOOL AddServiceElem(LPWSTR service_name, RegCloseKey(service_hkey); /* Load the DLL and obtain a pointer to ServiceMain entry point */ - library = LoadLibraryW(dll_name_long); + library = LoadLibraryExW(dll_name_long, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (!library) { WINE_ERR("failed to load library %s, err=%u\n",