Accessing PCI Device's Configuration Space from Device Driver

Last reviewed: December 12, 1995
Article ID: Q140730
The information in this article applies to:
  • Microsoft Win32 Device Development Kit (DDK) for Windows 95

SUMMARY

Under certain circumstances, a Windows 95 device driver will need to access a device's PCI configuration space. The Configuration Manager service CONFIGMG_Call_Enumerator_Function can be used to accomplish this.

MORE INFORMATION

The CONFIGMG_Call_Enumerator_Function can be used to read or write to a device's PCI configuraton space. It should be noted that SCSI miniports and NDIS drivers already have defined services for accessing PCI configuration space, and should use those services.

The CONFIGMG_Call_Enumerator_Function service allows you to run bus- specific functions through the bus enumerator. In the case of PCI, there is a Pci.h header file in the DDK that defines two different PCI functions:

   #define PCI_ENUM_FUNC_GET_DEVICE_INFO   0
   #define PCI_ENUM_FUNC_SET_DEVICE_INFO   1

These two functions are used to get and set data in the PCI config space. The parameters for CONFIGMG_Call_Enumerator_Function are:

   Parameter      Description
   ----------------------------------------------------------------------
   dnDevNode      Handle of a device's DevNode
   efFunc         Function number that is one of the Pci.h #defines
   ulRefData      Reference data. Starting byte in PCI config space.
   pBuffer        Pointer to a buffer to read or write PCI config data.
   ulBufferSize   Number of bytes in PCI config space to read or write.
   ulFlags        Must be zero.

For generic Plug and Play drivers, the dnDevNode handle is passed to the driver directly by ConfigMg when it is loaded. For specific driver models (VCOMM, IOS, Display, etc.), please refer to the DDK documentation and samples for information on how to retrieve a DevNode handle for your device.


Additional reference words: 4.00 PCI kbinf
KBCategory: kbgraphic
KBSubcategory:


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 12, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.