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.

280 lines
6.0 KiB

  1. // Group policy refresh named event signaled by our GPE when gp refreshes
  2. // without GP changes or without a forced refresh.
  3. #define IPSEC_GP_REFRESH_EVENT L"IPSEC_GP_REFRESH_EVENT"
  4. #define REG_IPSEC_DRIVER_STATEFULMODE 3
  5. #define IPSEC_REGISTRY_PROVIDER 0
  6. #define IPSEC_DIRECTORY_PROVIDER 1
  7. #define IPSEC_FILE_PROVIDER 2
  8. #define IPSEC_WMI_PROVIDER 3
  9. #define IPSEC_PERSISTENT_PROVIDER 4
  10. #define POLSTORE_READWRITE 0x00000000
  11. #define POLSTORE_READONLY 0x00000001
  12. #define POLSTORE_NEW_VER 0x00000002
  13. #define POLSTORE_PARTIAL 0x00000004
  14. #define POL_ACTION_ASSIGN 1
  15. #define POL_ACTION_UNASSIGN 2
  16. //
  17. // Structure for data interchange between Winlogon/Group Policy
  18. // and polstore (see RSOP_PolicySetting in MSDN)
  19. //
  20. typedef struct _GPO_INFO {
  21. BSTR bsCreationtime;
  22. UINT32 uiPrecedence;
  23. BSTR bsGPOID;
  24. BSTR bsSOMID;
  25. UINT32 uiTotalGPOs;
  26. } GPO_INFO, *PGPO_INFO;
  27. //
  28. // Extra RSOP information for objects stored in WMI store.
  29. //
  30. typedef struct _RSOP_INFO {
  31. LPWSTR pszCreationtime;
  32. LPWSTR pszID;
  33. LPWSTR pszName;
  34. UINT32 uiPrecedence;
  35. LPWSTR pszGPOID;
  36. LPWSTR pszSOMID;
  37. } RSOP_INFO, * PRSOP_INFO;
  38. typedef struct _IPSEC_AUTH_METHOD {
  39. DWORD dwAuthType;
  40. DWORD dwAuthLen;
  41. LPWSTR pszAuthMethod;
  42. DWORD dwAltAuthLen;
  43. PBYTE pAltAuthMethod;
  44. DWORD dwAuthFlags;
  45. } IPSEC_AUTH_METHOD, *PIPSEC_AUTH_METHOD;
  46. typedef struct _IPSEC_FILTER_SPEC {
  47. LPWSTR pszSrcDNSName;
  48. LPWSTR pszDestDNSName;
  49. LPWSTR pszDescription;
  50. GUID FilterSpecGUID;
  51. DWORD dwMirrorFlag;
  52. IPSEC_FILTER Filter;
  53. } IPSEC_FILTER_SPEC, *PIPSEC_FILTER_SPEC;
  54. typedef struct _IPSEC_FILTER_DATA {
  55. GUID FilterIdentifier;
  56. DWORD dwNumFilterSpecs;
  57. PIPSEC_FILTER_SPEC * ppFilterSpecs;
  58. DWORD dwWhenChanged;
  59. LPWSTR pszIpsecName;
  60. LPWSTR pszDescription;
  61. DWORD dwFlags;
  62. } IPSEC_FILTER_DATA, *PIPSEC_FILTER_DATA;
  63. typedef IPSEC_ALG_TYPE IPSEC_SECURITY_METHOD, *PIPSEC_SECURITY_METHOD;
  64. // Flags specific to security method
  65. #define FALLBACK_NON_IPSEC_AWARE 0x1
  66. #define FALLBACK_IKE_FAILURE 0x2
  67. typedef struct _IPSEC_NEGPOL_DATA {
  68. GUID NegPolIdentifier;
  69. GUID NegPolAction;
  70. GUID NegPolType;
  71. DWORD dwSecurityMethodCount;
  72. IPSEC_SECURITY_METHOD * pIpsecSecurityMethods;
  73. DWORD dwWhenChanged;
  74. LPWSTR pszIpsecName;
  75. LPWSTR pszDescription;
  76. DWORD dwFlags;
  77. } IPSEC_NEGPOL_DATA, *PIPSEC_NEGPOL_DATA;
  78. typedef struct _IPSEC_ISAKMP_DATA {
  79. GUID ISAKMPIdentifier;
  80. ISAKMP_POLICY ISAKMPPolicy;
  81. DWORD dwNumISAKMPSecurityMethods;
  82. PCRYPTO_BUNDLE pSecurityMethods;
  83. DWORD dwWhenChanged;
  84. DWORD dwFlags;
  85. } IPSEC_ISAKMP_DATA, *PIPSEC_ISAKMP_DATA;
  86. typedef struct _IPSEC_NFA_DATA {
  87. LPWSTR pszIpsecName;
  88. GUID NFAIdentifier;
  89. DWORD dwAuthMethodCount;
  90. PIPSEC_AUTH_METHOD * ppAuthMethods;
  91. DWORD dwInterfaceType;
  92. LPWSTR pszInterfaceName;
  93. DWORD dwTunnelIpAddr;
  94. DWORD dwTunnelFlags;
  95. DWORD dwActiveFlag;
  96. LPWSTR pszEndPointName;
  97. PIPSEC_FILTER_DATA pIpsecFilterData;
  98. PIPSEC_NEGPOL_DATA pIpsecNegPolData;
  99. DWORD dwWhenChanged;
  100. GUID NegPolIdentifier;
  101. GUID FilterIdentifier;
  102. LPWSTR pszDescription;
  103. DWORD dwFlags;
  104. } IPSEC_NFA_DATA, *PIPSEC_NFA_DATA;
  105. typedef struct _IPSEC_POLICY_DATA{
  106. GUID PolicyIdentifier;
  107. DWORD dwPollingInterval;
  108. PIPSEC_ISAKMP_DATA pIpsecISAKMPData;
  109. PIPSEC_NFA_DATA * ppIpsecNFAData;
  110. DWORD dwNumNFACount;
  111. DWORD dwWhenChanged;
  112. LPWSTR pszIpsecName;
  113. LPWSTR pszDescription;
  114. GUID ISAKMPIdentifier;
  115. PRSOP_INFO pRsopInfo;
  116. DWORD dwFlags;
  117. } IPSEC_POLICY_DATA, *PIPSEC_POLICY_DATA;
  118. LPVOID
  119. AllocPolMem(
  120. DWORD cb
  121. );
  122. BOOL
  123. FreePolMem(
  124. LPVOID pMem
  125. );
  126. LPWSTR
  127. AllocPolStr(
  128. LPCWSTR pStr
  129. );
  130. BOOL
  131. FreePolStr(
  132. LPWSTR pStr
  133. );
  134. DWORD
  135. ReallocatePolMem(
  136. LPVOID * ppOldMem,
  137. DWORD cbOld,
  138. DWORD cbNew
  139. );
  140. BOOL
  141. ReallocPolStr(
  142. LPWSTR *ppStr,
  143. LPWSTR pStr
  144. );
  145. void
  146. FreeIpsecPolicyData(
  147. PIPSEC_POLICY_DATA pIpsecPolicyData
  148. );
  149. void
  150. FreeIpsecNegPolData(
  151. PIPSEC_NEGPOL_DATA pIpsecNegPolData
  152. );
  153. void
  154. FreeIpsecFilterData(
  155. PIPSEC_FILTER_DATA pIpsecFilterData
  156. );
  157. void
  158. FreeIpsecISAKMPData(
  159. PIPSEC_ISAKMP_DATA pIpsecISAKMPData
  160. );
  161. void
  162. FreeIpsecNFAData(
  163. PIPSEC_NFA_DATA pIpsecNFAData
  164. );
  165. DWORD
  166. CopyIpsecPolicyData(
  167. PIPSEC_POLICY_DATA pIpsecPolicyData,
  168. PIPSEC_POLICY_DATA * ppIpsecPolicyData
  169. );
  170. DWORD
  171. CopyIpsecNFAData(
  172. PIPSEC_NFA_DATA pIpsecNFAData,
  173. PIPSEC_NFA_DATA * ppIpsecNFAData
  174. );
  175. DWORD
  176. CopyIpsecAuthMethod(
  177. PIPSEC_AUTH_METHOD pAuthMethod,
  178. PIPSEC_AUTH_METHOD * ppAuthMethod
  179. );
  180. DWORD
  181. CopyIpsecISAKMPData(
  182. PIPSEC_ISAKMP_DATA pIpsecISAKMPData,
  183. PIPSEC_ISAKMP_DATA * ppIpsecISAKMPData
  184. );
  185. DWORD
  186. CopyIpsecFilterData(
  187. PIPSEC_FILTER_DATA pIpsecFilterData,
  188. PIPSEC_FILTER_DATA * ppIpsecFilterData
  189. );
  190. DWORD
  191. CopyIpsecFilterSpec(
  192. PIPSEC_FILTER_SPEC pFilterSpecs,
  193. PIPSEC_FILTER_SPEC * ppFilterSpecs
  194. );
  195. DWORD
  196. CopyIpsecNegPolData(
  197. PIPSEC_NEGPOL_DATA pIpsecNegPolData,
  198. PIPSEC_NEGPOL_DATA * ppIpsecNegPolData
  199. );
  200. void
  201. FreeMulIpsecFilterData(
  202. PIPSEC_FILTER_DATA * ppIpsecFilterData,
  203. DWORD dwNumFilterObjects
  204. );
  205. void
  206. FreeMulIpsecNegPolData(
  207. PIPSEC_NEGPOL_DATA * ppIpsecNegPolData,
  208. DWORD dwNumNegPolObjects
  209. );
  210. void
  211. FreeMulIpsecPolicyData(
  212. PIPSEC_POLICY_DATA * ppIpsecPolicyData,
  213. DWORD dwNumPolicyObjects
  214. );
  215. void
  216. FreeMulIpsecNFAData(
  217. PIPSEC_NFA_DATA * ppIpsecNFAData,
  218. DWORD dwNumNFAObjects
  219. );
  220. void
  221. FreeIpsecFilterSpecs(
  222. PIPSEC_FILTER_SPEC * ppIpsecFilterSpecs,
  223. DWORD dwNumFilterSpecs
  224. );
  225. void
  226. FreeIpsecFilterSpec(
  227. PIPSEC_FILTER_SPEC pIpsecFilterSpec
  228. );
  229. void
  230. FreeMulIpsecISAKMPData(
  231. PIPSEC_ISAKMP_DATA * ppIpsecISAKMPData,
  232. DWORD dwNumISAKMPObjects
  233. );