221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
-
+
|
int tcharsize = sizeof(TCHAR);
/*
* If user types a Ctrl-Break or Ctrl-C, ReadConsole will return
* success with ntchars == 0 and GetLastError() will be
* ERROR_OPERATION_ABORTED. We do not want to treat this case
* as EOF so we will loop around again. If no Ctrl signal handlers
* have been established, the default signal OS handler in a separate
* have been established, the default signal OS handler in a separate
* thread will terminate the program. If a Ctrl signal handler
* has been established (through an extension for example), it
* will run and take whatever action it deems appropriate.
*/
do {
result = ReadConsole(hConsole, lpBuffer, nbytes / tcharsize, &ntchars,
NULL);
|