diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index f775d10..cb612ba 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) /* NT4 */ + { + win_skip("CreateWellKnownSid is not present, skipping test\n"); + return; + } + 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) ||