Author: pschweitzer
Date: Sun May 5 22:19:54 2013
New Revision: 58959
URL:
http://svn.reactos.org/svn/reactos?rev=58959&view=rev
Log:
[RTL]
When we are impersonating, also set the flag, so that on release, we can kill it.
This hopefully fixes 2nd stage and the whole mess it was causing in privileges.
Modified:
trunk/reactos/lib/rtl/priv.c
Modified: trunk/reactos/lib/rtl/priv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/priv.c?rev=58959&a…
==============================================================================
--- trunk/reactos/lib/rtl/priv.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/priv.c [iso-8859-1] Sun May 5 22:19:54 2013
@@ -247,8 +247,9 @@
goto Cleanup;
}
- /* Save said token */
+ /* Save said token and the fact we have impersonated */
State->Token = ImpersonationToken;
+ State->Flags |= RTL_ACQUIRE_PRIVILEGE_IMPERSONATE;
ZwClose(ProcessToken);
}
@@ -372,7 +373,9 @@
DPRINT("RtlReleasePrivilege(%p)\n", ReturnedState);
- /* If we had an active impersonation before we acquired privileges */
+ /* If we had an active impersonation before we acquired privileges
+ * Or if we have impersonated, quit it
+ */
if (State->Flags & RTL_ACQUIRE_PRIVILEGE_IMPERSONATE)
{
/* Restore it for the current thread */