microsoft / go-winio

Win32 IO-related utilities for Go
MIT License
950 stars 182 forks source link

fileinfo: internally fix FileBasicInfo memory alignment #312

Closed dagood closed 8 months ago

dagood commented 8 months ago

This PR fixes memory alignment for the structs passed to both GetFileInformationByHandleEx and SetFileInformationByHandle.

Includes a direct test for memory alignment. (Also makes sure it has the right amount of padding, since it's convenient to check this in the test too.)