server: Fix return value for FSCTL_PIPE_WAIT if pipe does not exist.

This commit is contained in:
Michael Müller 2014-05-31 02:44:36 +02:00 committed by Alexandre Julliard
parent 2227abbc2c
commit 9602fa7a93
2 changed files with 7 additions and 1 deletions

View File

@ -60,6 +60,12 @@ static void test_CreateNamedPipe(int pipemode)
trace("test_CreateNamedPipe starting in byte mode\n");
else
trace("test_CreateNamedPipe starting in message mode\n");
/* Wait for non existing pipe */
ret = WaitNamedPipeA(PIPENAME, 2000);
ok(ret == 0, "WaitNamedPipe returned %d for non existing pipe\n", ret);
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError());
/* Bad parameter checks */
hnp = CreateNamedPipeA("not a named pipe", PIPE_ACCESS_DUPLEX, pipemode | PIPE_WAIT,
/* nMaxInstances */ 1,

View File

@ -900,7 +900,7 @@ static obj_handle_t named_pipe_device_ioctl( struct fd *fd, ioctl_code_t code, c
name.len = (buffer->NameLength / sizeof(WCHAR)) * sizeof(WCHAR);
if (!(pipe = (struct named_pipe *)find_object( device->pipes, &name, OBJ_CASE_INSENSITIVE )))
{
set_error( STATUS_PIPE_NOT_AVAILABLE );
set_error( STATUS_OBJECT_NAME_NOT_FOUND );
return 0;
}
if (!(server = find_available_server( pipe )))