GetOverlappedResultEx function kernel32

Win32Result<bool> GetOverlappedResultEx(
  1. HANDLE hFile,
  2. Pointer<OVERLAPPED> lpOverlapped,
  3. Pointer<Uint32> lpNumberOfBytesTransferred,
  4. int dwMilliseconds,
  5. bool bAlertable,
)

Retrieves the results of an overlapped operation on the specified file, named pipe, or communications device within the specified time-out interval.

The calling thread can perform an alertable wait.

To learn more, see learn.microsoft.com/windows/win32/api/ioapiset/nf-ioapiset-getoverlappedresultex.

Implementation

Win32Result<bool> GetOverlappedResultEx(
  HANDLE hFile,
  Pointer<OVERLAPPED> lpOverlapped,
  Pointer<Uint32> lpNumberOfBytesTransferred,
  int dwMilliseconds,
  bool bAlertable,
) {
  final result_ = GetOverlappedResultEx_Wrapper(
    hFile,
    lpOverlapped,
    lpNumberOfBytesTransferred,
    dwMilliseconds,
    bAlertable ? TRUE : FALSE,
  );
  return .new(value: result_.value.i32 != FALSE, error: result_.error);
}