Chris Liechti | fbdd8a0 | 2015-08-09 02:37:45 +0200 | [diff] [blame] | 1 | #! python |
| 2 | # |
| 3 | # (C) 2001-2015 Chris Liechti <cliechti@gmx.net> |
| 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 7 | from ctypes import * |
| 8 | from ctypes.wintypes import HANDLE |
| 9 | from ctypes.wintypes import BOOL |
| 10 | from ctypes.wintypes import LPCWSTR |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 11 | from ctypes.wintypes import DWORD |
| 12 | from ctypes.wintypes import WORD |
| 13 | from ctypes.wintypes import BYTE |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 14 | _stdcall_libraries = {} |
| 15 | _stdcall_libraries['kernel32'] = WinDLL('kernel32') |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 16 | |
cliechti | e37b6a8 | 2009-07-24 12:19:50 +0000 | [diff] [blame] | 17 | INVALID_HANDLE_VALUE = HANDLE(-1).value |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 18 | |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 19 | |
cliechti | 251e5ce | 2011-08-25 01:24:49 +0000 | [diff] [blame] | 20 | # some details of the windows API differ between 32 and 64 bit systems.. |
| 21 | def is_64bit(): |
| 22 | """Returns true when running on a 64 bit system""" |
| 23 | return sizeof(c_ulong) != sizeof(c_void_p) |
| 24 | |
cliechti | de43290 | 2011-08-18 22:51:41 +0000 | [diff] [blame] | 25 | # ULONG_PTR is a an ordinary number, not a pointer and contrary to the name it |
| 26 | # is either 32 or 64 bits, depending on the type of windows... |
| 27 | # so test if this a 32 bit windows... |
cliechti | 251e5ce | 2011-08-25 01:24:49 +0000 | [diff] [blame] | 28 | if is_64bit(): |
cliechti | de43290 | 2011-08-18 22:51:41 +0000 | [diff] [blame] | 29 | # assume 64 bits |
| 30 | ULONG_PTR = c_int64 |
cliechti | 251e5ce | 2011-08-25 01:24:49 +0000 | [diff] [blame] | 31 | else: |
| 32 | # 32 bits |
| 33 | ULONG_PTR = c_ulong |
cliechti | de43290 | 2011-08-18 22:51:41 +0000 | [diff] [blame] | 34 | |
| 35 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 36 | class _SECURITY_ATTRIBUTES(Structure): |
| 37 | pass |
| 38 | LPSECURITY_ATTRIBUTES = POINTER(_SECURITY_ATTRIBUTES) |
| 39 | |
cliechti | e37b6a8 | 2009-07-24 12:19:50 +0000 | [diff] [blame] | 40 | |
cliechti | 8a34513 | 2011-08-05 02:33:14 +0000 | [diff] [blame] | 41 | try: |
| 42 | CreateEventW = _stdcall_libraries['kernel32'].CreateEventW |
| 43 | except AttributeError: |
| 44 | # Fallback to non wide char version for old OS... |
| 45 | from ctypes.wintypes import LPCSTR |
| 46 | CreateEventA = _stdcall_libraries['kernel32'].CreateEventA |
| 47 | CreateEventA.restype = HANDLE |
| 48 | CreateEventA.argtypes = [LPSECURITY_ATTRIBUTES, BOOL, BOOL, LPCSTR] |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 49 | CreateEvent = CreateEventA |
cliechti | 8a34513 | 2011-08-05 02:33:14 +0000 | [diff] [blame] | 50 | |
| 51 | CreateFileA = _stdcall_libraries['kernel32'].CreateFileA |
| 52 | CreateFileA.restype = HANDLE |
| 53 | CreateFileA.argtypes = [LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE] |
| 54 | CreateFile = CreateFileA |
| 55 | else: |
| 56 | CreateEventW.restype = HANDLE |
| 57 | CreateEventW.argtypes = [LPSECURITY_ATTRIBUTES, BOOL, BOOL, LPCWSTR] |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 58 | CreateEvent = CreateEventW # alias |
cliechti | 8a34513 | 2011-08-05 02:33:14 +0000 | [diff] [blame] | 59 | |
| 60 | CreateFileW = _stdcall_libraries['kernel32'].CreateFileW |
| 61 | CreateFileW.restype = HANDLE |
| 62 | CreateFileW.argtypes = [LPCWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE] |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 63 | CreateFile = CreateFileW # alias |
| 64 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 65 | |
| 66 | class _OVERLAPPED(Structure): |
| 67 | pass |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 68 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 69 | OVERLAPPED = _OVERLAPPED |
| 70 | |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 71 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 72 | class _COMSTAT(Structure): |
| 73 | pass |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 74 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 75 | COMSTAT = _COMSTAT |
| 76 | |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 77 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 78 | class _DCB(Structure): |
| 79 | pass |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 80 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 81 | DCB = _DCB |
| 82 | |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 83 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 84 | class _COMMTIMEOUTS(Structure): |
| 85 | pass |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 86 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 87 | COMMTIMEOUTS = _COMMTIMEOUTS |
| 88 | |
| 89 | GetLastError = _stdcall_libraries['kernel32'].GetLastError |
| 90 | GetLastError.restype = DWORD |
| 91 | GetLastError.argtypes = [] |
| 92 | |
| 93 | LPOVERLAPPED = POINTER(_OVERLAPPED) |
| 94 | LPDWORD = POINTER(DWORD) |
| 95 | |
| 96 | GetOverlappedResult = _stdcall_libraries['kernel32'].GetOverlappedResult |
| 97 | GetOverlappedResult.restype = BOOL |
| 98 | GetOverlappedResult.argtypes = [HANDLE, LPOVERLAPPED, LPDWORD, BOOL] |
| 99 | |
| 100 | ResetEvent = _stdcall_libraries['kernel32'].ResetEvent |
| 101 | ResetEvent.restype = BOOL |
| 102 | ResetEvent.argtypes = [HANDLE] |
| 103 | |
| 104 | LPCVOID = c_void_p |
| 105 | |
| 106 | WriteFile = _stdcall_libraries['kernel32'].WriteFile |
| 107 | WriteFile.restype = BOOL |
| 108 | WriteFile.argtypes = [HANDLE, LPCVOID, DWORD, LPDWORD, LPOVERLAPPED] |
| 109 | |
| 110 | LPVOID = c_void_p |
| 111 | |
| 112 | ReadFile = _stdcall_libraries['kernel32'].ReadFile |
| 113 | ReadFile.restype = BOOL |
| 114 | ReadFile.argtypes = [HANDLE, LPVOID, DWORD, LPDWORD, LPOVERLAPPED] |
| 115 | |
| 116 | CloseHandle = _stdcall_libraries['kernel32'].CloseHandle |
| 117 | CloseHandle.restype = BOOL |
| 118 | CloseHandle.argtypes = [HANDLE] |
| 119 | |
| 120 | ClearCommBreak = _stdcall_libraries['kernel32'].ClearCommBreak |
| 121 | ClearCommBreak.restype = BOOL |
| 122 | ClearCommBreak.argtypes = [HANDLE] |
| 123 | |
| 124 | LPCOMSTAT = POINTER(_COMSTAT) |
| 125 | |
| 126 | ClearCommError = _stdcall_libraries['kernel32'].ClearCommError |
| 127 | ClearCommError.restype = BOOL |
| 128 | ClearCommError.argtypes = [HANDLE, LPDWORD, LPCOMSTAT] |
| 129 | |
| 130 | SetupComm = _stdcall_libraries['kernel32'].SetupComm |
| 131 | SetupComm.restype = BOOL |
| 132 | SetupComm.argtypes = [HANDLE, DWORD, DWORD] |
| 133 | |
| 134 | EscapeCommFunction = _stdcall_libraries['kernel32'].EscapeCommFunction |
| 135 | EscapeCommFunction.restype = BOOL |
| 136 | EscapeCommFunction.argtypes = [HANDLE, DWORD] |
| 137 | |
| 138 | GetCommModemStatus = _stdcall_libraries['kernel32'].GetCommModemStatus |
| 139 | GetCommModemStatus.restype = BOOL |
| 140 | GetCommModemStatus.argtypes = [HANDLE, LPDWORD] |
| 141 | |
| 142 | LPDCB = POINTER(_DCB) |
| 143 | |
| 144 | GetCommState = _stdcall_libraries['kernel32'].GetCommState |
| 145 | GetCommState.restype = BOOL |
| 146 | GetCommState.argtypes = [HANDLE, LPDCB] |
| 147 | |
| 148 | LPCOMMTIMEOUTS = POINTER(_COMMTIMEOUTS) |
| 149 | |
| 150 | GetCommTimeouts = _stdcall_libraries['kernel32'].GetCommTimeouts |
| 151 | GetCommTimeouts.restype = BOOL |
| 152 | GetCommTimeouts.argtypes = [HANDLE, LPCOMMTIMEOUTS] |
| 153 | |
| 154 | PurgeComm = _stdcall_libraries['kernel32'].PurgeComm |
| 155 | PurgeComm.restype = BOOL |
| 156 | PurgeComm.argtypes = [HANDLE, DWORD] |
| 157 | |
| 158 | SetCommBreak = _stdcall_libraries['kernel32'].SetCommBreak |
| 159 | SetCommBreak.restype = BOOL |
| 160 | SetCommBreak.argtypes = [HANDLE] |
| 161 | |
| 162 | SetCommMask = _stdcall_libraries['kernel32'].SetCommMask |
| 163 | SetCommMask.restype = BOOL |
| 164 | SetCommMask.argtypes = [HANDLE, DWORD] |
| 165 | |
| 166 | SetCommState = _stdcall_libraries['kernel32'].SetCommState |
| 167 | SetCommState.restype = BOOL |
| 168 | SetCommState.argtypes = [HANDLE, LPDCB] |
| 169 | |
| 170 | SetCommTimeouts = _stdcall_libraries['kernel32'].SetCommTimeouts |
| 171 | SetCommTimeouts.restype = BOOL |
| 172 | SetCommTimeouts.argtypes = [HANDLE, LPCOMMTIMEOUTS] |
| 173 | |
cliechti | e37b6a8 | 2009-07-24 12:19:50 +0000 | [diff] [blame] | 174 | WaitForSingleObject = _stdcall_libraries['kernel32'].WaitForSingleObject |
| 175 | WaitForSingleObject.restype = DWORD |
| 176 | WaitForSingleObject.argtypes = [HANDLE, DWORD] |
| 177 | |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 178 | ONESTOPBIT = 0 # Variable c_int |
| 179 | TWOSTOPBITS = 2 # Variable c_int |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 180 | ONE5STOPBITS = 1 |
| 181 | |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 182 | NOPARITY = 0 # Variable c_int |
| 183 | ODDPARITY = 1 # Variable c_int |
| 184 | EVENPARITY = 2 # Variable c_int |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 185 | MARKPARITY = 3 |
| 186 | SPACEPARITY = 4 |
| 187 | |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 188 | RTS_CONTROL_HANDSHAKE = 2 # Variable c_int |
| 189 | RTS_CONTROL_DISABLE = 0 # Variable c_int |
| 190 | RTS_CONTROL_ENABLE = 1 # Variable c_int |
| 191 | RTS_CONTROL_TOGGLE = 3 # Variable c_int |
cliechti | e37b6a8 | 2009-07-24 12:19:50 +0000 | [diff] [blame] | 192 | SETRTS = 3 |
| 193 | CLRRTS = 4 |
| 194 | |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 195 | DTR_CONTROL_HANDSHAKE = 2 # Variable c_int |
| 196 | DTR_CONTROL_DISABLE = 0 # Variable c_int |
| 197 | DTR_CONTROL_ENABLE = 1 # Variable c_int |
cliechti | e37b6a8 | 2009-07-24 12:19:50 +0000 | [diff] [blame] | 198 | SETDTR = 5 |
| 199 | CLRDTR = 6 |
| 200 | |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 201 | MS_DSR_ON = 32 # Variable c_ulong |
| 202 | EV_RING = 256 # Variable c_int |
| 203 | EV_PERR = 512 # Variable c_int |
| 204 | EV_ERR = 128 # Variable c_int |
| 205 | SETXOFF = 1 # Variable c_int |
| 206 | EV_RXCHAR = 1 # Variable c_int |
| 207 | GENERIC_WRITE = 1073741824 # Variable c_long |
| 208 | PURGE_TXCLEAR = 4 # Variable c_int |
| 209 | FILE_FLAG_OVERLAPPED = 1073741824 # Variable c_int |
| 210 | EV_DSR = 16 # Variable c_int |
| 211 | MAXDWORD = 4294967295 # Variable c_uint |
| 212 | EV_RLSD = 32 # Variable c_int |
| 213 | ERROR_IO_PENDING = 997 # Variable c_long |
| 214 | MS_CTS_ON = 16 # Variable c_ulong |
| 215 | EV_EVENT1 = 2048 # Variable c_int |
| 216 | EV_RX80FULL = 1024 # Variable c_int |
| 217 | PURGE_RXABORT = 2 # Variable c_int |
| 218 | FILE_ATTRIBUTE_NORMAL = 128 # Variable c_int |
| 219 | PURGE_TXABORT = 1 # Variable c_int |
| 220 | SETXON = 2 # Variable c_int |
| 221 | OPEN_EXISTING = 3 # Variable c_int |
| 222 | MS_RING_ON = 64 # Variable c_ulong |
| 223 | EV_TXEMPTY = 4 # Variable c_int |
| 224 | EV_RXFLAG = 2 # Variable c_int |
| 225 | MS_RLSD_ON = 128 # Variable c_ulong |
| 226 | GENERIC_READ = 2147483648 # Variable c_ulong |
| 227 | EV_EVENT2 = 4096 # Variable c_int |
| 228 | EV_CTS = 8 # Variable c_int |
| 229 | EV_BREAK = 64 # Variable c_int |
| 230 | PURGE_RXCLEAR = 8 # Variable c_int |
Chris Liechti | 68340d7 | 2015-08-03 14:15:48 +0200 | [diff] [blame] | 231 | INFINITE = 0xFFFFFFFF |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 232 | |
cliechti | de43290 | 2011-08-18 22:51:41 +0000 | [diff] [blame] | 233 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 234 | class N11_OVERLAPPED4DOLLAR_48E(Union): |
| 235 | pass |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 236 | |
| 237 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 238 | class N11_OVERLAPPED4DOLLAR_484DOLLAR_49E(Structure): |
| 239 | pass |
Chris Liechti | 033f17c | 2015-08-30 21:28:04 +0200 | [diff] [blame^] | 240 | |
| 241 | |
cliechti | 183d4ae | 2009-07-23 22:03:51 +0000 | [diff] [blame] | 242 | N11_OVERLAPPED4DOLLAR_484DOLLAR_49E._fields_ = [ |
| 243 | ('Offset', DWORD), |
| 244 | ('OffsetHigh', DWORD), |
| 245 | ] |
| 246 | |
| 247 | PVOID = c_void_p |
| 248 | |
| 249 | N11_OVERLAPPED4DOLLAR_48E._anonymous_ = ['_0'] |
| 250 | N11_OVERLAPPED4DOLLAR_48E._fields_ = [ |
| 251 | ('_0', N11_OVERLAPPED4DOLLAR_484DOLLAR_49E), |
| 252 | ('Pointer', PVOID), |
| 253 | ] |
| 254 | _OVERLAPPED._anonymous_ = ['_0'] |
| 255 | _OVERLAPPED._fields_ = [ |
| 256 | ('Internal', ULONG_PTR), |
| 257 | ('InternalHigh', ULONG_PTR), |
| 258 | ('_0', N11_OVERLAPPED4DOLLAR_48E), |
| 259 | ('hEvent', HANDLE), |
| 260 | ] |
| 261 | _SECURITY_ATTRIBUTES._fields_ = [ |
| 262 | ('nLength', DWORD), |
| 263 | ('lpSecurityDescriptor', LPVOID), |
| 264 | ('bInheritHandle', BOOL), |
| 265 | ] |
| 266 | _COMSTAT._fields_ = [ |
| 267 | ('fCtsHold', DWORD, 1), |
| 268 | ('fDsrHold', DWORD, 1), |
| 269 | ('fRlsdHold', DWORD, 1), |
| 270 | ('fXoffHold', DWORD, 1), |
| 271 | ('fXoffSent', DWORD, 1), |
| 272 | ('fEof', DWORD, 1), |
| 273 | ('fTxim', DWORD, 1), |
| 274 | ('fReserved', DWORD, 25), |
| 275 | ('cbInQue', DWORD), |
| 276 | ('cbOutQue', DWORD), |
| 277 | ] |
| 278 | _DCB._fields_ = [ |
| 279 | ('DCBlength', DWORD), |
| 280 | ('BaudRate', DWORD), |
| 281 | ('fBinary', DWORD, 1), |
| 282 | ('fParity', DWORD, 1), |
| 283 | ('fOutxCtsFlow', DWORD, 1), |
| 284 | ('fOutxDsrFlow', DWORD, 1), |
| 285 | ('fDtrControl', DWORD, 2), |
| 286 | ('fDsrSensitivity', DWORD, 1), |
| 287 | ('fTXContinueOnXoff', DWORD, 1), |
| 288 | ('fOutX', DWORD, 1), |
| 289 | ('fInX', DWORD, 1), |
| 290 | ('fErrorChar', DWORD, 1), |
| 291 | ('fNull', DWORD, 1), |
| 292 | ('fRtsControl', DWORD, 2), |
| 293 | ('fAbortOnError', DWORD, 1), |
| 294 | ('fDummy2', DWORD, 17), |
| 295 | ('wReserved', WORD), |
| 296 | ('XonLim', WORD), |
| 297 | ('XoffLim', WORD), |
| 298 | ('ByteSize', BYTE), |
| 299 | ('Parity', BYTE), |
| 300 | ('StopBits', BYTE), |
| 301 | ('XonChar', c_char), |
| 302 | ('XoffChar', c_char), |
| 303 | ('ErrorChar', c_char), |
| 304 | ('EofChar', c_char), |
| 305 | ('EvtChar', c_char), |
| 306 | ('wReserved1', WORD), |
| 307 | ] |
| 308 | _COMMTIMEOUTS._fields_ = [ |
| 309 | ('ReadIntervalTimeout', DWORD), |
| 310 | ('ReadTotalTimeoutMultiplier', DWORD), |
| 311 | ('ReadTotalTimeoutConstant', DWORD), |
| 312 | ('WriteTotalTimeoutMultiplier', DWORD), |
| 313 | ('WriteTotalTimeoutConstant', DWORD), |
| 314 | ] |
| 315 | __all__ = ['GetLastError', 'MS_CTS_ON', 'FILE_ATTRIBUTE_NORMAL', |
| 316 | 'DTR_CONTROL_ENABLE', '_COMSTAT', 'MS_RLSD_ON', |
| 317 | 'GetOverlappedResult', 'SETXON', 'PURGE_TXABORT', |
| 318 | 'PurgeComm', 'N11_OVERLAPPED4DOLLAR_48E', 'EV_RING', |
| 319 | 'ONESTOPBIT', 'SETXOFF', 'PURGE_RXABORT', 'GetCommState', |
| 320 | 'RTS_CONTROL_ENABLE', '_DCB', 'CreateEvent', |
| 321 | '_COMMTIMEOUTS', '_SECURITY_ATTRIBUTES', 'EV_DSR', |
| 322 | 'EV_PERR', 'EV_RXFLAG', 'OPEN_EXISTING', 'DCB', |
| 323 | 'FILE_FLAG_OVERLAPPED', 'EV_CTS', 'SetupComm', |
| 324 | 'LPOVERLAPPED', 'EV_TXEMPTY', 'ClearCommBreak', |
| 325 | 'LPSECURITY_ATTRIBUTES', 'SetCommBreak', 'SetCommTimeouts', |
| 326 | 'COMMTIMEOUTS', 'ODDPARITY', 'EV_RLSD', |
| 327 | 'GetCommModemStatus', 'EV_EVENT2', 'PURGE_TXCLEAR', |
| 328 | 'EV_BREAK', 'EVENPARITY', 'LPCVOID', 'COMSTAT', 'ReadFile', |
| 329 | 'PVOID', '_OVERLAPPED', 'WriteFile', 'GetCommTimeouts', |
| 330 | 'ResetEvent', 'EV_RXCHAR', 'LPCOMSTAT', 'ClearCommError', |
| 331 | 'ERROR_IO_PENDING', 'EscapeCommFunction', 'GENERIC_READ', |
| 332 | 'RTS_CONTROL_HANDSHAKE', 'OVERLAPPED', |
| 333 | 'DTR_CONTROL_HANDSHAKE', 'PURGE_RXCLEAR', 'GENERIC_WRITE', |
| 334 | 'LPDCB', 'CreateEventW', 'SetCommMask', 'EV_EVENT1', |
| 335 | 'SetCommState', 'LPVOID', 'CreateFileW', 'LPDWORD', |
| 336 | 'EV_RX80FULL', 'TWOSTOPBITS', 'LPCOMMTIMEOUTS', 'MAXDWORD', |
| 337 | 'MS_DSR_ON', 'MS_RING_ON', |
| 338 | 'N11_OVERLAPPED4DOLLAR_484DOLLAR_49E', 'EV_ERR', |
| 339 | 'ULONG_PTR', 'CreateFile', 'NOPARITY', 'CloseHandle'] |