advapi32: add a couple testcases for GetNamedSecurityInfo (try 3)
Austin English
austinenglish at gmail.com
Fri Apr 17 12:02:26 CDT 2009
Added win_skip for NT4, where it would crash (thanks Paul!).
--
-Austin
-------------- next part --------------
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index f775d10..82961e1 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -2569,6 +2569,25 @@ static void test_GetNamedSecurityInfoA(void)
}
ok(!error, "GetNamedSecurityInfo failed with error %d\n", error);
+ /* Test with a NULL ObjectName */
+ SetLastError(0xdeadbeef);
+ error = pGetNamedSecurityInfoA(NULL, SE_FILE_OBJECT,
+ OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION,
+ NULL, NULL, NULL, NULL, &pSecDesc);
+ ok(error == ERROR_INVALID_PARAMETER, "GetNamedSecurityInfoA should've returned ERROR_INVALID PARAMETER, got %d\n", error);
+
+ /* Test with a NULL descriptor */
+ if(!pCreateWellKnownSid)
+ win_skip("Crashes on NT4\n");
+ else
+ {
+ SetLastError(0xdeadbeef);
+ error = pGetNamedSecurityInfoA(windows_dir, SE_FILE_OBJECT,
+ OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION,
+ NULL, NULL, NULL, NULL, NULL);
+ ok(error == ERROR_INVALID_PARAMETER, "GetNamedSecurityInfoA should've returned ERROR_INVALID PARAMETER, got %d\n", error);
+ }
+
ret = GetSecurityDescriptorControl(pSecDesc, &control, &revision);
ok(ret, "GetSecurityDescriptorControl failed with error %d\n", GetLastError());
ok((control & (SE_SELF_RELATIVE|SE_DACL_PRESENT)) == (SE_SELF_RELATIVE|SE_DACL_PRESENT) ||
More information about the wine-patches
mailing list