pciScanIoctl.h
资源名称:pciexp.zip [点击查看]
上传用户:zhuqijet
上传日期:2007-01-04
资源大小:138k
文件大小:3k
源码类别:
驱动编程
开发平台:
Visual C++
- // pciScanioctl.h Include file for Generic Port I/O Example Driver
- /*****************************************************************************
- * Change Log
- * Date | Change
- *-----------+-----------------------------------------------------------------
- *****************************************************************************/
- //
- // Define the IOCTL codes we will use. The IOCTL code contains a command
- // identifier, plus other information about the device, the type of access
- // with which the file must have been opened, and the type of buffering.
- //
- //
- // Device type -- in the "User Defined" range."
- #define PCISCAN_TYPE 42000u
- // The IOCTL function codes from 0x800 to 0xFFF are for customer use.
- #define IOCTL_PCISCAN_INITIALIZE
- CTL_CODE(PCISCAN_TYPE, 0x0B10, METHOD_BUFFERED, FILE_WRITE_DATA | FILE_READ_DATA)
- /****************************************************************************
- * IOCTL_PCISCAN_GET_FIRST
- *
- *-----------------------------------------------------------------------------
- * BOOL DeviceIoControl(h, IOCTL_PCISCAN_GET_FIRST,
- * InputBuffer, InputBufferLength,
- * OutputBuffer, OutputBufferLength,
- * BytesWritten, NULL);
- *-----------------------------------------------------------------------------
- * Inputs:
- * InputBuffer: NULL
- * InputBufferLength: 0
- * OutputBuffer: PPCISCAN_OUTPUT
- * OutputBufferLength: sizeof(PPCISCAN_OUTPUT)
- * Return: BOOL
- * TRUE - a valid PCI device has been found and the PCISCAN_OUTPUT data
- * is valid
- * FALSE - no PCI device has been found, PCISCAN_OUTPUT data is undefined
- * Effect:
- * The internal position pointers are set to point to the lowest-numbered
- * PCI bus:device:function, 0:0:0. The driver then iterates until it
- * either finds a valid bus:device:function code, or exhausts the
- * PCI limits.
- ****************************************************************************/
- #define IOCTL_PCISCAN_GET_FIRST
- CTL_CODE(PCISCAN_TYPE, 0x0B11, METHOD_BUFFERED, FILE_WRITE_DATA | FILE_READ_DATA)
- /****************************************************************************
- * IOCTL_PCISCAN_GET_NEXT
- *
- *-----------------------------------------------------------------------------
- * BOOL DeviceIoControl(h, IOCTL_PCISCAN_GET_NEXT,
- * InputBuffer, InputBufferLength,
- * OutputBuffer, OutputBufferLength,
- * BytesWritten, NULL);
- *-----------------------------------------------------------------------------
- * Inputs:
- * InputBuffer: NULL
- * InputBufferLength: 0
- * OutputBuffer: PPCISCAN_OUTPUT
- * OutputBufferLength: sizeof(PPCISCAN_OUTPUT)
- * Return: BOOL
- * TRUE - a valid PCI device has been found and the PCISCAN_OUTPUT data
- * is valid
- * FALSE - no PCI device has been found, PCISCAN_OUTPUT data is undefined
- * Effect:
- * The internal position pointers are incremented until the driver
- * either finds a valid bus:device:function code, or exhausts the
- * PCI limits.
- ****************************************************************************/
- #define IOCTL_PCISCAN_GET_NEXT
- CTL_CODE(PCISCAN_TYPE, 0x0B12, METHOD_BUFFERED, FILE_WRITE_DATA | FILE_READ_DATA)
- typedef struct _PCISCAN_OUTPUT {
- PCI_SLOT_NUMBER SlotData;
- PCI_COMMON_CONFIG PciData;
- unsigned int BusNumber;
- } PCISCAN_OUTPUT;
- typedef PCISCAN_OUTPUT *PPCISCAN_OUTPUT;