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.

355 lines
6.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997 - 2000
  5. //
  6. // File: H N C U T I L . H
  7. //
  8. // Contents: Home Networking Configuration Utility Routines
  9. //
  10. // Notes:
  11. //
  12. // Author: jonburs 13 June 2000
  13. //
  14. //----------------------------------------------------------------------------
  15. #define HTONS(s) ((UCHAR)((s) >> 8) | ((UCHAR)(s) << 8))
  16. #define HTONL(l) ((HTONS(l) << 16) | HTONS((l) >> 16))
  17. #define NTOHS(s) HTONS(s)
  18. #define NTOHL(l) HTONL(l)
  19. BOOLEAN
  20. ApplicationProtocolExists(
  21. IWbemServices *piwsNamespace,
  22. BSTR bstrWQL,
  23. USHORT usOutgoingPort,
  24. UCHAR ucOutgoingIPProtocol
  25. );
  26. HRESULT
  27. HrFromLastWin32Error();
  28. HRESULT
  29. BuildAndString(
  30. LPWSTR *ppwsz,
  31. LPCWSTR pwszLeft,
  32. LPCWSTR pwszRight
  33. );
  34. HRESULT
  35. BuildAssociatorsQueryBstr(
  36. BSTR *pBstr,
  37. LPCWSTR pwszObjectPath,
  38. LPCWSTR pwszAssocClass
  39. );
  40. HRESULT
  41. BuildEqualsString(
  42. LPWSTR *ppwsz,
  43. LPCWSTR pwszLeft,
  44. LPCWSTR pwszRight
  45. );
  46. HRESULT
  47. BuildEscapedQuotedEqualsString(
  48. LPWSTR *ppwsz,
  49. LPCWSTR pwszLeft,
  50. LPCWSTR pwszRight
  51. );
  52. HRESULT
  53. BuildQuotedEqualsString(
  54. LPWSTR *ppwsz,
  55. LPCWSTR pwszLeft,
  56. LPCWSTR pwszRight
  57. );
  58. HRESULT
  59. BuildReferencesQueryBstr(
  60. BSTR *pBstr,
  61. LPCWSTR pwszObjectPath,
  62. LPCWSTR pwszTargetClass
  63. );
  64. HRESULT
  65. BuildSelectQueryBstr(
  66. BSTR *pBstr,
  67. LPCWSTR pwszProperties,
  68. LPCWSTR pwszFromClause,
  69. LPCWSTR pwszWhereClause
  70. );
  71. BOOLEAN
  72. ConnectionIsBoundToTcp(
  73. PIP_INTERFACE_INFO pIpInfoTable,
  74. GUID *pConnectionGuid
  75. );
  76. HRESULT
  77. ConvertResponseRangeArrayToInstanceSafearray(
  78. IWbemServices *piwsNamespace,
  79. USHORT uscResponses,
  80. HNET_RESPONSE_RANGE rgResponses[],
  81. SAFEARRAY **ppsa
  82. );
  83. HRESULT
  84. CopyResponseInstanceToStruct(
  85. IWbemClassObject *pwcoInstance,
  86. HNET_RESPONSE_RANGE *pResponse
  87. );
  88. HRESULT
  89. CopyStructToResponseInstance(
  90. HNET_RESPONSE_RANGE *pResponse,
  91. IWbemClassObject *pwcoInstance
  92. );
  93. HRESULT
  94. DeleteWmiInstance(
  95. IWbemServices *piwsNamespace,
  96. IWbemClassObject *pwcoInstance
  97. );
  98. LPWSTR
  99. EscapeString(
  100. LPCWSTR wsz
  101. );
  102. HRESULT
  103. InitializeNetCfgForWrite(
  104. OUT INetCfg **ppnetcfg,
  105. OUT INetCfgLock **ppncfglock
  106. );
  107. void
  108. UninitializeNetCfgForWrite(
  109. IN INetCfg *pnetcfg,
  110. IN INetCfgLock *pncfglock
  111. );
  112. HRESULT
  113. FindAdapterByGUID(
  114. IN INetCfg *pnetcfg,
  115. IN GUID *pguid,
  116. OUT INetCfgComponent **ppncfgcomp
  117. );
  118. HRESULT
  119. BindOnlyToBridge(
  120. IN INetCfgComponent *pnetcfgcomp
  121. );
  122. HRESULT
  123. FindINetConnectionByGuid(
  124. GUID *pGuid,
  125. INetConnection **ppNetCon
  126. );
  127. HRESULT
  128. GetBridgeConnection(
  129. IN IWbemServices *piwsHomenet,
  130. OUT IHNetBridge **pphnetBridge
  131. );
  132. HRESULT
  133. GetIHNetConnectionForNetCfgComponent(
  134. IN IWbemServices *piwsHomenet,
  135. IN INetCfgComponent *pnetcfgcomp,
  136. IN BOOLEAN fLanConnection,
  137. IN REFIID iid,
  138. OUT PVOID *ppv
  139. );
  140. HRESULT
  141. GetBooleanValue(
  142. IWbemClassObject *pwcoInstance,
  143. LPCWSTR pwszProperty,
  144. BOOLEAN *pfBoolean
  145. );
  146. HRESULT
  147. GetConnectionInstanceByGuid(
  148. IWbemServices *piwsNamespace,
  149. BSTR bstrWQL,
  150. GUID *pGuid,
  151. IWbemClassObject **ppwcoConnection
  152. );
  153. HRESULT
  154. GetConnAndPropInstancesByGuid(
  155. IWbemServices *piwsNamespace,
  156. GUID *pGuid,
  157. IWbemClassObject **ppwcoConnection,
  158. IWbemClassObject **ppwcoProperties
  159. );
  160. HRESULT
  161. GetConnAndPropInstancesForHNC(
  162. IWbemServices *piwsNamespace,
  163. IHNetConnection *pConn,
  164. IWbemClassObject **ppwcoConnection,
  165. IWbemClassObject **ppwcoProperties
  166. );
  167. HRESULT
  168. GetPhonebookPathFromRasNetcon(
  169. INetConnection *pConn,
  170. LPWSTR *ppwstr
  171. );
  172. HRESULT
  173. GetPortMappingBindingInstance(
  174. IWbemServices *piwsNamespace,
  175. BSTR bstrWQL,
  176. BSTR bstrConnectionPath,
  177. BSTR bstrProtocolPath,
  178. USHORT usPublicPort,
  179. IWbemClassObject **ppInstance
  180. );
  181. HRESULT
  182. GetPropInstanceFromConnInstance(
  183. IWbemServices *piwsNamespace,
  184. IWbemClassObject *pwcoConnection,
  185. IWbemClassObject **ppwcoProperties
  186. );
  187. HRESULT
  188. GetWmiObjectFromPath(
  189. IWbemServices *piwsNamespace,
  190. BSTR bstrPath,
  191. IWbemClassObject **pwcoInstance
  192. );
  193. HRESULT
  194. GetWmiPathFromObject(
  195. IWbemClassObject *pwcoInstance,
  196. BSTR *pbstrPath
  197. );
  198. HRESULT
  199. MapGuidStringToAdapterIndex(
  200. LPCWSTR pwszGuid,
  201. ULONG *pulIndex
  202. );
  203. HRESULT
  204. HostAddrToIpPsz(
  205. DWORD dwIPAddress,
  206. LPWSTR* ppszwNewStr
  207. );
  208. DWORD
  209. IpPszToHostAddr(
  210. LPCWSTR cp
  211. );
  212. BOOLEAN
  213. IsRrasConfigured();
  214. BOOLEAN
  215. IsServiceRunning(
  216. LPCWSTR pwszServiceName
  217. );
  218. HRESULT
  219. OpenRegKey(
  220. PHANDLE Key,
  221. ACCESS_MASK DesiredAccess,
  222. PCWSTR Name
  223. );
  224. BOOLEAN
  225. PortMappingProtocolExists(
  226. IWbemServices *piwsNamespace,
  227. BSTR bstrWQL,
  228. USHORT usPort,
  229. UCHAR ucIPProtocol
  230. );
  231. HRESULT
  232. QueryRegValueKey(
  233. HANDLE Key,
  234. const WCHAR ValueName[],
  235. PKEY_VALUE_PARTIAL_INFORMATION* Information
  236. );
  237. HRESULT
  238. ReadDhcpScopeSettings(
  239. DWORD *pdwScopeAddress,
  240. DWORD *pdwScopeMask
  241. );
  242. HRESULT
  243. RetrieveSingleInstance(
  244. IWbemServices *piwsNamespace,
  245. const OLECHAR *pwszClass,
  246. BOOLEAN fCreate,
  247. IWbemClassObject **ppwcoInstance
  248. );
  249. HRESULT
  250. SetBooleanValue(
  251. IWbemClassObject *pwcoInstance,
  252. LPCWSTR pwszProperty,
  253. BOOLEAN fBoolean
  254. );
  255. VOID
  256. SetProxyBlanket(
  257. IUnknown *pUnk
  258. );
  259. HRESULT
  260. SpawnNewInstance(
  261. IWbemServices *piwsNamespace,
  262. LPCWSTR wszClass,
  263. IWbemClassObject **ppwcoInstance
  264. );
  265. DWORD
  266. StartOrUpdateService(
  267. VOID
  268. );
  269. VOID
  270. StopService(
  271. VOID
  272. );
  273. HRESULT
  274. UpdateOrStopService(
  275. IWbemServices *piwsNamespace,
  276. BSTR bstrWQL,
  277. DWORD dwControlCode
  278. );
  279. VOID
  280. UpdateService(
  281. DWORD dwControlCode
  282. );
  283. VOID
  284. ValidateFinishedWCOEnum(
  285. IWbemServices *piwsNamespace,
  286. IEnumWbemClassObject *pwcoEnum
  287. );
  288. HRESULT
  289. SendPortMappingListChangeNotification();
  290. HRESULT
  291. SignalModifiedConnection(
  292. GUID *pGUID
  293. );
  294. HRESULT
  295. SignalNewConnection(
  296. GUID *pGUID
  297. );
  298. HRESULT
  299. SignalDeletedConnection(
  300. GUID *pGUID
  301. );