microsoft / go-winio

Win32 IO-related utilities for Go
MIT License
953 stars 181 forks source link

fileinfo: internally fix FileBasicInfo memory alignment #312

Closed dagood closed 9 months ago

dagood commented 10 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.)