ReadFile function kernel32
Reads data from the specified file or input/output (I/O) device.
Reads occur at the position specified by the file pointer if supported by the device.
To learn more, see learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-readfile.
Implementation
Win32Result<bool> ReadFile(
HANDLE hFile,
Pointer<Uint8>? lpBuffer,
int nNumberOfBytesToRead,
Pointer<Uint32>? lpNumberOfBytesRead,
Pointer<OVERLAPPED>? lpOverlapped,
) {
final result_ = ReadFile_Wrapper(
hFile,
lpBuffer ?? nullptr,
nNumberOfBytesToRead,
lpNumberOfBytesRead ?? nullptr,
lpOverlapped ?? nullptr,
);
return Win32Result(value: result_.value.i32 != FALSE, error: result_.error);
}