Skip to content

Commit

Permalink
server: Signal pipe server fd in create_pipe_server.
Browse files Browse the repository at this point in the history
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
  • Loading branch information
cjacek authored and julliard committed Dec 2, 2016
1 parent 7ce4ae6 commit d8bfbbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dlls/kernel32/tests/pipe.c
Expand Up @@ -110,6 +110,13 @@ static BOOL RpcReadFile(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, LPDWORD
return (BOOL)rpcargs.returnValue;
}

#define test_signaled(h) _test_signaled(__LINE__,h)
static void _test_signaled(unsigned line, HANDLE handle)
{
DWORD res = WaitForSingleObject(handle, 0);
ok_(__FILE__,line)(res == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", res);
}

static void test_CreateNamedPipe(int pipemode)
{
HANDLE hnp;
Expand Down Expand Up @@ -176,6 +183,7 @@ static void test_CreateNamedPipe(int pipemode)
/* nDefaultWait */ NMPWAIT_USE_DEFAULT_WAIT,
/* lpSecurityAttrib */ NULL);
ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n");
test_signaled(hnp);

ret = WaitNamedPipeA(PIPENAME, 2000);
ok(ret, "WaitNamedPipe failed (%d)\n", GetLastError());
Expand Down
1 change: 1 addition & 0 deletions server/named_pipe.c
Expand Up @@ -690,6 +690,7 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned
release_object( server );
return NULL;
}
set_fd_signaled( server->ioctl_fd, 1 );
set_server_state( server, ps_idle_server );
return server;
}
Expand Down

0 comments on commit d8bfbbd

Please sign in to comment.