ntdll: Test object attributes in NtCreateMailslotFile.
This commit is contained in:
parent
74db5a192e
commit
8b2a86a892
|
@ -2213,6 +2213,10 @@ NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE pHandle, ULONG DesiredAccess,
|
||||||
|
|
||||||
if (!pHandle) return STATUS_ACCESS_VIOLATION;
|
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) ||
|
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]) ))
|
||||||
|
|
|
@ -80,9 +80,41 @@ static void nt_mailslot_test(void)
|
||||||
|
|
||||||
if ( rc == STATUS_SUCCESS ) rc = pNtClose(hslot);
|
if ( rc == STATUS_SUCCESS ) rc = pNtClose(hslot);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Test that the length field is checked properly
|
||||||
|
*/
|
||||||
|
attr.Length = 0;
|
||||||
|
rc = pNtCreateMailslotFile(&hslot, DesiredAccess,
|
||||||
|
&attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize,
|
||||||
|
&TimeOut);
|
||||||
|
todo_wine ok( rc == STATUS_INVALID_PARAMETER, "rc = %x not c000000d STATUS_INVALID_PARAMETER\n", rc);
|
||||||
|
|
||||||
|
if (rc == STATUS_SUCCESS) pNtClose(hslot);
|
||||||
|
|
||||||
|
attr.Length = sizeof(OBJECT_ATTRIBUTES)+1;
|
||||||
|
rc = pNtCreateMailslotFile(&hslot, DesiredAccess,
|
||||||
|
&attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize,
|
||||||
|
&TimeOut);
|
||||||
|
todo_wine ok( rc == STATUS_INVALID_PARAMETER, "rc = %x not c000000d STATUS_INVALID_PARAMETER\n", rc);
|
||||||
|
|
||||||
|
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 = %x not c000003b STATUS_OBJECT_PATH_SYNTAX_BAD\n", rc);
|
||||||
|
|
||||||
|
if (rc == STATUS_SUCCESS) pNtClose(hslot);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Test a valid call
|
* Test a valid call
|
||||||
*/
|
*/
|
||||||
|
InitializeObjectAttributes(&attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL);
|
||||||
rc = pNtCreateMailslotFile(&hslot, DesiredAccess,
|
rc = pNtCreateMailslotFile(&hslot, DesiredAccess,
|
||||||
&attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize,
|
&attr, &IoStatusBlock, CreateOptions, MailslotQuota, MaxMessageSize,
|
||||||
&TimeOut);
|
&TimeOut);
|
||||||
|
|
Loading…
Reference in New Issue