| author | |
| committer | |
| log | 0288034c2f2d158970cd481e1810a2301ab0b50a |
| tree | a25218b9bd138a44a5e112ef279064d8dc1a4467 |
| parent | 0aabfb09f9a33f7199e53996a0baa9b5eb8b1e50 |
3 files changed, 4 insertions(+), 3 deletions(-)
CMakeLists.txt+1| ... | ... | @@ -630,6 +630,7 @@ set(ZIG_STD_FILES |
| 630 | 630 | "os/windows/bits.zig" |
| 631 | 631 | "os/windows/error.zig" |
| 632 | 632 | "os/windows/kernel32.zig" |
| 633 | "os/windows/lang.zig" | |
| 633 | 634 | "os/windows/ntdll.zig" |
| 634 | 635 | "os/windows/ole32.zig" |
| 635 | 636 | "os/windows/shell32.zig" |
std/os/windows.zig+2-2| ... | ... | @@ -756,7 +756,7 @@ pub fn sliceToPrefixedSuffixedFileW(s: []const u8, comptime suffix: []const u16) |
| 756 | 756 | return result; |
| 757 | 757 | } |
| 758 | 758 | |
| 759 | inline fn MAKELANGID(p: USHORT, s: USHORT) LANGID { | |
| 759 | inline fn MAKELANGID(p: c_ushort, s: c_ushort) LANGID { | |
| 760 | 760 | return (s << 10) | p; |
| 761 | 761 | } |
| 762 | 762 | |
| ... | ... | @@ -765,7 +765,7 @@ inline fn MAKELANGID(p: USHORT, s: USHORT) LANGID { |
| 765 | 765 | pub fn unexpectedError(err: DWORD) std.os.UnexpectedError { |
| 766 | 766 | if (std.os.unexpected_error_tracing) { |
| 767 | 767 | var buf: LPSTR = undefined; |
| 768 | const len = kernel32.FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, err, MAKELANGID(LANG.LANG_NEUTRAL, LANG.SUBLANG_DEFAULT), buf, 0, null); | |
| 768 | const len = kernel32.FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, err, MAKELANGID(LANG.LANG_NEUTRAL, LANG.SUBLANG_DEFAULT), @ptrCast(LPSTR, &buf), 0, null); | |
| 769 | 769 | defer _ = kernel32.LocalFree(@ptrCast(HLOCAL, buf)); |
| 770 | 770 | std.debug.warn("error.Unexpected: {}: {}\n", err, buf[0..len]); |
| 771 | 771 |
std/os/windows/kernel32.zig+1-1| ... | ... | @@ -50,7 +50,7 @@ pub extern "kernel32" stdcallcc fn FindFirstFileW(lpFileName: [*]const u16, lpFi |
| 50 | 50 | pub extern "kernel32" stdcallcc fn FindClose(hFindFile: HANDLE) BOOL; |
| 51 | 51 | pub extern "kernel32" stdcallcc fn FindNextFileW(hFindFile: HANDLE, lpFindFileData: *WIN32_FIND_DATAW) BOOL; |
| 52 | 52 | |
| 53 | pub extern "kernel32" stdcallcc fn FormatMessageA(dwFlags: DWORD, lpSource: LPVOID, dwMessageId: DWORD, dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD, Arguments: ?*va_list) DWORD; | |
| 53 | pub extern "kernel32" stdcallcc fn FormatMessageA(dwFlags: DWORD, lpSource: ?LPVOID, dwMessageId: DWORD, dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD, Arguments: ?*va_list) DWORD; | |
| 54 | 54 | |
| 55 | 55 | pub extern "kernel32" stdcallcc fn FreeEnvironmentStringsW(penv: [*]u16) BOOL; |
| 56 | 56 |