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.

279 lines
6.6 KiB

  1. //***************************************************************************
  2. //
  3. // UPDATECFG.H
  4. //
  5. // Module: WMI Framework Instance provider
  6. //
  7. // Purpose: Defines class NlbConfigurationUpdate, used for
  8. // async update of NLB properties associated with a particular NIC.
  9. //
  10. // Copyright (c)2001 Microsoft Corporation, All Rights Reserved
  11. //
  12. // History:
  13. //
  14. // 04/05/01 JosephJ Created
  15. //
  16. //***************************************************************************
  17. typedef struct _NLB_IP_ADDRESS_INFO
  18. {
  19. WCHAR IpAddress[WLBS_MAX_CL_IP_ADDR];
  20. WCHAR SubnetMask[WLBS_MAX_CL_NET_MASK];
  21. } NLB_IP_ADDRESS_INFO;
  22. WBEMSTATUS
  23. CfgUtilInitialize(VOID);
  24. VOID
  25. CfgUtilDeitialize(VOID);
  26. //
  27. // Gets the list of IP addresses and the friendly name for the specified NIC.
  28. //
  29. WBEMSTATUS
  30. CfgUtilGetIpAddressesAndFriendlyName(
  31. IN LPCWSTR szNic,
  32. OUT UINT *pNumIpAddresses,
  33. OUT NLB_IP_ADDRESS_INFO **ppIpInfo, // Free using c++ delete operator.
  34. OUT LPWSTR *pszFriendlyName // Optional, Free using c++ delete
  35. );
  36. //
  37. // Sets the list of statically-bound IP addresses for the NIC.
  38. // if NumIpAddresses is 0, the NIC is configured for DHCP.
  39. //
  40. WBEMSTATUS
  41. CfgUtilSetStaticIpAddresses(
  42. IN LPCWSTR szNic,
  43. IN UINT NumIpAddresses,
  44. IN NLB_IP_ADDRESS_INFO *pIpInfo
  45. );
  46. //
  47. // Returns an array of pointers to string-version of GUIDS
  48. // that represent the set of alive and healthy NICS that are
  49. // suitable for NLB to bind to -- basically alive ethernet NICs.
  50. //
  51. // Delete ppNics using the delete WCHAR[] operator. Do not
  52. // delete the individual strings.
  53. //
  54. WBEMSTATUS
  55. CfgUtilsGetNlbCompatibleNics(
  56. OUT LPWSTR **ppszNics,
  57. OUT UINT *pNumNics,
  58. OUT UINT *pNumBoundToNlb // Optional
  59. );
  60. //
  61. // Determines whether NLB is bound to the specified NIC.
  62. //
  63. WBEMSTATUS
  64. CfgUtilCheckIfNlbBound(
  65. IN LPCWSTR szNic,
  66. OUT BOOL *pfBound
  67. );
  68. //
  69. // Binds/unbinds NLB to the specified NIC.
  70. //
  71. WBEMSTATUS
  72. CfgUtilChangeNlbBindState(
  73. IN LPCWSTR szNic,
  74. IN BOOL fBind
  75. );
  76. //
  77. // Initializes pParams using default values.
  78. //
  79. VOID
  80. CfgUtilInitializeParams(
  81. OUT WLBS_REG_PARAMS *pParams
  82. );
  83. //
  84. // Gets the current NLB configuration for the specified NIC
  85. //
  86. WBEMSTATUS
  87. CfgUtilGetNlbConfig(
  88. IN LPCWSTR szNic,
  89. OUT WLBS_REG_PARAMS *pParams
  90. );
  91. //
  92. // Sets the current NLB configuration for the specified NIC. This
  93. // includes notifying the driver if required.
  94. //
  95. WBEMSTATUS
  96. CfgUtilSetNlbConfig(
  97. IN LPCWSTR szNic,
  98. IN WLBS_REG_PARAMS *pParams
  99. );
  100. //
  101. // Recommends whether the update should be performed async or sync
  102. // Returns WBEM_S_FALSE if the update is a no op.
  103. // Returns WBEM_INVALID_PARAMATER if the params are invalid.
  104. //
  105. WBEMSTATUS
  106. CfgUtilsAnalyzeNlbUpdate(
  107. IN WLBS_REG_PARAMS *pCurrentParams, OPTIONAL
  108. IN WLBS_REG_PARAMS *pNewParams,
  109. OUT BOOL *pfConnectivityChange
  110. );
  111. //
  112. // Verifies that the NIC GUID exists.
  113. //
  114. WBEMSTATUS
  115. CfgUtilsValidateNicGuid(
  116. IN LPCWSTR szGuid
  117. );
  118. WBEMSTATUS
  119. CfgUtilControlCluster(
  120. IN LPCWSTR szNic,
  121. IN LONG ioctl
  122. );
  123. WBEMSTATUS
  124. CfgUtilSafeArrayFromStrings(
  125. IN LPCWSTR *pStrings,
  126. IN UINT NumStrings,
  127. OUT SAFEARRAY **ppSA
  128. );
  129. WBEMSTATUS
  130. CfgUtilStringsFromSafeArray(
  131. IN SAFEARRAY *pSA,
  132. OUT LPWSTR **ppStrings,
  133. OUT UINT *pNumStrings
  134. );
  135. _COM_SMARTPTR_TYPEDEF(IWbemClassObject, __uuidof(IWbemClassObject));
  136. _COM_SMARTPTR_TYPEDEF(IWbemServices, __uuidof(IWbemServices));
  137. _COM_SMARTPTR_TYPEDEF(IWbemLocator, __uuidof(IWbemLocator));
  138. _COM_SMARTPTR_TYPEDEF(IWbemClassObject, __uuidof(IWbemClassObject));
  139. _COM_SMARTPTR_TYPEDEF(IEnumWbemClassObject, __uuidof(IEnumWbemClassObject));
  140. _COM_SMARTPTR_TYPEDEF(IWbemCallResult, __uuidof(IWbemCallResult));
  141. _COM_SMARTPTR_TYPEDEF(IWbemStatusCodeText, __uuidof(IWbemStatusCodeText));
  142. WBEMSTATUS
  143. get_string_parameter(
  144. IN IWbemClassObjectPtr spObj,
  145. IN LPCWSTR szParameterName,
  146. OUT LPWSTR *ppStringValue
  147. );
  148. WBEMSTATUS
  149. CfgUtilGetWmiObjectInstance(
  150. IN IWbemServicesPtr spWbemServiceIF,
  151. IN LPCWSTR szClassName,
  152. IN LPCWSTR szPropertyName,
  153. IN LPCWSTR szPropertyValue,
  154. OUT IWbemClassObjectPtr &sprefObj // smart pointer
  155. );
  156. WBEMSTATUS
  157. CfgUtilGetWmiRelPath(
  158. IN IWbemClassObjectPtr spObj,
  159. OUT LPWSTR * pszRelPath // free using delete
  160. );
  161. WBEMSTATUS
  162. CfgUtilGetWmiInputInstanceAndRelPath(
  163. IN IWbemServicesPtr spWbemServiceIF,
  164. IN LPCWSTR szClassName,
  165. IN LPCWSTR szPropertyName, // NULL: return Class rel path
  166. IN LPCWSTR szPropertyValue,
  167. IN LPCWSTR szMethodName,
  168. OUT IWbemClassObjectPtr &spWbemInputInstance, // smart pointer
  169. OUT LPWSTR * pszRelPath // free using delete
  170. );
  171. WBEMSTATUS
  172. CfgUtilGetWmiStringParam(
  173. IN IWbemClassObjectPtr spObj,
  174. IN LPCWSTR szParameterName,
  175. OUT LPWSTR *ppStringValue
  176. );
  177. WBEMSTATUS
  178. CfgUtilSetWmiStringParam(
  179. IN IWbemClassObjectPtr spObj,
  180. IN LPCWSTR szParameterName,
  181. IN LPCWSTR szValue
  182. );
  183. WBEMSTATUS
  184. CfgUtilGetWmiStringArrayParam(
  185. IN IWbemClassObjectPtr spObj,
  186. IN LPCWSTR szParameterName,
  187. OUT LPWSTR **ppStrings,
  188. OUT UINT *pNumStrings
  189. );
  190. WBEMSTATUS
  191. CfgUtilSetWmiStringArrayParam(
  192. IN IWbemClassObjectPtr spObj,
  193. IN LPCWSTR szParameterName,
  194. IN LPCWSTR *ppStrings,
  195. IN UINT NumStrings
  196. );
  197. WBEMSTATUS
  198. CfgUtilGetWmiDWORDParam(
  199. IN IWbemClassObjectPtr spObj,
  200. IN LPCWSTR szParameterName,
  201. OUT DWORD *pValue
  202. );
  203. WBEMSTATUS
  204. CfgUtilSetWmiDWORDParam(
  205. IN IWbemClassObjectPtr spObj,
  206. IN LPCWSTR szParameterName,
  207. IN DWORD Value
  208. );
  209. WBEMSTATUS
  210. CfgUtilGetWmiBoolParam(
  211. IN IWbemClassObjectPtr spObj,
  212. IN LPCWSTR szParameterName,
  213. OUT BOOL *pValue
  214. );
  215. WBEMSTATUS
  216. CfgUtilSetWmiBoolParam(
  217. IN IWbemClassObjectPtr spObj,
  218. IN LPCWSTR szParameterName,
  219. IN BOOL Value
  220. );
  221. WBEMSTATUS
  222. CfgUtilConnectToServer(
  223. IN LPCWSTR szNetworkResource, // \\machinename\root\microsoftnlb \root\...
  224. IN LPCWSTR szUser, // Must be NULL for local server
  225. IN LPCWSTR szPassword, // Must be NULL for local server
  226. IN LPCWSTR szAuthority, // Must be NULL for local server
  227. OUT IWbemServices **ppWbemService // deref when done.
  228. );
  229. LPWSTR *
  230. CfgUtilsAllocateStringArray(
  231. UINT NumStrings,
  232. UINT MaxStringLen // excluding ending NULL
  233. );