From cdf1fc5784efc0b215797cd06b983c1dfee39a57 Mon Sep 17 00:00:00 2001 From: David Quintana Date: Mon, 24 Jul 2017 10:34:06 +0000 Subject: [PATCH] [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 --- reactos/base/applications/mspaint/main.cpp | 2 +- reactos/base/setup/usetup/inffile.h | 8 ++++---- reactos/drivers/usb/usbport/usbport.h | 9 +++++++-- reactos/sdk/include/reactos/drivers/usbport/usbmport.h | 8 ++++---- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/reactos/base/applications/mspaint/main.cpp b/reactos/base/applications/mspaint/main.cpp index 908bf7108db..5d1248262bd 100644 --- a/reactos/base/applications/mspaint/main.cpp +++ b/reactos/base/applications/mspaint/main.cpp @@ -111,7 +111,7 @@ FileExtFromFilter(LPTSTR pExt, LPCTSTR pTitle, OPENFILENAME *pOFN) } // 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) { HWND hParent; diff --git a/reactos/base/setup/usetup/inffile.h b/reactos/base/setup/usetup/inffile.h index fdc3deb9688..039fbef3535 100644 --- a/reactos/base/setup/usetup/inffile.h +++ b/reactos/base/setup/usetup/inffile.h @@ -45,10 +45,10 @@ * Delete it once we don't use inflib anymore */ typedef struct _INFCONTEXT { - PVOID Inf; - PVOID CurrentInf; - PVOID Section; - PVOID Line; + HINF Inf; + HINF CurrentInf; + UINT Section; + UINT Line; } INFCONTEXT; C_ASSERT(sizeof(INFCONTEXT) == 2 * sizeof(PVOID) + 2 * sizeof(UINT)); diff --git a/reactos/drivers/usb/usbport/usbport.h b/reactos/drivers/usb/usbport/usbport.h index 637a7eac41c..2238a0e7e70 100644 --- a/reactos/drivers/usb/usbport/usbport.h +++ b/reactos/drivers/usb/usbport/usbport.h @@ -355,7 +355,12 @@ typedef struct _USBPORT_DEVICE_EXTENSION { KSPIN_LOCK SetPowerD0SpinLock; KDPC WorkerRequestDpc; 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; C_ASSERT(sizeof(USBPORT_DEVICE_EXTENSION) == 0x400); @@ -392,7 +397,7 @@ typedef struct _USBPORT_ASYNC_CALLBACK_DATA { ULONG CallbackContext; } 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 { WORK_QUEUE_ITEM WqItem; diff --git a/reactos/sdk/include/reactos/drivers/usbport/usbmport.h b/reactos/sdk/include/reactos/drivers/usbport/usbmport.h index 4f26703036d..830ef1d20dd 100644 --- a/reactos/sdk/include/reactos/drivers/usbport/usbmport.h +++ b/reactos/sdk/include/reactos/drivers/usbport/usbmport.h @@ -62,7 +62,7 @@ typedef struct _USBPORT_RESOURCES { UCHAR Reserved3; } 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 RHSTATUS; // Roothub status @@ -578,7 +578,7 @@ typedef struct _USBPORT_MINIPORT_INTERFACE { USBPORT_REGISTRATION_PACKET Packet; } 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 typedef struct _USBPORT_ENDPOINT_PROPERTIES { @@ -617,7 +617,7 @@ typedef struct _USBPORT_SCATTER_GATHER_ELEMENT { ULONG Reserved2; } 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 { ULONG Flags; @@ -627,7 +627,7 @@ typedef struct _USBPORT_SCATTER_GATHER_LIST { USBPORT_SCATTER_GATHER_ELEMENT SgElement[1]; } 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 { ULONG TransferFlags; -- 2.17.1