@@ -349,8 +349,19 @@ func NewCallbackCDecl(fn interface{}) uintptr {
349
349
//sys SetProcessPriorityBoost(process Handle, disable bool) (err error) = kernel32.SetProcessPriorityBoost
350
350
//sys GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32)
351
351
//sys SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error)
352
+ //sys ClearCommBreak(handle Handle) (err error)
353
+ //sys ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error)
354
+ //sys EscapeCommFunction(handle Handle, dwFunc uint32) (err error)
355
+ //sys GetCommState(handle Handle, lpDCB *DCB) (err error)
356
+ //sys GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error)
352
357
//sys GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error)
358
+ //sys PurgeComm(handle Handle, dwFlags uint32) (err error)
359
+ //sys SetCommBreak(handle Handle) (err error)
360
+ //sys SetCommMask(handle Handle, dwEvtMask uint32) (err error)
361
+ //sys SetCommState(handle Handle, lpDCB *DCB) (err error)
353
362
//sys SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error)
363
+ //sys SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error)
364
+ //sys WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error)
354
365
//sys GetActiveProcessorCount(groupNumber uint16) (ret uint32)
355
366
//sys GetMaximumProcessorCount(groupNumber uint16) (ret uint32)
356
367
//sys EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) = user32.EnumWindows
@@ -1835,3 +1846,73 @@ func ResizePseudoConsole(pconsole Handle, size Coord) error {
1835
1846
// accept arguments that can be casted to uintptr, and Coord can't.
1836
1847
return resizePseudoConsole (pconsole , * ((* uint32 )(unsafe .Pointer (& size ))))
1837
1848
}
1849
+
1850
+ // DCB constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-dcb.
1851
+ const (
1852
+ CBR_110 = 110
1853
+ CBR_300 = 300
1854
+ CBR_600 = 600
1855
+ CBR_1200 = 1200
1856
+ CBR_2400 = 2400
1857
+ CBR_4800 = 4800
1858
+ CBR_9600 = 9600
1859
+ CBR_14400 = 14400
1860
+ CBR_19200 = 19200
1861
+ CBR_38400 = 38400
1862
+ CBR_57600 = 57600
1863
+ CBR_115200 = 115200
1864
+ CBR_128000 = 128000
1865
+ CBR_256000 = 256000
1866
+
1867
+ DTR_CONTROL_DISABLE = 0x00
1868
+ DTR_CONTROL_ENABLE = 0x01
1869
+ DTR_CONTROL_HANDSHAKE = 0x02
1870
+
1871
+ RTS_CONTROL_DISABLE = 0x00
1872
+ RTS_CONTROL_ENABLE = 0x01
1873
+ RTS_CONTROL_HANDSHAKE = 0x02
1874
+ RTS_CONTROL_TOGGLE = 0x03
1875
+
1876
+ NOPARITY = 0
1877
+ ODDPARITY = 1
1878
+ EVENPARITY = 2
1879
+ MARKPARITY = 3
1880
+ SPACEPARITY = 4
1881
+
1882
+ ONESTOPBIT = 0
1883
+ ONE5STOPBITS = 1
1884
+ TWOSTOPBITS = 2
1885
+ )
1886
+
1887
+ // EscapeCommFunction constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-escapecommfunction.
1888
+ const (
1889
+ SETXOFF = 1
1890
+ SETXON = 2
1891
+ SETRTS = 3
1892
+ CLRRTS = 4
1893
+ SETDTR = 5
1894
+ CLRDTR = 6
1895
+ SETBREAK = 8
1896
+ CLRBREAK = 9
1897
+ )
1898
+
1899
+ // PurgeComm constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-purgecomm.
1900
+ const (
1901
+ PURGE_TXABORT = 0x0001
1902
+ PURGE_RXABORT = 0x0002
1903
+ PURGE_TXCLEAR = 0x0004
1904
+ PURGE_RXCLEAR = 0x0008
1905
+ )
1906
+
1907
+ // SetCommMask constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setcommmask.
1908
+ const (
1909
+ EV_RXCHAR = 0x0001
1910
+ EV_RXFLAG = 0x0002
1911
+ EV_TXEMPTY = 0x0004
1912
+ EV_CTS = 0x0008
1913
+ EV_DSR = 0x0010
1914
+ EV_RLSD = 0x0020
1915
+ EV_BREAK = 0x0040
1916
+ EV_ERR = 0x0080
1917
+ EV_RING = 0x0100
1918
+ )
0 commit comments