diff --git a/dll/win32/kernelbase/wine/string.c b/dll/win32/kernelbase/wine/string.c index f83ae35f19a..c23270e610d 100644 --- a/dll/win32/kernelbase/wine/string.c +++ b/dll/win32/kernelbase/wine/string.c @@ -1457,6 +1457,9 @@ HRESULT WINAPI SHLoadIndirectString(const WCHAR *src, WCHAR *dst, UINT dst_len, WCHAR *dllname = NULL; HMODULE hmod = NULL; HRESULT hr = E_FAIL; +#ifdef __REACTOS__ + WCHAR szExpanded[512]; +#endif TRACE("%s, %p, %#x, %p\n", debugstr_w(src), dst, dst_len, reserved); @@ -1465,6 +1468,13 @@ HRESULT WINAPI SHLoadIndirectString(const WCHAR *src, WCHAR *dst, UINT dst_len, WCHAR *index_str; int index; +#ifdef __REACTOS__ + if (wcschr(src, '%') != NULL) + { + ExpandEnvironmentStringsW(src, szExpanded, ARRAY_SIZE(szExpanded)); + src = szExpanded; + } +#endif dst[0] = 0; dllname = StrDupW(src + 1); index_str = wcschr(dllname, ','); @@ -1475,7 +1485,11 @@ HRESULT WINAPI SHLoadIndirectString(const WCHAR *src, WCHAR *dst, UINT dst_len, index_str++; index = wcstol(index_str, NULL, 10); +#ifdef __REACTOS__ + hmod = LoadLibraryExW(dllname, NULL, LOAD_LIBRARY_AS_DATAFILE); +#else hmod = LoadLibraryW(dllname); +#endif if (!hmod) goto end; if (index < 0)