Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/advapi32/tests/security.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 77748abe9ec..d39aaba7323 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -8139,6 +8139,12 @@ static void test_elevation(void) ret = GetTokenInformation(linked.LinkedToken, TokenElevation, &elevation, sizeof(elevation), &size); ok(ret, "got error %u\n", GetLastError()); ok(elevation.TokenIsElevated == TRUE, "got elevation %#x\n", elevation.TokenIsElevated); + ret = GetTokenInformation(linked.LinkedToken, TokenType, &type, sizeof(type), &size); + ok(ret, "got error %u\n", GetLastError()); + ok(type == TokenImpersonation, "got type %#x\n", type); + ret = GetTokenInformation(linked.LinkedToken, TokenImpersonationLevel, &type, sizeof(type), &size); + ok(ret, "got error %u\n", GetLastError()); + ok(type == SecurityIdentification, "got impersonation level %#x\n", type);
/* Asking for the linked token again gives us a different token. */ ret = GetTokenInformation(token, TokenLinkedToken, &linked2, sizeof(linked2), &size); @@ -8194,6 +8200,12 @@ static void test_elevation(void) ret = GetTokenInformation(linked.LinkedToken, TokenElevation, &elevation, sizeof(elevation), &size); ok(ret, "got error %u\n", GetLastError()); ok(elevation.TokenIsElevated == FALSE, "got elevation %#x\n", elevation.TokenIsElevated); + ret = GetTokenInformation(linked.LinkedToken, TokenType, &type, sizeof(type), &size); + ok(ret, "got error %u\n", GetLastError()); + todo_wine ok(type == TokenImpersonation, "got type %#x\n", type); + ret = GetTokenInformation(linked.LinkedToken, TokenImpersonationLevel, &type, sizeof(type), &size); + todo_wine ok(ret, "got error %u\n", GetLastError()); + ok(type == SecurityIdentification, "got impersonation level %#x\n", type);
/* Asking for the linked token again gives us a different token. */ ret = GetTokenInformation(token, TokenLinkedToken, &linked2, sizeof(linked2), &size); @@ -8249,10 +8261,18 @@ static void test_elevation(void) ret = GetTokenInformation(token2, TokenLinkedToken, &linked, sizeof(linked), &size); ok(ret, "got error %u\n", GetLastError()); if (type == TokenElevationTypeDefault) + { ok(!linked.LinkedToken, "expected no linked token\n"); + ret = GetTokenInformation(linked.LinkedToken, TokenType, &type, sizeof(type), &size); + ok(ret, "got error %u\n", GetLastError()); + ok(type == TokenImpersonation, "got type %#x\n", type); + ret = GetTokenInformation(linked.LinkedToken, TokenImpersonationLevel, &type, sizeof(type), &size); + ok(ret, "got error %u\n", GetLastError()); + ok(type == SecurityIdentification, "got impersonation level %#x\n", type); + CloseHandle(linked.LinkedToken); + } else ok(!!linked.LinkedToken, "expected a linked token\n"); - CloseHandle(linked.LinkedToken); CloseHandle(token2);
ret = CreateRestrictedToken(token, 0, 0, NULL, 0, NULL, 0, NULL, &token2);