- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
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;