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.

133 lines
2.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: L 2 T P . C P P
  7. //
  8. // Contents: Implementation of L2TP configuration object.
  9. //
  10. // Notes:
  11. //
  12. // Author: shaunco 15 Jul 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "pch.h"
  16. #pragma hdrstop
  17. #include "ncui.h"
  18. #include "ndiswan.h"
  19. #include "rasobj.h"
  20. extern const WCHAR c_szInfId_MS_L2tpMiniport[];
  21. CL2tp::CL2tp () : CRasBindObject ()
  22. {
  23. m_pnccMe = NULL;
  24. m_fSaveAfData = FALSE;
  25. }
  26. CL2tp::~CL2tp ()
  27. {
  28. ReleaseObj (m_pnccMe);
  29. }
  30. //+---------------------------------------------------------------------------
  31. // INetCfgComponentControl
  32. //
  33. STDMETHODIMP
  34. CL2tp::Initialize (
  35. INetCfgComponent* pncc,
  36. INetCfg* pnc,
  37. BOOL fInstalling)
  38. {
  39. Validate_INetCfgNotify_Initialize (pncc, pnc, fInstalling);
  40. // Hold on to our the component representing us and our host
  41. // INetCfg object.
  42. //
  43. AddRefObj (m_pnccMe = pncc);
  44. AddRefObj (m_pnc = pnc);
  45. return S_OK;
  46. }
  47. STDMETHODIMP
  48. CL2tp::Validate ()
  49. {
  50. return S_OK;
  51. }
  52. STDMETHODIMP
  53. CL2tp::CancelChanges ()
  54. {
  55. return S_OK;
  56. }
  57. STDMETHODIMP
  58. CL2tp::ApplyRegistryChanges ()
  59. {
  60. if (m_fSaveAfData)
  61. {
  62. m_AfData.SaveToRegistry (m_pnc);
  63. m_fSaveAfData = FALSE;
  64. }
  65. return S_OK;
  66. }
  67. //+---------------------------------------------------------------------------
  68. // INetCfgComponentSetup
  69. //
  70. STDMETHODIMP
  71. CL2tp::ReadAnswerFile (
  72. PCWSTR pszAnswerFile,
  73. PCWSTR pszAnswerSection)
  74. {
  75. // Read data from the answer file.
  76. // Don't let this affect the HRESULT we return.
  77. //
  78. if (SUCCEEDED(m_AfData.HrOpenAndRead (pszAnswerFile, pszAnswerSection)))
  79. {
  80. m_fSaveAfData = TRUE;
  81. }
  82. return S_OK;
  83. }
  84. STDMETHODIMP
  85. CL2tp::Install (DWORD dwSetupFlags)
  86. {
  87. HRESULT hr;
  88. Validate_INetCfgNotify_Install (dwSetupFlags);
  89. // Install the L2TP miniport driver.
  90. //
  91. hr = HrEnsureZeroOrOneAdapter (m_pnc, c_szInfId_MS_L2tpMiniport, ARA_ADD);
  92. TraceError ("CL2tp::Install", hr);
  93. return hr;
  94. }
  95. STDMETHODIMP
  96. CL2tp::Removing ()
  97. {
  98. HRESULT hr;
  99. // Install the L2TP miniport driver.
  100. //
  101. hr = HrEnsureZeroOrOneAdapter (m_pnc, c_szInfId_MS_L2tpMiniport, ARA_REMOVE);
  102. TraceError ("CL2tp::Removing", hr);
  103. return hr;
  104. }
  105. STDMETHODIMP
  106. CL2tp::Upgrade (
  107. DWORD dwSetupFlags,
  108. DWORD dwUpgradeFromBuildNo)
  109. {
  110. return S_FALSE;
  111. }