Missing optional for lpName param on std.os.windows.kernel32.CreateEventExW
Pyrolistical opened this issue · 1 comments
Pyrolistical commented
Zig Version
0.13.0-dev.75+5c9eb4081
Steps to Reproduce and Observed Behavior
According to https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createeventexw, CreateEventExW has the signature:
HANDLE CreateEventExW(
[in, optional] LPSECURITY_ATTRIBUTES lpEventAttributes,
[in, optional] LPCWSTR lpName,
[in] DWORD dwFlags,
[in] DWORD dwDesiredAccess
);
but in std, it is defined as:
zig/lib/std/os/windows/kernel32.zig
Lines 83 to 88 in 084c2cd
Note lpName
type does not match. It should be lpName: ?LPCWSTR
Expected Behavior
std.os.windows.kernel32.CreateEventExW signature should match the win32 api
Pyrolistical commented
Another issue is there is no way to force a pointer to zero address as the zig compiler does a really good job at detecting that. It would have been nice to be able to @allowzeroCast(@as([*:0]allowzero const u16, @ptrFromInt(0))
or something to bypass compiler.