CancelIoEx function kernel32

Win32Result<bool> CancelIoEx(
  1. HANDLE hFile,
  2. Pointer<OVERLAPPED>? lpOverlapped
)

Marks any outstanding I/O operations for the specified file handle.

The function only cancels I/O operations in the current process, regardless of which thread created the I/O operation.

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

Implementation

Win32Result<bool> CancelIoEx(HANDLE hFile, Pointer<OVERLAPPED>? lpOverlapped) {
  resolveGetLastError();
  final result_ = _CancelIoEx(hFile, lpOverlapped ?? nullptr);
  return .new(value: result_ != FALSE, error: GetLastError());
}