NtDuplicateToken: If the called does not provide any desired access rights the duplicate token will inherit the granted rights of the original token.
svn path=/trunk/; revision=47535
PTOKEN NewToken;
PSECURITY_QUALITY_OF_SERVICE CapturedSecurityQualityOfService;
BOOLEAN QoSPresent;
+ OBJECT_HANDLE_INFORMATION HandleInformation;
NTSTATUS Status;
PAGED_CODE();
SepTokenObjectType,
PreviousMode,
(PVOID*)&Token,
- NULL);
+ &HandleInformation);
if (!NT_SUCCESS(Status))
{
SepReleaseSecurityQualityOfService(CapturedSecurityQualityOfService,
{
Status = ObInsertObject((PVOID)NewToken,
NULL,
- DesiredAccess,
+ (DesiredAccess ? DesiredAccess : HandleInformation.GrantedAccess),
0,
NULL,
&hToken);