// gpioctl.h Include file for Generic Port I/O Example Driver
//
// 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.
//
// Robert B. Nelson (Microsoft) March 1, 1993
// Device type -- in the "User Defined" range."
#define GPD_TYPE 40000
// The IOCTL function codes from 0x800 to 0xFFF are for customer use.
#define IOCTL_GPD_READ_PORT_UCHAR \
CTL_CODE( GPD_TYPE, 0x900, METHOD_BUFFERED, FILE_READ_ACCESS )
#define IOCTL_GPD_READ_PORT_USHORT \
CTL_CODE( GPD_TYPE, 0x901, METHOD_BUFFERED, FILE_READ_ACCESS )
#define IOCTL_GPD_READ_PORT_ULONG \
CTL_CODE( GPD_TYPE, 0x902, METHOD_BUFFERED, FILE_READ_ACCESS )
#define IOCTL_GPD_WRITE_PORT_UCHAR \
CTL_CODE(GPD_TYPE, 0x910, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_GPD_WRITE_PORT_USHORT \
CTL_CODE(GPD_TYPE, 0x911, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_GPD_WRITE_PORT_ULONG \
CTL_CODE(GPD_TYPE, 0x912, METHOD_BUFFERED, FILE_WRITE_ACCESS)
union DATABUFFER{
ULONG LongData;
USHORT ShortData;
UCHAR CharData;
};
typedef struct _GENPORT_WRITE_INPUT {
ULONG PortNumber; // Port # to write to
union { // Data to be output to port
ULONG LongData;
USHORT ShortData;
UCHAR CharData;
};
} GENPORT_WRITE_INPUT;
我看很多代码都有, 听说是驱动给提供的头文件,怎么都一样?,谁来说说这文件的来龙去脉?
5 个解决方案
#1
应该就是读写IO(端口)的东西吧
#2
那怎么都一样啊,很多程序都这样的。而且头文件的名字也不变。
#3
IO端口读写本来就是读和写,不同的程序只是端口号不同而已............
#4
就好像不同的程序访问文件都通过CreateFile来一样,不同的是文件名和参数.......
#5
Generic Port I/O Example Driver 所使用的IOCTL值。
#1
应该就是读写IO(端口)的东西吧
#2
那怎么都一样啊,很多程序都这样的。而且头文件的名字也不变。
#3
IO端口读写本来就是读和写,不同的程序只是端口号不同而已............
#4
就好像不同的程序访问文件都通过CreateFile来一样,不同的是文件名和参数.......
#5
Generic Port I/O Example Driver 所使用的IOCTL值。