Ignore:
Timestamp:
Nov 29, 2001, 12:33:37 AM (24 years ago)
Author:
phaller
Message:

Fixes in HandleManager and Device Handlers

File:
1 edited

Legend:

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

    r7472 r7474  
    1 /* $Id: HandleManager.cpp,v 1.78 2001-11-28 15:45:45 sandervl Exp $ */
     1/* $Id: HandleManager.cpp,v 1.79 2001-11-28 23:33:34 phaller Exp $ */
    22
    33/*
     
    432432
    433433    HMGlobals.fIsInitialized = TRUE;                             /* OK, done */
    434 
     434   
     435#if 1
     436    //This is a very bad idea. \\\\.\\NTICE -> NTICE, if the file exits, then
     437    //it will open the file instead of the device driver
     438    /* add standard symbolic links first, so local symbolic links in the
     439     * device handlers get precedence over the default here.
     440     *
     441     * Device handlers are supposed to place the appropriate
     442     * symbolic links such as "\\.\\COM1", "COM1"
     443     *
     444     * - "\\.\f:\temp\readme.txt" is a valid file
     445     * - "com1" is a valid device in case serial port 1 exists,
     446     *   otherwise it'd be a valid file.
     447     * - "\\.\filename" is the only misleading case (to be verified)
     448     *
     449     * Note:
     450     * the Open32 "device" definately MUST be the last device to be
     451     * asked to accept the specified name.
     452     */
     453    {
     454      // strings are placed in read-only segment
     455      PSZ pszDrive  = strdup("\\\\.\\x:");
     456      PSZ pszDrive2 = strdup("\\\\.\\x:");
     457      for (char ch = 'A'; ch <= 'Z'; ch++)
     458      {
     459        pszDrive[4] = ch;
     460        pszDrive2[4] = ch;
     461        HandleNamesAddSymbolicLink(pszDrive, pszDrive+4);
     462        HandleNamesAddSymbolicLink(pszDrive2, pszDrive2+4);
     463      }
     464      free(pszDrive);
     465      free(pszDrive2);
     466      HandleNamesAddSymbolicLink("\\\\?\\UNC\\", "\\\\");
     467    }
     468#endif
     469   
    435470    /* copy standard handles from OS/2's Open32 Subsystem */
    436471    HMGlobals.pHMStandard   = new HMDeviceStandardClass("\\\\STANDARD_HANDLE\\");
     
    453488    HMGlobals.pHMMailslot   = new HMMailslotClass("\\MAILSLOT\\");
    454489    HMGlobals.pHMParPort    = new HMDeviceParPortClass("\\\\LPT\\");
    455    
    456 #if 0
    457     //This is a very bad idea. \\\\.\\NTICE -> NTICE, if the file exits, then
    458     //it will open the file instead of the device driver
    459     /* add standard symbolic links */
    460     HandleNamesAddSymbolicLink("\\\\.\\", "");
    461 #endif
    462490  }
    463491  return (NO_ERROR);
     
    10701098  {
    10711099    TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE;
    1072     SetLastError(rc);          /* Hehe, OS/2 and NT are pretty compatible :) */
     1100   
     1101   
     1102    // Note:
     1103    // device handlers have to return an Win32-style error code
     1104    // from CreateFile() !
     1105    SetLastError(rc);
    10731106    return (INVALID_HANDLE_VALUE);                           /* signal error */
    10741107  }
Note: See TracChangeset for help on using the changeset viewer.