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.

136 lines
4.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: S R V R O B J . H
  7. //
  8. // Contents: Declaration of CSrvrcfg and helper functions.
  9. //
  10. // Notes:
  11. //
  12. // Author: danielwe 5 Mar 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <ncxbase.h>
  17. #include <ncatlps.h>
  18. #include <nceh.h>
  19. #include <notifval.h>
  20. #include "ncmisc.h"
  21. #include "resource.h"
  22. struct SERVER_DLG_DATA
  23. {
  24. DWORD dwSize; // corresponds to Size value in registry
  25. BOOL fAnnounce; // corresponds to Lmannounce value
  26. BOOL fLargeCache; // LargeSystemCache in Control\SessionManager
  27. // \MemoryManagement
  28. };
  29. /////////////////////////////////////////////////////////////////////////////
  30. // Srvrcfg
  31. class ATL_NO_VTABLE CSrvrcfg :
  32. public CComObjectRoot,
  33. public CComCoClass<CSrvrcfg, &CLSID_CSrvrcfg>,
  34. public INetCfgComponentControl,
  35. public INetCfgComponentSetup,
  36. public INetCfgComponentPropertyUi
  37. {
  38. public:
  39. CSrvrcfg();
  40. ~CSrvrcfg();
  41. BEGIN_COM_MAP(CSrvrcfg)
  42. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  43. COM_INTERFACE_ENTRY(INetCfgComponentPropertyUi)
  44. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  45. END_COM_MAP()
  46. // DECLARE_NOT_AGGREGATABLE(CSrvrcfg)
  47. // Remove the comment from the line above if you don't want your object to
  48. // support aggregation. The default is to support it
  49. DECLARE_REGISTRY_RESOURCEID(IDR_REG_SRVRCFG)
  50. // INetCfgComponentControl
  51. STDMETHOD (Initialize) (
  52. IN INetCfgComponent* pIComp,
  53. IN INetCfg* pINetCfg,
  54. IN BOOL fInstalling);
  55. STDMETHOD (ApplyRegistryChanges) ();
  56. STDMETHOD (ApplyPnpChanges) (
  57. IN INetCfgPnpReconfigCallback* pICallback) { return S_OK; }
  58. STDMETHOD (CancelChanges) ();
  59. STDMETHOD (Validate) ();
  60. // INetCfgComponentSetup
  61. STDMETHOD (Install) (DWORD dwSetupFlags);
  62. STDMETHOD (Upgrade) (DWORD dwSetupFlags,
  63. DWORD dwUpgradeFomBuildNo);
  64. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  65. PCWSTR pszAnswerSection);
  66. STDMETHOD (Removing) ();
  67. // INetCfgProperties
  68. STDMETHOD (QueryPropertyUi) (
  69. IN IUnknown* pUnk) { return S_OK; }
  70. STDMETHOD (SetContext) (
  71. IN IUnknown* pUnk) { return S_OK; }
  72. STDMETHOD (MergePropPages) (
  73. IN OUT DWORD* pdwDefPages,
  74. OUT LPBYTE* pahpspPrivate,
  75. OUT UINT* pcPrivate,
  76. IN HWND hwndParent,
  77. OUT PCWSTR* pszStartPage);
  78. STDMETHOD (ValidateProperties) (
  79. HWND hwndSheet);
  80. STDMETHOD (CancelProperties) ();
  81. STDMETHOD (ApplyProperties) ();
  82. // Accessors for Server dialog data
  83. const SERVER_DLG_DATA *DlgData() const
  84. {return (const SERVER_DLG_DATA *)&m_sdd;};
  85. SERVER_DLG_DATA *DlgDataRW() {return &m_sdd;};
  86. VOID SetDirty() {m_fDirty = TRUE;};
  87. SERVER_DLG_DATA m_sdd;
  88. private:
  89. HRESULT HrProcessAnswerFile(PCWSTR pszAnswerFile, PCWSTR pszAnswerSection);
  90. HRESULT HrOpenRegKeys(INetCfg *);
  91. HRESULT HrGetRegistryInfo(BOOL fInstalling);
  92. HRESULT HrSetRegistryInfo(VOID);
  93. HRESULT HrSetupPropSheets(HPROPSHEETPAGE **pahpsp, INT cPages);
  94. VOID CleanupPropPages(VOID);
  95. HRESULT HrRestoreRegistry(VOID);
  96. INetCfgComponent *m_pncc; // Place to keep my component
  97. // number of property sheet pages
  98. enum PAGES
  99. {
  100. c_cPages = 1
  101. };
  102. // Generic dialog data
  103. CPropSheetPage * m_apspObj[c_cPages];// pointer to each of the prop
  104. // sheet page objects
  105. BOOL m_fDirty;
  106. HKEY m_hkeyMM; // Memory Management key
  107. BOOL m_fOneTimeInstall; // TRUE if we're in install mode
  108. BOOL m_fUpgrade; // TRUE if we are upgrading with
  109. // an answer file
  110. BOOL m_fUpgradeFromWks; // TRUE if we are upgrading from
  111. // workstation product
  112. BOOL m_fRestoredRegistry;// TRUE if registry has been
  113. // restored on upgrade
  114. PRODUCT_FLAVOR m_pf;
  115. tstring m_strAutoTunedRestoreFile;
  116. tstring m_strSharesRestoreFile;
  117. tstring m_strParamsRestoreFile;
  118. };