From 928d28f688d5656fc366dd01e5d9403255ebb7a9 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 22 Mar 2007 14:41:37 +0100 Subject: [PATCH] server: Don't enforce mailslots path format in ntdll, only in the server. --- dlls/ntdll/file.c | 11 ----------- server/mailslot.c | 8 ++++++-- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index eb11c697f6a..16eb9b7e6ce 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -2187,8 +2187,6 @@ NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE pHandle, ULONG DesiredAccess, PLARGE_INTEGER TimeOut) { LARGE_INTEGER timeout; - static const WCHAR leadin[] = { - '\\','?','?','\\','M','A','I','L','S','L','O','T','\\'}; NTSTATUS ret; TRACE("%p %08x %p %p %08x %08x %08x %p\n", @@ -2196,18 +2194,9 @@ NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE pHandle, ULONG DesiredAccess, CreateOptions, MailslotQuota, MaxMessageSize, TimeOut); if (!pHandle) return STATUS_ACCESS_VIOLATION; - if (!attr) return STATUS_INVALID_PARAMETER; - if (!attr->ObjectName) return STATUS_OBJECT_PATH_SYNTAX_BAD; - if (attr->ObjectName->Length < sizeof(leadin) || - strncmpiW( attr->ObjectName->Buffer, - leadin, sizeof(leadin)/sizeof(leadin[0]) )) - { - return STATUS_OBJECT_NAME_INVALID; - } - /* * For a NULL TimeOut pointer set the default timeout value */ diff --git a/server/mailslot.c b/server/mailslot.c index 9391e131229..28c67a8acfd 100644 --- a/server/mailslot.c +++ b/server/mailslot.c @@ -345,7 +345,11 @@ static struct mailslot *create_mailslot( struct directory *root, if (!name || !name->len) return alloc_object( &mailslot_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) { @@ -362,7 +366,7 @@ static struct mailslot *create_mailslot( struct directory *root, if (obj->ops != &mailslot_device_ops) { - set_error( STATUS_OBJECT_TYPE_MISMATCH ); + set_error( STATUS_OBJECT_NAME_INVALID ); release_object( obj ); return NULL; }