Mikołaj Zalewski : advapi32/tests: Make the SDDL test pass under Vista.

Alexandre Julliard julliard at winehq.org
Mon Oct 22 09:55:33 CDT 2007


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

Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date:   Sat Oct 20 23:46:40 2007 -0700

advapi32/tests: Make the SDDL test pass under Vista.

---

 dlls/advapi32/tests/security.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 1a0e191..9962f0e 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -2025,6 +2025,11 @@ static void test_ConvertSecurityDescriptorToString()
     ok(len >= (strlen(exp_str) + 1), "Length mismatch (expected %d, got %d)\n", strlen(exp_str) + 1, len); \
     LocalFree(string);
 
+#define CHECK_ONE_OF_AND_FREE(exp_str1, exp_str2) \
+    ok(strcmp(string, (exp_str1)) == 0 || strcmp(string, (exp_str2)) == 0, "String mismatch (expected\n\"%s\" or\n\"%s\", got\n\"%s\")\n", (exp_str1), (exp_str2), string); \
+    ok(len >= (strlen(string) + 1), "Length mismatch (expected %d, got %d)\n", strlen(string) + 1, len); \
+    LocalFree(string);
+
     InitializeSecurityDescriptor(&desc, SECURITY_DESCRIPTOR_REVISION);
     ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
     CHECK_RESULT_AND_FREE("");
@@ -2086,11 +2091,13 @@ static void test_ConvertSecurityDescriptorToString()
     SetSecurityDescriptorDacl(&desc, TRUE, NULL, FALSE);
     AddAuditAccessAceEx(pacl, ACL_REVISION, VALID_INHERIT_FLAGS, KEY_READ|KEY_WRITE, psid2, TRUE, TRUE);
     ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
-    CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)");
+    CHECK_ONE_OF_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)", /* XP */
+        "O:SYG:S-1-5-21-93476-23408-4576D:NO_ACCESS_CONTROLS:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)" /* Vista */);
 
     AddAuditAccessAceEx(pacl, ACL_REVISION, NO_PROPAGATE_INHERIT_ACE, FILE_GENERIC_READ|FILE_GENERIC_WRITE, psid2, TRUE, FALSE);
     ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
-    CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)(AU;NPSA;0x12019f;;;SU)");
+    CHECK_ONE_OF_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)(AU;NPSA;0x12019f;;;SU)", /* XP */
+                          "O:SYG:S-1-5-21-93476-23408-4576D:NO_ACCESS_CONTROLS:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)(AU;NPSA;0x12019f;;;SU)" /* Vista */);
 }
 
 static void test_PrivateObjectSecurity(void)
@@ -2150,6 +2157,7 @@ static void test_PrivateObjectSecurity(void)
     HeapFree(GetProcessHeap(), 0, buf);
 }
 #undef CHECK_RESULT_AND_FREE
+#undef CHECK_ONE_OF_AND_FREE
 
 START_TEST(security)
 {




More information about the wine-cvs mailing list