Commit 38f9a788 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Add tests for NULL object attributes.

parent fe092462
......@@ -3513,6 +3513,8 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access,
options, pipe_type, read_mode, completion_mode, max_inst, inbound_quota,
outbound_quota, timeout);
if (!attr) return STATUS_INVALID_PARAMETER;
/* assume we only get relative timeout */
if (timeout->QuadPart > 0)
FIXME("Wrong time %s\n", wine_dbgstr_longlong(timeout->QuadPart));
......@@ -3637,7 +3639,6 @@ NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE pHandle, ULONG DesiredAccess,
if (!pHandle) return STATUS_ACCESS_VIOLATION;
if (!attr) return STATUS_INVALID_PARAMETER;
if (!attr->ObjectName) return STATUS_OBJECT_PATH_SYNTAX_BAD;
if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret;
......
......@@ -623,7 +623,7 @@ NTSTATUS WINAPI NtCreateSymbolicLinkObject(OUT PHANDLE SymbolicLinkHandle,IN ACC
data_size_t len;
struct object_attributes *objattr;
if (!SymbolicLinkHandle || !TargetName) return STATUS_ACCESS_VIOLATION;
if (!SymbolicLinkHandle || !attr || !TargetName) return STATUS_ACCESS_VIOLATION;
if (!TargetName->Buffer) return STATUS_INVALID_PARAMETER;
TRACE("(%p,0x%08x,%s -> %s)\n", SymbolicLinkHandle, DesiredAccess,
......
......@@ -1158,20 +1158,6 @@ static void nt_mailslot_test(void)
if (rc == STATUS_SUCCESS) pNtClose(hslot);
/*
* Test handling of a NULL unicode string in ObjectName
*/
InitializeObjectAttributes(&attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL);
attr.ObjectName = NULL;
rc = pNtCreateMailslotFile(&hslot, DesiredAccess,
&attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize,
&TimeOut);
ok( rc == STATUS_OBJECT_PATH_SYNTAX_BAD ||
rc == STATUS_INVALID_PARAMETER,
"rc = %x not STATUS_OBJECT_PATH_SYNTAX_BAD or STATUS_INVALID_PARAMETER\n", rc);
if (rc == STATUS_SUCCESS) pNtClose(hslot);
/*
* Test a valid call
*/
InitializeObjectAttributes(&attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment