Return an SID when GetTokenInformation is called with class

TokenOwner.
This commit is contained in:
Mike McCormack 2003-12-30 19:17:05 +00:00 committed by Alexandre Julliard
parent fabfea59c7
commit 9acaadea3f
1 changed files with 12 additions and 1 deletions

View File

@ -201,7 +201,7 @@ NTSTATUS WINAPI NtQueryInformationToken(
len = sizeof(TOKEN_PRIVILEGES);
break;
case TokenOwner:
len = sizeof(TOKEN_OWNER);
len = sizeof(TOKEN_OWNER) + sizeof(SID);
break;
case TokenPrimaryGroup:
len = sizeof(TOKEN_PRIMARY_GROUP);
@ -264,6 +264,17 @@ NTSTATUS WINAPI NtQueryInformationToken(
tpriv->PrivilegeCount = 1;
}
break;
case TokenOwner:
if (tokeninfo)
{
TOKEN_OWNER *owner = tokeninfo;
PSID sid = (PSID) (owner + 1);
SID_IDENTIFIER_AUTHORITY localSidAuthority = {SECURITY_NT_AUTHORITY};
RtlInitializeSid(sid, &localSidAuthority, 1);
*(RtlSubAuthoritySid(sid, 0)) = SECURITY_INTERACTIVE_RID;
owner->Owner = sid;
}
break;
}
return 0;
}