Commit e61d4853 authored by Jinoh Kang's avatar Jinoh Kang Committed by Alexandre Julliard

advapi32/tests: Add tests for GetTokenInformation TokenOwner.

parent cadac127
......@@ -1773,6 +1773,7 @@ static void test_token_attr(void)
TOKEN_PRIVILEGES *Privileges;
TOKEN_GROUPS *Groups;
TOKEN_USER *User;
TOKEN_OWNER *Owner;
TOKEN_DEFAULT_DACL *Dacl;
BOOL ret;
DWORD i, GLE;
......@@ -1874,6 +1875,20 @@ static void test_token_attr(void)
LocalFree(SidString);
HeapFree(GetProcessHeap(), 0, User);
/* owner */
ret = GetTokenInformation(Token, TokenOwner, NULL, 0, &Size);
ok(!ret && (GetLastError() == ERROR_INSUFFICIENT_BUFFER),
"GetTokenInformation(TokenOwner) failed with error %ld\n", GetLastError());
Owner = HeapAlloc(GetProcessHeap(), 0, Size);
ret = GetTokenInformation(Token, TokenOwner, Owner, Size, &Size);
ok(ret,
"GetTokenInformation(TokenOwner) failed with error %ld\n", GetLastError());
ConvertSidToStringSidA(Owner->Owner, &SidString);
trace("TokenOwner: %s\n", SidString);
LocalFree(SidString);
HeapFree(GetProcessHeap(), 0, Owner);
/* logon */
ret = GetTokenInformation(Token, TokenLogonSid, NULL, 0, &Size);
if (!ret && (GetLastError() == ERROR_INVALID_PARAMETER))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment