commit 52150b701cc5dae8864c908a6003d8dbe6b4d7b9 (tree)
parent 869880adac4f708b0fd1e65de6046b561c38528c
Author: Ronald Chen <pyrogx1133@gmail.com>
Date: Sat, 11 May 2024 20:02:28 -0700
[std] Fixed bug missing optional for lpName param on CreateEventExW. fixes #19946
https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createeventexw
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig
@@ -304,7 +304,7 @@ pub fn CreateEventEx(attributes: ?*SECURITY_ATTRIBUTES, name: []const u8, flags:
return CreateEventExW(attributes, nameW.span().ptr, flags, desired_access);
}
-pub fn CreateEventExW(attributes: ?*SECURITY_ATTRIBUTES, nameW: [*:0]const u16, flags: DWORD, desired_access: DWORD) !HANDLE {
+pub fn CreateEventExW(attributes: ?*SECURITY_ATTRIBUTES, nameW: ?LPCWSTR, flags: DWORD, desired_access: DWORD) !HANDLE {
const handle = kernel32.CreateEventExW(attributes, nameW, flags, desired_access);
if (handle) |h| {
return h;
diff --git a/lib/std/os/windows/kernel32.zig b/lib/std/os/windows/kernel32.zig
@@ -82,7 +82,7 @@ pub extern "kernel32" fn SetEndOfFile(hFile: HANDLE) callconv(WINAPI) BOOL;
pub extern "kernel32" fn CreateEventExW(
lpEventAttributes: ?*SECURITY_ATTRIBUTES,
- lpName: [*:0]const u16,
+ lpName: ?LPCWSTR,
dwFlags: DWORD,
dwDesiredAccess: DWORD,
) callconv(WINAPI) ?HANDLE;