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