Commit d5f23441 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use nameless unions/structs for IO_STATUS_BLOCK.

parent c3352feb
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winternl.h" #include "winternl.h"
#include "wine/debug.h" #include "wine/debug.h"
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#define NONAMELESSSTRUCT
#define NONAMELESSUNION
#include "ntdll_test.h" #include "ntdll_test.h"
static NTSTATUS (WINAPI *pTpAllocCleanupGroup)(TP_CLEANUP_GROUP **); static NTSTATUS (WINAPI *pTpAllocCleanupGroup)(TP_CLEANUP_GROUP **);
...@@ -2018,7 +2016,7 @@ static void CALLBACK io_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, ...@@ -2018,7 +2016,7 @@ static void CALLBACK io_cb(TP_CALLBACK_INSTANCE *instance, void *userdata,
struct io_cb_ctx *ctx = userdata; struct io_cb_ctx *ctx = userdata;
++ctx->count; ++ctx->count;
ctx->ovl = cvalue; ctx->ovl = cvalue;
ctx->ret = iosb->u.Status; ctx->ret = iosb->Status;
ctx->length = iosb->Information; ctx->length = iosb->Information;
ctx->io = io; ctx->io = io;
} }
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <stdarg.h> #include <stdarg.h>
#include <limits.h> #include <limits.h>
#define NONAMELESSUNION
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include "winternl.h" #include "winternl.h"
...@@ -483,10 +482,10 @@ static DWORD CALLBACK iocp_poller(LPVOID Arg) ...@@ -483,10 +482,10 @@ static DWORD CALLBACK iocp_poller(LPVOID Arg)
DWORD transferred = 0; DWORD transferred = 0;
DWORD err = 0; DWORD err = 0;
if (iosb.u.Status == STATUS_SUCCESS) if (iosb.Status == STATUS_SUCCESS)
transferred = iosb.Information; transferred = iosb.Information;
else else
err = RtlNtStatusToDosError(iosb.u.Status); err = RtlNtStatusToDosError(iosb.Status);
callback( err, transferred, overlapped ); callback( err, transferred, overlapped );
} }
...@@ -1537,7 +1536,7 @@ static void CALLBACK ioqueue_thread_proc( void *param ) ...@@ -1537,7 +1536,7 @@ static void CALLBACK ioqueue_thread_proc( void *param )
destroy = skip = FALSE; destroy = skip = FALSE;
io = (struct threadpool_object *)key; io = (struct threadpool_object *)key;
TRACE( "io %p, iosb.Status %#lx.\n", io, iosb.u.Status ); TRACE( "io %p, iosb.Status %#lx.\n", io, iosb.Status );
if (io && (io->shutdown || io->u.io.shutting_down)) if (io && (io->shutdown || io->u.io.shutting_down))
{ {
......
...@@ -117,7 +117,6 @@ typedef struct ...@@ -117,7 +117,6 @@ typedef struct
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winternl.h" #include "winternl.h"
#include "winioctl.h" #include "winioctl.h"
...@@ -3123,7 +3122,7 @@ NTSTATUS cdrom_DeviceIoControl( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc ...@@ -3123,7 +3122,7 @@ NTSTATUS cdrom_DeviceIoControl( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc
} }
if (needs_close) close( fd ); if (needs_close) close( fd );
error: error:
io->u.Status = status; io->Status = status;
io->Information = sz; io->Information = sz;
if (event) NtSetEvent(event, NULL); if (event) NtSetEvent(event, NULL);
return status; return status;
......
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winternl.h" #include "winternl.h"
#include "winioctl.h" #include "winioctl.h"
...@@ -1310,7 +1309,7 @@ static NTSTATUS io_control( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc, vo ...@@ -1310,7 +1309,7 @@ static NTSTATUS io_control( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc, vo
} }
if (needs_close) close( fd ); if (needs_close) close( fd );
error: error:
io->u.Status = status; io->Status = status;
io->Information = sz; io->Information = sz;
if (event && status != STATUS_PENDING) NtSetEvent(event, NULL); if (event && status != STATUS_PENDING) NtSetEvent(event, NULL);
return status; return status;
......
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winternl.h" #include "winternl.h"
#include "ddk/wdm.h" #include "ddk/wdm.h"
...@@ -1686,7 +1685,7 @@ NTSTATUS WINAPI NtSetIntervalProfile( ULONG interval, KPROFILE_SOURCE source ) ...@@ -1686,7 +1685,7 @@ NTSTATUS WINAPI NtSetIntervalProfile( ULONG interval, KPROFILE_SOURCE source )
ULONG WINAPI NtGetTickCount(void) ULONG WINAPI NtGetTickCount(void)
{ {
/* note: we ignore TickCountMultiplier */ /* note: we ignore TickCountMultiplier */
return user_shared_data->u.TickCount.LowPart; return user_shared_data->TickCount.LowPart;
} }
...@@ -1899,7 +1898,7 @@ NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE handle, ULONG_PTR *key, ULONG_PTR * ...@@ -1899,7 +1898,7 @@ NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE handle, ULONG_PTR *key, ULONG_PTR *
*key = reply->ckey; *key = reply->ckey;
*value = reply->cvalue; *value = reply->cvalue;
io->Information = reply->information; io->Information = reply->information;
io->u.Status = reply->status; io->Status = reply->status;
} }
} }
SERVER_END_REQ; SERVER_END_REQ;
...@@ -1933,7 +1932,7 @@ NTSTATUS WINAPI NtRemoveIoCompletionEx( HANDLE handle, FILE_IO_COMPLETION_INFORM ...@@ -1933,7 +1932,7 @@ NTSTATUS WINAPI NtRemoveIoCompletionEx( HANDLE handle, FILE_IO_COMPLETION_INFORM
info[i].CompletionKey = reply->ckey; info[i].CompletionKey = reply->ckey;
info[i].CompletionValue = reply->cvalue; info[i].CompletionValue = reply->cvalue;
info[i].IoStatusBlock.Information = reply->information; info[i].IoStatusBlock.Information = reply->information;
info[i].IoStatusBlock.u.Status = reply->status; info[i].IoStatusBlock.Status = reply->status;
} }
} }
SERVER_END_REQ; SERVER_END_REQ;
......
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winternl.h" #include "winternl.h"
#include "winioctl.h" #include "winioctl.h"
...@@ -582,7 +581,7 @@ NTSTATUS tape_DeviceIoControl( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc, ...@@ -582,7 +581,7 @@ NTSTATUS tape_DeviceIoControl( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc,
if (needs_close) close( fd ); if (needs_close) close( fd );
error: error:
io->u.Status = status; io->Status = status;
io->Information = sz; io->Information = sz;
if (event) NtSetEvent( event, NULL ); if (event) NtSetEvent( event, NULL );
return status; return status;
......
...@@ -433,21 +433,13 @@ static inline void set_async_iosb( client_ptr_t iosb, NTSTATUS status, ULONG_PTR ...@@ -433,21 +433,13 @@ static inline void set_async_iosb( client_ptr_t iosb, NTSTATUS status, ULONG_PTR
{ {
IO_STATUS_BLOCK *io = wine_server_get_ptr( iosb ); IO_STATUS_BLOCK *io = wine_server_get_ptr( iosb );
io->Information = info; io->Information = info;
#ifdef NONAMELESSUNION
WriteRelease( &io->u.Status, status );
#else
WriteRelease( &io->Status, status ); WriteRelease( &io->Status, status );
#endif
} }
} }
static inline client_ptr_t iosb_client_ptr( IO_STATUS_BLOCK *io ) static inline client_ptr_t iosb_client_ptr( IO_STATUS_BLOCK *io )
{ {
#ifdef NONAMELESSUNION
if (io && in_wow64_call()) return wine_server_client_ptr( io->u.Pointer );
#else
if (io && in_wow64_call()) return wine_server_client_ptr( io->Pointer ); if (io && in_wow64_call()) return wine_server_client_ptr( io->Pointer );
#endif
return wine_server_client_ptr( io ); return wine_server_client_ptr( io );
} }
......
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