Skip to content

Commit

Permalink
This is a Windows specific fix in libc. According to MSDN, the GUID
Browse files Browse the repository at this point in the history
structure's Data2 and Data3 members expect WORD types instead of DWORD. I
discovered this discrepancy while experimenting with some bindings to
Microsoft's OLE2 api. The discrepancy was corrupting the contents of the
string returned by UuidToString after I used known GUIDs to test the
accuracy of the function binding. I didn't add test cases because it would
mean adding a dependency to my rather incomplete binding library. However,
the fix produces expected string values when tested.
  • Loading branch information
iancormac84 committed Apr 16, 2014
1 parent bfaf171 commit fc4c6ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/liblibc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,8 +1221,8 @@ pub mod types {

pub struct GUID {
pub Data1: DWORD,
pub Data2: DWORD,
pub Data3: DWORD,
pub Data2: WORD,
pub Data3: WORD,
pub Data4: [BYTE, ..8],
}

Expand Down

5 comments on commit fc4c6ee

@bors
Copy link
Contributor

@bors bors commented on fc4c6ee Apr 17, 2014

Choose a reason for hiding this comment

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

saw approval from alexcrichton
at iancormac84@fc4c6ee

@bors
Copy link
Contributor

@bors bors commented on fc4c6ee Apr 17, 2014

Choose a reason for hiding this comment

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

merging iancormac84/rust/libc_windows_guid_fix = fc4c6ee into auto

@bors
Copy link
Contributor

@bors bors commented on fc4c6ee Apr 17, 2014

Choose a reason for hiding this comment

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

iancormac84/rust/libc_windows_guid_fix = fc4c6ee merged ok, testing candidate = 1fd7de8

@bors
Copy link
Contributor

@bors bors commented on fc4c6ee Apr 17, 2014

@bors
Copy link
Contributor

@bors bors commented on fc4c6ee Apr 17, 2014

Choose a reason for hiding this comment

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

fast-forwarding master to auto = 1fd7de8

Please sign in to comment.