| ... | @@ -1631,6 +1631,10 @@ pub fn HeapDestroy(hHeap: HANDLE) void { | ... | @@ -1631,6 +1631,10 @@ pub fn HeapDestroy(hHeap: HANDLE) void { |
| 1631 | assert(kernel32.HeapDestroy(hHeap) != 0); | 1631 | assert(kernel32.HeapDestroy(hHeap) != 0); |
| 1632 | } | 1632 | } |
| 1633 | | 1633 | |
| | 1634 | pub fn LocalFree(hMem: HLOCAL) void { |
| | 1635 | assert(kernel32.LocalFree(hMem) == null); |
| | 1636 | } |
| | 1637 | |
| 1634 | pub const GetFileInformationByHandleError = error{Unexpected}; | 1638 | pub const GetFileInformationByHandleError = error{Unexpected}; |
| 1635 | | 1639 | |
| 1636 | pub fn GetFileInformationByHandle( | 1640 | pub fn GetFileInformationByHandle( |
| ... | @@ -2011,6 +2015,21 @@ pub fn unexpectedStatus(status: NTSTATUS) std.os.UnexpectedError { | ... | @@ -2011,6 +2015,21 @@ pub fn unexpectedStatus(status: NTSTATUS) std.os.UnexpectedError { |
| 2011 | return error.Unexpected; | 2015 | return error.Unexpected; |
| 2012 | } | 2016 | } |
| 2013 | | 2017 | |
| | 2018 | pub fn SetThreadDescription(hThread: HANDLE, lpThreadDescription: LPCWSTR) !void { |
| | 2019 | if (kernel32.SetThreadDescription(hThread, lpThreadDescription) == 0) { |
| | 2020 | switch (kernel32.GetLastError()) { |
| | 2021 | else => |err| return unexpectedError(err), |
| | 2022 | } |
| | 2023 | } |
| | 2024 | } |
| | 2025 | pub fn GetThreadDescription(hThread: HANDLE, ppszThreadDescription: *LPWSTR) !void { |
| | 2026 | if (kernel32.GetThreadDescription(hThread, ppszThreadDescription) == 0) { |
| | 2027 | switch (kernel32.GetLastError()) { |
| | 2028 | else => |err| return unexpectedError(err), |
| | 2029 | } |
| | 2030 | } |
| | 2031 | } |
| | 2032 | |
| 2014 | test "" { | 2033 | test "" { |
| 2015 | if (builtin.os.tag == .windows) { | 2034 | if (builtin.os.tag == .windows) { |
| 2016 | _ = @import("windows/test.zig"); | 2035 | _ = @import("windows/test.zig"); |