Changeset 22055 for trunk/src/kernel32/console.cpp
- Timestamp:
- Dec 31, 2012, 1:34:36 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/console.cpp
r22051 r22055 455 455 rc)); 456 456 457 ULONG type = 0, attr = 0; 458 459 // Below, to distinguish console from other character devices (e.g. NUL) 460 // we use the undocumented device attr field of DosQueryHType(). For CON 461 // it returns 0x8083 here, for NUL -- 0x8084. We need to distinguish because 462 // we only use the console classes if the handle is a real console. 463 457 464 /*********************************************************************** 458 465 * initialize stdin handle * 459 466 ***********************************************************************/ 460 hStandardIn = GetStdHandle(STD_INPUT_HANDLE); 461 dwType = GetFileType(hStandardIn); 462 if (dwType == FILE_TYPE_CHAR) { /* is handle not redirected ? */ 467 if (DosQueryHType(0, &type, &attr) == 0 && type == 1 && (attr & 0xF) == 0x03) { 463 468 hStandardIn = HMCreateFile("CONIN$", 464 469 GENERIC_READ | GENERIC_WRITE, … … 475 480 * initialize stdout handle * 476 481 ***********************************************************************/ 477 hStandardOut = GetStdHandle(STD_OUTPUT_HANDLE); 478 dwType = GetFileType(hStandardOut); 479 if (dwType == FILE_TYPE_CHAR) { /* is handle redirected ? */ 482 if (DosQueryHType(1, &type, &attr) == 0 && type == 1 && (attr & 0xF) == 0x03) { 480 483 hStandardOut = HMCreateFile("CONOUT$", 481 484 GENERIC_READ | GENERIC_WRITE, … … 492 495 * initialize stderr handle * 493 496 ***********************************************************************/ 494 hStandardError = GetStdHandle(STD_ERROR_HANDLE); 495 dwType = GetFileType(hStandardError); 496 if (dwType == FILE_TYPE_CHAR) { /* is handle redirected ? */ 497 if (DosQueryHType(2, &type, &attr) == 0 && type == 1 && (attr & 0xF) == 0x03) { 497 498 hStandardError = HMCreateFile("CONOUT$", 498 499 GENERIC_READ | GENERIC_WRITE,
Note:
See TracChangeset
for help on using the changeset viewer.