Commit efed229a authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

advapi32: Add a test for access checks with the INHERIT_ONLY_ACE flag.

parent 23df453d
......@@ -894,6 +894,22 @@ static void test_AccessCheck(void)
trace("Couldn't get SE_SECURITY_PRIVILEGE (0x%08x), skipping ACCESS_SYSTEM_SECURITY test\n",
ret);
/* test INHERIT_ONLY_ACE */
ret = InitializeAcl(Acl, 256, ACL_REVISION);
ok(ret, "InitializeAcl failed with error %d\n", GetLastError());
ret = AddAccessAllowedAceEx(Acl, ACL_REVISION, INHERIT_ONLY_ACE, KEY_READ, EveryoneSid);
ok(ret, "AddAccessAllowedAceEx failed with error %d\n", GetLastError());
ret = AccessCheck(SecurityDescriptor, Token, KEY_READ, &Mapping,
PrivSet, &PrivSetLen, &Access, &AccessStatus);
ok(ret, "AccessCheck failed with error %d\n", GetLastError());
err = GetLastError();
todo_wine
ok(!AccessStatus && err == ERROR_ACCESS_DENIED, "AccessCheck should have failed "
"with ERROR_ACCESS_DENIED, instead of %d\n", err);
todo_wine
ok(!Access, "Should have failed to grant any access, got 0x%08x\n", Access);
CloseHandle(Token);
res = DuplicateToken(ProcessToken, SecurityAnonymous, &Token);
......
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