Jacek Caban : advapi32/tests: Added TokenIsAppContainer tests.

Alexandre Julliard julliard at winehq.org
Tue Nov 15 17:56:16 CST 2016


Module: wine
Branch: master
Commit: bf1537da8b64056a0d376cc043e3cc8b52099448
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bf1537da8b64056a0d376cc043e3cc8b52099448

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Nov 15 14:21:20 2016 -0600

advapi32/tests: Added TokenIsAppContainer tests.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/advapi32/tests/security.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index cf104ab..b28ffaf 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -1912,6 +1912,31 @@ static void test_token_attr(void)
     CloseHandle(Token);
 }
 
+static void test_GetTokenInformation(void)
+{
+    DWORD is_app_container, size;
+    HANDLE token;
+    BOOL ret;
+
+    ret = OpenProcessToken(GetCurrentProcess(), MAXIMUM_ALLOWED, &token);
+    ok(ret, "OpenProcessToken failed: %u\n", GetLastError());
+
+    size = 0;
+    is_app_container = 0xdeadbeef;
+    ret = GetTokenInformation(token, TokenIsAppContainer, &is_app_container,
+                              sizeof(is_app_container), &size);
+    todo_wine
+    ok(ret || broken(GetLastError() == ERROR_INVALID_PARAMETER ||
+                     GetLastError() == ERROR_INVALID_FUNCTION), /* pre-win8 */
+       "GetTokenInformation failed: %u\n", GetLastError());
+    if(ret) {
+        ok(size == sizeof(is_app_container), "size = %u\n", size);
+        ok(!is_app_container, "is_app_container = %x\n", is_app_container);
+    }
+
+    CloseHandle(token);
+}
+
 typedef union _MAX_SID
 {
     SID sid;
@@ -6396,6 +6421,7 @@ START_TEST(security)
     test_FileSecurity();
     test_AccessCheck();
     test_token_attr();
+    test_GetTokenInformation();
     test_LookupAccountSid();
     test_LookupAccountName();
     test_security_descriptor();




More information about the wine-cvs mailing list