⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pciscanioctl.h

📁 浏览所有的PCI设备
💻 H
字号:
// 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; 
  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -