Ignore:
Timestamp:
Nov 29, 2001, 11:53:28 AM (24 years ago)
Author:
phaller
Message:

Added support for DosDevConfig, query number of available parallel ports

File:
1 edited

Legend:

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

    r7476 r7482  
    1 /* $Id: hmparport.cpp,v 1.11 2001-11-29 00:20:48 phaller Exp $ */
     1/* $Id: hmparport.cpp,v 1.12 2001-11-29 10:53:27 phaller Exp $ */
    22
    33/*
     
    144144           lpDeviceName));
    145145 
     146#ifndef DEVINFO_PRINTER
     147#define DEVINFO_PRINTER         0
     148#endif
     149 
     150  // first, we determine the number of parallel port devices available
     151  BYTE  bParallelPorts;
     152  DWORD rc = OSLibDosDevConfig(&bParallelPorts,
     153                               DEVINFO_PRINTER);
     154  dprintf(("HMDeviceParPortClass: Parallel ports reported: %d\n",
     155          bParallelPorts));
     156  if (0 == bParallelPorts)
     157    return;
     158 
     159  // @@@PH
     160  // query configuration data from Resource Manager
     161  // (base i/o ports, etc. for the IOCTL_INTERNAL_GET_xxx)
     162 
     163 
    146164  VOID *pData;
    147   dprintf(("HMDeviceParPortClass: Register LPT1 to LPT3 with Handle Manager\n"));
     165  dprintf(("HMDeviceParPortClass: Registering LPTs with Handle Manager\n"));
    148166 
    149167  pData = CreateDevData();
     
    156174    PSZ pszLPT  = strdup("\\\\.\\LPTx");
    157175    PSZ pszLPT2 = strdup("\\Device\\ParallelPort1");
    158     for (char ch = '1'; ch <= '3'; ch++)
     176    for (char ch = '1'; ch <= '1' + (bParallelPorts - 1); ch++)
    159177    {
    160178      pszLPT[7] = ch;
Note: See TracChangeset for help on using the changeset viewer.