[CMD][HELP]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 28 Feb 2014 23:55:40 +0000 (23:55 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 28 Feb 2014 23:55:40 +0000 (23:55 +0000)
Fix the IsConsoleHandle helper.

svn path=/trunk/; revision=62362

reactos/base/applications/cmdutils/help/help.c
reactos/base/shell/cmd/console.c

index 69af5eb..2a2b67c 100644 (file)
@@ -25,7 +25,8 @@ BOOL IsConsoleHandle(HANDLE hHandle)
     DWORD dwMode;
 
     /* Check whether the handle may be that of a console... */
     DWORD dwMode;
 
     /* Check whether the handle may be that of a console... */
-    if ((GetFileType(hHandle) & FILE_TYPE_CHAR) == 0) return FALSE;
+    if ((GetFileType(hHandle) & ~FILE_TYPE_REMOTE) != FILE_TYPE_CHAR)
+        return FALSE;
 
     /*
      * It may be. Perform another test... The idea comes from the
 
     /*
      * It may be. Perform another test... The idea comes from the
index 921684b..a01c0c8 100644 (file)
@@ -31,7 +31,8 @@ BOOL IsConsoleHandle(HANDLE hHandle)
     DWORD dwMode;
 
     /* Check whether the handle may be that of a console... */
     DWORD dwMode;
 
     /* Check whether the handle may be that of a console... */
-    if ((GetFileType(hHandle) & FILE_TYPE_CHAR) == 0) return FALSE;
+    if ((GetFileType(hHandle) & ~FILE_TYPE_REMOTE) != FILE_TYPE_CHAR)
+        return FALSE;
 
     /*
      * It may be. Perform another test... The idea comes from the
 
     /*
      * It may be. Perform another test... The idea comes from the