Commit cb489f7a authored by Jeff Latimer's avatar Jeff Latimer Committed by Alexandre Julliard

ntdll: Check for passing a NULL handle to NtCreateMailslotFile and add a test.

parent 2775db3b
......@@ -2210,6 +2210,8 @@ NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE pHandle, ULONG DesiredAccess,
pHandle, DesiredAccess, attr, IoStatusBlock,
CreateOptions, MailslotQuota, MaxMessageSize, TimeOut);
if (!pHandle) return STATUS_ACCESS_VIOLATION;
if (attr->ObjectName->Length < sizeof(leadin) ||
strncmpiW( attr->ObjectName->Buffer,
leadin, sizeof(leadin)/sizeof(leadin[0]) ))
......
......@@ -55,11 +55,19 @@ static void nt_mailslot_test(void)
WCHAR buffer1[] = { '\\','?','?','\\','M','A','I','L','S','L','O','T','\\',
'R',':','\\','F','R','E','D','\0' };
TimeOut.QuadPart = -1;
pRtlInitUnicodeString(&str, buffer1);
InitializeObjectAttributes(&attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL);
DesiredAccess = CreateOptions = MailslotQuota = MaxMessageSize = 0;
TimeOut.QuadPart = -1;
/*
* Check for NULL pointer handling
*/
rc = pNtCreateMailslotFile(NULL, DesiredAccess,
&attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize,
&TimeOut);
ok( rc == STATUS_ACCESS_VIOLATION, "rc = %x not c0000005 STATUS_ACCESS_VIOLATION\n", rc);
/*
* Test a valid call
......
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