24#define WIN32_NO_STATUS
32#define FASTBAUD 115200
38#define LOOPBACK_TXD_RXD FALSE
39#define LOOPBACK_CTS_RTS FALSE
40#define LOOPBACK_DTR_DSR FALSE
41#define LOOPBACK_DTR_RING FALSE
42#define LOOPBACK_DTR_DCD FALSE
76 "baud=9600 parity=e data=5 stop=1 xon=on odsr=off octs=off dtr=on rts=on idsr=on",
78 { 0x00000000, 0x00002580, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
79 { 0xffffffff, 0x00002580, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x05, 0x02, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
80 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
81 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
84 "baud=0 parity=M data=6 stop=1.5 xon=off odsr=on octs=ON dtr=off rts=off idsr=OFF",
86 { 0x00000000, 0x00000000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
87 { 0xffffffff, 0x00000000, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x06, 0x03, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
88 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
89 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
92 "BAUD=4000000000 parity=n data=7 stop=2 to=off",
94 { 0x00000000, 0xee6b2800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x07, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
95 { 0xffffffff, 0xee6b2800, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x07, 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
96 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
97 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }
100 "Baud=115200 Parity=O Data=8 To=On",
102 { 0x00000000, 0x0001c200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
103 { 0xffffffff, 0x0001c200, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x08, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
104 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000EA60 },
105 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000EA60 }
108 "PaRiTy=s Data=7 DTR=on",
110 { 0x00000000, 0x00000000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
111 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x07, 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
112 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
113 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
118 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
119 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
120 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
121 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
126 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
127 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
128 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
129 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
134 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
135 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
136 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
137 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
142 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
143 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
144 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
145 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
150 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
151 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
152 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
153 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
158 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
159 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
160 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
161 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
166 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
167 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
168 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
169 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
174 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
175 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
176 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
177 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
182 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
183 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
184 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
185 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
190 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
191 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
192 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
193 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
198 { 0x00000000, 0x0000006e, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
199 { 0xffffffff, 0x0000006e, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x08, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
200 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
201 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
206 { 0x00000000, 0x0000012c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x05, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
207 { 0xffffffff, 0x0000012c, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x05, 0x02, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
208 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
209 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
214 { 0x00000000, 0x00000258, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x06, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
215 { 0xffffffff, 0x00000258, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x06, 0x03, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
216 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
217 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
222 { 0x00000000, 0x000004b0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
223 { 0xffffffff, 0x000004b0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x07, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
224 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
225 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
230 { 0x00000000, 0x00000960, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x08, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
231 { 0xffffffff, 0x00000960, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x08, 0x04, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
232 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
233 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
238 { 0x00000000, 0x000012c0, 0, 0, 1, 1, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
239 { 0xffffffff, 0x000012c0, 1, 1, 1, 1, 2, 1, 1, 0, 0, 1, 1, 2, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x08, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
240 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
241 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
246 { 0x00000000, 0x00002580, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
247 { 0xffffffff, 0x00002580, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x08, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
248 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
249 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
254 { 0x00000000, 0x00004b00, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
255 { 0xffffffff, 0x00004b00, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x07, 0x02, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
256 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
257 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
262 { 0x00000000, 0x00000000, 0, 0, 1, 1, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
263 { 0xffffffff, 0x00000000, 1, 1, 1, 1, 2, 1, 1, 0, 0, 1, 1, 2, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x07, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
264 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
265 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
268 "4000000000,O,7,1.5,X",
270 { 0x00000000, 0xee6b2800, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x07, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
271 { 0xffffffff, 0xee6b2800, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x07, 0x01, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
272 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
273 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
278 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
279 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
280 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
281 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
286 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
287 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
288 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
289 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
294 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
295 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
296 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
297 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
302 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
303 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
304 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
305 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
310 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
311 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
312 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
313 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
318 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
319 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
320 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
321 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
326 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
327 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
328 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
329 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
334 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
335 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
336 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
337 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
340 "COMx:baud=38400 data=8",
342 { 0x00000000, 0x00009600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
343 { 0xffffffff, 0x00009600, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x08, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
344 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
345 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
348 "COMx :to=on stop=1.5",
350 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
351 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
352 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000EA60 },
353 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000EA60 }
356 "COMx: baud=12345 data=7",
358 { 0x00000000, 0x00003039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
359 { 0xffffffff, 0x00003039, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x07, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
360 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
361 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
364 "COMx : xon=on odsr=off",
366 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
367 { 0xffffffff, 0xffffffff, 1, 1, 1, 0, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
368 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
369 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
374 { 0x00000000, 0x00000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
375 { 0xffffffff, 0xffffffff, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
376 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
377 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
382 { 0x00000000, 0x00002580, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
383 { 0xffffffff, 0x00002580, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x08, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
384 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
385 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
390 { 0x00000000, 0x0000006e, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x07, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
391 { 0xffffffff, 0x0000006e, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x07, 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
392 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
393 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
398 { 0x00000000, 0x00004b00, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x05, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
399 { 0xffffffff, 0x00004b00, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x05, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
400 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
401 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
404 "COMx : 57600,S,6,2,x",
406 { 0x00000000, 0x0000e100, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0x00000, 0x0000, 0x0000, 0x0000, 0x06, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 },
407 { 0xffffffff, 0x0000e100, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0x1ffff, 0xffff, 0xffff, 0xffff, 0x06, 0x04, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffff },
408 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
409 { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
453 ok(LastError == CorrectError,
"%s(\"%s\"), 0x%02x: GetLastError() returned %ld, should be %ld\n", function, ptest->
string, initial_value, LastError, CorrectError);
454 ok(
result == ptest->
result,
"%s(\"%s\"), 0x%02x: return value should be %s\n", function, ptest->
string, initial_value, ptest->
result ?
"TRUE" :
"FALSE");
457#define check_dcb_member(a,b) ok(pdcb1->a == pdcb2->a, "%s(\"%s\"), 0x%02x: "#a" is "b", should be "b"\n", function, ptest->string, initial_value, pdcb1->a, pdcb2->a)
458#define check_dcb_member2(a,c,b) if(pdcb2->a == c) { check_dcb_member(a,b); } else { ok(pdcb1->a == pdcb2->a || pdcb1->a == c, "%s(\"%s\"), 0x%02x: "#a" is "b", should be "b" or "b"\n", function, ptest->string, initial_value, pdcb1->a, pdcb2->a, c); }
460static void check_dcb(
const char *function,
const TEST *ptest,
int initial_value,
const DCB *pdcb1,
const DCB *pdcb2)
530#define check_timeouts_member(a) ok(ptimeouts1->a == ptimeouts2->a, "%s(\"%s\"), 0x%02x: "#a" is %lu, should be %lu\n", function, ptest->string, initial_value, ptimeouts1->a, ptimeouts2->a);
547 memset(&dcb, initial_value,
sizeof(
DCB));
554 check_dcb(
"BuildCommDCBA", ptest, initial_value, &dcb, pexpected_dcb);
564 memset(&dcb, initial_value,
sizeof(
DCB));
572 check_dcb(
"BuildCommDCBAndTimeoutsA", ptest, initial_value, &dcb, pexpected_dcb);
581 static int reportedDCBW = 0;
586 memset(&dcb, initial_value,
sizeof(
DCB));
594 win_skip(
"BuildCommDCBW is not implemented\n");
600 check_dcb(
"BuildCommDCBW", ptest, initial_value, &dcb, pexpected_dcb);
609 static int reportedDCBAndTW = 0;
614 memset(&dcb, initial_value,
sizeof(
DCB));
622 if(!reportedDCBAndTW++)
623 win_skip(
"BuildCommDCBAndTimeoutsW is not implemented\n");
629 check_dcb(
"BuildCommDCBAndTimeoutsW", ptest, initial_value, &dcb, pexpected_dcb);
635 char port_name[] =
"COMx";
642 for(port_name[3] =
'1'; port_name[3] <=
'9'; port_name[3]++)
655 trace(
"Could not find a valid COM port. Some tests will be skipped.\n");
690 char port_name[] =
"COMx";
696 for(port_name[3] =
'1'; port_name[3] <=
'9'; port_name[3]++)
706 trace(
"Could not find a valid COM port.\n");
708 trace(
"Found Com port %s. Connected devices may disturb results\n", port_name);
719 trace(
"%s doesn't respond, skipping the test\n", port_name);
721 trace(
"%s is not a real serial port, skipping the test\n", port_name);
727 ok(comstat.
cbInQue == 0,
"Unexpected %ld chars in InQueue\n",comstat.
cbInQue);
728 ok(comstat.
cbOutQue == 0,
"Still pending %ld characters in OutQueue\n", comstat.
cbOutQue);
729 ok(errors == 0,
"Unexpected errors 0x%08lx\n", errors);
739 trace(
"GetCommModemStatus returned 0x%08lx->%s%s%s%s\n", ModemStat,
779 ok(
res ==
TRUE,
"A timed-out read should return TRUE\n");
780 ok( LastError == 0xdeadbeef,
"err=%ld\n", LastError);
783 "Unexpected TimeOut %ld, expected %d\n", timediff,
TIMEOUT);
793 char tbuf[]=
"test_waittxempty";
831 ok(!
res,
"WriteFile on an overlapped handle without ovl structure should fail\n");
844 ok(
after -
before < 30,
"WriteFile took %ld ms to write %ld Bytes at %ld Baud\n",
864 ok(
bytes ==
sizeof(evtmask),
"expected %u, written %lu\n", (
UINT)
sizeof(evtmask),
bytes);
870 trace(
"recovering after WAIT_TIMEOUT...\n");
881 ok(evtmask &
EV_TXEMPTY,
"WaitCommEvent: expected EV_TXEMPTY, got %#lx\n", evtmask);
885 trace(
"WaitCommEvent for EV_TXEMPTY took %ld ms (timeout 1500)\n", timediff);
886 ok(timediff < 1200,
"WaitCommEvent used %ld ms for waiting\n", timediff);
892 ok(
bytes ==
sizeof(tbuf),
"expected %u, written %lu\n", (
UINT)
sizeof(tbuf),
bytes);
897 for (
i = 0;
i < 2;
i++)
917 ok(
stat.cbInQue == 0,
"InQueue should be empty, got %ld bytes\n",
stat.cbInQue);
918 ok(
stat.cbOutQue != 0 ||
broken(
stat.cbOutQue == 0) ,
"OutQueue should not be empty\n");
919 ok(errors == 0,
"ClearCommErrors: Unexpected error 0x%08lx\n", errors);
923 ok(
bytes ==
sizeof(tbuf),
"expected %u, written %lu\n", (
UINT)
sizeof(tbuf),
bytes);
931 ok(
stat.cbInQue == 0,
"InQueue should be empty, got %ld bytes\n",
stat.cbInQue);
932 ok(
stat.cbOutQue == 0,
"OutQueue should be empty, got %ld bytes\n",
stat.cbOutQue);
933 ok(errors == 0,
"ClearCommErrors: Unexpected error 0x%08lx\n", errors);
953 ok(
bytes ==
sizeof(evtmask),
"expected %u, written %lu\n", (
UINT)
sizeof(evtmask),
bytes);
955 ok(evtmask &
EV_TXEMPTY,
"WaitCommEvent: expected EV_TXEMPTY, got %#lx\n", evtmask);
959 ok(!evtmask,
"WaitCommEvent: expected 0, got %#lx\n", evtmask);
966 ok(!
res,
"WaitCommEvent should fail if there is a pending wait\n");
971 trace(
"recovering after WAIT_TIMEOUT...\n");
995 ok(lpStat.
cbInQue == 0,
"Unexpected %ld chars in InQueue\n", lpStat.
cbInQue);
997 ok(errors == 0,
"ClearCommErrors: Unexpected error 0x%08lx\n", errors);
1013 ok(!
SetCommState(hcom, &dcb),
"SetCommState should have failed\n");
1015 ok(!(
err &
CE_MODE),
"ClearCommError shouldn't set CE_MODE byte in this case (%lx)\n",
err);
1028 char tbuf[]=
"test_LoopbackRead";
1035 trace(
"Starting test_LoopbackRead\n");
1052 ok(
WriteFile(hcom,tbuf,
sizeof(tbuf),&written,
NULL),
"WriteFile failed\n");
1054 ok(written ==
sizeof(tbuf),
"WriteFile %ld bytes written\n", written);
1061 "WaitCommEvent: Unexpected EvtMask 0x%08lx, expected 0x%08x\n",
1063 trace(
"Write %ld ms WaitCommEvent EV_TXEMPTY %ld ms\n", diff,
before-
after);
1067 ok(
read ==
sizeof(tbuf),
"ReadFile read %ld bytes, expected \"%s\"\n",
read,rbuf);
1074 dcb.BaudRate = 9600;
1083 ok(
WriteFile(hcom,tbuf,
sizeof(tbuf),&written,
NULL),
"WriteFile failed\n");
1084 ok(written ==
sizeof(tbuf),
"WriteFile %ld bytes written\n", written);
1086 trace(
"WaitCommEventEV_RXCHAR\n");
1088 ok(evtmask ==
EV_RXCHAR,
"WaitCommEvent: Unexpected EvtMask 0x%08lx, expected 0x%08x\n",
1094 ok(
res,
"Readfile failed\n");
1095 ok(
read ==
sizeof(tbuf),
"ReadFile read %ld bytes\n",
read);
1097 trace(
"Readfile for %ld chars took %ld ms\n",
read, diff);
1099 "Timedout Wait took %ld ms, expected around %d\n", diff,
TIMEOUT);
1106 ok(
WriteFile(hcom,tbuf,
sizeof(tbuf),&written,
NULL),
"WriteFile failed\n");
1114 ok(
res,
"Readfile failed\n");
1118 while ((
read <
sizeof(tbuf)) && (
i <10));
1120 ok(
read ==
sizeof(tbuf),
"ReadFile read %ld bytes\n",
read);
1129 DWORD ModemStat = 0, defaultStat = 0;
1137 memset (&dcb, 0,
sizeof (dcb));
1141 trace(
"RTS_CONTROL_HANDSHAKE is set, so don't manipulate RTS\n");
1152 ok ((ModemStat &
MS_CTS_ON) == 0,
"CTS didn't react: 0x%04lx, expected 0x%04lx\n",
1156 ok (ModemStat == defaultStat,
"Failed to restore CTS: 0x%04lx, expected 0x%04lx\n",
1157 ModemStat, defaultStat);
1164 "CTS didn't react: 0x%04lx, expected 0x%04lx\n",
1168 ok (ModemStat == defaultStat,
"Failed to restore CTS: 0x%04lx, expected 0x%04lx\n",
1169 ModemStat, defaultStat);
1178 DWORD ModemStat = 0, defaultStat = 0;
1189 trace(
"DTR_CONTROL_HANDSHAKE is set, so don't manipulate DTR\n");
1200 ok ((ModemStat &
MS_RLSD_ON) == 0,
"RLSD didn't react: 0x%04lx, expected 0x%04lx\n",
1204 ok (ModemStat == defaultStat,
"Failed to restore RLSD: 0x%04lx, expected 0x%04lx\n",
1205 ModemStat, defaultStat);
1212 "RLSD didn't react: 0x%04lx, expected 0x%04lx\n",
1216 ok (ModemStat == defaultStat,
"Failed to restore RLSD: 0x%04lx, expected 0x%04lx\n",
1217 ModemStat, defaultStat);
1226 DWORD ModemStat = 0, defaultStat = 0;
1237 trace(
"DTR_CONTROL_HANDSHAKE is set, so don't manipulate DTR\n");
1248 ok ((ModemStat &
MS_DSR_ON) == 0,
"CTS didn't react: 0x%04lx, expected 0x%04lx\n",
1252 ok (ModemStat == defaultStat,
"Failed to restore DSR: 0x%04lx, expected 0x%04lx\n",
1253 ModemStat, defaultStat);
1260 "CTS didn't react: 0x%04lx,expected 0x%04lx\n",
1264 ok (ModemStat == defaultStat,
"Failed to restore DSR: 0x%04lx, expected 0x%04lx\n",
1265 ModemStat, defaultStat);
1274 DWORD ModemStat = 0, defaultStat = 0;
1285 trace(
"DTR_CONTROL_HANDSHAKE is set, so don't manipulate DTR\n");
1296 ok ((ModemStat &
MS_RING_ON) == 0,
"RING didn't react: 0x%04lx, expected 0x%04lx\n",
1300 ok (ModemStat == defaultStat,
"Failed to restore RING: 0x%04lx, expected 0x%04lx\n",
1301 ModemStat, defaultStat);
1308 "RING didn't react: 0x%04lx,expected 0x%04lx\n",
1312 ok (ModemStat == defaultStat,
"Failed to restore RING: 0x%04lx, expected 0x%04lx\n",
1313 ModemStat, defaultStat);
1329 HANDLE hcom, hComPortEvent, hComWriteEvent;
1331 DWORD err_wait, err_write, written, evtmask=0;
1340 ok(hComPortEvent != 0,
"CreateEvent failed\n");
1346 ZeroMemory( &overlapped_w,
sizeof(overlapped_w));
1347 overlapped_w.
hEvent = hComWriteEvent;
1353 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx\n", success_wait, err_wait, evtmask);
1354 ok(success_wait || err_wait ==
ERROR_IO_PENDING,
"overlapped WaitCommEvent failed\n");
1355 trace(
"overlapped WaitCommEvent returned.\n");
1357 success_write=
WriteFile(hcom,
"X", 1, &written, &overlapped_w);
1360 "overlapped WriteFile failed, err %ld\n",
1366 ok(success_write ==
WAIT_OBJECT_0,
"WaitForSingleObjectEx, res %ld, err %ld\n",
1367 success_write, err_write);
1373 trace(
"Write after Wait res 0x%08lx err %ld\n",success_write, err_write);
1374 ok(success_write && written ==1,
"Write after Wait res 0x%08lx err %ld\n",
1375 success_write, err_write);
1380 ok(success_wait ==
WAIT_OBJECT_0,
"wait hComPortEvent, res 0x%08lx, err %ld\n",
1381 success_wait, err_wait);
1386 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n",
1389 ok(evtmask &
EV_RXCHAR,
"Detect EV_RXCHAR: 0x%08lx, expected 0x%08x\n",
1393 "Unexpected time %ld, expected around %d\n", diff,
TIMEOUT>>1);
1410 trace(
"toggle_ctlLine timeout %ld ctl 0x%08lx handle %p\n",
timeout, ctl, hcom );
1413 trace(
"toggle_ctline done\n");
1416 trace(
"toggle_ctline WaitForSingleObjectEx res 0x%08lx err %ld\n",
1429 HANDLE hcom, hComPortEvent, alarmThread;
1444 trace(
"RTS_CONTROL_HANDSHAKE is set, so don't manipulate DTR\n");
1456 trace(
"test_WaitCts timeout %Id clt 0x%08Ix handle %p\n",
args[0],
args[1], hcom);
1460 ok(hComPortEvent != 0,
"CreateEvent failed\n");
1465 trace(
"Thread created\n");
1466 ok(alarmThread !=0 ,
"CreateThread Failed\n");
1475 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx\n",
success,
err, evtmask);
1477 trace(
"overlapped WaitCommEvent returned.\n");
1480 "WaitCts hComPortEvent failed\n");
1484 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n",
1487 ok(evtmask &
EV_CTS,
"Failed to detect EV_CTS: 0x%08lx, expected 0x%08x\n",
1491 ok((evtmask &
MS_CTS_ON) == 0,
"CTS didn't change state!\n");
1493 ok((evtmask &
MS_CTS_ON),
"CTS didn't change state!\n");
1497 "Unexpected time %ld, expected around %d\n", diff,
TIMEOUT>>1);
1519 trace(
" Changing CommMask on the fly for handle %p after timeout %ld\n",
1523 trace(
"SetCommMask changed\n");
1535 HANDLE hcom, hComPortEvent, alarmThread;
1545 trace(
"RTS_CONTROL_HANDSHAKE is set, so don't manipulate DTR\n");
1552 trace(
"test_AbortWaitCts timeout %Id handle %p\n",
args[0], hcom);
1556 ok(hComPortEvent != 0,
"CreateEvent failed\n");
1560 trace(
"Thread created\n");
1561 ok(alarmThread !=0 ,
"CreateThread Failed\n");
1570 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx\n",
success,
err, evtmask);
1572 trace(
"overlapped WaitCommEvent returned.\n");
1575 "AbortWaitCts hComPortEvent failed\n");
1579 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n",
1582 ok(evtmask == 0,
"Incorrect EventMask 0x%08lx returned on Wait aborted bu SetCommMask, expected 0x%08x\n",
1587 "Unexpected time %ld, expected around %d\n", diff,
TIMEOUT>>1);
1602 HANDLE hcom, hComPortEvent, alarmThread;
1614 trace(
"DTR_CONTROL_HANDSHAKE is set, so don't manipulate DTR\n");
1626 trace(
"test_WaitDsr timeout %Id clt 0x%08Ix handle %p\n",
args[0],
args[1], hcom);
1630 ok(hComPortEvent != 0,
"CreateEvent failed\n");
1632 ok(alarmThread !=0 ,
"CreateThread Failed\n");
1641 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx\n",
success,
err, evtmask);
1643 trace(
"overlapped WaitCommEvent returned.\n");
1646 "wait hComPortEvent failed\n");
1650 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n",
1653 ok(evtmask &
EV_DSR,
"Failed to detect EV_DSR: 0x%08lx, expected 0x%08x\n",
1657 ok((evtmask &
MS_DSR_ON) == 0,
"DTR didn't change state!\n");
1659 ok((evtmask &
MS_DSR_ON),
"DTR didn't change state!\n");
1663 "Unexpected time %ld, expected around %d\n", diff,
TIMEOUT>>1);
1684 HANDLE hcom, hComPortEvent, alarmThread;
1697 trace(
"DTR_CONTROL_HANDSHAKE is set, so don't manipulate DTR\n");
1704 skip(
"modem status failed -> skip.\n");
1714 trace(
"test_WaitRing timeout %Id clt 0x%08Ix handle %p\n",
args[0],
args[1], hcom);
1718 ok(hComPortEvent != 0,
"CreateEvent failed\n");
1720 ok(alarmThread !=0 ,
"CreateThread Failed\n");
1729 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx\n",
success,
err, evtmask);
1731 trace(
"overlapped WaitCommEvent returned.\n");
1734 "wait hComPortEvent failed\n");
1738 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n",
1741 ok(evtmask &
EV_RING,
"Failed to detect EV_RING: 0x%08lx, expected 0x%08x\n",
1745 ok((evtmask &
MS_RING_ON) == 0,
"DTR didn't change state!\n");
1747 ok((evtmask &
MS_RING_ON),
"DTR didn't change state!\n");
1751 "Unexpected time %ld, expected around %d\n", diff,
TIMEOUT>>1);
1771 HANDLE hcom, hComPortEvent, alarmThread;
1783 trace(
"DTR_CONTROL_HANDSHAKE is set, so don't manipulate DTR\n");
1795 trace(
"test_WaitDcd timeout %Id clt 0x%08Ix handle %p\n",
args[0],
args[1], hcom);
1799 ok(hComPortEvent != 0,
"CreateEvent failed\n");
1801 ok(alarmThread !=0 ,
"CreateThread Failed\n");
1810 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx\n",
success,
err, evtmask);
1812 trace(
"overlapped WaitCommEvent returned.\n");
1815 "wait hComPortEvent failed\n");
1819 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n",
1822 ok(evtmask &
EV_RLSD,
"Failed to detect EV_RLSD: 0x%08lx, expected 0x%08x\n",
1826 ok((evtmask &
MS_RLSD_ON) == 0,
"DTR didn't change state!\n");
1828 ok((evtmask &
MS_RLSD_ON),
"DTR didn't change state!\n");
1832 "Unexpected time %ld, expected around %d\n", diff,
TIMEOUT>>1);
1854 trace(
"SetCommBreak for handle %p after timeout %ld\n",
1858 trace(
"SetCommBreak done\n");
1869 HANDLE hcom, hComPortEvent, alarmThread;
1880 ok(hComPortEvent != 0,
"CreateEvent failed\n");
1882 trace(
"test_WaitBreak\n");
1888 trace(
"Thread created\n");
1889 ok(alarmThread !=0 ,
"CreateThread Failed\n");
1898 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx\n",
success,
err, evtmask);
1900 trace(
"overlapped WaitCommEvent returned.\n");
1910 trace(
"Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n",
1913 ok(evtmask &
EV_BREAK,
"Failed to detect EV_BREAK: 0x%08lx, expected 0x%08x\n",
1919 "Unexpected time %ld, expected around %d\n", diff,
TIMEOUT>>1);
1956 trace(
"waiting 10 secs for com port events (turn on/off the device)...\n");
1957 last_event_time = 0;
1972 last_event_time =
after;
1975 ok(
bytes ==
sizeof(evtmask),
"expected %u, written %lu\n", (
UINT)
sizeof(evtmask),
bytes);
1976 trace(
"WaitCommEvent: got events %#lx\n", evtmask);
1982 if (last_event_time ||
after -
before >= 10000)
goto done;
2010 ok(
stat.cbInQue == 0,
"expected 0, got %ld bytes in InQueue\n",
stat.cbInQue);
2011 ok(
stat.cbOutQue == 0,
"expected 0, got %ld bytes in OutQueue\n",
stat.cbOutQue);
2012 ok(errors == 0,
"expected errors 0, got %#lx\n", errors);
2019 static const char atz[]=
"ATZ\r\n";
2030 if (!pNtReadFile || !pNtWriteFile)
2032 win_skip(
"not running on NT, skipping test\n");
2041 dcb.BaudRate = 9600;
2061 ok(!
ret,
"WriteFile should fail\n");
2072 for (
i = -20;
i < 20;
i++)
2078 if (
i >= 0 ||
i == -1)
2104 skip(
"Probably modem is not connected.\n");
2119 trace(
"waiting 3 secs for modem response...\n");
2120 last_event_time = 0;
2135 trace(
"got modem response.\n");
2137 last_event_time =
after;
2140 ok(
bytes ==
sizeof(evtmask),
"expected sizeof(evtmask), got %lu\n",
bytes);
2141 ok(evtmask &
EV_RXCHAR,
"EV_RXCHAR should be set\n");
2146 ok(!
ret,
"ReadFile should fail\n");
2157 for (
i = -20;
i < 20;
i++)
2188 if (last_event_time ||
after -
before >= 3000)
goto done;
2230 skip(
"interactive tests (set WINETEST_INTERACTIVE=1)\n");
static unsigned char bytes[4]
struct timeout * timeouts
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
#define ERROR_INVALID_FUNCTION
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define ReadFile(a, b, c, d, e)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define ERROR_INVALID_HANDLE
#define MultiByteToWideChar
BOOL WINAPI FlushFileBuffers(IN HANDLE hFile)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
BOOL WINAPI GetDefaultCommConfigA(LPCSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize)
BOOL WINAPI BuildCommDCBAndTimeoutsW(LPCWSTR devid, LPDCB lpdcb, LPCOMMTIMEOUTS lptimeouts)
BOOL WINAPI SetCommBreak(HANDLE handle)
BOOL WINAPI SetCommTimeouts(HANDLE hComm, LPCOMMTIMEOUTS lptimeouts)
BOOL WINAPI SetupComm(HANDLE handle, DWORD insize, DWORD outsize)
BOOL WINAPI SetCommMask(HANDLE handle, DWORD evtmask)
BOOL WINAPI SetCommState(HANDLE handle, LPDCB lpdcb)
BOOL WINAPI GetCommState(HANDLE handle, LPDCB lpdcb)
BOOL WINAPI BuildCommDCBA(LPCSTR device, LPDCB lpdcb)
BOOL WINAPI BuildCommDCBW(LPCWSTR devid, LPDCB lpdcb)
BOOL WINAPI GetCommModemStatus(HANDLE hFile, LPDWORD lpModemStat)
BOOL WINAPI BuildCommDCBAndTimeoutsA(LPCSTR device, LPDCB lpdcb, LPCOMMTIMEOUTS lptimeouts)
BOOL WINAPI EscapeCommFunction(HANDLE handle, DWORD func)
BOOL WINAPI ClearCommBreak(HANDLE handle)
BOOL WINAPI WaitCommEvent(HANDLE hFile, LPDWORD lpdwEvents, LPOVERLAPPED lpOverlapped)
BOOL WINAPI ClearCommError(HANDLE handle, LPDWORD errors, LPCOMSTAT lpStat)
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
_ACRTIMP char *__cdecl strstr(const char *, const char *)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
BOOL WINAPI GetOverlappedResult(IN HANDLE hFile, IN LPOVERLAPPED lpOverlapped, OUT LPDWORD lpNumberOfBytesTransferred, IN BOOL bWait)
#define FILE_FLAG_OVERLAPPED
static HANDLE PIO_APC_ROUTINE void PIO_STATUS_BLOCK void ULONG PLARGE_INTEGER PULONG key
static void test_BuildCommDCBAndTimeoutsA(const char *string, const TEST *ptest, int initial_value, const DCB *pexpected_dcb, const COMMTIMEOUTS *pexpected_timeouts)
static void test_stdio(void)
static void test_WaitCts(void)
static HANDLE PIO_APC_ROUTINE void PIO_STATUS_BLOCK io_status
static BOOL loopback_dtr_dsr
static HANDLE test_OpenComm(BOOL doOverlap)
#define LOOPBACK_DTR_RING
static void test_ReadTimeOut(void)
static void test_LoopbackDtrRing(void)
static void test_waittxempty(void)
static void test_BuildCommDCBW(const char *string, const TEST *ptest, int initial_value, const DCB *pexpected_dcb)
static DWORD CALLBACK toggle_ctlLine(LPVOID arg)
static DWORD CALLBACK reset_CommMask(LPVOID arg)
static HANDLE PIO_APC_ROUTINE void * apc_user
static void test_WaitBreak(void)
static DWORD CALLBACK set_CommBreak(LPVOID arg)
static void test_BuildCommDCB(void)
static void check_timeouts(const char *function, const TEST *ptest, int initial_value, const COMMTIMEOUTS *ptimeouts1, const COMMTIMEOUTS *ptimeouts2)
static BOOL loopback_dtr_dcd
static void test_BuildCommDCBAndTimeoutsW(const char *string, const TEST *ptest, int initial_value, const DCB *pexpected_dcb, const COMMTIMEOUTS *pexpected_timeouts)
static void test_BuildCommDCBA(const char *string, const TEST *ptest, int initial_value, const DCB *pexpected_dcb)
#define check_timeouts_member(a)
static BOOL loopback_rts_cts
static HANDLE PIO_APC_ROUTINE void PIO_STATUS_BLOCK void ULONG PLARGE_INTEGER offset
static HANDLE PIO_APC_ROUTINE apc
static void test_GetModemStatus(HANDLE hcom)
#define check_dcb_member(a, b)
static void test_WaitRing(void)
static void test_LoopbackRead(void)
static void test_LoopbackDtrDsr(void)
static void test_LoopbackCtsRts(void)
static void test_FlushFileBuffers(void)
#define check_dcb_member2(a, c, b)
static void test_WaitRx(void)
static void check_dcb(const char *function, const TEST *ptest, int initial_value, const DCB *pdcb1, const DCB *pdcb2)
static void check_result(const char *function, const TEST *ptest, int initial_value, BOOL result)
static void test_WaitDsr(void)
static void test_WaitDcd(void)
static void test_AbortWaitCts(void)
static HANDLE PIO_APC_ROUTINE void PIO_STATUS_BLOCK void * buffer
static BOOL loopback_txd_rxd
static void test_non_pending_errors(void)
static void test_read_write(void)
static BOOL loopback_dtr_ring
static HANDLE PIO_APC_ROUTINE void PIO_STATUS_BLOCK void ULONG length
static void test_ClearCommError(void)
static void test_WaitCommEvent(void)
static void test_LoopbackDtrDcd(void)
VOID(* PIO_APC_ROUTINE)(IN PVOID ApcContext, IN PIO_STATUS_BLOCK IoStatusBlock, IN ULONG Reserved)
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED * overlapped
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
DWORD WINAPI WaitForSingleObjectEx(IN HANDLE hHandle, IN DWORD dwMilliseconds, IN BOOL bAlertable)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
__inline int before(__u32 seq1, __u32 seq2)
__inline int after(__u32 seq1, __u32 seq2)
#define STATUS_INVALID_PARAMETER
#define success(from, fromstr, to, tostr)
struct _COMM_CONFIG COMMCONFIG
#define RTS_CONTROL_ENABLE
#define DTR_CONTROL_HANDSHAKE
DWORD WINAPI GetLastError(void)
#define RTS_CONTROL_HANDSHAKE
#define DTR_CONTROL_DISABLE
#define RTS_CONTROL_DISABLE
#define DTR_CONTROL_ENABLE
_IRQL_requires_same_ _In_ CLONG ByteSize