aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/windows.zig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/os/windows.zig')
-rw-r--r--lib/std/os/windows.zig10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig
index f5acb70adb..813a77c275 100644
--- a/lib/std/os/windows.zig
+++ b/lib/std/os/windows.zig
@@ -1276,7 +1276,15 @@ pub fn unexpectedError(err: Win32Error) std.os.UnexpectedError {
// 614 is the length of the longest windows error desciption
var buf_u16: [614]u16 = undefined;
var buf_u8: [614]u8 = undefined;
- var len = kernel32.FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, err, MAKELANGID(LANG.NEUTRAL, SUBLANG.DEFAULT), buf_u16[0..].ptr, buf_u16.len / @sizeOf(TCHAR), null);
+ const len = kernel32.FormatMessageW(
+ FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ null,
+ err,
+ MAKELANGID(LANG.NEUTRAL, SUBLANG.DEFAULT),
+ &buf_u16,
+ buf_u16.len / @sizeOf(TCHAR),
+ null,
+ );
_ = std.unicode.utf16leToUtf8(&buf_u8, buf_u16[0..len]) catch unreachable;
std.debug.warn("error.Unexpected: GetLastError({}): {}\n", .{ @enumToInt(err), buf_u8[0..len] });
std.debug.dumpCurrentStackTrace(null);