ntdll/tests: Add a helper function to run tests across all kernel object types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-01-30 00:29:01 +09:00
parent 80ea5a01ef
commit b93c78dc6c
1 changed files with 79 additions and 190 deletions

View File

@ -368,6 +368,80 @@ static void test_name_collisions(void)
pNtClose(dir); pNtClose(dir);
} }
static void test_all_kernel_objects( UINT line, OBJECT_ATTRIBUTES *attr,
NTSTATUS create_expect, NTSTATUS open_expect )
{
UNICODE_STRING target;
LARGE_INTEGER size;
NTSTATUS status, status2;
HANDLE ret, ret2;
pRtlCreateUnicodeStringFromAsciiz( &target, "\\DosDevices" );
size.QuadPart = 4096;
status = pNtCreateMutant( &ret, GENERIC_ALL, attr, FALSE );
ok( status == create_expect, "%u: NtCreateMutant failed %x\n", line, status );
status2 = pNtOpenMutant( &ret2, GENERIC_ALL, attr );
ok( status2 == open_expect, "%u: NtOpenMutant failed %x\n", line, status2 );
if (!status) pNtClose( ret );
if (!status2) pNtClose( ret2 );
status = pNtCreateSemaphore( &ret, GENERIC_ALL, attr, 1, 2 );
ok( status == create_expect, "%u: NtCreateSemaphore failed %x\n", line, status );
status2 = pNtOpenSemaphore( &ret2, GENERIC_ALL, attr );
ok( status2 == open_expect, "%u: NtOpenSemaphore failed %x\n", line, status2 );
if (!status) pNtClose( ret );
if (!status2) pNtClose( ret2 );
status = pNtCreateEvent( &ret, GENERIC_ALL, attr, 1, 0 );
ok( status == create_expect, "%u: NtCreateEvent failed %x\n", line, status );
status2 = pNtOpenEvent( &ret2, GENERIC_ALL, attr );
ok( status2 == open_expect, "%u: NtOpenEvent failed %x\n", line, status2 );
if (!status) pNtClose( ret );
if (!status2) pNtClose( ret2 );
status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, attr, 0 );
ok( status == create_expect, "%u: NtCreateKeyedEvent failed %x\n", line, status );
status2 = pNtOpenKeyedEvent( &ret2, GENERIC_ALL, attr );
ok( status2 == open_expect, "%u: NtOpenKeyedEvent failed %x\n", line, status2 );
if (!status) pNtClose( ret );
if (!status2) pNtClose( ret2 );
status = pNtCreateTimer( &ret, GENERIC_ALL, attr, NotificationTimer );
ok( status == create_expect, "%u: NtCreateTimer failed %x\n", line, status );
status2 = pNtOpenTimer( &ret2, GENERIC_ALL, attr );
ok( status2 == open_expect, "%u: NtOpenTimer failed %x\n", line, status2 );
if (!status) pNtClose( ret );
if (!status2) pNtClose( ret2 );
status = pNtCreateIoCompletion( &ret, GENERIC_ALL, attr, 0 );
ok( status == create_expect, "%u: NtCreateCompletion failed %x\n", line, status );
status2 = pNtOpenIoCompletion( &ret2, GENERIC_ALL, attr );
ok( status2 == open_expect, "%u: NtOpenCompletion failed %x\n", line, status2 );
if (!status) pNtClose( ret );
if (!status2) pNtClose( ret2 );
status = pNtCreateJobObject( &ret, GENERIC_ALL, attr );
ok( status == create_expect, "%u: NtCreateJobObject failed %x\n", line, status );
status2 = pNtOpenJobObject( &ret2, GENERIC_ALL, attr );
ok( status2 == open_expect, "%u: NtOpenJobObject failed %x\n", line, status2 );
if (!status) pNtClose( ret );
if (!status2) pNtClose( ret2 );
status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, attr );
ok( status == create_expect, "%u: NtCreateDirectoryObject failed %x\n", line, status );
status2 = pNtOpenDirectoryObject( &ret2, GENERIC_ALL, attr );
ok( status2 == open_expect, "%u: NtOpenDirectoryObject failed %x\n", line, status2 );
if (!status) pNtClose( ret );
if (!status2) pNtClose( ret2 );
status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, attr, &target );
ok( status == create_expect, "%u: NtCreateSymbolicLinkObject failed %x\n", line, status );
status2 = pNtOpenSymbolicLinkObject( &ret2, GENERIC_ALL, attr );
ok( status2 == open_expect, "%u: NtOpenSymbolicLinkObject failed %x\n", line, status2 );
if (!status) pNtClose( ret );
if (!status2) pNtClose( ret2 );
status = pNtCreateSection( &ret, SECTION_MAP_WRITE, attr, &size, PAGE_READWRITE, SEC_COMMIT, 0 );
ok( status == create_expect, "%u: NtCreateSection failed %x\n", line, status );
status2 = pNtOpenSection( &ret2, SECTION_MAP_WRITE, attr );
ok( status2 == open_expect, "%u: NtOpenSection failed %x\n", line, status2 );
if (!status) pNtClose( ret );
if (!status2) pNtClose( ret2 );
pRtlFreeUnicodeString( &target );
}
static void test_name_limits(void) static void test_name_limits(void)
{ {
static const WCHAR pipeW[] = {'\\','D','e','v','i','c','e','\\','N','a','m','e','d','P','i','p','e','\\'}; static const WCHAR pipeW[] = {'\\','D','e','v','i','c','e','\\','N','a','m','e','d','P','i','p','e','\\'};
@ -511,108 +585,10 @@ static void test_name_limits(void)
pNtClose( ret ); pNtClose( ret );
str.Length = 67; str.Length = 67;
status = pNtCreateMutant( &ret, GENERIC_ALL, &attr2, FALSE ); test_all_kernel_objects( __LINE__, &attr2, STATUS_OBJECT_NAME_INVALID, STATUS_OBJECT_NAME_INVALID );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateMutant failed %x\n", str.Length, status );
status = pNtOpenMutant( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtOpenMutant failed %x\n", str.Length, status );
status = pNtCreateSemaphore( &ret, GENERIC_ALL, &attr2, 1, 2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateSemaphore failed %x\n", str.Length, status );
status = pNtOpenSemaphore( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtOpenSemaphore failed %x\n", str.Length, status );
status = pNtCreateEvent( &ret, GENERIC_ALL, &attr2, 1, 0 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateEvent failed %x\n", str.Length, status );
status = pNtOpenEvent( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtOpenEvent failed %x\n", str.Length, status );
status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, &attr2, 0 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateKeyedEvent failed %x\n", str.Length, status );
status = pNtOpenKeyedEvent( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtOpenKeyedEvent failed %x\n", str.Length, status );
status = pNtCreateTimer( &ret, GENERIC_ALL, &attr2, NotificationTimer );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateTimer failed %x\n", str.Length, status );
status = pNtOpenTimer( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtOpenTimer failed %x\n", str.Length, status );
status = pNtCreateIoCompletion( &ret, GENERIC_ALL, &attr2, 0 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateCompletion failed %x\n", str.Length, status );
status = pNtOpenIoCompletion( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtOpenCompletion failed %x\n", str.Length, status );
status = pNtCreateJobObject( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateJobObject failed %x\n", str.Length, status );
status = pNtOpenJobObject( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtOpenJobObject failed %x\n", str.Length, status );
status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateDirectoryObject failed %x\n", str.Length, status );
status = pNtOpenDirectoryObject( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtOpenDirectoryObject failed %x\n", str.Length, status );
status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, &attr2, &target );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateSymbolicLinkObject failed %x\n", str.Length, status );
status = pNtOpenSymbolicLinkObject( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtOpenSymbolicLinkObject failed %x\n", str.Length, status );
status = pNtCreateSection( &ret, SECTION_MAP_WRITE, &attr2, &size, PAGE_READWRITE, SEC_COMMIT, 0 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtCreateSection failed %x\n", str.Length, status );
status = pNtOpenSection( &ret, SECTION_MAP_WRITE, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "%u: NtOpenSection failed %x\n", str.Length, status );
str.Length = 65532; str.Length = 65532;
status = pNtCreateMutant( &ret, GENERIC_ALL, &attr, FALSE ); test_all_kernel_objects( __LINE__, &attr, STATUS_SUCCESS, STATUS_SUCCESS );
ok( status == STATUS_SUCCESS, "%u: NtCreateMutant failed %x\n", str.Length, status );
status = pNtOpenMutant( &ret2, GENERIC_ALL, &attr );
ok( status == STATUS_SUCCESS, "%u: NtOpenMutant failed %x\n", str.Length, status );
pNtClose( ret2 );
pNtClose( ret );
status = pNtCreateSemaphore( &ret, GENERIC_ALL, &attr, 1, 2 );
ok( status == STATUS_SUCCESS, "%u: NtCreateSemaphore failed %x\n", str.Length, status );
status = pNtOpenSemaphore( &ret2, GENERIC_ALL, &attr );
ok( status == STATUS_SUCCESS, "%u: NtOpenSemaphore failed %x\n", str.Length, status );
pNtClose( ret2 );
pNtClose( ret );
status = pNtCreateEvent( &ret, GENERIC_ALL, &attr, 1, 0 );
ok( status == STATUS_SUCCESS, "%u: NtCreateEvent failed %x\n", str.Length, status );
status = pNtOpenEvent( &ret2, GENERIC_ALL, &attr );
ok( status == STATUS_SUCCESS, "%u: NtOpenEvent failed %x\n", str.Length, status );
pNtClose( ret2 );
pNtClose( ret );
status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, &attr, 0 );
ok( status == STATUS_SUCCESS, "%u: NtCreateKeyedEvent failed %x\n", str.Length, status );
status = pNtOpenKeyedEvent( &ret2, GENERIC_ALL, &attr );
ok( status == STATUS_SUCCESS, "%u: NtOpenKeyedEvent failed %x\n", str.Length, status );
pNtClose( ret2 );
pNtClose( ret );
status = pNtCreateTimer( &ret, GENERIC_ALL, &attr, NotificationTimer );
ok( status == STATUS_SUCCESS, "%u: NtCreateTimer failed %x\n", str.Length, status );
status = pNtOpenTimer( &ret2, GENERIC_ALL, &attr );
ok( status == STATUS_SUCCESS, "%u: NtOpenTimer failed %x\n", str.Length, status );
pNtClose( ret2 );
pNtClose( ret );
status = pNtCreateIoCompletion( &ret, GENERIC_ALL, &attr, 0 );
ok( status == STATUS_SUCCESS, "%u: NtCreateCompletion failed %x\n", str.Length, status );
status = pNtOpenIoCompletion( &ret2, GENERIC_ALL, &attr );
ok( status == STATUS_SUCCESS, "%u: NtOpenCompletion failed %x\n", str.Length, status );
pNtClose( ret2 );
pNtClose( ret );
status = pNtCreateJobObject( &ret, GENERIC_ALL, &attr );
ok( status == STATUS_SUCCESS, "%u: NtCreateJobObject failed %x\n", str.Length, status );
status = pNtOpenJobObject( &ret2, GENERIC_ALL, &attr );
ok( status == STATUS_SUCCESS, "%u: NtOpenJobObject failed %x\n", str.Length, status );
pNtClose( ret2 );
pNtClose( ret );
status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, &attr );
ok( status == STATUS_SUCCESS, "%u: NtCreateDirectoryObject failed %x\n", str.Length, status );
status = pNtOpenDirectoryObject( &ret2, GENERIC_ALL, &attr );
ok( status == STATUS_SUCCESS, "%u: NtOpenDirectoryObject failed %x\n", str.Length, status );
pNtClose( ret2 );
pNtClose( ret );
status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, &attr, &target );
ok( status == STATUS_SUCCESS, "%u: NtCreateSymbolicLinkObject failed %x\n", str.Length, status );
status = pNtOpenSymbolicLinkObject( &ret2, GENERIC_ALL, &attr );
ok( status == STATUS_SUCCESS, "%u: NtOpenSymbolicLinkObject failed %x\n", str.Length, status );
pNtClose( ret2 );
pNtClose( ret );
status = pNtCreateSection( &ret, SECTION_MAP_WRITE, &attr, &size, PAGE_READWRITE, SEC_COMMIT, 0 );
ok( status == STATUS_SUCCESS, "%u: NtCreateSection failed %x\n", str.Length, status );
status = pNtOpenSection( &ret2, SECTION_MAP_WRITE, &attr );
ok( status == STATUS_SUCCESS, "%u: NtOpenSection failed %x\n", str.Length, status );
pNtClose( ret2 );
pNtClose( ret );
str.Length = 65534; str.Length = 65534;
status = pNtCreateMutant( &ret, GENERIC_ALL, &attr, FALSE ); status = pNtCreateMutant( &ret, GENERIC_ALL, &attr, FALSE );
@ -669,145 +645,58 @@ static void test_name_limits(void)
/* null attributes or ObjectName, with or without RootDirectory */ /* null attributes or ObjectName, with or without RootDirectory */
attr3.RootDirectory = 0; attr3.RootDirectory = 0;
attr2.ObjectName = attr3.ObjectName = NULL; attr2.ObjectName = attr3.ObjectName = NULL;
status = pNtCreateMutant( &ret, GENERIC_ALL, &attr2, FALSE ); test_all_kernel_objects( __LINE__, &attr2, STATUS_OBJECT_NAME_INVALID, STATUS_OBJECT_NAME_INVALID );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateMutant failed %x\n", status ); test_all_kernel_objects( __LINE__, &attr3, STATUS_SUCCESS, STATUS_OBJECT_PATH_SYNTAX_BAD );
status = pNtCreateMutant( &ret, GENERIC_ALL, &attr3, FALSE );
ok( status == STATUS_SUCCESS, "NULL: NtCreateMutant failed %x\n", status );
pNtClose( ret );
status = pNtCreateMutant( &ret, GENERIC_ALL, NULL, FALSE ); status = pNtCreateMutant( &ret, GENERIC_ALL, NULL, FALSE );
ok( status == STATUS_SUCCESS, "NULL: NtCreateMutant failed %x\n", status ); ok( status == STATUS_SUCCESS, "NULL: NtCreateMutant failed %x\n", status );
pNtClose( ret ); pNtClose( ret );
status = pNtOpenMutant( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtOpenMutant failed %x\n", status );
status = pNtOpenMutant( &ret, GENERIC_ALL, &attr3 );
ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtOpenMutant failed %x\n", status );
status = pNtOpenMutant( &ret, GENERIC_ALL, NULL ); status = pNtOpenMutant( &ret, GENERIC_ALL, NULL );
ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenMutant failed %x\n", status ); ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenMutant failed %x\n", status );
status = pNtCreateSemaphore( &ret, GENERIC_ALL, &attr2, 1, 2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateSemaphore failed %x\n", status );
status = pNtCreateSemaphore( &ret, GENERIC_ALL, &attr3, 1, 2 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateSemaphore failed %x\n", status );
pNtClose( ret );
status = pNtCreateSemaphore( &ret, GENERIC_ALL, NULL, 1, 2 ); status = pNtCreateSemaphore( &ret, GENERIC_ALL, NULL, 1, 2 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateSemaphore failed %x\n", status ); ok( status == STATUS_SUCCESS, "NULL: NtCreateSemaphore failed %x\n", status );
pNtClose( ret ); pNtClose( ret );
status = pNtOpenSemaphore( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtOpenSemaphore failed %x\n", status );
status = pNtOpenSemaphore( &ret, GENERIC_ALL, &attr3 );
ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtOpenSemaphore failed %x\n", status );
status = pNtOpenSemaphore( &ret, GENERIC_ALL, NULL ); status = pNtOpenSemaphore( &ret, GENERIC_ALL, NULL );
ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenSemaphore failed %x\n", status ); ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenSemaphore failed %x\n", status );
status = pNtCreateEvent( &ret, GENERIC_ALL, &attr2, 1, 0 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateEvent failed %x\n", status );
status = pNtCreateEvent( &ret, GENERIC_ALL, &attr3, 1, 0 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateEvent failed %x\n", status );
pNtClose( ret );
status = pNtCreateEvent( &ret, GENERIC_ALL, NULL, 1, 0 ); status = pNtCreateEvent( &ret, GENERIC_ALL, NULL, 1, 0 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateEvent failed %x\n", status ); ok( status == STATUS_SUCCESS, "NULL: NtCreateEvent failed %x\n", status );
pNtClose( ret ); pNtClose( ret );
status = pNtOpenEvent( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtOpenEvent failed %x\n", status );
status = pNtOpenEvent( &ret, GENERIC_ALL, &attr3 );
ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtOpenEvent failed %x\n", status );
status = pNtOpenEvent( &ret, GENERIC_ALL, NULL ); status = pNtOpenEvent( &ret, GENERIC_ALL, NULL );
ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenEvent failed %x\n", status ); ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenEvent failed %x\n", status );
status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, &attr2, 0 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateKeyedEvent failed %x\n", status );
status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, &attr3, 0 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateKeyedEvent failed %x\n", status );
pNtClose( ret );
status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, NULL, 0 ); status = pNtCreateKeyedEvent( &ret, GENERIC_ALL, NULL, 0 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateKeyedEvent failed %x\n", status ); ok( status == STATUS_SUCCESS, "NULL: NtCreateKeyedEvent failed %x\n", status );
pNtClose( ret ); pNtClose( ret );
status = pNtOpenKeyedEvent( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtOpenKeyedEvent failed %x\n", status );
status = pNtOpenKeyedEvent( &ret, GENERIC_ALL, &attr3 );
ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtOpenKeyedEvent failed %x\n", status );
status = pNtOpenKeyedEvent( &ret, GENERIC_ALL, NULL ); status = pNtOpenKeyedEvent( &ret, GENERIC_ALL, NULL );
ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenKeyedEvent failed %x\n", status ); ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenKeyedEvent failed %x\n", status );
status = pNtCreateTimer( &ret, GENERIC_ALL, &attr2, NotificationTimer );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateTimer failed %x\n", status );
status = pNtCreateTimer( &ret, GENERIC_ALL, &attr3, NotificationTimer );
ok( status == STATUS_SUCCESS, "NULL: NtCreateTimer failed %x\n", status );
pNtClose( ret );
status = pNtCreateTimer( &ret, GENERIC_ALL, NULL, NotificationTimer ); status = pNtCreateTimer( &ret, GENERIC_ALL, NULL, NotificationTimer );
ok( status == STATUS_SUCCESS, "NULL: NtCreateTimer failed %x\n", status ); ok( status == STATUS_SUCCESS, "NULL: NtCreateTimer failed %x\n", status );
pNtClose( ret ); pNtClose( ret );
status = pNtOpenTimer( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtOpenTimer failed %x\n", status );
status = pNtOpenTimer( &ret, GENERIC_ALL, &attr3 );
ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtOpenTimer failed %x\n", status );
status = pNtOpenTimer( &ret, GENERIC_ALL, NULL ); status = pNtOpenTimer( &ret, GENERIC_ALL, NULL );
ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenTimer failed %x\n", status ); ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenTimer failed %x\n", status );
status = pNtCreateIoCompletion( &ret, GENERIC_ALL, &attr2, 0 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateCompletion failed %x\n", status );
status = pNtCreateIoCompletion( &ret, GENERIC_ALL, &attr3, 0 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateCompletion failed %x\n", status );
pNtClose( ret );
status = pNtCreateIoCompletion( &ret, GENERIC_ALL, NULL, 0 ); status = pNtCreateIoCompletion( &ret, GENERIC_ALL, NULL, 0 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateCompletion failed %x\n", status ); ok( status == STATUS_SUCCESS, "NULL: NtCreateCompletion failed %x\n", status );
pNtClose( ret ); pNtClose( ret );
status = pNtOpenIoCompletion( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtOpenCompletion failed %x\n", status );
status = pNtOpenIoCompletion( &ret, GENERIC_ALL, &attr3 );
ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtOpenCompletion failed %x\n", status );
status = pNtOpenIoCompletion( &ret, GENERIC_ALL, NULL ); status = pNtOpenIoCompletion( &ret, GENERIC_ALL, NULL );
ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenCompletion failed %x\n", status ); ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenCompletion failed %x\n", status );
status = pNtCreateJobObject( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateJobObject failed %x\n", status );
status = pNtCreateJobObject( &ret, GENERIC_ALL, &attr3 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateJobObject failed %x\n", status );
pNtClose( ret );
status = pNtCreateJobObject( &ret, GENERIC_ALL, NULL ); status = pNtCreateJobObject( &ret, GENERIC_ALL, NULL );
ok( status == STATUS_SUCCESS, "NULL: NtCreateJobObject failed %x\n", status ); ok( status == STATUS_SUCCESS, "NULL: NtCreateJobObject failed %x\n", status );
pNtClose( ret ); pNtClose( ret );
status = pNtOpenJobObject( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtOpenJobObject failed %x\n", status );
status = pNtOpenJobObject( &ret, GENERIC_ALL, &attr3 );
ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtOpenJobObject failed %x\n", status );
status = pNtOpenJobObject( &ret, GENERIC_ALL, NULL ); status = pNtOpenJobObject( &ret, GENERIC_ALL, NULL );
ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenJobObject failed %x\n", status ); ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenJobObject failed %x\n", status );
status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateDirectoryObject failed %x\n", status );
status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, &attr3 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateDirectoryObject failed %x\n", status );
pNtClose( ret );
status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, NULL ); status = pNtCreateDirectoryObject( &ret, GENERIC_ALL, NULL );
ok( status == STATUS_SUCCESS, "NULL: NtCreateDirectoryObject failed %x\n", status ); ok( status == STATUS_SUCCESS, "NULL: NtCreateDirectoryObject failed %x\n", status );
pNtClose( ret ); pNtClose( ret );
status = pNtOpenDirectoryObject( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtOpenDirectoryObject failed %x\n", status );
status = pNtOpenDirectoryObject( &ret, GENERIC_ALL, &attr3 );
ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtOpenDirectoryObject failed %x\n", status );
status = pNtOpenDirectoryObject( &ret, GENERIC_ALL, NULL ); status = pNtOpenDirectoryObject( &ret, GENERIC_ALL, NULL );
ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenDirectoryObject failed %x\n", status ); ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenDirectoryObject failed %x\n", status );
status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, &attr2, &target );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateSymbolicLinkObject failed %x\n", status );
status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, &attr3, &target );
ok( status == STATUS_SUCCESS, "NULL: NtCreateSymbolicLinkObject failed %x\n", status );
pNtClose( ret );
status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, NULL, &target ); status = pNtCreateSymbolicLinkObject( &ret, GENERIC_ALL, NULL, &target );
ok( status == STATUS_ACCESS_VIOLATION || broken( status == STATUS_SUCCESS), /* winxp */ ok( status == STATUS_ACCESS_VIOLATION || broken( status == STATUS_SUCCESS), /* winxp */
"NULL: NtCreateSymbolicLinkObject failed %x\n", status ); "NULL: NtCreateSymbolicLinkObject failed %x\n", status );
if (!status) pNtClose( ret ); if (!status) pNtClose( ret );
status = pNtOpenSymbolicLinkObject( &ret, GENERIC_ALL, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtOpenSymbolicLinkObject failed %x\n", status );
status = pNtOpenSymbolicLinkObject( &ret, GENERIC_ALL, &attr3 );
ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtOpenSymbolicLinkObject failed %x\n", status );
status = pNtOpenSymbolicLinkObject( &ret, GENERIC_ALL, NULL ); status = pNtOpenSymbolicLinkObject( &ret, GENERIC_ALL, NULL );
ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenSymbolicLinkObject failed %x\n", status ); ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenSymbolicLinkObject failed %x\n", status );
status = pNtCreateSection( &ret, SECTION_MAP_WRITE, &attr2, &size, PAGE_READWRITE, SEC_COMMIT, 0 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtCreateSection failed %x\n", status );
status = pNtCreateSection( &ret, SECTION_MAP_WRITE, &attr3, &size, PAGE_READWRITE, SEC_COMMIT, 0 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateSection failed %x\n", status );
pNtClose( ret );
status = pNtCreateSection( &ret, SECTION_MAP_WRITE, NULL, &size, PAGE_READWRITE, SEC_COMMIT, 0 ); status = pNtCreateSection( &ret, SECTION_MAP_WRITE, NULL, &size, PAGE_READWRITE, SEC_COMMIT, 0 );
ok( status == STATUS_SUCCESS, "NULL: NtCreateSection failed %x\n", status ); ok( status == STATUS_SUCCESS, "NULL: NtCreateSection failed %x\n", status );
pNtClose( ret ); pNtClose( ret );
status = pNtOpenSection( &ret, SECTION_MAP_WRITE, &attr2 );
ok( status == STATUS_OBJECT_NAME_INVALID, "NULL: NtOpenSection failed %x\n", status );
status = pNtOpenSection( &ret, SECTION_MAP_WRITE, &attr3 );
ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NULL: NtOpenSection failed %x\n", status );
status = pNtOpenSection( &ret, SECTION_MAP_WRITE, NULL ); status = pNtOpenSection( &ret, SECTION_MAP_WRITE, NULL );
ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenSection failed %x\n", status ); ok( status == STATUS_INVALID_PARAMETER, "NULL: NtOpenSection failed %x\n", status );
attr2.ObjectName = attr3.ObjectName = &str; attr2.ObjectName = attr3.ObjectName = &str;