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.

139 lines
2.5 KiB

  1. //++
  2. //
  3. // Copyright (C) Microsoft Corporation, 1987 - 2001
  4. //
  5. // Module Name:
  6. //
  7. // spdcheck.h
  8. //
  9. // Abstract:
  10. //
  11. // SPD Check stats for netdiag
  12. //
  13. // Author:
  14. //
  15. // Madhurima Pawar (mpawar) - 10/15/2001
  16. //
  17. // Environment:
  18. //
  19. // User mode only.
  20. // Contains NT-specific code.
  21. //
  22. //--
  23. #ifndef HEADER_SPDCHECK
  24. #define HEADER_SPDCHECK
  25. #include <ipsec.h>
  26. #include<winipsec.h>
  27. #include<ipsecshr.h>
  28. #include <oleauto.h>
  29. #include <oakdefs.h>
  30. #include <polstore2.h>
  31. //#include <polstructs.h>
  32. //++
  33. //define
  34. //--
  35. #define MAXSTRLEN (1024)
  36. typedef struct{
  37. HANDLE hPolicyStore;
  38. GUID gNegPolAction;
  39. DWORD dwFlags;
  40. }POLICYPARAMS, *PPOLICYPARAMS;
  41. typedef struct _filter_list{
  42. IPSEC_FILTER ipsecFilter;
  43. struct _filter_list *next;
  44. } FILTERLIST, *PFILTERLIST;
  45. //flags for filterparams
  46. #define PROCESS_NONE 1
  47. #define PROCESS_QM_FILTER 2
  48. #define PROCESS_BOTH 4
  49. #define ALLOW_SOFT 8
  50. #define Match(_guid, _filterList, _numFilter)\
  51. while(_numFilter)\
  52. {\
  53. if(IsEqualGUID(&(_filterList[_numFilter].gFilterID),&_guid))\
  54. break;\
  55. _numFilter --;\
  56. }\
  57. //Globals
  58. PFILTERLIST gpFilterList;
  59. DWORD dwNumofFilters;
  60. DWORD gErrorFlag;
  61. // policy source constants
  62. #define PS_NO_POLICY 0
  63. #define PS_DS_POLICY 1
  64. #define PS_LOC_POLICY 2
  65. //++
  66. //macro defintion
  67. //--
  68. #define BAIL_ON_WIN32_ERROR(dwError) \
  69. if (dwError) {\
  70. goto error; \
  71. }
  72. #define BAIL_ON_FAILURE(hr) \
  73. if (FAILED(hr)) {\
  74. goto error; \
  75. }
  76. #define reportErr()\
  77. if(dwError != ERROR_SUCCESS)\
  78. {\
  79. reportError(dwError, pParams, pResults);\
  80. gErrorFlag = 1;\
  81. goto error;\
  82. }\
  83. //++
  84. //data structures
  85. //--
  86. typedef struct
  87. {
  88. int iPolicySource; // one of the three constants mentioned above
  89. TCHAR pszPolicyName[MAXSTRLEN]; // policy name
  90. TCHAR pszPolicyDesc[MAXSTRLEN]; // policy description
  91. TCHAR pszPolicyPath[MAXSTRLEN]; // policy path (DN or RegKey)
  92. time_t timestamp; // last updated time
  93. GUID policyGUID;
  94. } POLICY_INFO, *PPOLICY_INFO;
  95. typedef struct{
  96. NETDIAG_PARAMS* pParams;
  97. NETDIAG_RESULT* pResults;
  98. }CHECKLIST, *PCHECKLIST;
  99. //++
  100. //global variables
  101. //--
  102. POLICY_INFO piAssignedPolicy;
  103. //++
  104. //function definition
  105. //--
  106. BOOL SPDCheckTEST(NETDIAG_PARAMS* pParams,
  107. NETDIAG_RESULT* pResults); //defined in spdcheck.cpp
  108. void reportError ( DWORD dwError,
  109. NETDIAG_PARAMS* pParams,
  110. NETDIAG_RESULT* pResults );
  111. #endif