Huw Davies : ntdll/tests: Skip broken SYSTEM_HANDLE_INFORMATION behaviour.

Alexandre Julliard julliard at winehq.org
Thu Aug 18 10:23:25 CDT 2016


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Thu Aug 18 09:22:58 2016 +0100

ntdll/tests: Skip broken SYSTEM_HANDLE_INFORMATION behaviour.

Vista and 2008 only copy the first handle's information into the
buffer.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/tests/info.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index ea1f3ef..448bc64 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -504,6 +504,7 @@ static void test_query_handle(void)
 
     SystemInformationLength = ReturnLength;
     shi = HeapReAlloc(GetProcessHeap(), 0, shi , SystemInformationLength);
+    memset(shi, 0x55, SystemInformationLength);
 
     ReturnLength = 0xdeadbeef;
     status = pNtQuerySystemInformation(SystemHandleInformation, shi, SystemInformationLength, &ReturnLength);
@@ -511,6 +512,7 @@ static void test_query_handle(void)
     {
         SystemInformationLength *= 2;
         shi = HeapReAlloc(GetProcessHeap(), 0, shi, SystemInformationLength);
+        memset(shi, 0x55, SystemInformationLength);
         status = pNtQuerySystemInformation(SystemHandleInformation, shi, SystemInformationLength, &ReturnLength);
     }
     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status );
@@ -518,6 +520,15 @@ static void test_query_handle(void)
     ok( ReturnLength == ExpectedLength || broken(ReturnLength == ExpectedLength - sizeof(DWORD)), /* Vista / 2008 */
         "Expected length %u, got %u\n", ExpectedLength, ReturnLength );
     ok( shi->Count > 1, "Expected more than 1 handle, got %u\n", shi->Count );
+    ok( shi->Handle[1].HandleValue != 0x5555 || broken( shi->Handle[1].HandleValue == 0x5555 ), /* Vista / 2008 */
+        "Uninitialized second handle\n" );
+    if (shi->Handle[1].HandleValue == 0x5555)
+    {
+        win_skip("Skipping broken SYSTEM_HANDLE_INFORMATION\n");
+        CloseHandle(EventHandle);
+        goto done;
+    }
+
     for (i = 0, found = FALSE; i < shi->Count && !found; i++)
         found = (shi->Handle[i].OwnerPid == GetCurrentProcessId()) &&
                 ((HANDLE)(ULONG_PTR)shi->Handle[i].HandleValue == EventHandle);
@@ -546,6 +557,7 @@ static void test_query_handle(void)
     status = pNtQuerySystemInformation(SystemHandleInformation, NULL, SystemInformationLength, &ReturnLength);
     ok( status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got %08x\n", status );
 
+done:
     HeapFree( GetProcessHeap(), 0, shi);
 }
 




More information about the wine-cvs mailing list