server: Fix error returned when opening none existent pipes

Vitaliy Margolen wine-patch at kievinfo.com
Tue Nov 1 11:16:52 CST 2005



Vitaliy Margolen

changelog:
  server
  - Fix error returned when opening none existent pipes
  - Fix failing test on XP/2003
-------------- next part --------------
Index: server/named_pipe.c
===================================================================
RCS file: /home/wine/wine/server/named_pipe.c,v
retrieving revision 1.50
diff -u -p -r1.50 named_pipe.c
--- server/named_pipe.c	29 Oct 2005 12:38:23 -0000	1.50
+++ server/named_pipe.c	1 Nov 2005 17:12:21 -0000
@@ -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 );
Index: dlls/ntdll/tests/om.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/tests/om.c,v
retrieving revision 1.2
diff -u -p -r1.2 om.c
--- dlls/ntdll/tests/om.c	1 Nov 2005 10:22:38 -0000	1.2
+++ dlls/ntdll/tests/om.c	1 Nov 2005 17:12:24 -0000
@@ -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);


More information about the wine-patches mailing list