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

WSASetEvent and WSAResetEvent should take a WSAEVENT instead of a HANDLE #1960

Closed
eduardosm opened this issue Aug 8, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@eduardosm
Copy link

Summary

Functions WSASetEvent and WSAResetEvent are defined in windows-sys as:

pub unsafe extern "system" fn WSAResetEvent(hevent: HANDLE) -> BOOL

pub unsafe extern "system" fn WSASetEvent(hevent: HANDLE) -> BOOL

However, in their original C definitions they take a WSAEVENT instead of a HANDLE:

BOOL WSAAPI WSASetEvent(
  [in] WSAEVENT hEvent
);

BOOL WSAAPI WSAResetEvent(
  [in] WSAEVENT hEvent
);

Crate manifest

[dependencies.windows-sys]
version = "0.59.0"
features = ["Win32_Networking_WinSock"]

Crate code

use windows_sys::Win32::Networking::WinSock;

unsafe {
    let event = WinSock::WSACreateEvent();
    WinSock::WSASetEvent(event); // compilation error due to mismatching types
}
@eduardosm eduardosm added the bug Something isn't working label Aug 8, 2024
@riverar
Copy link
Collaborator

riverar commented Aug 8, 2024

Will forward this to upstream win32metadata; looks like just a missing annotation there.

@riverar riverar transferred this issue from microsoft/windows-rs Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants