ReadFileEx function kernel32

int ReadFileEx(
  1. int hFile,
  2. Pointer<Uint8> lpBuffer,
  3. int nNumberOfBytesToRead,
  4. Pointer<OVERLAPPED> lpOverlapped,
  5. Pointer<NativeFunction<LPOVERLAPPED_COMPLETION_ROUTINE>> lpCompletionRoutine,
)

Reads data from the specified file or input/output (I/O) device. It reports its completion status asynchronously, calling the specified completion routine when reading is completed or canceled and the calling thread is in an alertable wait state.

BOOL ReadFileEx(
  [in]            HANDLE                          hFile,
  [out, optional] LPVOID                          lpBuffer,
  [in]            DWORD                           nNumberOfBytesToRead,
  [in, out]       LPOVERLAPPED                    lpOverlapped,
  [in]            LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);

Implementation

int ReadFileEx(
  int hFile,
  Pointer<Uint8> lpBuffer,
  int nNumberOfBytesToRead,
  Pointer<OVERLAPPED> lpOverlapped,
  Pointer<NativeFunction<LPOVERLAPPED_COMPLETION_ROUTINE>> lpCompletionRoutine,
) => _ReadFileEx(
  hFile,
  lpBuffer,
  nNumberOfBytesToRead,
  lpOverlapped,
  lpCompletionRoutine,
);