From ead4c062d698b64cdded5910a533c48b6d7803f4 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 0af06370d716..af59727bea20 100644 --- a/lib/std/os/windows/kernel32.zig +++ b/lib/std/os/windows/kernel32.zig @@ -585,7 +585,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;