WaitCommEvent function kernel32

Win32Result<bool> WaitCommEvent(
  1. HANDLE hFile,
  2. Pointer<Uint32> lpEvtMask,
  3. Pointer<OVERLAPPED>? lpOverlapped
)

Waits for an event to occur for a specified communications device.

The set of events that are monitored by this function is contained in the event mask associated with the device handle.

To learn more, see learn.microsoft.com/windows/win32/api/winbase/nf-winbase-waitcommevent.

Implementation

Win32Result<bool> WaitCommEvent(
  HANDLE hFile,
  Pointer<Uint32> lpEvtMask,
  Pointer<OVERLAPPED>? lpOverlapped,
) {
  final result_ = WaitCommEvent_Wrapper(
    hFile,
    lpEvtMask,
    lpOverlapped ?? nullptr,
  );
  return Win32Result(value: result_.value.i32 != FALSE, error: result_.error);
}