[Wine-patches] [eter-1.0.12] eterbug #7347

Alexander Morozov amorozov на etersoft.ru
Вт Июл 5 19:52:37 MSD 2011


----------- следующая часть -----------
From c113f3e1f7c060f4e51f752b1fbd53ab4d8ccb8d Mon Sep 17 00:00:00 2001
From: Charles Davis <cdavis на mymail.mines.edu>
Date: Wed, 24 Feb 2010 09:50:03 -0700
Subject: [eter-1.0.12] include: Don't accidentally redefine a member in
 struct _IRP (LLVM/Clang).

---
 dlls/mountmgr.sys/device.c   |    4 ++--
 dlls/mountmgr.sys/mountmgr.c |    2 +-
 dlls/mountmgr.sys/parport.c  |    4 ++--
 dlls/mountmgr.sys/usbhub.c   |   10 +++++-----
 dlls/ntoskrnl.exe/ntoskrnl.c |   24 ++++++++++++------------
 include/ddk/wdm.h            |    4 ++--
 6 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index 838b696..9297128 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -789,7 +789,7 @@ static NTSTATUS WINAPI harddisk_read( DEVICE_OBJECT *device, IRP *irp )
 {
     static const char ntfs[] = "NTFS    ";
 
-    IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation;
+    IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
     struct dos_drive *drive = device->DeviceExtension;
     NTSTATUS status;
     DWORD len = irpsp->Parameters.Read.Length;
@@ -828,7 +828,7 @@ static NTSTATUS WINAPI harddisk_read( DEVICE_OBJECT *device, IRP *irp )
 /* handler for ioctls on the harddisk device */
 static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
 {
-    IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation;
+    IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
     struct dos_drive *drive = device->DeviceExtension;
     NTSTATUS status;
 
diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c
index 64806c6..4f8d840 100644
--- a/dlls/mountmgr.sys/mountmgr.c
+++ b/dlls/mountmgr.sys/mountmgr.c
@@ -352,7 +352,7 @@ static NTSTATUS query_unix_drive( const void *in_buff, SIZE_T insize,
 /* handler for ioctls on the mount manager device */
 static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
 {
-    IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation;
+    IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
     NTSTATUS status;
 
     TRACE( "ioctl %x insize %u outsize %u\n",
diff --git a/dlls/mountmgr.sys/parport.c b/dlls/mountmgr.sys/parport.c
index 293dcdf..4f460d0 100644
--- a/dlls/mountmgr.sys/parport.c
+++ b/dlls/mountmgr.sys/parport.c
@@ -87,7 +87,7 @@ static ULONG WINAPI parport_query_waiters( void *context )
 
 static NTSTATUS WINAPI parport_ioctl( DEVICE_OBJECT *device, IRP *irp )
 {
-    IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation;
+    IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
     NTSTATUS status = STATUS_NOT_SUPPORTED;
 
     TRACE( "%p, %p\n", device, irp );
@@ -145,7 +145,7 @@ static NTSTATUS WINAPI parport_pnp( DEVICE_OBJECT *device, IRP *irp )
 {
     static const WCHAR fmtW[] = {'%','d',0};
 
-    IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation;
+    IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
     NTSTATUS status;
 
     TRACE( "%p, %p\n", device, irp );
diff --git a/dlls/mountmgr.sys/usbhub.c b/dlls/mountmgr.sys/usbhub.c
index 8e02b08..685f3ed 100644
--- a/dlls/mountmgr.sys/usbhub.c
+++ b/dlls/mountmgr.sys/usbhub.c
@@ -145,7 +145,7 @@ static NTSTATUS WINAPI usbhub_ioctl( DEVICE_OBJECT *device, IRP *irp )
     if (!device_exists( device )) goto done;
     inst = ((struct PdoExtension *)device->DeviceExtension)->instance;
     if (inst->service) goto done;
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation;
+    irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
 
     switch (irpsp->Parameters.DeviceIoControl.IoControlCode)
     {
@@ -414,7 +414,7 @@ static NTSTATUS WINAPI usbhub_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
     if (!device_exists( device )) goto done;
     inst = ((struct PdoExtension *)device->DeviceExtension)->instance;
     if (!inst->service) goto done;
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation;
+    irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
     urb = irpsp->Parameters.Others.Argument1;
 
     switch (irpsp->Parameters.DeviceIoControl.IoControlCode)
@@ -764,7 +764,7 @@ static NTSTATUS WINAPI usbhub_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
     if (!device_exists( device )) goto done;
     inst = ((struct PdoExtension *)device->DeviceExtension)->instance;
     if (!inst->service) goto done;
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation;
+    irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
     urb = irpsp->Parameters.Others.Argument1;
 
     switch (irpsp->Parameters.DeviceIoControl.IoControlCode)
@@ -1136,7 +1136,7 @@ static NTSTATUS WINAPI usbhub_dispatch_pnp( DEVICE_OBJECT *device, IRP *irp )
     TRACE( "%p, %p\n", device, irp );
 
     EnterCriticalSection( &usbhub_cs );
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation;
+    irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
     if (!device_exists( device ))
     {
         if (irpsp->MinorFunction == IRP_MN_SURPRISE_REMOVAL ||
@@ -1725,7 +1725,7 @@ static NTSTATUS call_pnp_func( DEVICE_OBJECT *device, UCHAR minor_func )
     irp = IoAllocateIrp( device->StackSize, FALSE );
     if (irp == NULL) return STATUS_NO_MEMORY;
 
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
+    irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation - 1;
     irp->RequestorMode = KernelMode;
     irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED;
     irpsp->MajorFunction = IRP_MJ_PNP;
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 29188c7..04ad350 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -265,7 +265,7 @@ static NTSTATUS get_device_id( DEVICE_OBJECT *pdo, BUS_QUERY_ID_TYPE id_type,
     *id = NULL;
     irp = IoAllocateIrp( pdo->StackSize, FALSE );
     if (irp == NULL) return STATUS_NO_MEMORY;
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
+    irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation - 1;
     irpsp->MajorFunction = IRP_MJ_PNP;
     irpsp->MinorFunction = IRP_MN_QUERY_ID;
     irpsp->Parameters.QueryId.IdType = id_type;
@@ -550,7 +550,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff,
         status = STATUS_NO_MEMORY;
         goto end;
     }
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
+    irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation - 1;
     irp->RequestorMode = UserMode;
     irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED;
     irp->Tail.Overlay.OriginalFileObject = file;
@@ -582,7 +582,7 @@ static NTSTATUS process_read( DEVICE_OBJECT *device, void *buff, ULONG *size )
     if (irp == NULL)
         return STATUS_NO_MEMORY;
     irp->RequestorMode = UserMode;
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
+    irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation - 1;
     irpsp->DeviceObject = device;
     irpsp->MajorFunction = IRP_MJ_READ;
     irpsp->Parameters.Read.Length = *size;
@@ -623,7 +623,7 @@ static NTSTATUS process_write( DEVICE_OBJECT *device, void *buff, ULONG *size )
     if (irp == NULL)
         return STATUS_NO_MEMORY;
     irp->RequestorMode = UserMode;
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
+    irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation - 1;
     irpsp->DeviceObject = device;
     irpsp->MajorFunction = IRP_MJ_WRITE;
     irpsp->Parameters.Write.Length = *size;
@@ -849,7 +849,7 @@ NTSTATUS CDECL __wine_start_device( DEVICE_OBJECT *device )
     irp = IoAllocateIrp( device->StackSize, FALSE );
     if (irp == NULL) return STATUS_NO_MEMORY;
 
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
+    irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation - 1;
     irp->RequestorMode = KernelMode;
     irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED;
     irpsp->MajorFunction = IRP_MJ_PNP;
@@ -1000,7 +1000,7 @@ void WINAPI IoInitializeIrp( IRP *irp, USHORT size, CCHAR stack_size )
     InitializeListHead( &irp->ThreadListEntry );
     irp->StackCount = stack_size;
     irp->CurrentLocation = stack_size + 1;
-    irp->Tail.Overlay.s.u.CurrentStackLocation =
+    irp->Tail.Overlay.s.u2.CurrentStackLocation =
             (PIO_STACK_LOCATION)(irp + 1) + stack_size;
 }
 
@@ -1173,7 +1173,7 @@ PIRP WINAPI IoBuildDeviceIoControlRequest( ULONG IoControlCode,
     if (irp == NULL)
         return NULL;
 
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
+    irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation - 1;
     irpsp->MajorFunction = InternalDeviceIoControl ?
             IRP_MJ_INTERNAL_DEVICE_CONTROL : IRP_MJ_DEVICE_CONTROL;
     irpsp->Parameters.DeviceIoControl.IoControlCode = IoControlCode;
@@ -1412,7 +1412,7 @@ void WINAPI IoInvalidateDeviceRelations( PDEVICE_OBJECT DeviceObject,
 
         irp = IoAllocateIrp( DeviceObject->StackSize, FALSE );
         if (irp == NULL) return;
-        irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
+        irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation - 1;
         irpsp->MajorFunction = IRP_MJ_PNP;
         irpsp->MinorFunction = IRP_MN_QUERY_DEVICE_RELATIONS;
         irpsp->Parameters.QueryDeviceRelations.Type = BusRelations;
@@ -1427,7 +1427,7 @@ void WINAPI IoInvalidateDeviceRelations( PDEVICE_OBJECT DeviceObject,
                 IoFreeIrp( irp );
                 irp = IoAllocateIrp( rel->Objects[k]->StackSize, FALSE );
                 if (irp == NULL) return;
-                irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
+                irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation - 1;
                 irpsp->MajorFunction = IRP_MJ_PNP;
                 irpsp->MinorFunction = IRP_MN_QUERY_ID;
                 irpsp->Parameters.QueryId.IdType = BusQueryDeviceID;
@@ -1892,7 +1892,7 @@ NTSTATUS WINAPI IoCallDriver( DEVICE_OBJECT *device, IRP *irp )
     TRACE( "%p %p\n", device, irp );
 
     --irp->CurrentLocation;
-    irpsp = --irp->Tail.Overlay.s.u.CurrentStackLocation;
+    irpsp = --irp->Tail.Overlay.s.u2.CurrentStackLocation;
     irpsp->DeviceObject = device;
     dispatch = device->DriverObject->MajorFunction[irpsp->MajorFunction];
     if (!dispatch)
@@ -2085,7 +2085,7 @@ void WINAPI IoCompleteRequest( IRP *irp, UCHAR priority_boost )
     status = irp->IoStatus.u.Status;
     while (irp->CurrentLocation <= irp->StackCount)
     {
-        irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation;
+        irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
         routine = irpsp->CompletionRoutine;
         call_flag = 0;
         /* FIXME: add SL_INVOKE_ON_CANCEL support */
@@ -2097,7 +2097,7 @@ void WINAPI IoCompleteRequest( IRP *irp, UCHAR priority_boost )
                 call_flag = 1;
         }
         ++irp->CurrentLocation;
-        ++irp->Tail.Overlay.s.u.CurrentStackLocation;
+        ++irp->Tail.Overlay.s.u2.CurrentStackLocation;
         if (call_flag)
         {
             TRACE( "calling %p( %p, %p, %p )\n", routine,
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index 755ac2d..017effe 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -432,7 +432,7 @@ typedef struct _IRP {
         struct {
           PVOID  DriverContext[4];
         } DUMMYSTRUCTNAME;
-      } DUMMYUNIONNAME;
+      } DUMMYUNIONNAME1;
       PETHREAD  Thread;
       PCHAR  AuxiliaryBuffer;
       struct {
@@ -440,7 +440,7 @@ typedef struct _IRP {
         union {
           struct _IO_STACK_LOCATION  *CurrentStackLocation;
           ULONG  PacketType;
-        } DUMMYUNIONNAME;
+        } DUMMYUNIONNAME2;
       } DUMMYSTRUCTNAME;
       struct _FILE_OBJECT  *OriginalFileObject;
     } Overlay;
-- 
1.7.5.4



Подробная информация о списке рассылки Wine-patches