Paul Vriens : advapi32/tests: Fix some crashes on NT4.

Alexandre Julliard julliard at winehq.org
Mon Dec 1 07:34:06 CST 2008


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

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Sat Nov 29 12:38:30 2008 +0100

advapi32/tests: Fix some crashes on NT4.

---

 dlls/advapi32/tests/security.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 3d02777..b5c10ff 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -2146,7 +2146,7 @@ static void test_SetEntriesInAcl(void)
 
     if (!pSetEntriesInAclW)
     {
-        skip("SetEntriesInAclW is not available\n");
+        win_skip("SetEntriesInAclW is not available\n");
         return;
     }
 
@@ -2154,7 +2154,7 @@ static void test_SetEntriesInAcl(void)
     res = pSetEntriesInAclW(0, NULL, NULL, &NewAcl);
     if(res == ERROR_CALL_NOT_IMPLEMENTED)
     {
-        skip("SetEntriesInAclW is not implemented\n");
+        win_skip("SetEntriesInAclW is not implemented\n");
         return;
     }
     ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res);
@@ -2164,7 +2164,7 @@ static void test_SetEntriesInAcl(void)
     res = InitializeAcl(OldAcl, 256, ACL_REVISION);
     if(!res && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
     {
-        skip("ACLs not implemented - skipping tests\n");
+        win_skip("ACLs not implemented - skipping tests\n");
         HeapFree(GetProcessHeap(), 0, OldAcl);
         return;
     }
@@ -2209,15 +2209,17 @@ static void test_SetEntriesInAcl(void)
         ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_BAD_FORM;
         res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl);
         ok(res == ERROR_INVALID_PARAMETER, "SetEntriesInAclW failed: %u\n", res);
-        ok(NewAcl == NULL, "returned acl wasn't NULL: %p\n", NewAcl);
-        LocalFree(NewAcl);
+        ok(NewAcl == NULL ||
+            broken(NewAcl != NULL), /* NT4 */
+            "returned acl wasn't NULL: %p\n", NewAcl);
 
         ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_USER;
         ExplicitAccess.Trustee.MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
         res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl);
         ok(res == ERROR_INVALID_PARAMETER, "SetEntriesInAclW failed: %u\n", res);
-        ok(NewAcl == NULL, "returned acl wasn't NULL: %p\n", NewAcl);
-        LocalFree(NewAcl);
+        ok(NewAcl == NULL ||
+            broken(NewAcl != NULL), /* NT4 */
+            "returned acl wasn't NULL: %p\n", NewAcl);
 
         ExplicitAccess.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
         ExplicitAccess.grfAccessMode = SET_ACCESS;
@@ -2805,6 +2807,13 @@ static void test_GetSecurityInfo(void)
 
     LocalFree(sd);
 
+    if (!pCreateWellKnownSid)
+    {
+        win_skip("NULL parameter test would crash on NT4\n");
+        CloseHandle(obj);
+        return;
+    }
+
     /* If we don't ask for the security descriptor, Windows will still give us
        the other stuff, leaving us no way to free it.  */
     ret = pGetSecurityInfo(obj, SE_FILE_OBJECT,




More information about the wine-cvs mailing list