mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
fix returning the new token handle in DuplicateTokenEx
svn path=/trunk/; revision=18833
This commit is contained in:
parent
6ee31ba0a4
commit
b1f73ba822
1 changed files with 3 additions and 4 deletions
|
@ -258,7 +258,6 @@ DuplicateTokenEx (IN HANDLE ExistingTokenHandle,
|
||||||
OUT PHANDLE DuplicateTokenHandle)
|
OUT PHANDLE DuplicateTokenHandle)
|
||||||
{
|
{
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
HANDLE NewToken;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
SECURITY_QUALITY_OF_SERVICE Sqos;
|
SECURITY_QUALITY_OF_SERVICE Sqos;
|
||||||
|
|
||||||
|
@ -291,7 +290,7 @@ DuplicateTokenEx (IN HANDLE ExistingTokenHandle,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
FALSE,
|
FALSE,
|
||||||
TokenType,
|
TokenType,
|
||||||
&NewToken);
|
DuplicateTokenHandle);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastError(RtlNtStatusToDosError(Status));
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
|
@ -344,7 +343,7 @@ CheckTokenMembership(IN HANDLE ExistingTokenHandle,
|
||||||
};
|
};
|
||||||
PACL Dacl;
|
PACL Dacl;
|
||||||
ULONG SidLen;
|
ULONG SidLen;
|
||||||
HANDLE hToken;
|
HANDLE hToken = NULL;
|
||||||
NTSTATUS Status, AccessStatus;
|
NTSTATUS Status, AccessStatus;
|
||||||
|
|
||||||
/* doesn't return gracefully if IsMember is NULL! */
|
/* doesn't return gracefully if IsMember is NULL! */
|
||||||
|
@ -484,7 +483,7 @@ CheckTokenMembership(IN HANDLE ExistingTokenHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
Cleanup:
|
Cleanup:
|
||||||
if (hToken != ExistingTokenHandle)
|
if (hToken != NULL && hToken != ExistingTokenHandle)
|
||||||
{
|
{
|
||||||
NtClose(hToken);
|
NtClose(hToken);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue