Bernhard Loos : server: Only the sharing parameter of two instances of the same pipe have to match .

Alexandre Julliard julliard at winehq.org
Tue Sep 27 13:00:07 CDT 2011


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

Author: Bernhard Loos <bernhardloos at googlemail.com>
Date:   Mon Sep 26 13:57:29 2011 +0200

server: Only the sharing parameter of two instances of the same pipe have to match.

---

 dlls/kernel32/tests/pipe.c |   22 ++++++++++++++++++++--
 server/named_pipe.c        |    4 +---
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c
index a86baed..890a50e 100644
--- a/dlls/kernel32/tests/pipe.c
+++ b/dlls/kernel32/tests/pipe.c
@@ -374,7 +374,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
     ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n");
 
     hnp2 = CreateNamedPipe(PIPENAME, PIPE_ACCESS_INBOUND, PIPE_TYPE_BYTE | PIPE_WAIT,
-        /* nMaxInstances */ 1,
+        /* nMaxInstances */ 2,
         /* nOutBufSize */ 1024,
         /* nInBufSize */ 1024,
         /* nDefaultWait */ NMPWAIT_USE_DEFAULT_WAIT,
@@ -384,7 +384,25 @@ static void test_CreateNamedPipe_instances_must_match(void)
 
     ok(CloseHandle(hnp), "CloseHandle\n");
 
-    /* etc, etc */
+    /* check everything else */
+    hnp = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT,
+        /* nMaxInstances */ 4,
+        /* nOutBufSize */ 1024,
+        /* nInBufSize */ 1024,
+        /* nDefaultWait */ NMPWAIT_USE_DEFAULT_WAIT,
+        /* lpSecurityAttrib */ NULL);
+    ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n");
+
+    hnp2 = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE,
+        /* nMaxInstances */ 3,
+        /* nOutBufSize */ 102,
+        /* nInBufSize */ 24,
+        /* nDefaultWait */ 1234,
+        /* lpSecurityAttrib */ NULL);
+    ok(hnp2 != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n");
+
+    ok(CloseHandle(hnp), "CloseHandle\n");
+    ok(CloseHandle(hnp2), "CloseHandle\n");
 }
 
 /** implementation of alarm() */
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 9a37acb..0f89f5b 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -971,9 +971,7 @@ DECL_HANDLER(create_named_pipe)
             release_object( pipe );
             return;
         }
-        if ((pipe->maxinstances != req->maxinstances) ||
-            (pipe->timeout != req->timeout) ||
-            (pipe->flags != req->flags))
+        if (pipe->sharing != req->sharing)
         {
             set_error( STATUS_ACCESS_DENIED );
             release_object( pipe );




More information about the wine-cvs mailing list