[USERENV]

LoadUserProfileW: Add a hack to prevent a failure when a newly created user profile is loaded twice. This failure (sharing violation) is caused by the unimplemented NtUnloadKey function!

This patch enables us to create and use our own user accounts. Please note that these accounts still have hard-coded group and privilege settings.

svn path=/trunk/; revision=60823
This commit is contained in:
Eric Kohl 2013-11-01 14:41:06 +00:00
parent 7445605fbd
commit b463d3a396

View file

@ -1186,6 +1186,11 @@ LoadUserProfileW(IN HANDLE hToken,
SidString.Buffer,
szUserHivePath);
AcquireRemoveRestorePrivilege(FALSE);
/* HACK: Do not fail if the profile has already been loaded! */
if (Error == ERROR_SHARING_VIOLATION)
Error = ERROR_SUCCESS;
if (Error != ERROR_SUCCESS)
{
DPRINT1("RegLoadKeyW() failed (Error %ld)\n", Error);