ClearCommError function kernel32
Retrieves information about a communications error and reports the current status of a communications device.
To learn more, see learn.microsoft.com/windows/win32/api/winbase/nf-winbase-clearcommerror.
Implementation
Win32Result<bool> ClearCommError(
HANDLE hFile,
Pointer<Uint32>? lpErrors,
Pointer<COMSTAT>? lpStat,
) {
resolveGetLastError();
final result_ = _ClearCommError(
hFile,
lpErrors ?? nullptr,
lpStat ?? nullptr,
);
return .new(value: result_ != FALSE, error: GetLastError());
}