server: Use server side named pipe implementation in byte mode.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c
index 18ffa7a..87e64ef 100644
--- a/dlls/kernel32/tests/pipe.c
+++ b/dlls/kernel32/tests/pipe.c
@@ -2576,7 +2576,6 @@
     SetLastError(0xdeadbeef);
     ret = ReadFile(server, read_buf, 0, &num_bytes, &overlapped);
     ok(!ret, "ReadFile should fail\n");
-todo_wine
     ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError());
     ok(num_bytes == 0, "bytes %u\n", num_bytes);
     ok((NTSTATUS)overlapped.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %#lx\n", overlapped.Internal);
@@ -2592,11 +2591,9 @@
     ok(num_bytes == 1, "bytes %u\n", num_bytes);
 
     wait = WaitForSingleObject(event, 100);
-todo_wine
     ok(wait == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", wait);
 
     ok(num_bytes == 1, "bytes %u\n", num_bytes);
-todo_wine
     ok((NTSTATUS)overlapped.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", overlapped.Internal);
     ok(overlapped.InternalHigh == 0, "expected 0, got %lu\n", overlapped.InternalHigh);
 
@@ -3132,6 +3129,5 @@
     test_readfileex_pending();
     test_overlapped_transport(TRUE, FALSE);
     test_overlapped_transport(TRUE, TRUE);
-    if (broken(1)) /* FIXME: Remove once Wine is ready. */
-        test_overlapped_transport(FALSE, FALSE);
+    test_overlapped_transport(FALSE, FALSE);
 }
diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c
index 897c44b..9628cc2 100644
--- a/dlls/ntdll/tests/pipe.c
+++ b/dlls/ntdll/tests/pipe.c
@@ -726,7 +726,7 @@
     ok( !reserved, "reserved is not 0: %x\n", reserved );
 }
 
-static void test_peek(HANDLE pipe, BOOL is_msgmode)
+static void test_peek(HANDLE pipe)
 {
     FILE_PIPE_PEEK_BUFFER buf;
     IO_STATUS_BLOCK iosb;
@@ -745,7 +745,6 @@
     ok(!status || status == STATUS_PENDING, "NtFsControlFile failed: %x\n", status);
     ok(buf.ReadDataAvailable == 1, "ReadDataAvailable = %u\n", buf.ReadDataAvailable);
     ok(!iosb.Status, "iosb.Status = %x\n", iosb.Status);
-    todo_wine_if(!is_msgmode)
     ok(is_signaled(event), "event is not signaled\n");
 
     CloseHandle(event);
@@ -857,7 +856,7 @@
     ret = WriteFile( write, buffer, 1, &written, NULL );
     ok(ret && written == 1, "WriteFile error %d\n", GetLastError());
 
-    test_peek(read, pipe_type & PIPE_TYPE_MESSAGE);
+    test_peek(read);
 
     status = NtReadFile( read, event, apc, &apc_count, &iosb, buffer, 1, NULL, NULL );
     ok( status == STATUS_SUCCESS, "wrong status %x\n", status );
@@ -984,7 +983,6 @@
     ok( !apc_count, "apc was called\n" );
     CloseHandle( write );
     Sleep(1);  /* FIXME: needed for wine to run the i/o apc  */
-    todo_wine_if(!(pipe_type & PIPE_TYPE_MESSAGE) && (pipe_flags & PIPE_ACCESS_OUTBOUND))
     ok( U(iosb).Status == STATUS_PIPE_BROKEN, "wrong status %x\n", U(iosb).Status );
     ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information );
     ok( is_signaled( event ), "event is not signaled\n" );
diff --git a/server/named_pipe.c b/server/named_pipe.c
index a98041e..3566663 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -294,10 +294,11 @@
     default_fd_reselect_async         /* reselect_async */
 };
 
-/* Returns if we handle I/O via server calls. Currently message-mode pipes are handled this way. */
+/* Returns if we handle I/O via server calls.
+ * FIXME: no longer needed. */
 static int use_server_io( struct pipe_end *pipe_end )
 {
-    return pipe_end->flags & NAMED_PIPE_MESSAGE_STREAM_WRITE;
+    return 1;
 }
 
 static void named_pipe_dump( struct object *obj, int verbose )