Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fileinfo: internally fix FileBasicInfo memory alignment #312

Merged
merged 2 commits into from Jan 16, 2024

Conversation

dagood
Copy link
Member

@dagood dagood commented Jan 13, 2024

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.)

Signed-off-by: Davis Goodin <dagood@microsoft.com>
Copy link
Contributor

@helsaawy helsaawy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nits, but overall LGTM

fileinfo_test.go Outdated Show resolved Hide resolved
fileinfo_test.go Outdated Show resolved Hide resolved
Remove unused winName.

Extract more into Windows alignment consts to repeat less.

Document reason for having multiple alignment consts for the same value.

Signed-off-by: Davis Goodin <dagood@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants