Alexandre Julliard : ntdll/tests: Fix some more failures on restricted Windows.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jan 27 11:27:20 CST 2016


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jan 27 12:15:48 2016 +0900

ntdll/tests: Fix some more failures on restricted Windows.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/tests/om.c | 38 +++++++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 17 deletions(-)

diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c
index b957128..8a62cd3 100644
--- a/dlls/ntdll/tests/om.c
+++ b/dlls/ntdll/tests/om.c
@@ -1099,24 +1099,28 @@ static void test_query_object(void)
 
     pRtlCreateUnicodeStringFromAsciiz( &path, "\\REGISTRY\\Machine\\Software\\Classes" );
     status = pNtCreateKey( &handle, KEY_ALL_ACCESS, &attr, 0, 0, 0, 0 );
-    ok( handle != 0, "NtCreateKey failed status %x\n", status );
+    ok( status == STATUS_SUCCESS || status == STATUS_ACCESS_DENIED,
+        "NtCreateKey failed status %x\n", status );
     pRtlFreeUnicodeString( &path );
-    len = 0;
-    status = pNtQueryObject( handle, ObjectNameInformation, buffer, sizeof(buffer), &len );
-    ok( status == STATUS_SUCCESS , "NtQueryObject returned %x\n", status );
-    str = (UNICODE_STRING *)buffer;
-    todo_wine
-    ok( len > sizeof(UNICODE_STRING), "unexpected len %u\n", len );
-    str = (UNICODE_STRING *)buffer;
-    expected_len = sizeof(UNICODE_STRING) + str->Length + sizeof(WCHAR);
-    todo_wine
-    ok( len == expected_len || broken(len == expected_len - sizeof(WCHAR)), /* NT4 */
-        "unexpected len %u\n", len );
-    todo_wine
-    ok( len > sizeof(UNICODE_STRING) + sizeof("\\Classes") * sizeof(WCHAR),
-        "name too short %s\n", wine_dbgstr_w(str->Buffer) );
-    trace( "got %s len %u\n", wine_dbgstr_w(str->Buffer), len );
-    pNtClose( handle );
+    if (status == STATUS_SUCCESS)
+    {
+        len = 0;
+        status = pNtQueryObject( handle, ObjectNameInformation, buffer, sizeof(buffer), &len );
+        ok( status == STATUS_SUCCESS , "NtQueryObject returned %x\n", status );
+        str = (UNICODE_STRING *)buffer;
+        todo_wine
+        ok( len > sizeof(UNICODE_STRING), "unexpected len %u\n", len );
+        str = (UNICODE_STRING *)buffer;
+        expected_len = sizeof(UNICODE_STRING) + str->Length + sizeof(WCHAR);
+        todo_wine
+        ok( len == expected_len || broken(len == expected_len - sizeof(WCHAR)), /* NT4 */
+            "unexpected len %u\n", len );
+        todo_wine
+        ok( len > sizeof(UNICODE_STRING) + sizeof("\\Classes") * sizeof(WCHAR),
+            "name too short %s\n", wine_dbgstr_w(str->Buffer) );
+        trace( "got %s len %u\n", wine_dbgstr_w(str->Buffer), len );
+        pNtClose( handle );
+    }
 }
 
 static void test_type_mismatch(void)




More information about the wine-cvs mailing list