Skip to content
New issue

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

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

Already on GitHub? # to your account

Change Windows HANDLE types back to *mut c_void **again** 😩? #171

Open
MarijnS95 opened this issue Jul 14, 2024 · 4 comments
Open

Change Windows HANDLE types back to *mut c_void **again** 😩? #171

MarijnS95 opened this issue Jul 14, 2024 · 4 comments

Comments

@MarijnS95
Copy link
Member

FYI, win32metadata is changing these back to void pointers it seems:

microsoft/win32metadata#1924
microsoft/win32metadata@b4dfd2f

See also my local regeneration: microsoft/windows-rs@96b9a27

Originally posted by @MarijnS95 in #136 (comment)


This is out now in the windows 0.58 release and somewhat annoying when using raw-window-handle together with it.

@Lokathor
Copy link
Contributor

deep and heavy sigh

@madsmtm
Copy link
Member

madsmtm commented Jul 14, 2024

This is a breaking change, and should be combined with #154

@notgull
Copy link
Member

notgull commented Aug 10, 2024

We can change them back to pointers. If they decide to go back to usize just keep them as pointers.

@notgull
Copy link
Member

notgull commented Aug 10, 2024

Actually wait, does this impact us? From the issue linked above:

Rust currently emits isize/usize integers as a result of decomposing our synthetic handle types and encountering IntPtr/UIntPtr. Rust would now like to emit pointers to better align with its core handle type, but it cannot differentiate between legitimate pointer-sized integers (e.g. LRESULT) and handles (e.g. HMODULE).

Since window IDs in Windows are just indexes into a thread-local table, they're still semantically usize/isize. So it's still correct (by Rust's standards) to not change them here, even if win32metadata doesn't realize it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

4 participants