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.

195 lines
5.8 KiB

  1. //-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: A U N I O B J . H
  7. //
  8. // Contents: CAtmUniCfg interface declaration
  9. //
  10. // Notes:
  11. //
  12. // Author: tongl 21 Mar 1997
  13. //
  14. //-----------------------------------------------------------------------
  15. #pragma once
  16. #include <ncxbase.h>
  17. #include <nceh.h>
  18. #include <notifval.h>
  19. #include "resource.h"
  20. #include "atmutil.h"
  21. #include "pvcdata.h"
  22. // Constants
  23. static const WCHAR c_szPVC[] = L"PVC";
  24. // Reg key value names ( non-configurable parameters )
  25. static const WCHAR c_szMaxActiveSVCs[] = L"MaxActiveSVCs";
  26. static const WCHAR c_szMaxSVCsInProgress[] = L"MaxSVCsInProgress";
  27. static const WCHAR c_szMaxPMPSVCs[] = L"MaxPMPSVCs";
  28. static const WCHAR c_szMaxActiveParties[] = L"MaxActiveParties";
  29. static const WCHAR c_szMaxPartiesInProgress[] = L"MaxPartiesInProgress";
  30. // Default Reg key values ( non-configurable parameters )
  31. static const c_dwWksMaxActiveSVCs = 256;
  32. static const c_dwSrvMaxActiveSVCs = 1024;
  33. static const c_dwWksMaxSVCsInProgress = 8;
  34. static const c_dwSrvMaxSVCsInProgress = 32;
  35. static const c_dwWksMaxPMPSVCs = 32;
  36. static const c_dwSrvMaxPMPSVCs = 64;
  37. static const c_dwWksMaxActiveParties = 64;
  38. static const c_dwSrvMaxActiveParties = 512;
  39. static const c_dwWksMaxPartiesInProgress = 8;
  40. static const c_dwSrvMaxPartiesInProgress = 32;
  41. // number of property sheet pages
  42. static const INT c_cUniPages = 1;
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CAtmUniCfg
  45. class ATL_NO_VTABLE CAtmUniCfg :
  46. public CComObjectRoot,
  47. public CComCoClass<CAtmUniCfg, &CLSID_CAtmUniCfg>,
  48. public INetCfgComponentControl,
  49. public INetCfgComponentSetup,
  50. public INetCfgComponentNotifyBinding,
  51. public INetCfgComponentPropertyUi
  52. {
  53. public:
  54. CAtmUniCfg();
  55. ~CAtmUniCfg();
  56. BEGIN_COM_MAP(CAtmUniCfg)
  57. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  58. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  59. COM_INTERFACE_ENTRY(INetCfgComponentNotifyBinding)
  60. COM_INTERFACE_ENTRY(INetCfgComponentPropertyUi)
  61. END_COM_MAP()
  62. // DECLARE_NOT_AGGREGATABLE(CAtmUniCfg)
  63. // Remove the comment from the line above if you don't want your object to
  64. // support aggregation. The default is to support it
  65. DECLARE_REGISTRY_RESOURCEID(IDR_REG_AUNICFG)
  66. // INetCfgComponentControl
  67. STDMETHOD (Initialize) (
  68. IN INetCfgComponent* pIComp,
  69. IN INetCfg* pINetCfg,
  70. IN BOOL fInstalling);
  71. STDMETHOD (ApplyRegistryChanges) ();
  72. STDMETHOD (ApplyPnpChanges) (
  73. IN INetCfgPnpReconfigCallback* pICallback) { return S_OK; }
  74. STDMETHOD (CancelChanges) ();
  75. STDMETHOD (Validate) ();
  76. // INetCfgComponentSetup
  77. STDMETHOD (Install) (DWORD dwSetupFlags);
  78. STDMETHOD (Upgrade) (DWORD dwSetupFlags,
  79. DWORD dwUpgradeFomBuildNo );
  80. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  81. PCWSTR pszAnswerSection);
  82. STDMETHOD (Removing)();
  83. // INetCfgNotifyBinding
  84. STDMETHOD (QueryBindingPath) (DWORD dwChangeFlag, INetCfgBindingPath* pncbp);
  85. STDMETHOD (NotifyBindingPath) (DWORD dwChangeFlag, INetCfgBindingPath* pncbp);
  86. // INetCfgProperties
  87. STDMETHOD (QueryPropertyUi) (
  88. IN IUnknown* pUnk);
  89. STDMETHOD (SetContext) (
  90. IN IUnknown* pUnk);
  91. STDMETHOD (MergePropPages) (
  92. IN OUT DWORD* pdwDefPages,
  93. OUT LPBYTE* pahpspPrivate,
  94. OUT UINT* pcPrivate,
  95. IN HWND hwndParent,
  96. OUT PCWSTR* pszStartPage);
  97. STDMETHOD (ValidateProperties) (
  98. HWND hwndSheet);
  99. STDMETHOD (CancelProperties) ();
  100. STDMETHOD (ApplyProperties) ();
  101. // help functions
  102. CUniAdapterInfo * GetSecondMemoryAdapterInfo()
  103. {
  104. return m_pSecondMemoryAdapterInfo;
  105. }
  106. void SetSecondMemoryModified()
  107. {
  108. m_fSecondMemoryModified = TRUE;
  109. }
  110. private:
  111. // Place to keep the INetCfg pointer
  112. INetCfg * m_pnc;
  113. // Place to keep corresponding component object
  114. INetCfgComponent * m_pnccUni;
  115. INetCfgComponent * m_pnccRwan;
  116. // Place to keep the pointer to UI context
  117. IUnknown * m_pUnkContext;
  118. // (STL) List of adapter info structures
  119. UNI_ADAPTER_LIST m_listAdapters;
  120. // Guid of the current connection
  121. tstring m_strGuidConn;
  122. // Second memory adapter info structures
  123. CUniAdapterInfo * m_pSecondMemoryAdapterInfo;
  124. // Do we need to update registry on Apply
  125. BOOL m_fSaveRegistry;
  126. BOOL m_fUIParamChanged;
  127. BOOL m_fSecondMemoryModified;
  128. // property page
  129. class CUniPage * m_uniPage;
  130. // Load parameters from registry
  131. HRESULT HrLoadSettings();
  132. // Save parameters to registry
  133. HRESULT HrSaveSettings();
  134. // Add/Remove adapters from first memory state
  135. HRESULT HrAddAdapter(INetCfgComponent * pncc);
  136. HRESULT HrRemoveAdapter(INetCfgComponent * pncc);
  137. HRESULT HrBindAdapter(INetCfgComponent * pnccAdapter);
  138. HRESULT HrUnBindAdapter(INetCfgComponent * pnccAdapter);
  139. // Set defaults for statis parameters
  140. HRESULT HrSaveDefaultSVCParam(HKEY hkey);
  141. // Check if a card guid string is on m_listAdapters
  142. BOOL fIsAdapterOnList(PCWSTR pszBindName, CUniAdapterInfo ** ppAdapterInfo);
  143. HRESULT HrSetConnectionContext();
  144. HRESULT HrSetupPropSheets(HPROPSHEETPAGE ** pahpsp, INT * pcPages);
  145. // Have we already load PVC info into memory
  146. BOOL m_fPVCInfoLoaded;
  147. // load and save adapter PVC info to first memory
  148. HRESULT HrLoadPVCRegistry();
  149. HRESULT HrLoadAdapterPVCRegistry(HKEY hkeyAdapterParam, CUniAdapterInfo * pAdapterInfo);
  150. HRESULT HrSaveAdapterPVCRegistry(HKEY hkeyAdapterParam, CUniAdapterInfo * pAdapterInfo);
  151. // load and save adapter parameters to second memory
  152. HRESULT HrLoadAdapterPVCInfo();
  153. HRESULT HrSaveAdapterPVCInfo();
  154. };