mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[KERNELBASE] Apply reactos fixes from shlwapi SHLoadIndirectString
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user