| author | |
| committer | |
| log | 610ce544d51ab0bc80c1882e4b923eda9bc0126c |
| tree | 54df39830561fc0bde575997f5cdf60d3b3eb2fa |
| parent | c71e8a30cdf050e45c2ca2dc81e93b10cf00dc5f |
3 files changed, 7 insertions(+), 11 deletions(-)
lib/std/os/windows.zig+6-6| ... | ... | @@ -1922,19 +1922,19 @@ pub fn loadWinsockExtensionFunction(comptime T: type, sock: ws2_32.SOCKET, guid: |
| 1922 | 1922 | pub fn unexpectedError(err: Win32Error) std.os.UnexpectedError { |
| 1923 | 1923 | if (std.os.unexpected_error_tracing) { |
| 1924 | 1924 | // 614 is the length of the longest windows error desciption |
| 1925 | var buf_u16: [614]u16 = undefined; | |
| 1926 | var buf_u8: [614]u8 = undefined; | |
| 1925 | var buf_wstr: [614]WCHAR = undefined; | |
| 1926 | var buf_utf8: [614]u8 = undefined; | |
| 1927 | 1927 | const len = kernel32.FormatMessageW( |
| 1928 | 1928 | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, |
| 1929 | 1929 | null, |
| 1930 | 1930 | err, |
| 1931 | 1931 | MAKELANGID(LANG.NEUTRAL, SUBLANG.DEFAULT), |
| 1932 | &buf_u16, | |
| 1933 | buf_u16.len / @sizeOf(TCHAR), | |
| 1932 | &buf_wstr, | |
| 1933 | buf_wstr.len, | |
| 1934 | 1934 | null, |
| 1935 | 1935 | ); |
| 1936 | _ = std.unicode.utf16leToUtf8(&buf_u8, buf_u16[0..len]) catch unreachable; | |
| 1937 | std.debug.warn("error.Unexpected: GetLastError({}): {s}\n", .{ @enumToInt(err), buf_u8[0..len] }); | |
| 1936 | _ = std.unicode.utf16leToUtf8(&buf_utf8, buf_wstr[0..len]) catch unreachable; | |
| 1937 | std.debug.warn("error.Unexpected: GetLastError({}): {s}\n", .{ @enumToInt(err), buf_utf8[0..len] }); | |
| 1938 | 1938 | std.debug.dumpCurrentStackTrace(null); |
| 1939 | 1939 | } |
| 1940 | 1940 | return error.Unexpected; |
lib/std/os/windows/bits.zig-4| ... | ... | @@ -52,23 +52,19 @@ pub const INT = c_int; |
| 52 | 52 | pub const LPBYTE = *BYTE; |
| 53 | 53 | pub const LPCH = *CHAR; |
| 54 | 54 | pub const LPCSTR = [*:0]const CHAR; |
| 55 | pub const LPCTSTR = [*:0]const TCHAR; | |
| 56 | 55 | pub const LPCVOID = *const c_void; |
| 57 | 56 | pub const LPDWORD = *DWORD; |
| 58 | 57 | pub const LPSTR = [*:0]CHAR; |
| 59 | pub const LPTSTR = if (UNICODE) LPWSTR else LPSTR; | |
| 60 | 58 | pub const LPVOID = *c_void; |
| 61 | 59 | pub const LPWSTR = [*:0]WCHAR; |
| 62 | 60 | pub const LPCWSTR = [*:0]const WCHAR; |
| 63 | 61 | pub const PVOID = *c_void; |
| 64 | 62 | pub const PWSTR = [*:0]WCHAR; |
| 65 | 63 | pub const SIZE_T = usize; |
| 66 | pub const TCHAR = if (UNICODE) WCHAR else u8; | |
| 67 | 64 | pub const UINT = c_uint; |
| 68 | 65 | pub const ULONG_PTR = usize; |
| 69 | 66 | pub const LONG_PTR = isize; |
| 70 | 67 | pub const DWORD_PTR = ULONG_PTR; |
| 71 | pub const UNICODE = false; | |
| 72 | 68 | pub const WCHAR = u16; |
| 73 | 69 | pub const WORD = u16; |
| 74 | 70 | pub const DWORD = u32; |
lib/std/os/windows/kernel32.zig+1-1| ... | ... | @@ -89,7 +89,7 @@ pub extern "kernel32" fn GetCommandLineW() callconv(WINAPI) LPWSTR; |
| 89 | 89 | pub extern "kernel32" fn GetConsoleMode(in_hConsoleHandle: HANDLE, out_lpMode: *DWORD) callconv(WINAPI) BOOL; |
| 90 | 90 | |
| 91 | 91 | pub extern "kernel32" fn GetConsoleScreenBufferInfo(hConsoleOutput: HANDLE, lpConsoleScreenBufferInfo: *CONSOLE_SCREEN_BUFFER_INFO) callconv(WINAPI) BOOL; |
| 92 | pub extern "kernel32" fn FillConsoleOutputCharacterA(hConsoleOutput: HANDLE, cCharacter: TCHAR, nLength: DWORD, dwWriteCoord: COORD, lpNumberOfCharsWritten: LPDWORD) callconv(WINAPI) BOOL; | |
| 92 | pub extern "kernel32" fn FillConsoleOutputCharacterA(hConsoleOutput: HANDLE, cCharacter: CHAR, nLength: DWORD, dwWriteCoord: COORD, lpNumberOfCharsWritten: LPDWORD) callconv(WINAPI) BOOL; | |
| 93 | 93 | pub extern "kernel32" fn FillConsoleOutputAttribute(hConsoleOutput: HANDLE, wAttribute: WORD, nLength: DWORD, dwWriteCoord: COORD, lpNumberOfAttrsWritten: LPDWORD) callconv(WINAPI) BOOL; |
| 94 | 94 | pub extern "kernel32" fn SetConsoleCursorPosition(hConsoleOutput: HANDLE, dwCursorPosition: COORD) callconv(WINAPI) BOOL; |
| 95 | 95 |