ntdll: Check for passing a NULL handle to NtCreateMailslotFile and add a test.
This commit is contained in:
parent
2775db3b79
commit
cb489f7a25
|
@ -2210,6 +2210,8 @@ NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE pHandle, ULONG DesiredAccess,
|
||||||
pHandle, DesiredAccess, attr, IoStatusBlock,
|
pHandle, DesiredAccess, attr, IoStatusBlock,
|
||||||
CreateOptions, MailslotQuota, MaxMessageSize, TimeOut);
|
CreateOptions, MailslotQuota, MaxMessageSize, TimeOut);
|
||||||
|
|
||||||
|
if (!pHandle) return STATUS_ACCESS_VIOLATION;
|
||||||
|
|
||||||
if (attr->ObjectName->Length < sizeof(leadin) ||
|
if (attr->ObjectName->Length < sizeof(leadin) ||
|
||||||
strncmpiW( attr->ObjectName->Buffer,
|
strncmpiW( attr->ObjectName->Buffer,
|
||||||
leadin, sizeof(leadin)/sizeof(leadin[0]) ))
|
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','\\',
|
WCHAR buffer1[] = { '\\','?','?','\\','M','A','I','L','S','L','O','T','\\',
|
||||||
'R',':','\\','F','R','E','D','\0' };
|
'R',':','\\','F','R','E','D','\0' };
|
||||||
|
|
||||||
|
TimeOut.QuadPart = -1;
|
||||||
|
|
||||||
pRtlInitUnicodeString(&str, buffer1);
|
pRtlInitUnicodeString(&str, buffer1);
|
||||||
InitializeObjectAttributes(&attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL);
|
InitializeObjectAttributes(&attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL);
|
||||||
DesiredAccess = CreateOptions = MailslotQuota = MaxMessageSize = 0;
|
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
|
* Test a valid call
|
||||||
|
|
Loading…
Reference in New Issue