Author: ekohl
Date: Fri Nov 1 14:41:06 2013
New Revision: 60823
URL: http://svn.reactos.org/svn/reactos?rev=60823&view=rev
Log:
[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.
Modified:
trunk/reactos/dll/win32/userenv/profile.c
Modified: trunk/reactos/dll/win32/userenv/profile.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/profile.…
==============================================================================
--- trunk/reactos/dll/win32/userenv/profile.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/profile.c [iso-8859-1] Fri Nov 1 14:41:06 2013
@@ -1186,6 +1186,11 @@
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);