[MSPAINT]

Correct callback return type (Fixes X64 build).

[USETUP]
Correct definition of the struct (fixes X64 build).

[USBPORT]
Improve struct size checks so they are X64-compatible (fixes X64 build).

The build as a whole still fails due to bootlib, but implementing those is beyond my expertise.

svn path=/trunk/; revision=75392
This commit is contained in:
David Quintana 2017-07-24 10:34:06 +00:00
parent dbcb280e05
commit cdf1fc5784
4 changed files with 16 additions and 11 deletions

View file

@ -111,7 +111,7 @@ FileExtFromFilter(LPTSTR pExt, LPCTSTR pTitle, OPENFILENAME *pOFN)
} }
// Hook procedure for OPENFILENAME to change the file name extension // Hook procedure for OPENFILENAME to change the file name extension
static UINT APIENTRY static UINT_PTR APIENTRY
OFNHookProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) OFNHookProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
HWND hParent; HWND hParent;

View file

@ -45,10 +45,10 @@
* Delete it once we don't use inflib anymore */ * Delete it once we don't use inflib anymore */
typedef struct _INFCONTEXT typedef struct _INFCONTEXT
{ {
PVOID Inf; HINF Inf;
PVOID CurrentInf; HINF CurrentInf;
PVOID Section; UINT Section;
PVOID Line; UINT Line;
} INFCONTEXT; } INFCONTEXT;
C_ASSERT(sizeof(INFCONTEXT) == 2 * sizeof(PVOID) + 2 * sizeof(UINT)); C_ASSERT(sizeof(INFCONTEXT) == 2 * sizeof(PVOID) + 2 * sizeof(UINT));

View file

@ -355,7 +355,12 @@ typedef struct _USBPORT_DEVICE_EXTENSION {
KSPIN_LOCK SetPowerD0SpinLock; KSPIN_LOCK SetPowerD0SpinLock;
KDPC WorkerRequestDpc; KDPC WorkerRequestDpc;
KDPC HcWakeDpc; KDPC HcWakeDpc;
ULONG Padded[34]; // Miniport extension should be aligned on 0x100
/* Miniport extension should be aligned on 0x100 */
#if !defined(_M_X64)
ULONG Padded[34];
#endif
} USBPORT_DEVICE_EXTENSION, *PUSBPORT_DEVICE_EXTENSION; } USBPORT_DEVICE_EXTENSION, *PUSBPORT_DEVICE_EXTENSION;
C_ASSERT(sizeof(USBPORT_DEVICE_EXTENSION) == 0x400); C_ASSERT(sizeof(USBPORT_DEVICE_EXTENSION) == 0x400);
@ -392,7 +397,7 @@ typedef struct _USBPORT_ASYNC_CALLBACK_DATA {
ULONG CallbackContext; ULONG CallbackContext;
} USBPORT_ASYNC_CALLBACK_DATA, *PUSBPORT_ASYNC_CALLBACK_DATA; } USBPORT_ASYNC_CALLBACK_DATA, *PUSBPORT_ASYNC_CALLBACK_DATA;
C_ASSERT(sizeof(USBPORT_ASYNC_CALLBACK_DATA) == 88); C_ASSERT(sizeof(USBPORT_ASYNC_CALLBACK_DATA) == 84 + sizeof(PVOID));
typedef struct _TIMER_WORK_QUEUE_ITEM { typedef struct _TIMER_WORK_QUEUE_ITEM {
WORK_QUEUE_ITEM WqItem; WORK_QUEUE_ITEM WqItem;

View file

@ -62,7 +62,7 @@ typedef struct _USBPORT_RESOURCES {
UCHAR Reserved3; UCHAR Reserved3;
} USBPORT_RESOURCES, *PUSBPORT_RESOURCES; } USBPORT_RESOURCES, *PUSBPORT_RESOURCES;
C_ASSERT(sizeof(USBPORT_RESOURCES) == 52); C_ASSERT(sizeof(USBPORT_RESOURCES) == 40 + 3 * sizeof(PVOID));
typedef ULONG MPSTATUS; // Miniport status typedef ULONG MPSTATUS; // Miniport status
typedef ULONG RHSTATUS; // Roothub status typedef ULONG RHSTATUS; // Roothub status
@ -578,7 +578,7 @@ typedef struct _USBPORT_MINIPORT_INTERFACE {
USBPORT_REGISTRATION_PACKET Packet; USBPORT_REGISTRATION_PACKET Packet;
} USBPORT_MINIPORT_INTERFACE, *PUSBPORT_MINIPORT_INTERFACE; } USBPORT_MINIPORT_INTERFACE, *PUSBPORT_MINIPORT_INTERFACE;
C_ASSERT(sizeof(USBPORT_MINIPORT_INTERFACE) == 336); C_ASSERT(sizeof(USBPORT_MINIPORT_INTERFACE) == 332 + 3 * sizeof(PVOID));
#define USBPORT_TRANSFER_DIRECTION_OUT 1 // From host to device #define USBPORT_TRANSFER_DIRECTION_OUT 1 // From host to device
typedef struct _USBPORT_ENDPOINT_PROPERTIES { typedef struct _USBPORT_ENDPOINT_PROPERTIES {
@ -617,7 +617,7 @@ typedef struct _USBPORT_SCATTER_GATHER_ELEMENT {
ULONG Reserved2; ULONG Reserved2;
} USBPORT_SCATTER_GATHER_ELEMENT, *PUSBPORT_SCATTER_GATHER_ELEMENT; } USBPORT_SCATTER_GATHER_ELEMENT, *PUSBPORT_SCATTER_GATHER_ELEMENT;
C_ASSERT(sizeof(USBPORT_SCATTER_GATHER_ELEMENT) == 24); C_ASSERT(sizeof(USBPORT_SCATTER_GATHER_ELEMENT) == 20 + sizeof(PVOID));
typedef struct _USBPORT_SCATTER_GATHER_LIST { typedef struct _USBPORT_SCATTER_GATHER_LIST {
ULONG Flags; ULONG Flags;
@ -627,7 +627,7 @@ typedef struct _USBPORT_SCATTER_GATHER_LIST {
USBPORT_SCATTER_GATHER_ELEMENT SgElement[1]; USBPORT_SCATTER_GATHER_ELEMENT SgElement[1];
} USBPORT_SCATTER_GATHER_LIST, *PUSBPORT_SCATTER_GATHER_LIST; } USBPORT_SCATTER_GATHER_LIST, *PUSBPORT_SCATTER_GATHER_LIST;
C_ASSERT(sizeof(USBPORT_SCATTER_GATHER_LIST) == 40); C_ASSERT(sizeof(USBPORT_SCATTER_GATHER_LIST) == 36 + sizeof(PVOID));
typedef struct _USBPORT_TRANSFER_PARAMETERS { typedef struct _USBPORT_TRANSFER_PARAMETERS {
ULONG TransferFlags; ULONG TransferFlags;