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

Don't flip GUID fields when converting to UUID #540

Merged
merged 1 commit into from
Oct 31, 2021
Merged

Don't flip GUID fields when converting to UUID #540

merged 1 commit into from
Oct 31, 2021

Conversation

KodrAus
Copy link
Member

@KodrAus KodrAus commented Oct 31, 2021

Part of #537

In #336 we introduced conversions between Windows GUIDs and UUIDs. These didn't attempt to swap the ordering of the fields in any way. GUID specifies its fields as being in the native endianness (which for Windows is basically always little endian), while UUID requires them to be big endian. So we started flipping those fields coming from GUIDs in #345. Unfortunately, this seems like it was the wrong thing to do. All GUIDs I've been able to find already have the right ordering for UUIDs, so we've just been mangling them and losing the UUID version and variant.

This PR fixes that by removing the endianness conversion. We're going to be pulling this out into a separate crate before stabilizing so we can call out the change there. Anybody who actually does want to flip bytes between GUID and UUID fields can use the from_fields_le and to_fields_le methods.

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

1 participant