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

Bump windows to 0.58.0 #208

Open
veeenu opened this issue Oct 27, 2024 · 2 comments
Open

Bump windows to 0.58.0 #208

veeenu opened this issue Oct 27, 2024 · 2 comments
Milestone

Comments

@veeenu
Copy link
Owner

veeenu commented Oct 27, 2024

No description provided.

@veeenu veeenu added this to the 0.9.0 milestone Nov 4, 2024
@cryeprecision
Copy link
Contributor

Some types from the windows crate use pointers as their inner type in 0.58 compared to pointer sized numeric types in 0.54 which means that these types are now neither Send nor Sync and I don't have a good idea for how to handle this change.

E.g. HWND on 0.54

#[repr(transparent)]
#[derive(::core::cmp::PartialEq, ::core::cmp::Eq)]
pub struct HWND(pub isize);

and now on 0.58

#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct HWND(pub *mut core::ffi::c_void);

@veeenu
Copy link
Owner Author

veeenu commented Nov 5, 2024

Yeah, that's correct. I don't have a good answer, either. I'm going to stay on 0.54 for 0.8 and look into bumping later. I see the point in not making thread-unsafe handles Send and Sync, e.g. HWND is not completely thread safe, it does offer some not-greatly-documented concurrency guarantees but they don't map cleanly to however the Rust bindings are generated and I'm not sure there is/can be metadata support for it. This could be a good chance to review hudhook's concurrency assumptions: imgui is not thread safe at all either and it would be great if we managed to offer some guarantees that certain things are always called from the same thread. In practice, that's already so, but we have hooks and global statics and that makes things hard to formalize within the type system.

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

No branches or pull requests

2 participants