[USERENV]

Hack, that fixes the "Volatile Environment" bug by deleting the "Volatile Environment" key before the user hive is unloaded.
CORE-10705

svn path=/trunk/; revision=70406
This commit is contained in:
Eric Kohl 2015-12-20 22:30:51 +00:00
parent 716992c8c7
commit 03e066f2f1

View file

@ -539,8 +539,8 @@ GetAllUsersProfileDirectoryW(LPWSTR lpProfileDir,
return FALSE;
}
wcscpy(lpProfileDir, szProfilePath);
}
wcscpy(lpProfileDir, szProfilePath);
}
*lpcchSize = dwLength;
@ -667,8 +667,8 @@ GetDefaultUserProfileDirectoryW(LPWSTR lpProfileDir,
return FALSE;
}
wcscpy(lpProfileDir, szProfilePath);
}
wcscpy(lpProfileDir, szProfilePath);
}
*lpcchSize = dwLength;
@ -1309,6 +1309,25 @@ UnloadUserProfile(HANDLE hToken,
return FALSE;
}
/* HACK */
{
HKEY hUserKey;
Error = RegOpenKeyExW(HKEY_USERS,
SidString.Buffer,
0,
KEY_WRITE,
&hUserKey);
if (Error == ERROR_SUCCESS)
{
RegDeleteKeyW(hUserKey,
L"Volatile Environment");
RegCloseKey(hUserKey);
}
}
/* End of HACK */
/* Unload the hive */
Error = RegUnLoadKeyW(HKEY_USERS,
SidString.Buffer);