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
This commit is contained in:
Reuben Dunnington 2023-03-19 16:23:05 -07:00 committed by GitHub
parent 9a203fa789
commit 30427ff794
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 20 deletions

View File

@ -1708,21 +1708,6 @@ pub fn LocalFree(hMem: HLOCAL) void {
assert(kernel32.LocalFree(hMem) == null);
}
pub const GetFileInformationByHandleError = error{Unexpected};
pub fn GetFileInformationByHandle(
hFile: HANDLE,
) GetFileInformationByHandleError!BY_HANDLE_FILE_INFORMATION {
var info: BY_HANDLE_FILE_INFORMATION = undefined;
const rc = ntdll.GetFileInformationByHandle(hFile, &info);
if (rc == 0) {
switch (kernel32.GetLastError()) {
else => |err| return unexpectedError(err),
}
}
return info;
}
pub const SetFileTimeError = error{Unexpected};
pub fn SetFileTime(

View File

@ -202,11 +202,6 @@ pub extern "kernel32" fn GetModuleHandleW(lpModuleName: ?[*:0]const WCHAR) callc
pub extern "kernel32" fn GetLastError() callconv(WINAPI) Win32Error;
pub extern "kernel32" fn SetLastError(dwErrCode: Win32Error) callconv(WINAPI) void;
pub extern "kernel32" fn GetFileInformationByHandle(
hFile: HANDLE,
lpFileInformation: *BY_HANDLE_FILE_INFORMATION,
) callconv(WINAPI) BOOL;
pub extern "kernel32" fn GetFileInformationByHandleEx(
in_hFile: HANDLE,
in_FileInformationClass: FILE_INFO_BY_HANDLE_CLASS,