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/hmcomm.cpp

    r7471 r7474  
    1 /* $Id: hmcomm.cpp,v 1.17 2001-11-28 15:35:15 sandervl Exp $ */
     1/* $Id: hmcomm.cpp,v 1.18 2001-11-28 23:33:35 phaller Exp $ */
    22
    33/*
     
    1919#include <string.h>
    2020#include <handlemanager.h>
     21#include "handlenames.h"
    2122#include <heapstring.h>
    2223#include "hmdevice.h"
     
    9192  if(pData!= NULL)
    9293    HMDeviceRegisterEx("COM1", this, pData);
     94 
     95  // add symbolic links to the "real name" of the device
     96  {
     97    // @@@PH what's the long device name: SerialPortx ?
     98    // HandleNamesAddSymbolicLink("\\Device\\ParallelPort3", "COM3");
     99   
     100    PSZ pszCOM = strdup("\\\\.\\COMx");
     101    for (char ch = '1'; ch <= '9'; ch++)
     102    {
     103      pszCOM[7] = ch;
     104      HandleNamesAddSymbolicLink(pszCOM, pszCOM+4);
     105    }
     106    free(pszCOM);
     107  }
    93108}
    94109
     
    109124{
    110125    dprintf2(("HMDeviceCommClass::FindDevice %s %s", lpClassDevName, lpDeviceName));
    111 
    112     if(namelength > 5) {
    113         if(namelength != 9 || lstrncmpA(lpDeviceName, "\\\\.\\", 4) != 0) {
    114             return FALSE;  //can't be com name
    115         }
    116         lpDeviceName += 4; //skip prefix
    117     }
    118 
     126 
    119127    //first 3 letters 'COM'?
    120128    if(lstrncmpiA(lpDeviceName, lpClassDevName, 3) != 0) {
     
    207215    {
    208216      delete pHMHandleData->lpHandlerData;
    209       return rc;
     217      return error2WinError(rc);
    210218    }
    211219    rc = SetBaud(pHMHandleData,9600);
Note: See TracChangeset for help on using the changeset viewer.