mirror of
https://github.com/reactos/reactos.git
synced 2025-07-08 15:47:53 +00:00
[NTOSKRNL]
- Fix logic in PsReferenceEffectiveToken svn path=/trunk/; revision=62206
This commit is contained in:
parent
77decfe72f
commit
5c9eeb7616
1 changed files with 17 additions and 19 deletions
|
@ -698,25 +698,7 @@ PsReferenceEffectiveToken(IN PETHREAD Thread,
|
||||||
|
|
||||||
/* Check if we don't have impersonation info */
|
/* Check if we don't have impersonation info */
|
||||||
Process = Thread->ThreadsProcess;
|
Process = Thread->ThreadsProcess;
|
||||||
if (!Thread->ActiveImpersonationInfo)
|
if (Thread->ActiveImpersonationInfo)
|
||||||
{
|
|
||||||
/* Fast Reference the Token */
|
|
||||||
Token = ObFastReferenceObject(&Process->Token);
|
|
||||||
|
|
||||||
/* Check if we got the Token or if we got locked */
|
|
||||||
if (!Token)
|
|
||||||
{
|
|
||||||
/* Lock the Process */
|
|
||||||
PspLockProcessSecurityShared(Process);
|
|
||||||
|
|
||||||
/* Do a Locked Fast Reference */
|
|
||||||
Token = ObFastReferenceObjectLocked(&Process->Token);
|
|
||||||
|
|
||||||
/* Unlock the Process */
|
|
||||||
PspUnlockProcessSecurityShared(Process);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/* Lock the Process */
|
/* Lock the Process */
|
||||||
PspLockProcessSecurityShared(Process);
|
PspLockProcessSecurityShared(Process);
|
||||||
|
@ -742,6 +724,22 @@ PsReferenceEffectiveToken(IN PETHREAD Thread,
|
||||||
PspUnlockProcessSecurityShared(Process);
|
PspUnlockProcessSecurityShared(Process);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Fast Reference the Token */
|
||||||
|
Token = ObFastReferenceObject(&Process->Token);
|
||||||
|
|
||||||
|
/* Check if we got the Token or if we got locked */
|
||||||
|
if (!Token)
|
||||||
|
{
|
||||||
|
/* Lock the Process */
|
||||||
|
PspLockProcessSecurityShared(Process);
|
||||||
|
|
||||||
|
/* Do a Locked Fast Reference */
|
||||||
|
Token = ObFastReferenceObjectLocked(&Process->Token);
|
||||||
|
|
||||||
|
/* Unlock the Process */
|
||||||
|
PspUnlockProcessSecurityShared(Process);
|
||||||
|
}
|
||||||
|
|
||||||
/* Return the token */
|
/* Return the token */
|
||||||
*TokenType = TokenPrimary;
|
*TokenType = TokenPrimary;
|
||||||
*EffectiveOnly = FALSE;
|
*EffectiveOnly = FALSE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue