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

This commit is contained in:
Bernhard Loos 2011-09-26 13:57:29 +02:00 committed by Alexandre Julliard
parent 039bacb0c9
commit 5098b13177
2 changed files with 21 additions and 5 deletions

View File

@ -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() */

View File

@ -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 );