kernel32/tests: Test waiting on a disconnected client pipe.

This commit is contained in:
Vincent Povirk 2009-06-08 16:23:36 -05:00 committed by Alexandre Julliard
parent 0bca442f25
commit b210eeb1ad

View File

@ -836,6 +836,7 @@ static int test_DisconnectNamedPipe(void)
char ibuf[32]; char ibuf[32];
DWORD written; DWORD written;
DWORD readden; DWORD readden;
DWORD ret;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hnp = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, hnp = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT,
@ -876,6 +877,8 @@ static int test_DisconnectNamedPipe(void)
"ReadFile from disconnected pipe with bytes waiting\n"); "ReadFile from disconnected pipe with bytes waiting\n");
ok(!DisconnectNamedPipe(hnp) && GetLastError() == ERROR_PIPE_NOT_CONNECTED, ok(!DisconnectNamedPipe(hnp) && GetLastError() == ERROR_PIPE_NOT_CONNECTED,
"DisconnectNamedPipe worked twice\n"); "DisconnectNamedPipe worked twice\n");
ret = WaitForSingleObject(hFile, 0);
ok(ret == WAIT_TIMEOUT, "WaitForSingleObject returned %X\n", ret);
ok(CloseHandle(hFile), "CloseHandle\n"); ok(CloseHandle(hFile), "CloseHandle\n");
} }