Fix error returned when opening nonexistent pipes.

oldstable
Vitaliy Margolen 2005-11-02 14:15:09 +00:00 committed by Alexandre Julliard
parent 3f85e26af2
commit f2686d4620
2 changed files with 3 additions and 7 deletions

View File

@ -127,13 +127,13 @@ void test_namespace_pipe(void)
pRtlInitUnicodeString(&str, buffer3);
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
status = pNtOpenFile(&h, GENERIC_READ, &attr, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN);
todo_wine ok(status == STATUS_OBJECT_PATH_NOT_FOUND,
todo_wine ok(status == STATUS_OBJECT_PATH_NOT_FOUND || status == STATUS_PIPE_NOT_AVAILABLE,
"pNtOpenFile should have failed with STATUS_OBJECT_PATH_NOT_FOUND got(%08lx)\n", status);
pRtlInitUnicodeString(&str, buffer4);
InitializeObjectAttributes(&attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL);
status = pNtOpenFile(&h, GENERIC_READ, &attr, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN);
todo_wine ok(status == STATUS_OBJECT_NAME_NOT_FOUND,
ok(status == STATUS_OBJECT_NAME_NOT_FOUND,
"pNtOpenFile should have failed with STATUS_OBJECT_NAME_NOT_FOUND got(%08lx)\n", status);
pNtClose(pipe);

View File

@ -598,12 +598,8 @@ DECL_HANDLER(open_named_pipe)
struct named_pipe *pipe;
int fds[2];
pipe = open_named_pipe( get_req_data(), get_req_data_size(), req->attributes );
if (!pipe)
{
set_error( STATUS_NO_SUCH_FILE );
if (!(pipe = open_named_pipe( get_req_data(), get_req_data_size(), req->attributes )))
return;
}
server = find_server2( pipe, ps_idle_server, ps_wait_open );
release_object( pipe );