- Timestamp:
- Dec 31, 2012, 1:34:36 PM (13 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/HandleManager.cpp
r22051 r22055 1114 1114 pHMHandleData->lpHandlerData = NULL; 1115 1115 1116 1117 DWORD type = OSLibDosQueryHType(handle); 1116 DWORD type = OSLibDosQueryHType(handle, NULL); 1118 1117 switch (type & 0x7) 1119 1118 { -
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, -
trunk/src/kernel32/oslibdos.cpp
r22051 r22055 3485 3485 //****************************************************************************** 3486 3486 //****************************************************************************** 3487 DWORD OSLibDosQueryHType(ULONG handle )3487 DWORD OSLibDosQueryHType(ULONG handle, PULONG pAttr) 3488 3488 { 3489 3489 ULONG type, attr; 3490 APIRET rc = DosQueryHType(handle, &type, &attr);3490 APIRET rc = DosQueryHType(handle, &type, pAttr ? pAttr : &attr); 3491 3491 if (rc != NO_ERROR) { 3492 3492 dprintf(("DosQueryHType error: return code = %u\n", rc)); -
trunk/src/kernel32/oslibdos.h
r22051 r22055 363 363 DWORD OSLibDosGetNumPhysDrives(); 364 364 365 DWORD OSLibDosQueryHType(ULONG handle );365 DWORD OSLibDosQueryHType(ULONG handle, PULONG pAttr); 366 366 367 367 #ifdef __cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.