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

This commit is contained in:
Alexandre Julliard 2007-03-22 14:41:37 +01:00
parent 50c4800405
commit 928d28f688
2 changed files with 6 additions and 13 deletions

View File

@ -2187,8 +2187,6 @@ NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE pHandle, ULONG DesiredAccess,
PLARGE_INTEGER TimeOut) PLARGE_INTEGER TimeOut)
{ {
LARGE_INTEGER timeout; LARGE_INTEGER timeout;
static const WCHAR leadin[] = {
'\\','?','?','\\','M','A','I','L','S','L','O','T','\\'};
NTSTATUS ret; NTSTATUS ret;
TRACE("%p %08x %p %p %08x %08x %08x %p\n", 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); CreateOptions, MailslotQuota, MaxMessageSize, TimeOut);
if (!pHandle) return STATUS_ACCESS_VIOLATION; if (!pHandle) return STATUS_ACCESS_VIOLATION;
if (!attr) return STATUS_INVALID_PARAMETER; if (!attr) return STATUS_INVALID_PARAMETER;
if (!attr->ObjectName) return STATUS_OBJECT_PATH_SYNTAX_BAD; 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 * For a NULL TimeOut pointer set the default timeout value
*/ */

View File

@ -345,7 +345,11 @@ static struct mailslot *create_mailslot( struct directory *root,
if (!name || !name->len) return alloc_object( &mailslot_ops ); 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) if (!new_name.len)
{ {
@ -362,7 +366,7 @@ static struct mailslot *create_mailslot( struct directory *root,
if (obj->ops != &mailslot_device_ops) if (obj->ops != &mailslot_device_ops)
{ {
set_error( STATUS_OBJECT_TYPE_MISMATCH ); set_error( STATUS_OBJECT_NAME_INVALID );
release_object( obj ); release_object( obj );
return NULL; return NULL;
} }