Ignore:
Timestamp:
Aug 19, 1999, 2:57:41 PM (26 years ago)
Author:
phaller
Message:

Fix: HandleManager will no more return 0 as valid file handle

File:
1 edited

Legend:

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

    r532 r578  
    1 /* $Id: HandleManager.cpp,v 1.10 1999-08-17 17:04:50 sandervl Exp $ */
     1/* $Id: HandleManager.cpp,v 1.11 1999-08-19 12:57:41 phaller Exp $ */
    22
    33/*
     
    131131
    132132                        /* get appropriate device handler by the device name */
    133 static HMDeviceHandler *_HMDeviceFind(PSZ pszDeviceName);
     133static HMDeviceHandler*  _Optlink _HMDeviceFind(PSZ pszDeviceName);
    134134
    135135                               /* get next free handle from the handle table */
    136 static ULONG            _HMHandleGetFree(void);
     136static ULONG            _Optlink _HMHandleGetFree(void);
    137137
    138138                                       /* get handle table entry from handle */
    139 static ULONG            _HMHandleQuery(HANDLE hHandle);
     139static ULONG            _Optlink _HMHandleQuery(HANDLE hHandle);
    140140
    141141
     
    188188  register ULONG ulLoop;
    189189
    190   for (ulLoop = 0;
     190  for (ulLoop = 1; // @@@PH Note, this is an experimental change
     191                   // 0L as hHandle is sometimes considered invalid!
     192                   // this will never return 0l as free handle now.
    191193       ulLoop < MAX_OS2_HMHANDLES;
    192194       ulLoop++)
     
    396398
    397399    if (ulHandle >= MAX_OS2_HMHANDLES)                     /* check boundary */
    398       ulHandle = 0;
     400      ulHandle = 1;
    399401  }
    400402  while (ulHandle != HMGlobals.ulHandleLast);
     
    492494#endif
    493495
    494   for (ulIndex = 0;
     496  for (ulIndex = 1;
    495497       ulIndex < MAX_OS2_HMHANDLES;
    496498       ulIndex++)
Note: See TracChangeset for help on using the changeset viewer.