Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
4.8 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. D4drvif.h
  5. Abstract:
  6. DOT4 Driver Interface
  7. --*/
  8. #ifndef _DOT4DRVIF_H
  9. #define _DOT4DRVIF_H
  10. //////////////////////////////////////////////////////////////////////////////
  11. // Includes
  12. //////////////////////////////////////////////////////////////////////////////
  13. //////////////////////////////////////////////////////////////////////////////
  14. // Defines
  15. //////////////////////////////////////////////////////////////////////////////
  16. #define MAX_SERVICE_LENGTH 40
  17. #ifndef CTL_CODE
  18. //
  19. // Macro definition for defining IOCTL and FSCTL function control codes. Note
  20. // that function codes 0-2047 are reserved for Microsoft Corporation, and
  21. // 2048-4095 are reserved for customers.
  22. //
  23. #define CTL_CODE( DeviceType, Function, Method, Access ) ( \
  24. ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
  25. )
  26. //
  27. // Define the method codes for how buffers are passed for I/O and FS controls
  28. //
  29. #define METHOD_BUFFERED 0
  30. #define METHOD_IN_DIRECT 1
  31. #define METHOD_OUT_DIRECT 2
  32. #define METHOD_NEITHER 3
  33. //
  34. // Define the access check value for any access
  35. //
  36. //
  37. // The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in
  38. // ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these
  39. // constants *MUST* always be in sync.
  40. //
  41. #define FILE_ANY_ACCESS 0
  42. #define FILE_READ_ACCESS ( 0x0001 ) // file & pipe
  43. #define FILE_WRITE_ACCESS ( 0x0002 ) // file & pipe
  44. #endif
  45. #define FILE_DEVICE_DOT4 0x3a
  46. #define IOCTL_DOT4_USER_BASE 2049
  47. #define IOCTL_DOT4_LAST IOCTL_DOT4_USER_BASE + 9
  48. #define IOCTL_DOT4_CREATE_SOCKET CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 7, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  49. #define IOCTL_DOT4_DESTROY_SOCKET CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 9, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  50. #define IOCTL_DOT4_WAIT_FOR_CHANNEL CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 8, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  51. #define IOCTL_DOT4_OPEN_CHANNEL CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 0, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  52. #define IOCTL_DOT4_CLOSE_CHANNEL CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
  53. #define IOCTL_DOT4_READ CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 2, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  54. #define IOCTL_DOT4_WRITE CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 3, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
  55. #define IOCTL_DOT4_ADD_ACTIVITY_BROADCAST CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
  56. #define IOCTL_DOT4_REMOVE_ACTIVITY_BROADCAST CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
  57. #define IOCTL_DOT4_WAIT_ACTIVITY_BROADCAST CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 6, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  58. //////////////////////////////////////////////////////////////////////////////
  59. // Types
  60. //////////////////////////////////////////////////////////////////////////////
  61. typedef struct _DOT4_DRIVER_CMD
  62. {
  63. // Handle to channel
  64. CHANNEL_HANDLE hChannelHandle;
  65. // Length of request
  66. ULONG ulSize;
  67. // Offset into buffer
  68. ULONG ulOffset;
  69. // Timeout of operation. Can be INFINITE.
  70. ULONG ulTimeout;
  71. } DOT4_DRIVER_CMD, *PDOT4_DRIVER_CMD;
  72. typedef struct _DOT4_DC_OPEN_DATA
  73. {
  74. // Host socket created by CREATE_SOCKET
  75. unsigned char bHsid;
  76. // TRUE to immediately add activity broadcast upon creation
  77. unsigned char fAddActivity;
  78. // Handle to channel returned
  79. CHANNEL_HANDLE hChannelHandle;
  80. } DOT4_DC_OPEN_DATA, *PDOT4_DC_OPEN_DATA;
  81. typedef struct _DOT4_DC_CREATE_DATA
  82. {
  83. // This or service name sent
  84. unsigned char bPsid;
  85. CHAR pServiceName[MAX_SERVICE_LENGTH + 1];
  86. // Type (stream or packet) of channels on socket
  87. unsigned char bType;
  88. // Size of read buffer for channels on socket
  89. ULONG ulBufferSize;
  90. USHORT usMaxHtoPPacketSize;
  91. USHORT usMaxPtoHPacketSize;
  92. // Host socket id returned
  93. unsigned char bHsid;
  94. } DOT4_DC_CREATE_DATA, *PDOT4_DC_CREATE_DATA;
  95. typedef struct _DOT4_DC_DESTROY_DATA
  96. {
  97. // Host socket created by CREATE_SOCKET
  98. unsigned char bHsid;
  99. } DOT4_DC_DESTROY_DATA, *PDOT4_DC_DESTROY_DATA;
  100. //////////////////////////////////////////////////////////////////////////////
  101. // Prototypes
  102. //////////////////////////////////////////////////////////////////////////////
  103. #endif