Ignore:
Timestamp:
Nov 24, 2000, 5:16:18 PM (25 years ago)
Author:
phaller
Message:

accelerated get handle type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/HandleManager.cpp

    r4588 r4695  
    1 /* $Id: HandleManager.cpp,v 1.54 2000-11-14 14:26:55 sandervl Exp $ */
     1/* $Id: HandleManager.cpp,v 1.55 2000-11-24 16:16:18 phaller Exp $ */
    22
    33/*
     
    13701370  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
    13711371
    1372   //Must return FILE_TYPE_CHAR here; (used to fail index check)
    1373   if((hFile == GetStdHandle(STD_INPUT_HANDLE)) ||
    1374      (hFile == GetStdHandle(STD_OUTPUT_HANDLE)) ||
    1375      (hFile == GetStdHandle(STD_ERROR_HANDLE)))
    1376   {
    1377       return FILE_TYPE_CHAR;
    1378   }
    13791372                                                          /* validate handle */
    13801373  iIndex = _HMHandleQuery(hFile);                           /* get the index */
    13811374  if (-1 == iIndex)                                               /* error ? */
    13821375  {
    1383     SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
    1384     return FILE_TYPE_UNKNOWN;                         /* signal failure */
     1376    //Must return FILE_TYPE_CHAR here; (used to fail index check)
     1377    if((hFile == GetStdHandle(STD_INPUT_HANDLE)) ||
     1378       (hFile == GetStdHandle(STD_OUTPUT_HANDLE)) ||
     1379       (hFile == GetStdHandle(STD_ERROR_HANDLE)))
     1380    {
     1381        return FILE_TYPE_CHAR;
     1382    }
     1383    else
     1384    {
     1385      SetLastError(ERROR_INVALID_HANDLE);     /* set win32 error information */
     1386      return FILE_TYPE_UNKNOWN;                            /* signal failure */
     1387    }
    13851388  }
    13861389
Note: See TracChangeset for help on using the changeset viewer.