| ... | @@ -1230,23 +1230,6 @@ test "GetFinalPathNameByHandle" { | ... | @@ -1230,23 +1230,6 @@ test "GetFinalPathNameByHandle" { |
| 1230 | _ = try GetFinalPathNameByHandle(handle, .{ .volume_name = .Dos }, buffer[0..required_len_in_u16]); | 1230 | _ = try GetFinalPathNameByHandle(handle, .{ .volume_name = .Dos }, buffer[0..required_len_in_u16]); |
| 1231 | } | 1231 | } |
| 1232 | | 1232 | |
| 1233 | pub const QueryInformationFileError = error{Unexpected}; | | |
| 1234 | | | |
| 1235 | pub fn QueryInformationFile( | | |
| 1236 | handle: HANDLE, | | |
| 1237 | info_class: FILE_INFORMATION_CLASS, | | |
| 1238 | out_buffer: []u8, | | |
| 1239 | ) QueryInformationFileError!void { | | |
| 1240 | var io: IO_STATUS_BLOCK = undefined; | | |
| 1241 | const len_bytes = std.math.cast(u32, out_buffer.len) orelse unreachable; | | |
| 1242 | const rc = ntdll.NtQueryInformationFile(handle, &io, out_buffer.ptr, len_bytes, info_class); | | |
| 1243 | switch (rc) { | | |
| 1244 | .SUCCESS => {}, | | |
| 1245 | .INVALID_PARAMETER => unreachable, | | |
| 1246 | else => return unexpectedStatus(rc), | | |
| 1247 | } | | |
| 1248 | } | | |
| 1249 | | | |
| 1250 | pub const GetFileSizeError = error{Unexpected}; | 1233 | pub const GetFileSizeError = error{Unexpected}; |
| 1251 | | 1234 | |
| 1252 | pub fn GetFileSizeEx(hFile: HANDLE) GetFileSizeError!u64 { | 1235 | pub fn GetFileSizeEx(hFile: HANDLE) GetFileSizeError!u64 { |