WinIo_NT.h
上传用户:ason123
上传日期:2010-03-31
资源大小:177k
文件大小:2k
源码类别:

并口编程

开发平台:

C++ Builder

  1. #ifndef WINIONT_H
  2. #define WINIONT_H
  3. // Define the various device type values.  Note that values used by Microsoft
  4. // Corporation are in the range 0-32767, and 32768-65535 are reserved for use
  5. // by customers.
  6. #define FILE_DEVICE_WINIO 0x00008010
  7. // Macro definition for defining IOCTL and FSCTL function control codes.
  8. // Note that function codes 0-2047 are reserved for Microsoft Corporation,
  9. // and 2048-4095 are reserved for customers.
  10. #define WINIO_IOCTL_INDEX 0x810
  11. // Define our own private IOCTL
  12. #define IOCTL_WINIO_MAPPHYSTOLIN     CTL_CODE(FILE_DEVICE_WINIO,  
  13.                                      WINIO_IOCTL_INDEX,      
  14.                                      METHOD_BUFFERED,        
  15.                                      FILE_ANY_ACCESS)
  16. #define IOCTL_WINIO_UNMAPPHYSADDR    CTL_CODE(FILE_DEVICE_WINIO,  
  17.                                      WINIO_IOCTL_INDEX + 1,  
  18.                                      METHOD_BUFFERED,        
  19.                                      FILE_ANY_ACCESS)
  20. #define IOCTL_WINIO_ENABLEDIRECTIO   CTL_CODE(FILE_DEVICE_WINIO,  
  21.                                      WINIO_IOCTL_INDEX + 2,   
  22.                                      METHOD_BUFFERED,         
  23.                                      FILE_ANY_ACCESS)
  24. #define IOCTL_WINIO_DISABLEDIRECTIO  CTL_CODE(FILE_DEVICE_WINIO,  
  25.                                      WINIO_IOCTL_INDEX + 3,   
  26.                                      METHOD_BUFFERED,         
  27.                                      FILE_ANY_ACCESS)
  28. #pragma pack(1)
  29. struct tagPhys32Struct
  30. {
  31.   HANDLE PhysicalMemoryHandle;
  32.   ULONG dwPhysMemSizeInBytes;
  33.   PVOID pvPhysAddress;
  34.   PVOID pvPhysMemLin;
  35. };
  36. extern struct tagPhys32Struct Phys32Struct;
  37. #endif