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.

283 lines
7.3 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. gpcstruc.h
  5. Abstract:
  6. This module contains type definitions for the interface between the traffic dll and
  7. kernel mode components.
  8. Author:
  9. Jim Stewart ( jstew ) August 22, 1996
  10. Revision History:
  11. Yoram Bernet (yoramb) May 1, 1997
  12. Ofer Bar (oferbar) Oct 1, 1997 - Revision 2 changes
  13. --*/
  14. #ifndef __GPCSTRUC_H
  15. #define __GPCSTRUC_H
  16. #define GPC_NOTIFY_CFINFO_CLOSED 1
  17. //
  18. // NtDeviceIoControlFile IoControlCode values for the GPC.
  19. //
  20. #define CTRL_CODE(function, method, access) \
  21. CTL_CODE(FILE_DEVICE_NETWORK, function, method, access)
  22. #define IOCTL_GPC_REGISTER_CLIENT CTRL_CODE( 20, METHOD_BUFFERED,FILE_WRITE_ACCESS)
  23. #define IOCTL_GPC_DEREGISTER_CLIENT CTRL_CODE( 21, METHOD_BUFFERED,FILE_WRITE_ACCESS)
  24. #define IOCTL_GPC_ADD_CF_INFO CTRL_CODE( 22, METHOD_BUFFERED,FILE_WRITE_ACCESS)
  25. #define IOCTL_GPC_ADD_PATTERN CTRL_CODE( 23, METHOD_BUFFERED,FILE_WRITE_ACCESS)
  26. #define IOCTL_GPC_MODIFY_CF_INFO CTRL_CODE( 24, METHOD_BUFFERED,FILE_WRITE_ACCESS)
  27. #define IOCTL_GPC_REMOVE_CF_INFO CTRL_CODE( 25, METHOD_BUFFERED,FILE_WRITE_ACCESS)
  28. #define IOCTL_GPC_REMOVE_PATTERN CTRL_CODE( 26, METHOD_BUFFERED,FILE_WRITE_ACCESS)
  29. #define IOCTL_GPC_ENUM_CFINFO CTRL_CODE( 27, METHOD_BUFFERED,FILE_WRITE_ACCESS)
  30. #define IOCTL_GPC_NOTIFY_REQUEST CTRL_CODE( 28, METHOD_BUFFERED,FILE_WRITE_ACCESS)
  31. #define IOCTL_GPC_ADD_CF_INFO_EX CTRL_CODE( 30, METHOD_BUFFERED,FILE_ANY_ACCESS)
  32. #define IOCTL_GPC_ADD_PATTERN_EX CTRL_CODE( 31, METHOD_BUFFERED,FILE_ANY_ACCESS)
  33. #define IOCTL_GPC_REMOVE_CF_INFO_EX CTRL_CODE( 32, METHOD_BUFFERED,FILE_ANY_ACCESS)
  34. #define IOCTL_GPC_REMOVE_PATTERN_EX CTRL_CODE( 33, METHOD_BUFFERED,FILE_ANY_ACCESS)
  35. #define IOCTL_GPC_REGISTER_CLIENT_EX CTRL_CODE( 34, METHOD_BUFFERED,FILE_ANY_ACCESS)
  36. #define IOCTL_GPC_DEREGISTER_CLIENT_EX CTRL_CODE( 35, METHOD_BUFFERED,FILE_ANY_ACCESS)
  37. #define IOCTL_GPC_GET_ENTRIES CTRL_CODE( 50, METHOD_BUFFERED,FILE_ANY_ACCESS)
  38. /*
  39. /////////////////////////////////////////////////////////////////
  40. //
  41. // Ioctl buffer formats - user level clients send buffers to the
  42. // GPC instead of calling entry points. Parameters are returned
  43. // in other buffers. Buffers are defined below:
  44. //
  45. /////////////////////////////////////////////////////////////////
  46. */
  47. //
  48. // Register client
  49. //
  50. typedef struct _GPC_REGISTER_CLIENT_REQ {
  51. ULONG CfId;
  52. ULONG Flags;
  53. ULONG MaxPriorities;
  54. GPC_CLIENT_HANDLE ClientContext;
  55. } GPC_REGISTER_CLIENT_REQ, *PGPC_REGISTER_CLIENT_REQ;
  56. typedef struct _GPC_REGISTER_CLIENT_RES {
  57. GPC_STATUS Status;
  58. GPC_HANDLE ClientHandle;
  59. } GPC_REGISTER_CLIENT_RES, *PGPC_REGISTER_CLIENT_RES;
  60. //
  61. // Deregister client
  62. //
  63. typedef struct _GPC_DEREGISTER_CLIENT_REQ {
  64. GPC_HANDLE ClientHandle;
  65. } GPC_DEREGISTER_CLIENT_REQ, *PGPC_DEREGISTER_CLIENT_REQ;
  66. typedef struct _GPC_DEREGISTER_CLIENT_RES {
  67. GPC_STATUS Status;
  68. } GPC_DEREGISTER_CLIENT_RES, *PGPC_DEREGISTER_CLIENT_RES;
  69. //
  70. // Add CfInfo
  71. //
  72. typedef struct _GPC_ADD_CF_INFO_REQ {
  73. GPC_HANDLE ClientHandle;
  74. GPC_CLIENT_HANDLE ClientCfInfoContext; // client specific context
  75. ULONG CfInfoSize;
  76. CHAR CfInfo[1]; // Varies from CF to CF
  77. } GPC_ADD_CF_INFO_REQ, *PGPC_ADD_CF_INFO_REQ;
  78. //
  79. // Add CfInfo EX
  80. //
  81. typedef struct _GPC_ADD_CF_INFO_EX_REQ {
  82. GPC_HANDLE ClientHandle;
  83. GPC_CLIENT_HANDLE ClientCfInfoContext; // client specific context
  84. //
  85. // New Fields for QOS only usage
  86. //
  87. HANDLE FileHandle;
  88. ULONG RemoteAddress;
  89. USHORT RemotePort;
  90. ULONG CfInfoSize;
  91. CHAR CfInfo[1]; // Varies from CF to CF
  92. } GPC_ADD_CF_INFO_EX_REQ, *PGPC_ADD_CF_INFO_EX_REQ;
  93. typedef struct _GPC_ADD_CF_INFO_RES {
  94. GPC_STATUS Status;
  95. GPC_HANDLE GpcCfInfoHandle;
  96. // this is filled after PENDING
  97. GPC_CLIENT_HANDLE ClientCtx;
  98. GPC_CLIENT_HANDLE CfInfoCtx;
  99. USHORT InstanceNameLength;
  100. WCHAR InstanceName[MAX_STRING_LENGTH];
  101. } GPC_ADD_CF_INFO_RES, *PGPC_ADD_CF_INFO_RES;
  102. //
  103. // Add pattern
  104. //
  105. typedef struct _GPC_ADD_PATTERN_REQ {
  106. GPC_HANDLE ClientHandle;
  107. GPC_HANDLE GpcCfInfoHandle;
  108. GPC_CLIENT_HANDLE ClientPatternContext;
  109. ULONG Priority;
  110. ULONG ProtocolTemplate;
  111. ULONG PatternSize;
  112. CHAR PatternAndMask[1];
  113. } GPC_ADD_PATTERN_REQ, *PGPC_ADD_PATTERN_REQ;
  114. typedef struct _GPC_ADD_PATTERN_RES {
  115. GPC_STATUS Status;
  116. GPC_HANDLE GpcPatternHandle;
  117. CLASSIFICATION_HANDLE ClassificationHandle;
  118. } GPC_ADD_PATTERN_RES, *PGPC_ADD_PATTERN_RES;
  119. //
  120. // Modify CfInfo
  121. //
  122. typedef struct _GPC_MODIFY_CF_INFO_REQ {
  123. GPC_HANDLE ClientHandle;
  124. GPC_HANDLE GpcCfInfoHandle;
  125. ULONG CfInfoSize;
  126. CHAR CfInfo[1];
  127. } GPC_MODIFY_CF_INFO_REQ, *PGPC_MODIFY_CF_INFO_REQ;
  128. typedef struct _GPC_MODIFY_CF_INFO_RES {
  129. GPC_STATUS Status;
  130. // this is filled after PENDING
  131. GPC_CLIENT_HANDLE ClientCtx;
  132. GPC_CLIENT_HANDLE CfInfoCtx;
  133. } GPC_MODIFY_CF_INFO_RES, *PGPC_MODIFY_CF_INFO_RES;
  134. //
  135. // Remove CfInfo
  136. //
  137. typedef struct _GPC_REMOVE_CF_INFO_REQ {
  138. GPC_HANDLE ClientHandle;
  139. GPC_HANDLE GpcCfInfoHandle;
  140. } GPC_REMOVE_CF_INFO_REQ, *PGPC_REMOVE_CF_INFO_REQ;
  141. typedef struct _GPC_REMOVE_CF_INFO_RES {
  142. GPC_STATUS Status;
  143. // this is filled after PENDING
  144. GPC_CLIENT_HANDLE ClientCtx;
  145. GPC_CLIENT_HANDLE CfInfoCtx;
  146. } GPC_REMOVE_CF_INFO_RES, *PGPC_REMOVE_CF_INFO_RES;
  147. //
  148. // Remove pattern
  149. //
  150. typedef struct _GPC_REMOVE_PATTERN_REQ {
  151. GPC_HANDLE ClientHandle;
  152. GPC_HANDLE GpcPatternHandle;
  153. } GPC_REMOVE_PATTERN_REQ, *PGPC_REMOVE_PATTERN_REQ;
  154. typedef struct _GPC_REMOVE_PATTERN_RES {
  155. GPC_STATUS Status;
  156. } GPC_REMOVE_PATTERN_RES, *PGPC_REMOVE_PATTERN_RES;
  157. //
  158. // Enumerate CfInfo
  159. //
  160. typedef struct _GPC_ENUM_CFINFO_REQ {
  161. GPC_HANDLE ClientHandle;
  162. HANDLE EnumHandle;
  163. ULONG CfInfoCount; // # requested
  164. } GPC_ENUM_CFINFO_REQ, *PGPC_ENUM_CFINFO_REQ;
  165. typedef struct _GPC_ENUM_CFINFO_RES {
  166. GPC_STATUS Status;
  167. HANDLE EnumHandle;
  168. ULONG TotalCfInfo; // total installed
  169. GPC_ENUM_CFINFO_BUFFER EnumBuffer[1];
  170. } GPC_ENUM_CFINFO_RES, *PGPC_ENUM_CFINFO_RES;
  171. //
  172. // Notify request
  173. //
  174. typedef struct _GPC_NOTIFY_REQUEST_REQ {
  175. HANDLE ClientHandle;
  176. } GPC_NOTIFY_REQUEST_REQ, *PGPC_NOTIFY_REQUEST_REQ;
  177. typedef struct _GPC_NOTIFY_REQUEST_RES {
  178. HANDLE ClientCtx;
  179. ULONG SubCode; // notification type
  180. ULONG Reason; // reason
  181. ULONG_PTR NotificationCtx; // i.e. flow context
  182. ULONG Param1; // optional param
  183. IO_STATUS_BLOCK IoStatBlock; // reserved for the IOCTL
  184. } GPC_NOTIFY_REQUEST_RES, *PGPC_NOTIFY_REQUEST_RES;
  185. #endif