Commit 59ee798d authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll/tests: Use nameless unions/structs.

parent 490aee03
......@@ -86,15 +86,15 @@ static void test_ntncdf(void)
filter |= FILE_NOTIFY_CHANGE_CREATION;
filter |= FILE_NOTIFY_CHANGE_SECURITY;
U(iosb).Status = 1;
iosb.Status = 1;
iosb.Information = 1;
r = pNtNotifyChangeDirectoryFile(hdir,hEvent,NULL,NULL,&iosb,buffer,sizeof buffer,-1,0);
ok(r==STATUS_INVALID_PARAMETER, "should return invalid parameter\n");
ok( U(iosb).Status == 1, "information wrong\n");
ok( iosb.Status == 1, "information wrong\n");
ok( iosb.Information == 1, "information wrong\n");
U(iosb).Status = 1;
iosb.Status = 1;
iosb.Information = 0;
r = pNtNotifyChangeDirectoryFile(hdir,hEvent,NULL,NULL,&iosb,buffer,sizeof buffer,filter,0);
ok(r==STATUS_PENDING, "should return status pending\n");
......@@ -114,7 +114,7 @@ static void test_ntncdf(void)
r = WaitForSingleObject( hEvent, 100 );
ok( r == WAIT_OBJECT_0, "event should be ready\n" );
ok( U(iosb).Status == STATUS_SUCCESS, "information wrong\n");
ok( iosb.Status == STATUS_SUCCESS, "information wrong\n");
ok( iosb.Information == 0x12, "information wrong\n");
pfni = (PFILE_NOTIFY_INFORMATION) buffer;
......@@ -131,12 +131,12 @@ static void test_ntncdf(void)
filter = FILE_NOTIFY_CHANGE_SIZE;
U(iosb).Status = 1;
iosb.Status = 1;
iosb.Information = 1;
r = pNtNotifyChangeDirectoryFile(hdir,0,NULL,NULL,&iosb,NULL,0,filter,0);
ok(r==STATUS_PENDING, "should status pending\n");
ok( U(iosb).Status == 1, "information wrong\n");
ok( iosb.Status == 1, "information wrong\n");
ok( iosb.Information == 1, "information wrong\n");
r = WaitForSingleObject( hdir, 0 );
......@@ -151,7 +151,7 @@ static void test_ntncdf(void)
r = WaitForSingleObject( hdir, 100 );
ok( r == WAIT_OBJECT_0, "should be ready\n" );
ok( U(iosb).Status == STATUS_NOTIFY_ENUM_DIR, "information wrong\n");
ok( iosb.Status == STATUS_NOTIFY_ENUM_DIR, "information wrong\n");
ok( iosb.Information == 0, "information wrong\n");
CloseHandle(hdir);
......@@ -209,11 +209,11 @@ static void test_ntncdf_async(void)
filter |= FILE_NOTIFY_CHANGE_SECURITY;
U(iosb).Status = 0x01234567;
iosb.Status = 0x01234567;
iosb.Information = 0x12345678;
r = pNtNotifyChangeDirectoryFile(hdir,0,NULL,NULL,&iosb,buffer,sizeof buffer,filter,0);
ok(r==STATUS_PENDING, "should status pending\n");
ok(U(iosb).Status == 0x01234567, "status set too soon\n");
ok(iosb.Status == 0x01234567, "status set too soon\n");
ok(iosb.Information == 0x12345678, "info set too soon\n");
r = CreateDirectoryW( subdir, NULL );
......@@ -222,7 +222,7 @@ static void test_ntncdf_async(void)
r = WaitForSingleObject( hdir, 100 );
ok( r == WAIT_OBJECT_0, "should be ready\n" );
ok(U(iosb).Status == STATUS_SUCCESS, "status not successful\n");
ok(iosb.Status == STATUS_SUCCESS, "status not successful\n");
ok(iosb.Information == 0x12, "info not set\n");
pfni = (PFILE_NOTIFY_INFORMATION) buffer;
......@@ -240,7 +240,7 @@ static void test_ntncdf_async(void)
r = WaitForSingleObject( hdir, 0 );
ok( r == WAIT_OBJECT_0, "should be ready\n" );
ok(U(iosb).Status == STATUS_SUCCESS, "status not successful\n");
ok(iosb.Status == STATUS_SUCCESS, "status not successful\n");
ok(iosb.Information == 0x12, "info not set\n");
ok( pfni->NextEntryOffset == 0, "offset wrong\n" );
......@@ -249,7 +249,7 @@ static void test_ntncdf_async(void)
ok( !memcmp(pfni->FileName,&szHoo[1],6), "name wrong\n" );
/* check APCs */
U(iosb).Status = 0;
iosb.Status = 0;
iosb.Information = 0;
r = pNtNotifyChangeDirectoryFile(hdir,0,NULL,NULL,&iosb,NULL,0,filter,0);
......@@ -261,10 +261,10 @@ static void test_ntncdf_async(void)
r = WaitForSingleObject( hdir, 0 );
ok( r == WAIT_OBJECT_0, "should be ready\n" );
ok(U(iosb).Status == STATUS_NOTIFY_ENUM_DIR, "status not successful\n");
ok(iosb.Status == STATUS_NOTIFY_ENUM_DIR, "status not successful\n");
ok(iosb.Information == 0, "info not set\n");
U(iosb).Status = 0;
iosb.Status = 0;
iosb.Information = 0;
r = pNtNotifyChangeDirectoryFile(hdir,hEvent,NULL,NULL,&iosb,buffer,sizeof buffer,filter,0);
......@@ -276,24 +276,24 @@ static void test_ntncdf_async(void)
r = WaitForSingleObject( hEvent, 0 );
ok( r == WAIT_OBJECT_0, "should be ready\n" );
ok(U(iosb).Status == STATUS_SUCCESS, "status not successful\n");
ok(iosb.Status == STATUS_SUCCESS, "status not successful\n");
ok(iosb.Information == 0x12, "info not set\n");
U(iosb).Status = 0x01234567;
iosb.Status = 0x01234567;
iosb.Information = 0x12345678;
r = pNtNotifyChangeDirectoryFile(hdir,0,NULL,NULL,&iosb,buffer,sizeof buffer,filter,0);
ok(r==STATUS_PENDING, "should status pending\n");
U(iosb2).Status = 0x01234567;
iosb2.Status = 0x01234567;
iosb2.Information = 0x12345678;
r = pNtNotifyChangeDirectoryFile(hdir,0,NULL,NULL,&iosb2,buffer,sizeof buffer,filter,0);
ok(r==STATUS_PENDING, "should status pending\n");
ok(U(iosb).Status == 0x01234567, "status set too soon\n");
ok(iosb.Status == 0x01234567, "status set too soon\n");
ok(iosb.Information == 0x12345678, "info set too soon\n");
U(iosb3).Status = 0x111111;
iosb3.Status = 0x111111;
iosb3.Information = 0x222222;
r = pNtCancelIoFile(hdir, &iosb3);
......@@ -301,19 +301,19 @@ static void test_ntncdf_async(void)
CloseHandle(hdir);
ok(U(iosb).Status == STATUS_CANCELLED, "status wrong %lx\n",U(iosb).Status);
ok(U(iosb2).Status == STATUS_CANCELLED, "status wrong %lx\n",U(iosb2).Status);
ok(U(iosb3).Status == STATUS_SUCCESS, "status wrong %lx\n",U(iosb3).Status);
ok(iosb.Status == STATUS_CANCELLED, "status wrong %lx\n",iosb.Status);
ok(iosb2.Status == STATUS_CANCELLED, "status wrong %lx\n",iosb2.Status);
ok(iosb3.Status == STATUS_SUCCESS, "status wrong %lx\n",iosb3.Status);
ok(iosb.Information == 0, "info wrong\n");
ok(iosb2.Information == 0, "info wrong\n");
ok(iosb3.Information == 0, "info wrong\n");
U(iosb3).Status = 0x111111;
iosb3.Status = 0x111111;
iosb3.Information = 0x222222;
r = pNtCancelIoFile(hdir, &iosb3);
ok( r == STATUS_INVALID_HANDLE, "cancel failed %lx\n", r);
ok(U(iosb3).Status == 0x111111, "status wrong %lx\n",U(iosb3).Status);
ok(iosb3.Status == 0x111111, "status wrong %lx\n",iosb3.Status);
ok(iosb3.Information == 0x222222, "info wrong\n");
r = RemoveDirectoryW( path );
......
......@@ -1406,16 +1406,16 @@ static void test_iosb(void)
args[0] = (LONG_PTR)server;
status = call_func64( func, ARRAY_SIZE(args), args );
ok( status == STATUS_PENDING, "NtFsControlFile returned %lx\n", status );
ok( U(iosb32).Status == 0x55555555, "status changed to %lx\n", U(iosb32).Status );
ok( U(iosb64).Pointer == PtrToUlong(&iosb32), "status changed to %lx\n", U(iosb64).Status );
ok( iosb32.Status == 0x55555555, "status changed to %lx\n", iosb32.Status );
ok( iosb64.Pointer == PtrToUlong(&iosb32), "status changed to %lx\n", iosb64.Status );
ok( iosb64.Information == 0xdeadbeef, "info changed to %Ix\n", (ULONG_PTR)iosb64.Information );
client = CreateFileA( pipe_name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED, NULL );
ok( client != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError() );
ok( U(iosb32).Status == 0, "Wrong iostatus %lx\n", U(iosb32).Status );
ok( U(iosb64).Pointer == PtrToUlong(&iosb32), "status changed to %lx\n", U(iosb64).Status );
ok( iosb32.Status == 0, "Wrong iostatus %lx\n", iosb32.Status );
ok( iosb64.Pointer == PtrToUlong(&iosb32), "status changed to %lx\n", iosb64.Status );
ok( iosb64.Information == 0xdeadbeef, "info changed to %Ix\n", (ULONG_PTR)iosb64.Information );
memset( &iosb32, 0x55, sizeof(iosb32) );
......@@ -1433,9 +1433,9 @@ static void test_iosb(void)
ok( status == STATUS_PENDING || status == STATUS_SUCCESS, "NtFsControlFile returned %lx\n", status );
todo_wine
{
ok( U(iosb32).Status == STATUS_SUCCESS, "status changed to %lx\n", U(iosb32).Status );
ok( iosb32.Status == STATUS_SUCCESS, "status changed to %lx\n", iosb32.Status );
ok( iosb32.Information == sizeof(id), "info changed to %Ix\n", iosb32.Information );
ok( U(iosb64).Pointer == PtrToUlong(&iosb32), "status changed to %lx\n", U(iosb64).Status );
ok( iosb64.Pointer == PtrToUlong(&iosb32), "status changed to %lx\n", iosb64.Status );
ok( iosb64.Information == 0xdeadbeef, "info changed to %Ix\n", (ULONG_PTR)iosb64.Information );
}
ok( id == GetCurrentProcessId(), "wrong id %lx / %lx\n", id, GetCurrentProcessId() );
......@@ -1461,9 +1461,9 @@ static void test_iosb(void)
args[0] = (LONG_PTR)server;
status = call_func64( func, ARRAY_SIZE(args), args );
ok( status == STATUS_SUCCESS, "NtFsControlFile returned %lx\n", status );
ok( U(iosb32).Status == 0x55555555, "status changed to %lx\n", U(iosb32).Status );
ok( iosb32.Status == 0x55555555, "status changed to %lx\n", iosb32.Status );
ok( iosb32.Information == 0x55555555, "info changed to %Ix\n", iosb32.Information );
ok( U(iosb64).Pointer == STATUS_SUCCESS, "status changed to %lx\n", U(iosb64).Status );
ok( iosb64.Pointer == STATUS_SUCCESS, "status changed to %lx\n", iosb64.Status );
ok( iosb64.Information == sizeof(id), "info changed to %Ix\n", (ULONG_PTR)iosb64.Information );
ok( id == GetCurrentProcessId(), "wrong id %lx / %lx\n", id, GetCurrentProcessId() );
CloseHandle( client );
......
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