From ac6c72e128680a4b64fa6f1fba58d63656f2c637 Mon Sep 17 00:00:00 2001 From: Louis Lenders Date: Fri, 16 Apr 2010 13:13:17 +0200 Subject: shell32: create usersid subkey under the profilelistkey --- dlls/shell32/shellpath.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 451d6ff..2d601c2 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -1487,9 +1487,22 @@ static HRESULT _SHOpenProfilesKey(PHKEY pKey) { LONG lRet; DWORD disp; + HKEY sidkey; + WCHAR sidpathW[MAX_PATH]; + HANDLE tokenhandle; lRet = RegCreateKeyExW(HKEY_LOCAL_MACHINE, ProfileListW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, pKey, &disp); + /*Also create a UserSid subkey, needed by some apps*/ + if (lRet == ERROR_SUCCESS) + { + OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &tokenhandle); + lstrcpyW(sidpathW, ProfileListW); + PathAppendW(sidpathW, _GetUserSidStringFromToken(tokenhandle)); + RegCreateKeyExW(HKEY_LOCAL_MACHINE, sidpathW, 0, NULL, 0, + KEY_ALL_ACCESS, NULL, &sidkey, NULL); + } + return HRESULT_FROM_WIN32(lRet); } -- 1.7.0.4