[KERNELBASE] Apply reactos fixes from shlwapi SHLoadIndirectString

This commit is contained in:
Timo Kreuzer
2026-06-09 17:40:07 +00:00
parent db16f10a91
commit 2820072004
+14
View File
@@ -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)