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.

208 lines
5.5 KiB

  1. //////////////////////////////////////////////////////////////////////
  2. // globals.h : Declaration of some global const and functions
  3. // Copyright (c)1997-2001 Microsoft Corporation
  4. //
  5. // some global definitions
  6. // Original Create Date: 2/21/2001
  7. // Original Author: shawnwu
  8. //////////////////////////////////////////////////////////////////////
  9. #pragma once
  10. #include "precomp.h"
  11. #include "netseccore.h"
  12. extern CComModule _Module;
  13. #include <atlcom.h>
  14. #include "resource.h" // main symbols
  15. extern LPCWSTR pszRollbackAll;
  16. extern LPCWSTR pszEmptyRollbackToken;
  17. extern LPCWSTR pszCreateDefaultPolicy;
  18. extern LPCWSTR pszGetDefaultPolicyName;
  19. const DWORD Guid_Buffer_Size = 64;
  20. using namespace std;
  21. //
  22. // these are the WMI class names
  23. //
  24. extern LPCWSTR pszNspGeneral;
  25. extern LPCWSTR pszNspTcp;
  26. extern LPCWSTR pszNspIPConfigure;
  27. extern LPCWSTR pszNspFilter;
  28. extern LPCWSTR pszNspTransportFilter;
  29. extern LPCWSTR pszNspTunnelFilter;
  30. extern LPCWSTR pszNspMMFilter;
  31. extern LPCWSTR pszNspQMPolicy;
  32. extern LPCWSTR pszNspMMPolicy;
  33. extern LPCWSTR pszNspMMAuth;
  34. extern LPCWSTR pszNspExceptionPorts;
  35. extern LPCWSTR pszNspRollbackFilter;
  36. extern LPCWSTR pszNspRollbackPolicy;
  37. extern LPCWSTR pszNspRollbackMMAuth;
  38. extern LPCWSTR pszNspTranxManager;
  39. //
  40. // the following are names of classes for SCW
  41. //
  42. extern LPCWSTR pszScwActiveSocket;
  43. //
  44. // these are the WMI class property names
  45. //
  46. extern LPCWSTR g_pszFilterName;
  47. extern LPCWSTR g_pszDirection;
  48. extern LPCWSTR g_pszFilterType;
  49. extern LPCWSTR g_pszInterfaceType;
  50. //extern LPCWSTR g_pszGenericFilter;
  51. extern LPCWSTR g_pszCreateMirror;
  52. extern LPCWSTR g_pszSrcAddr;
  53. extern LPCWSTR g_pszSrcSubnetMask;
  54. extern LPCWSTR g_pszSrcAddrType;
  55. extern LPCWSTR g_pszDestAddr;
  56. extern LPCWSTR g_pszDestSubnetMask;
  57. extern LPCWSTR g_pszDestAddrType;
  58. extern LPCWSTR g_pszMMPolicyName;
  59. extern LPCWSTR g_pszMMAuthName;
  60. extern LPCWSTR g_pszInboundFlag;
  61. extern LPCWSTR g_pszOutboundFlag;
  62. extern LPCWSTR g_pszProtocol;
  63. extern LPCWSTR g_pszSrcPort;
  64. extern LPCWSTR g_pszDestPort;
  65. extern LPCWSTR g_pszQMPolicyName;
  66. extern LPCWSTR g_pszTunnelSrcAddr;
  67. extern LPCWSTR g_pszTunnelSrcSubnetMask;
  68. extern LPCWSTR g_pszTunnelSrcAddrType;
  69. extern LPCWSTR g_pszTunnelDestAddr;
  70. extern LPCWSTR g_pszTunnelDestSubnetMask;
  71. extern LPCWSTR g_pszTunnelDestAddrType;
  72. extern LPCWSTR g_pszPolicyName;
  73. extern LPCWSTR g_pszPolicyFlag;
  74. extern LPCWSTR g_pszOfferCount;
  75. extern LPCWSTR g_pszSoftSAExpTime;
  76. extern LPCWSTR g_pszKeyLifeTime;
  77. extern LPCWSTR g_pszKeyLifeTimeKBytes;
  78. extern LPCWSTR g_pszQMLimit;
  79. extern LPCWSTR g_pszDHGroup;
  80. extern LPCWSTR g_pszEncryptID;
  81. extern LPCWSTR g_pszHashID;
  82. extern LPCWSTR g_pszPFSRequired;
  83. extern LPCWSTR g_pszPFSGroup;
  84. extern LPCWSTR g_pszNumAlgos;
  85. extern LPCWSTR g_pszAlgoOp;
  86. extern LPCWSTR g_pszAlgoID;
  87. extern LPCWSTR g_pszAlgoSecID;
  88. extern LPCWSTR g_pszAuthMethodID;
  89. extern LPCWSTR g_pszNumAuthInfos;
  90. extern LPCWSTR g_pszAuthMethod;
  91. extern LPCWSTR g_pszAuthInfoSize;
  92. extern LPCWSTR g_pszAuthInfo;
  93. extern LPCWSTR g_pszTokenGuid;
  94. extern LPCWSTR g_pszAction;
  95. extern LPCWSTR g_pszPreviousData;
  96. extern LPCWSTR g_pszFilterGuid;
  97. extern LPCWSTR g_pszFilterType;
  98. extern LPCWSTR g_pszPolicyType;
  99. extern LPCWSTR g_pszRollback;
  100. extern LPCWSTR g_pszClearAll;
  101. extern LPCWSTR g_pszEncryption;
  102. //
  103. // constant string for SPD data
  104. //
  105. extern LPCWSTR g_pszIP_ADDRESS_ME;
  106. extern LPCWSTR g_pszIP_ADDRESS_MASK_NONE;
  107. extern LPCWSTR g_pszSUBNET_ADDRESS_ANY;
  108. extern LPCWSTR g_pszSUBNET_MASK_ANY;
  109. //
  110. // these are WMI class property names for SCW
  111. //
  112. extern LPCWSTR g_pszPort;
  113. //extern LPCWSTR g_pszProtocol;
  114. extern LPCWSTR g_pszAddress;
  115. extern LPCWSTR g_pszForeignAddress;
  116. extern LPCWSTR g_pszForeignPort;
  117. extern LPCWSTR g_pszState; //Listening, Established, TIME_WAIT
  118. extern LPCWSTR g_pszProcessID;
  119. extern LPCWSTR g_pszImageName;
  120. extern LPCWSTR g_pszImageTitleBar;
  121. extern LPCWSTR g_pszNTService;
  122. //
  123. // these are default quick mode policy names
  124. //
  125. extern LPCWSTR g_pszDefQMPolicyNegNone;
  126. extern LPCWSTR g_pszDefQMPolicyNegRequest;
  127. extern LPCWSTR g_pszDefQMPolicyNegRequire;
  128. extern LPCWSTR g_pszDefQMPolicyNegMax;
  129. //
  130. // This defines what action has taken place
  131. //
  132. enum ActionEnum
  133. {
  134. Action_Add = 0,
  135. Action_Delete = 1,
  136. Action_CallMethod = 2,
  137. };
  138. //
  139. // Some global helper functions
  140. //
  141. HRESULT CheckImpersonationLevel();
  142. HRESULT CheckSafeArraySize(VARIANT* pVar, long lCount, long* plLB, long* plUP);
  143. HRESULT GetDWORDSafeArrayElements (
  144. VARIANT * pVar,
  145. long lCount,
  146. DWORD * pValArray
  147. );
  148. HRESULT FindMMAuthMethodsByID (
  149. IN LPCWSTR pszGuid,
  150. OUT PMM_AUTH_METHODS * ppAuthMethod,
  151. IN OUT DWORD * pdwResumeHandle
  152. );
  153. HRESULT GetClassEnum (
  154. IN IWbemServices * pNamespace,
  155. IN LPCWSTR pszClassName,
  156. OUT IEnumWbemClassObject ** pEnum
  157. );
  158. HRESULT DeleteRollbackObjects (
  159. IN IWbemServices * pNamespace,
  160. IN LPCWSTR pszClassName
  161. );
  162. HRESULT IPSecErrorToWbemError (
  163. IN DWORD dwErr
  164. );