Source code of Windows XP (NT5)
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.

252 lines
6.0 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_GET_ENTRIES CTRL_CODE( 50, METHOD_BUFFERED,FILE_ANY_ACCESS)
  32. /*
  33. /////////////////////////////////////////////////////////////////
  34. //
  35. // Ioctl buffer formats - user level clients send buffers to the
  36. // GPC instead of calling entry points. Parameters are returned
  37. // in other buffers. Buffers are defined below:
  38. //
  39. /////////////////////////////////////////////////////////////////
  40. */
  41. //
  42. // Register client
  43. //
  44. typedef struct _GPC_REGISTER_CLIENT_REQ {
  45. ULONG CfId;
  46. ULONG Flags;
  47. ULONG MaxPriorities;
  48. GPC_CLIENT_HANDLE ClientContext;
  49. } GPC_REGISTER_CLIENT_REQ, *PGPC_REGISTER_CLIENT_REQ;
  50. typedef struct _GPC_REGISTER_CLIENT_RES {
  51. GPC_STATUS Status;
  52. GPC_HANDLE ClientHandle;
  53. } GPC_REGISTER_CLIENT_RES, *PGPC_REGISTER_CLIENT_RES;
  54. //
  55. // Deregister client
  56. //
  57. typedef struct _GPC_DEREGISTER_CLIENT_REQ {
  58. GPC_HANDLE ClientHandle;
  59. } GPC_DEREGISTER_CLIENT_REQ, *PGPC_DEREGISTER_CLIENT_REQ;
  60. typedef struct _GPC_DEREGISTER_CLIENT_RES {
  61. GPC_STATUS Status;
  62. } GPC_DEREGISTER_CLIENT_RES, *PGPC_DEREGISTER_CLIENT_RES;
  63. //
  64. // Add CfInfo
  65. //
  66. typedef struct _GPC_ADD_CF_INFO_REQ {
  67. GPC_HANDLE ClientHandle;
  68. GPC_CLIENT_HANDLE ClientCfInfoContext; // client specific context
  69. ULONG CfInfoSize;
  70. CHAR CfInfo[1]; // Varies from CF to CF
  71. } GPC_ADD_CF_INFO_REQ, *PGPC_ADD_CF_INFO_REQ;
  72. typedef struct _GPC_ADD_CF_INFO_RES {
  73. GPC_STATUS Status;
  74. GPC_HANDLE GpcCfInfoHandle;
  75. // this is filled after PENDING
  76. GPC_CLIENT_HANDLE ClientCtx;
  77. GPC_CLIENT_HANDLE CfInfoCtx;
  78. USHORT InstanceNameLength;
  79. WCHAR InstanceName[MAX_STRING_LENGTH];
  80. } GPC_ADD_CF_INFO_RES, *PGPC_ADD_CF_INFO_RES;
  81. //
  82. // Add pattern
  83. //
  84. typedef struct _GPC_ADD_PATTERN_REQ {
  85. GPC_HANDLE ClientHandle;
  86. GPC_HANDLE GpcCfInfoHandle;
  87. GPC_CLIENT_HANDLE ClientPatternContext;
  88. ULONG Priority;
  89. ULONG ProtocolTemplate;
  90. ULONG PatternSize;
  91. CHAR PatternAndMask[1];
  92. } GPC_ADD_PATTERN_REQ, *PGPC_ADD_PATTERN_REQ;
  93. typedef struct _GPC_ADD_PATTERN_RES {
  94. GPC_STATUS Status;
  95. GPC_HANDLE GpcPatternHandle;
  96. CLASSIFICATION_HANDLE ClassificationHandle;
  97. } GPC_ADD_PATTERN_RES, *PGPC_ADD_PATTERN_RES;
  98. //
  99. // Modify CfInfo
  100. //
  101. typedef struct _GPC_MODIFY_CF_INFO_REQ {
  102. GPC_HANDLE ClientHandle;
  103. GPC_HANDLE GpcCfInfoHandle;
  104. ULONG CfInfoSize;
  105. CHAR CfInfo[1];
  106. } GPC_MODIFY_CF_INFO_REQ, *PGPC_MODIFY_CF_INFO_REQ;
  107. typedef struct _GPC_MODIFY_CF_INFO_RES {
  108. GPC_STATUS Status;
  109. // this is filled after PENDING
  110. GPC_CLIENT_HANDLE ClientCtx;
  111. GPC_CLIENT_HANDLE CfInfoCtx;
  112. } GPC_MODIFY_CF_INFO_RES, *PGPC_MODIFY_CF_INFO_RES;
  113. //
  114. // Remove CfInfo
  115. //
  116. typedef struct _GPC_REMOVE_CF_INFO_REQ {
  117. GPC_HANDLE ClientHandle;
  118. GPC_HANDLE GpcCfInfoHandle;
  119. } GPC_REMOVE_CF_INFO_REQ, *PGPC_REMOVE_CF_INFO_REQ;
  120. typedef struct _GPC_REMOVE_CF_INFO_RES {
  121. GPC_STATUS Status;
  122. // this is filled after PENDING
  123. GPC_CLIENT_HANDLE ClientCtx;
  124. GPC_CLIENT_HANDLE CfInfoCtx;
  125. } GPC_REMOVE_CF_INFO_RES, *PGPC_REMOVE_CF_INFO_RES;
  126. //
  127. // Remove pattern
  128. //
  129. typedef struct _GPC_REMOVE_PATTERN_REQ {
  130. GPC_HANDLE ClientHandle;
  131. GPC_HANDLE GpcPatternHandle;
  132. } GPC_REMOVE_PATTERN_REQ, *PGPC_REMOVE_PATTERN_REQ;
  133. typedef struct _GPC_REMOVE_PATTERN_RES {
  134. GPC_STATUS Status;
  135. } GPC_REMOVE_PATTERN_RES, *PGPC_REMOVE_PATTERN_RES;
  136. //
  137. // Enumerate CfInfo
  138. //
  139. typedef struct _GPC_ENUM_CFINFO_REQ {
  140. GPC_HANDLE ClientHandle;
  141. HANDLE EnumHandle;
  142. ULONG CfInfoCount; // # requested
  143. } GPC_ENUM_CFINFO_REQ, *PGPC_ENUM_CFINFO_REQ;
  144. typedef struct _GPC_ENUM_CFINFO_RES {
  145. GPC_STATUS Status;
  146. HANDLE EnumHandle;
  147. ULONG TotalCfInfo; // total installed
  148. GPC_ENUM_CFINFO_BUFFER EnumBuffer[1];
  149. } GPC_ENUM_CFINFO_RES, *PGPC_ENUM_CFINFO_RES;
  150. //
  151. // Notify request
  152. //
  153. typedef struct _GPC_NOTIFY_REQUEST_REQ {
  154. HANDLE ClientHandle;
  155. } GPC_NOTIFY_REQUEST_REQ, *PGPC_NOTIFY_REQUEST_REQ;
  156. typedef struct _GPC_NOTIFY_REQUEST_RES {
  157. HANDLE ClientCtx;
  158. ULONG SubCode; // notification type
  159. ULONG Reason; // reason
  160. ULONG_PTR NotificationCtx; // i.e. flow context
  161. ULONG Param1; // optional param
  162. IO_STATUS_BLOCK IoStatBlock; // reserved for the IOCTL
  163. } GPC_NOTIFY_REQUEST_RES, *PGPC_NOTIFY_REQUEST_RES;
  164. #endif