From f5b5c7ae4b87929146f5437903dc9171624ddbb8 Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Mon, 29 Jul 2024 06:07:20 -0700 Subject: [PATCH] Fix compile error due to GetModuleFileNameW binding change In https://github.com/ziglang/zig/pull/19641, this binding changed from `[*]u16` to `LPWSTR` which made it a sentinel-terminated pointer. This introduced a compiler error in the `std.os.windows.GetModuleFileNameW` wrapper since it takes a `[*]u16` pointer. This commit changes the binding back to what it was before instead of introducing a breaking change to `std.os.windows.GetModuleFileNameW` Related: https://github.com/ziglang/zig/issues/20858 --- lib/std/os/windows/kernel32.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/os/windows/kernel32.zig b/lib/std/os/windows/kernel32.zig index e560cf07ba72..b8ae72af5571 100644 --- a/lib/std/os/windows/kernel32.zig +++ b/lib/std/os/windows/kernel32.zig @@ -597,7 +597,7 @@ pub extern "kernel32" fn GetProcessHeap() callconv(WINAPI) ?HANDLE; // TODO: Wrapper around LdrGetDllFullName. pub extern "kernel32" fn GetModuleFileNameW( hModule: ?HMODULE, - lpFilename: LPWSTR, + lpFilename: [*]WCHAR, nSize: DWORD, ) callconv(WINAPI) DWORD;