Sebastian Lackner : ntdll/tests: Add tests for iosb.Status value after pending FSCTL_PIPE_LISTEN call.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Apr 7 11:42:52 CDT 2016


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

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Thu Apr  7 08:45:06 2016 +0200

ntdll/tests: Add tests for iosb.Status value after pending FSCTL_PIPE_LISTEN call.

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

---

 dlls/ntdll/tests/pipe.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c
index 0862f1c..0551d23 100644
--- a/dlls/ntdll/tests/pipe.c
+++ b/dlls/ntdll/tests/pipe.c
@@ -277,10 +277,9 @@ static void test_overlapped(void)
     ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
 
     memset(&iosb, 0x55, sizeof(iosb));
-
-/* try with event and apc */
     res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
     ok(res == STATUS_PENDING, "NtFsControlFile returned %x\n", res);
+    ok(U(iosb).Status == 0x55555555, "iosb.Status got changed to %x\n", U(iosb).Status);
 
     hClient = CreateFileW(testpipe, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
     ok(hClient != INVALID_HANDLE_VALUE, "can't open pipe, GetLastError: %x\n", GetLastError());
@@ -294,9 +293,28 @@ static void test_overlapped(void)
 
     ok(ioapc_called, "IOAPC didn't run\n");
 
-    CloseHandle(hEvent);
     CloseHandle(hPipe);
     CloseHandle(hClient);
+
+    res = create_pipe(&hPipe, FILE_SHARE_READ | FILE_SHARE_WRITE, 0 /* OVERLAPPED */);
+    ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
+
+    hClient = CreateFileW(testpipe, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
+    ok(hClient != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_PIPE_BUSY) /* > Win 8 */,
+       "can't open pipe, GetLastError: %x\n", GetLastError());
+
+    if (hClient != INVALID_HANDLE_VALUE)
+    {
+        memset(&iosb, 0x55, sizeof(iosb));
+        res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
+        ok(res == STATUS_PIPE_CONNECTED, "NtFsControlFile returned %x\n", res);
+        todo_wine ok(U(iosb).Status == 0x55555555, "iosb.Status got changed to %x\n", U(iosb).Status);
+
+        CloseHandle(hClient);
+    }
+
+    CloseHandle(hPipe);
+    CloseHandle(hEvent);
 }
 
 static BOOL userapc_called;




More information about the wine-cvs mailing list