[SCSIPORT] Use pointer alignment for MiniPortDeviceExtension

This seems logical and some miniport drivers (uniata) actually rely on
that.

CORE-17424
This commit is contained in:
Victor Perevertkin 2021-01-17 01:46:35 +03:00
parent e5c27b2fd6
commit 66cf1d20f4
No known key found for this signature in database
GPG key ID: C750B7222E9C7830

View file

@ -217,6 +217,12 @@ typedef struct _SCSI_PORT_SAVE_INTERRUPT
* part is the miniport-specific device extension. * part is the miniport-specific device extension.
*/ */
#ifdef _WIN64
#define ALIGNAS_PTR DECLSPEC_ALIGN(8)
#else
#define ALIGNAS_PTR DECLSPEC_ALIGN(4)
#endif
// FDO // FDO
typedef struct _SCSI_PORT_DEVICE_EXTENSION typedef struct _SCSI_PORT_DEVICE_EXTENSION
{ {
@ -312,7 +318,9 @@ typedef struct _SCSI_PORT_DEVICE_EXTENSION
BOOLEAN DeviceStarted; BOOLEAN DeviceStarted;
UINT8 TotalLUCount; UINT8 TotalLUCount;
UCHAR MiniPortDeviceExtension[1]; /* must be the last entry */ // use the pointer alignment here, some miniport drivers rely on this
// moreover, it has to be the last member
ALIGNAS_PTR UCHAR MiniPortDeviceExtension[];
} SCSI_PORT_DEVICE_EXTENSION, *PSCSI_PORT_DEVICE_EXTENSION; } SCSI_PORT_DEVICE_EXTENSION, *PSCSI_PORT_DEVICE_EXTENSION;
typedef struct _RESETBUS_PARAMS typedef struct _RESETBUS_PARAMS