I tried to translate some new parts of winuser.h header to Delphi. Why is this structure likely to be 48 bytes (only this size was accepted by this function). With a 4-byte limit, it appears that there should be 40 bytes in it.
typed format tag tag STOREINFO {UINT cbSize; DeDwand's Dedflag; DWORD dwID; Hwnd hwdrtg; Number of points; DWORD dwInstanceID; DWORD dwSequenceID; Ulglong ullArguments; UINT CBXTRRAIGGS; } GESTUREINFO, * PGESTUREINFO;
If it is related to an 8-byte limit? If so, is it relevant to any case where ULONGLONG structures appear?
Thank you
The structure is 48 bytes big because Windows APIs are 8-byte alignment is required. This is just a conference adopted by Microsoft Windows; This is because the largest integral type currently supported is 8 bytes big, so 8-byte alignment ensures that all integral types are properly aligned.
(Note that header files specify such winuser.h, but in order to actually use that compiled library, to use that API, you need one, in which calling conventions and Structure alignment.)
Comments
Post a Comment