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

Panic due to incorrect usage of winapi #570

Closed
DomantasJ opened this issue Sep 3, 2021 · 2 comments
Closed

Panic due to incorrect usage of winapi #570

DomantasJ opened this issue Sep 3, 2021 · 2 comments

Comments

@DomantasJ
Copy link

A user on reddit reported that System::new_all() panics on his windows machine. Here's what I found:

  1. The panic is caused by this offset_from call because referent is zero sized
  2. LPVOID is an alias to *mut c_void
  3. Unless std feature is enabled in winapi, it defines c_void as an empty enum

So the use of offset_from does not seem to be valid without enabling winapi/std. Although I'm not sure if winapi is doing the right thing by defining c_void as a zero sized type.

@GuillaumeGomez
Copy link
Owner

I opened a PR on winapi: retep998/winapi-rs#1003

Let's hope it'll get merged quickly and that a release will follow shortly.

@GuillaumeGomez
Copy link
Owner

Fixed #571.

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