fix returning the new token handle in DuplicateTokenEx

svn path=/trunk/; revision=18833
This commit is contained in:
Thomas Bluemel 2005-10-28 14:31:38 +00:00
parent 6ee31ba0a4
commit b1f73ba822

View file

@ -258,7 +258,6 @@ DuplicateTokenEx (IN HANDLE ExistingTokenHandle,
OUT PHANDLE DuplicateTokenHandle)
{
OBJECT_ATTRIBUTES ObjectAttributes;
HANDLE NewToken;
NTSTATUS Status;
SECURITY_QUALITY_OF_SERVICE Sqos;
@ -291,7 +290,7 @@ DuplicateTokenEx (IN HANDLE ExistingTokenHandle,
&ObjectAttributes,
FALSE,
TokenType,
&NewToken);
DuplicateTokenHandle);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
@ -344,7 +343,7 @@ CheckTokenMembership(IN HANDLE ExistingTokenHandle,
};
PACL Dacl;
ULONG SidLen;
HANDLE hToken;
HANDLE hToken = NULL;
NTSTATUS Status, AccessStatus;
/* doesn't return gracefully if IsMember is NULL! */
@ -484,7 +483,7 @@ CheckTokenMembership(IN HANDLE ExistingTokenHandle,
}
Cleanup:
if (hToken != ExistingTokenHandle)
if (hToken != NULL && hToken != ExistingTokenHandle)
{
NtClose(hToken);
}