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.

395 lines
13 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: R A S O B J . H
  7. //
  8. // Contents: Declaration of RAS configuration objects.
  9. //
  10. // Notes:
  11. //
  12. // Author: shaunco 21 Mar 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <ncxbase.h>
  17. #include <nceh.h>
  18. #include <notifval.h>
  19. #include <mprapi.h>
  20. #include "ndiswan.h"
  21. #include "resource.h"
  22. #include "rasaf.h"
  23. #include "rasdata.h"
  24. #include "ncutil.h"
  25. HRESULT
  26. HrModemClassCoInstaller (
  27. DI_FUNCTION dif,
  28. HDEVINFO hdi,
  29. PSP_DEVINFO_DATA pdeid,
  30. PCOINSTALLER_CONTEXT_DATA pContext);
  31. //+---------------------------------------------------------------------------
  32. // L2TP
  33. //
  34. class ATL_NO_VTABLE CL2tp :
  35. public CRasBindObject,
  36. public CComObjectRoot,
  37. public CComCoClass<CL2tp, &CLSID_CL2tp>,
  38. public INetCfgComponentControl,
  39. public INetCfgComponentSetup
  40. {
  41. protected:
  42. // This is handed to us during INetCfgComponentControl::Initialize.
  43. INetCfgComponent* m_pnccMe;
  44. CL2tpAnswerFileData m_AfData;
  45. BOOL m_fSaveAfData;
  46. public:
  47. CL2tp ();
  48. ~CL2tp ();
  49. BEGIN_COM_MAP(CL2tp)
  50. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  51. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  52. END_COM_MAP()
  53. DECLARE_REGISTRY_RESOURCEID(IDR_REG_L2TP)
  54. // INetCfgComponentControl
  55. STDMETHOD (Initialize) (
  56. IN INetCfgComponent* pIComp,
  57. IN INetCfg* pINetCfg,
  58. IN BOOL fInstalling);
  59. STDMETHOD (ApplyRegistryChanges) ();
  60. STDMETHOD (ApplyPnpChanges) (
  61. IN INetCfgPnpReconfigCallback* pICallback) { return S_OK; }
  62. STDMETHOD (CancelChanges) ();
  63. STDMETHOD (Validate) ();
  64. // INetCfgComponentSetup
  65. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  66. PCWSTR pszAnswerSection);
  67. STDMETHOD (Upgrade) (DWORD dwSetupFlags,
  68. DWORD dwUpgradeFromBuildNo);
  69. STDMETHOD (Install) (DWORD dwSetupFlags);
  70. STDMETHOD (Removing) ();
  71. };
  72. //+---------------------------------------------------------------------------
  73. // PPTP
  74. //
  75. class ATL_NO_VTABLE CPptp :
  76. public CRasBindObject,
  77. public CComObjectRoot,
  78. public CComCoClass<CPptp, &CLSID_CPptp>,
  79. public INetCfgComponentControl,
  80. public INetCfgComponentSetup
  81. {
  82. protected:
  83. // This is handed to us during INetCfgComponentControl::Initialize.
  84. INetCfgComponent* m_pnccMe;
  85. CPptpAnswerFileData m_AfData;
  86. BOOL m_fSaveAfData;
  87. public:
  88. CPptp ();
  89. ~CPptp ();
  90. BEGIN_COM_MAP(CPptp)
  91. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  92. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  93. END_COM_MAP()
  94. DECLARE_REGISTRY_RESOURCEID(IDR_REG_PPTP)
  95. // INetCfgComponentControl
  96. STDMETHOD (Initialize) (
  97. IN INetCfgComponent* pIComp,
  98. IN INetCfg* pINetCfg,
  99. IN BOOL fInstalling);
  100. STDMETHOD (ApplyRegistryChanges) ();
  101. STDMETHOD (ApplyPnpChanges) (
  102. IN INetCfgPnpReconfigCallback* pICallback) { return S_OK; }
  103. STDMETHOD (CancelChanges) ();
  104. STDMETHOD (Validate) ();
  105. // INetCfgComponentSetup
  106. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  107. PCWSTR pszAnswerSection);
  108. STDMETHOD (Upgrade) (DWORD dwSetupFlags,
  109. DWORD dwUpgradeFromBuildNo);
  110. STDMETHOD (Install) (DWORD dwSetupFlags);
  111. STDMETHOD (Removing) ();
  112. };
  113. //+---------------------------------------------------------------------------
  114. // PPPOE
  115. //
  116. class ATL_NO_VTABLE CPppoe :
  117. public CRasBindObject,
  118. public CComObjectRoot,
  119. public CComCoClass<CPppoe, &CLSID_CPppoe>,
  120. public INetCfgComponentControl,
  121. public INetCfgComponentSetup
  122. {
  123. protected:
  124. // This is handed to us during INetCfgComponentControl::Initialize.
  125. INetCfgComponent* m_pnccMe;
  126. CPppoeAnswerFileData m_AfData;
  127. BOOL m_fSaveAfData;
  128. public:
  129. CPppoe ();
  130. ~CPppoe ();
  131. BEGIN_COM_MAP(CPppoe)
  132. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  133. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  134. END_COM_MAP()
  135. DECLARE_REGISTRY_RESOURCEID(IDR_REG_PPPOE)
  136. // INetCfgComponentControl
  137. STDMETHOD (Initialize) (
  138. IN INetCfgComponent* pIComp,
  139. IN INetCfg* pINetCfg,
  140. IN BOOL fInstalling);
  141. STDMETHOD (ApplyRegistryChanges) ();
  142. STDMETHOD (ApplyPnpChanges) (
  143. IN INetCfgPnpReconfigCallback* pICallback) { return S_OK; }
  144. STDMETHOD (CancelChanges) ();
  145. STDMETHOD (Validate) ();
  146. // INetCfgComponentSetup
  147. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  148. PCWSTR pszAnswerSection);
  149. STDMETHOD (Upgrade) (DWORD dwSetupFlags,
  150. DWORD dwUpgradeFromBuildNo);
  151. STDMETHOD (Install) (DWORD dwSetupFlags);
  152. STDMETHOD (Removing) ();
  153. };
  154. //+---------------------------------------------------------------------------
  155. // RAS Client
  156. //
  157. class ATL_NO_VTABLE CRasCli :
  158. public CComObjectRoot,
  159. public CComCoClass<CRasCli, &CLSID_CRasCli>,
  160. public INetCfgComponentControl,
  161. public INetCfgComponentSetup
  162. {
  163. protected:
  164. // These are handed to us during INetCfgComponentControl::Initialize.
  165. INetCfg* m_pnc;
  166. INetCfgComponent* m_pnccMe;
  167. public:
  168. CRasCli ();
  169. ~CRasCli ();
  170. BEGIN_COM_MAP(CRasCli)
  171. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  172. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  173. END_COM_MAP()
  174. DECLARE_REGISTRY_RESOURCEID(IDR_REG_RASCLI)
  175. // INetCfgComponentControl
  176. STDMETHOD (Initialize) (
  177. IN INetCfgComponent* pIComp,
  178. IN INetCfg* pINetCfg,
  179. IN BOOL fInstalling);
  180. STDMETHOD (ApplyRegistryChanges) ();
  181. STDMETHOD (ApplyPnpChanges) (
  182. IN INetCfgPnpReconfigCallback* pICallback) { return S_OK; }
  183. STDMETHOD (CancelChanges) ();
  184. STDMETHOD (Validate) ();
  185. // INetCfgComponentSetup
  186. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  187. PCWSTR pszAnswerSection);
  188. STDMETHOD (Upgrade) (DWORD dwSetupFlags,
  189. DWORD dwUpgradeFromBuildNo);
  190. STDMETHOD (Install) (DWORD dwSetupFlags);
  191. STDMETHOD (Removing) ();
  192. };
  193. //+---------------------------------------------------------------------------
  194. // RAS Server
  195. //
  196. class ATL_NO_VTABLE CRasSrv :
  197. public CRasBindObject,
  198. public CComObjectRoot,
  199. public CComCoClass<CRasSrv, &CLSID_CRasSrv>,
  200. public INetCfgComponentControl,
  201. public INetCfgComponentSetup
  202. {
  203. protected:
  204. // This is handed to us during INetCfgComponentControl::Initialize.
  205. INetCfgComponent* m_pnccMe;
  206. // This is our in-memory state.
  207. BOOL m_fInstalling;
  208. BOOL m_fRemoving;
  209. BOOL m_fNt4ServerUpgrade;
  210. CRasSrvAnswerFileData m_AfData;
  211. BOOL m_fSaveAfData;
  212. public:
  213. CRasSrv ();
  214. ~CRasSrv ();
  215. BEGIN_COM_MAP(CRasSrv)
  216. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  217. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  218. END_COM_MAP()
  219. DECLARE_REGISTRY_RESOURCEID(IDR_REG_RASSRV)
  220. // INetCfgComponentControl
  221. STDMETHOD (Initialize) (
  222. IN INetCfgComponent* pIComp,
  223. IN INetCfg* pINetCfg,
  224. IN BOOL fInstalling);
  225. STDMETHOD (ApplyRegistryChanges) ();
  226. STDMETHOD (ApplyPnpChanges) (
  227. IN INetCfgPnpReconfigCallback* pICallback) { return S_OK; }
  228. STDMETHOD (CancelChanges) ();
  229. STDMETHOD (Validate) ();
  230. // INetCfgComponentSetup
  231. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  232. PCWSTR pszAnswerSection);
  233. STDMETHOD (Upgrade) (DWORD dwSetupFlags,
  234. DWORD dwUpgradeFromBuildNo);
  235. STDMETHOD (Install) (DWORD dwSetupFlags);
  236. STDMETHOD (Removing) ();
  237. };
  238. //+---------------------------------------------------------------------------
  239. // Steelhead
  240. //
  241. typedef void (WINAPI* PFN_MAKE_INTERFACE_INFO)(PCWSTR pszwAdapterName,
  242. DWORD dwPacketType,
  243. LPBYTE* ppb);
  244. typedef void (WINAPI* PFN_MAKE_TRANSPORT_INFO)(LPBYTE* ppbGlobal,
  245. LPBYTE* ppbClient);
  246. struct ROUTER_MANAGER_INFO
  247. {
  248. DWORD dwTransportId;
  249. DWORD dwPacketType;
  250. PCWSTR pszwTransportName;
  251. PCWSTR pszwDllPath;
  252. PFN_MAKE_INTERFACE_INFO pfnMakeInterfaceInfo;
  253. PFN_MAKE_TRANSPORT_INFO pfnMakeTransportInfo;
  254. };
  255. class ATL_NO_VTABLE CSteelhead :
  256. public CRasBindObject,
  257. public CComObjectRoot,
  258. public CComCoClass<CSteelhead, &CLSID_CSteelhead>,
  259. public INetCfgComponentControl,
  260. public INetCfgComponentSetup,
  261. public INetCfgComponentNotifyGlobal
  262. {
  263. protected:
  264. // This is handed to us during INetCfgComponentControl::Initialize.
  265. INetCfgComponent* m_pnccMe;
  266. HANDLE m_hMprConfig;
  267. HANDLE m_hMprAdmin;
  268. BOOL m_fRemoving;
  269. BOOL m_fUpdateRouterConfiguration;
  270. BOOL FAdapterExistsWithMatchingBindName (PCWSTR pszwAdapterName,
  271. INetCfgComponent** ppnccAdapter);
  272. BOOL FIpxFrameTypeInUseOnAdapter (DWORD dwwFrameType,
  273. PCWSTR pszwAdapterName);
  274. BOOL FIpxFrameTypeInUseOnAdapter (PCWSTR pszwFrameType,
  275. PCWSTR pszwAdapterName);
  276. HRESULT HrEnsureRouterInterfaceForAdapter (ROUTER_INTERFACE_TYPE dwIfType,
  277. DWORD dwPacketType,
  278. PCWSTR pszwAdapterName,
  279. PCWSTR pszwInterfaceName,
  280. const ROUTER_MANAGER_INFO& rmi);
  281. HRESULT HrEnsureIpxRouterInterfacesForAdapter (PCWSTR pszwAdapterName);
  282. HRESULT HrEnsureRouterInterface (ROUTER_INTERFACE_TYPE dwIfType,
  283. PCWSTR pszwInterfaceName,
  284. HANDLE* phConfigInterface,
  285. HANDLE* phAdminInterface);
  286. HRESULT HrEnsureRouterInterfaceTransport (PCWSTR pszwAdapterName,
  287. DWORD dwPacketType,
  288. HANDLE hConfigInterface,
  289. HANDLE hAdminInterface,
  290. const ROUTER_MANAGER_INFO& rmi);
  291. HRESULT HrEnsureRouterManager (const ROUTER_MANAGER_INFO& rmi);
  292. HRESULT HrEnsureRouterManagerDeleted (const ROUTER_MANAGER_INFO& rmi);
  293. HRESULT HrPassToAddInterfaces ();
  294. HRESULT HrPassToRemoveInterfaces (BOOL fFromRunningRouter);
  295. HRESULT HrPassToRemoveInterfaceTransports (MPR_INTERFACE_0* pri0,
  296. PCWSTR pszwAdapterName,
  297. INetCfgComponent* pnccAdapter);
  298. HRESULT HrUpdateRouterConfiguration ();
  299. #if (WINVER >= 0x0501)
  300. HRESULT HrRemoveIPXRouterConfiguration (BOOL fRouter);
  301. #endif
  302. public:
  303. CSteelhead ();
  304. ~CSteelhead ();
  305. BEGIN_COM_MAP(CSteelhead)
  306. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  307. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  308. COM_INTERFACE_ENTRY(INetCfgComponentNotifyGlobal)
  309. END_COM_MAP()
  310. DECLARE_REGISTRY_RESOURCEID(IDR_REG_STEELHEAD)
  311. // INetCfgComponentControl
  312. STDMETHOD (Initialize) (
  313. IN INetCfgComponent* pIComp,
  314. IN INetCfg* pINetCfg,
  315. IN BOOL fInstalling);
  316. STDMETHOD (ApplyRegistryChanges) ();
  317. STDMETHOD (ApplyPnpChanges) (
  318. IN INetCfgPnpReconfigCallback* pICallback) { return S_OK; }
  319. STDMETHOD (CancelChanges) ();
  320. STDMETHOD (Validate) ();
  321. // INetCfgComponentSetup
  322. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  323. PCWSTR pszAnswerSection);
  324. STDMETHOD (Upgrade) (DWORD dwSetupFlags,
  325. DWORD dwUpgradeFromBuildNo);
  326. STDMETHOD (Install) (DWORD dwSetupFlags);
  327. STDMETHOD (Removing) ();
  328. // INetCfgNotifyGlobal
  329. STDMETHOD (GetSupportedNotifications) (DWORD* pdwNotificationFlag );
  330. STDMETHOD (SysQueryBindingPath) (DWORD dwChangeFlag, INetCfgBindingPath* pncbp);
  331. STDMETHOD (SysQueryComponent) (DWORD dwChangeFlag, INetCfgComponent* pncc);
  332. STDMETHOD (SysNotifyBindingPath) (DWORD dwChangeFlag, INetCfgBindingPath* pncbp);
  333. STDMETHOD (SysNotifyComponent) (DWORD dwChangeFlag, INetCfgComponent* pncc);
  334. };