Alexandre Julliard : server: Don't enforce named pipes path format in ntdll , only in the server.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Mar 22 10:11:09 CDT 2007


Module: wine
Branch: master
Commit: 50c48004054e8127ecae3afd8f970cac597f372f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=50c48004054e8127ecae3afd8f970cac597f372f

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Mar 22 14:40:41 2007 +0100

server: Don't enforce named pipes path format in ntdll, only in the server.

---

 dlls/ntdll/file.c   |    5 -----
 server/named_pipe.c |    8 ++++++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 2a2f9d2..eb11c69 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -2085,17 +2085,12 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access,
                                        PLARGE_INTEGER timeout)
 {
     NTSTATUS    status;
-    static const WCHAR leadin[] = {'\\','?','?','\\','P','I','P','E','\\'};
 
     TRACE("(%p %x %s %p %x %d %x %d %d %d %d %d %d %p)\n",
           handle, access, debugstr_w(attr->ObjectName->Buffer), iosb, sharing, dispo,
           options, pipe_type, read_mode, completion_mode, max_inst, inbound_quota,
           outbound_quota, timeout);
 
-    if (attr->ObjectName->Length < sizeof(leadin) ||
-        strncmpiW( attr->ObjectName->Buffer, 
-                   leadin, sizeof(leadin)/sizeof(leadin[0]) ))
-        return STATUS_OBJECT_NAME_INVALID;
     /* assume we only get relative timeout, and storable in a DWORD as ms */
     if (timeout->QuadPart > 0 || (timeout->QuadPart / -10000) >> 32)
         FIXME("Wrong time %s\n", wine_dbgstr_longlong(timeout->QuadPart));
diff --git a/server/named_pipe.c b/server/named_pipe.c
index e121c91..ff11280 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -585,7 +585,11 @@ static struct named_pipe *create_named_pipe( struct directory *root, const struc
 
     if (!name || !name->len) return alloc_object( &named_pipe_ops );
 
-    if (!(obj = find_object_dir( root, name, attr, &new_name ))) return NULL;
+    if (!(obj = find_object_dir( root, name, attr, &new_name )))
+    {
+        set_error( STATUS_OBJECT_NAME_INVALID );
+        return NULL;
+    }
     if (!new_name.len)
     {
         if (attr & OBJ_OPENIF && obj->ops == &named_pipe_ops)
@@ -603,7 +607,7 @@ static struct named_pipe *create_named_pipe( struct directory *root, const struc
     }
 
     if (obj->ops != &named_pipe_device_ops)
-        set_error( STATUS_OBJECT_TYPE_MISMATCH );
+        set_error( STATUS_OBJECT_NAME_INVALID );
     else
     {
         struct named_pipe_device *dev = (struct named_pipe_device *)obj;




More information about the wine-cvs mailing list