Changeset 7435 for trunk/src


Ignore:
Timestamp:
Nov 23, 2001, 1:50:06 AM (24 years ago)
Author:
phaller
Message:

.

File:
1 edited

Legend:

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

    r7302 r7435  
    1 /* $Id: hmparport.cpp,v 1.4 2001-11-08 16:00:17 phaller Exp $ */
     1/* $Id: hmparport.cpp,v 1.5 2001-11-23 00:50:06 phaller Exp $ */
    22
    33/*
     
    1616#include <handlemanager.h>
    1717#include <heapstring.h>
     18#include <winioctl.h>
    1819#include "hmdevice.h"
    1920#include "hmparport.h"
     
    8687
    8788#endif
     89
     90
     91#if 0
     92
     93typedef struct _PARALLEL_PNP_INFORMATION {
     94  PHYSICAL_ADDRESS  OriginalEcpController;
     95  PUCHAR  EcpController;
     96  ULONG  SpanOfEcpController;
     97  ULONG  PortNumber;
     98  ULONG  HardwareCapabilities;
     99  PPARALLEL_SET_CHIP_MODE  TrySetChipMode;
     100  PPARALLEL_CLEAR_CHIP_MODE  ClearChipMode;
     101  ULONG  FifoDepth;
     102  ULONG  FifoWidth;
     103  PHYSICAL_ADDRESS  EppControllerPhysicalAddress;
     104  ULONG  SpanOfEppController;
     105  ULONG  Ieee1284_3DeviceCount;
     106  PPARALLEL_TRY_SELECT_ROUTINE  TrySelectDevice;
     107  PPARALLEL_DESELECT_ROUTINE  DeselectDevice;
     108  PVOID  Context;
     109  ULONG  CurrentMode;
     110  PWSTR  PortName;
     111} PARALLEL_PNP_INFORMATION, *PPARALLEL_PNP_INFORMATION;
     112#endif
     113
    88114
    89115
     
    595621    switch(dwIoControlCode)
    596622    {
    597 /**
    598     case IOCTL_DISK_FORMAT_TRACKS:
    599         msg = "IOCTL_DISK_FORMAT_TRACKS";
     623      case IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO:
     624        msg = "IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO";
    600625        break;
    601 */
     626     
     627      case IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO:
     628        msg = "IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO";
     629        break;
    602630    }
    603631 
     
    610638    switch(dwIoControlCode)
    611639    {
    612 //    case IOCTL_SCSI_RESCAN_BUS:
    613 //        break;
    614 
     640      case IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO:
     641      {
     642        PPARALLEL_PORT_INFORMATION pPPI = (PPARALLEL_PORT_INFORMATION)lpOutBuffer;
     643       
     644        if(nOutBufferSize < sizeof(PARALLEL_PORT_INFORMATION) || !pPPI)
     645        {
     646          SetLastError(ERROR_INSUFFICIENT_BUFFER);
     647          return FALSE;
     648        }
     649       
     650        if(lpBytesReturned)
     651          *lpBytesReturned = sizeof(PARALLEL_PORT_INFORMATION);
     652       
     653        // fill in the data values
     654       
     655        // Specifies the bus relative base I/O address of the parallel port registers.
     656        pPPI->OriginalController.LowPart = 0;  // @@@PH
     657        pPPI->OriginalController.HighPart = 0;  // @@@PH
     658       
     659        // Pointer to the system-mapped base I/O location of the parallel port registers.
     660        pPPI->Controller = 0;          // @@@PH
     661       
     662        // Specifies the size, in bytes, of the I/O space, allocated to the parallel port.
     663        pPPI->SpanOfController = 0;    // @@@PH
     664       
     665        // Pointer to a callback routine that a kernel-mode driver can use to try to allocate the parallel port.
     666        pPPI->TryAllocatePort = NULL;
     667       
     668        // Pointer to a callback routine that a kernel-mode driver can use to free the parallel port.
     669        pPPI->FreePort = NULL;
     670       
     671        // Pointer to a callback routine that a kernel-mode driver can use to determine the number of requests on the work queue of the parallel port.
     672        pPPI->QueryNumWaiters = NULL;
     673       
     674        // Pointer to the device extension of parallel port.
     675        pPPI->Context = NULL;
     676
     677        return TRUE;
     678      }
     679     
     680     
     681      case IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO:
     682      {
     683        PPARALLEL_PNP_INFORMATION pPPI = (PPARALLEL_PNP_INFORMATION)lpOutBuffer;
     684       
     685        if(nOutBufferSize < sizeof(PARALLEL_PNP_INFORMATION) || !pPPI)
     686        {
     687          SetLastError(ERROR_INSUFFICIENT_BUFFER);
     688          return FALSE;
     689        }
     690       
     691        if(lpBytesReturned)
     692          *lpBytesReturned = sizeof(PARALLEL_PNP_INFORMATION);
     693       
     694        // fill in the data values
     695       
     696        // Specifies the base physical address that the system-supplied function driver for parallel ports uses to control the ECP operation of the parallel port.
     697        pPPI->OriginalEcpController.LowPart = 0;
     698        pPPI->OriginalEcpController.HighPart = 0;
     699       
     700        // Pointer to the I/O port resource that is used to control the port in ECP mode.
     701        pPPI->EcpController = 0;
     702       
     703        // Specifies the size, in bytes, of the I/O port resource.
     704        pPPI->SpanOfEcpController = 0;
     705       
     706        // Not used.
     707        pPPI->PortNumber = 0;
     708       
     709        // Specifies the hardware capabilities of the parallel port. The following capabilities can be set using a bitwise OR of the following constants:
     710        pPPI->HardwareCapabilities = 0;
     711        //  PPT_1284_3_PRESENT
     712        //  PPT_BYTE_PRESENT
     713        //  PPT_ECP_PRESENT
     714        //  PPT_EPP_32_PRESENT
     715        //  PPT_EPP_PRESENT
     716        //  PT_NO_HARDWARE_PRESENT
     717       
     718        // Pointer to a callback routine that a kernel-mode driver can use to change the operating mode of the parallel port.
     719        pPPI->TrySetChipMode = 0;
     720       
     721        // Pointer to a callback routine that a kernel-mode driver can use to clear the operating mode of the parallel port.
     722        pPPI->ClearChipMode = 0;
     723       
     724        // Specifies the size, in words, of the hardware first in/first out (FIFO) buffer. The FIFO word size, in bits, is the value of FifoWidth.
     725        pPPI->FifoDepth = 0;
     726       
     727        // Specifies the FIFO word size, in bits, which is the number of bits handled in parallel.
     728        pPPI->FifoWidth = 0;
     729       
     730        // Not used.
     731        pPPI->EppControllerPhysicalAddress.LowPart = 0;
     732        pPPI->EppControllerPhysicalAddress.HighPart = 0;
     733       
     734        // Not used.
     735        pPPI->SpanOfEppController = 0;
     736       
     737        // Specifies the number of daisy-chain devices currently attached to a parallel port. In Microsoftÿ Windowsÿ XP, from zero to two devices can be simultaneously connected to a
     738        // parallel port. In Windows 2000, from zero to four devices can be simultaneously connected to a parallel port.
     739        pPPI->Ieee1284_3DeviceCount = 0;
     740       
     741        // Pointer to a callback routine that a kernel-mode driver can use to try to select an IEEE 1284.3 device.
     742        pPPI->TrySelectDevice = 0;
     743       
     744        // Pointer to a callback routine that a kernel-mode driver can use to deselect an IEEE 1284.3 device.
     745        pPPI->DeselectDevice = 0;
     746       
     747        // Pointer to the device extension of a parallel port's function device object (FDO).
     748        pPPI->Context = 0;
     749       
     750        // The current operating mode of the parallel port.
     751        pPPI->CurrentMode = 0;
     752       
     753        // The symbolic link name of the parallel port.
     754        pPPI->PortName = 0;
     755       
     756        return TRUE;
     757      }
    615758    }
    616759    dprintf(("HMDeviceParPortClass::DeviceIoControl: unimplemented dwIoControlCode=%08lx\n", dwIoControlCode));
Note: See TracChangeset for help on using the changeset viewer.