Skip to content

Commit 30427ff

Browse files
authored
Fix GetFileInformationByHandle compile error (#14829)
* Fix GetFileInformationByHandle compile error The wrapper function was mistakenly referencing ntdll.zig when the actual function is declared in kernel32.zig. * delete GetFileInformationByHandle since it's not used by the stdlib
1 parent 9a203fa commit 30427ff

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

lib/std/os/windows.zig

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,21 +1708,6 @@ pub fn LocalFree(hMem: HLOCAL) void {
17081708
assert(kernel32.LocalFree(hMem) == null);
17091709
}
17101710

1711-
pub const GetFileInformationByHandleError = error{Unexpected};
1712-
1713-
pub fn GetFileInformationByHandle(
1714-
hFile: HANDLE,
1715-
) GetFileInformationByHandleError!BY_HANDLE_FILE_INFORMATION {
1716-
var info: BY_HANDLE_FILE_INFORMATION = undefined;
1717-
const rc = ntdll.GetFileInformationByHandle(hFile, &info);
1718-
if (rc == 0) {
1719-
switch (kernel32.GetLastError()) {
1720-
else => |err| return unexpectedError(err),
1721-
}
1722-
}
1723-
return info;
1724-
}
1725-
17261711
pub const SetFileTimeError = error{Unexpected};
17271712

17281713
pub fn SetFileTime(

lib/std/os/windows/kernel32.zig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,6 @@ pub extern "kernel32" fn GetModuleHandleW(lpModuleName: ?[*:0]const WCHAR) callc
202202
pub extern "kernel32" fn GetLastError() callconv(WINAPI) Win32Error;
203203
pub extern "kernel32" fn SetLastError(dwErrCode: Win32Error) callconv(WINAPI) void;
204204

205-
pub extern "kernel32" fn GetFileInformationByHandle(
206-
hFile: HANDLE,
207-
lpFileInformation: *BY_HANDLE_FILE_INFORMATION,
208-
) callconv(WINAPI) BOOL;
209-
210205
pub extern "kernel32" fn GetFileInformationByHandleEx(
211206
in_hFile: HANDLE,
212207
in_FileInformationClass: FILE_INFO_BY_HANDLE_CLASS,

0 commit comments

Comments
 (0)