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.

185 lines
6.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: M S C L I O B J . H
  7. //
  8. // Contents: Declaration of CMSClient and helper functions.
  9. //
  10. // Notes:
  11. //
  12. // Author: danielwe 25 Feb 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <ncxbase.h>
  17. #include <nceh.h>
  18. #include <notifval.h>
  19. #include <ncatlps.h>
  20. #include "resource.h"
  21. // constant defined in MSDN
  22. static const c_cchMaxNetAddr = 80;
  23. struct RPC_CONFIG_DATA
  24. {
  25. tstring strProt;
  26. tstring strNetAddr;
  27. tstring strEndPoint;
  28. };
  29. /////////////////////////////////////////////////////////////////////////////
  30. // MSClient
  31. class ATL_NO_VTABLE CMSClient :
  32. public INetCfgComponentControl,
  33. public INetCfgComponentSetup,
  34. public INetCfgComponentNotifyGlobal,
  35. public INetCfgComponentPropertyUi,
  36. public CComObjectRoot,
  37. public CComCoClass<CMSClient,&CLSID_CMSClient>
  38. {
  39. public:
  40. CMSClient();
  41. ~CMSClient();
  42. BEGIN_COM_MAP(CMSClient)
  43. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  44. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  45. COM_INTERFACE_ENTRY(INetCfgComponentNotifyGlobal)
  46. COM_INTERFACE_ENTRY(INetCfgComponentPropertyUi)
  47. END_COM_MAP()
  48. // DECLARE_NOT_AGGREGATABLE(CMSClient)
  49. // Remove the comment from the line above if you don't want your object to
  50. // support aggregation. The default is to support it
  51. DECLARE_REGISTRY_RESOURCEID(IDR_REG_MSCLICFG)
  52. // INetCfgComponentControl
  53. STDMETHOD (Initialize) (
  54. IN INetCfgComponent* pIComp,
  55. IN INetCfg* pINetCfg,
  56. IN BOOL fInstalling);
  57. STDMETHOD (ApplyRegistryChanges) ();
  58. STDMETHOD (ApplyPnpChanges) (
  59. IN INetCfgPnpReconfigCallback* pICallback);
  60. STDMETHOD (CancelChanges) ();
  61. STDMETHOD (Validate) ();
  62. // INetCfgComponentSetup
  63. STDMETHOD (Install) (DWORD dwSetupFlags);
  64. STDMETHOD (Upgrade) (DWORD dwSetupFlags,
  65. DWORD dwUpgradeFomBuildNo);
  66. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  67. PCWSTR pszAnswerSection);
  68. STDMETHOD (Removing) ();
  69. // INetCfgComponentNotifyGlobal
  70. STDMETHOD (GetSupportedNotifications) (DWORD* pdwNotificationFlag );
  71. STDMETHOD (SysQueryBindingPath) (DWORD dwChangeFlag, INetCfgBindingPath* pncbp);
  72. STDMETHOD (SysQueryComponent) (DWORD dwChangeFlag, INetCfgComponent* pncc);
  73. STDMETHOD (SysNotifyBindingPath) (DWORD dwChangeFlag, INetCfgBindingPath* pncbp);
  74. STDMETHOD (SysNotifyComponent) (DWORD dwChangeFlag, INetCfgComponent* pncc);
  75. // INetCfgProperties
  76. STDMETHOD (QueryPropertyUi) (
  77. IN IUnknown* pUnk) { return S_OK; }
  78. STDMETHOD (SetContext) (
  79. IN IUnknown* pUnk) {return S_OK;}
  80. STDMETHOD (MergePropPages) (
  81. IN OUT DWORD* pdwDefPages,
  82. OUT LPBYTE* pahpspPrivate,
  83. OUT UINT* pcPrivate,
  84. IN HWND hwndParent,
  85. OUT PCWSTR* pszStartPage);
  86. STDMETHOD (ValidateProperties) (
  87. HWND hwndSheet);
  88. STDMETHOD (CancelProperties) ();
  89. STDMETHOD (ApplyProperties) ();
  90. public:
  91. // Accessors for RPC data
  92. const RPC_CONFIG_DATA *RPCData() const
  93. {return (const RPC_CONFIG_DATA *)&m_rpcData;};
  94. RPC_CONFIG_DATA *RPCDataRW() {return &m_rpcData;};
  95. // Accessors for Browser data
  96. PCWSTR SzGetBrowserDomainList()
  97. {return const_cast<PCWSTR>(m_szDomainList);};
  98. VOID SetBrowserDomainList(PWSTR szNewList);
  99. // Dirty bit functions
  100. VOID SetRPCDirty() {m_fRPCChanges = TRUE;};
  101. VOID SetBrowserDirty() {m_fBrowserChanges = TRUE;};
  102. // RPC config dialog members
  103. RPC_CONFIG_DATA m_rpcData; // data used to handle the RPC
  104. // configuration dialog
  105. // Private state info
  106. private:
  107. enum ESRVSTATE
  108. {
  109. eSrvNone = 0,
  110. eSrvEnable = 1,
  111. eSrvDisable = 2,
  112. };
  113. INetCfgComponent *m_pncc; // Place to keep my component
  114. // object
  115. INetCfg *m_pnc; // Place to keep my INetCfg object
  116. BOOL m_fRPCChanges; // TRUE if RPC config settings have
  117. // changed (dialog)
  118. BOOL m_fBrowserChanges; // Same for browser dialog
  119. BOOL m_fOneTimeInstall; // TRUE if need to perform one-time
  120. // install tasks
  121. BOOL m_fUpgrade; // TRUE if upgrading with answer
  122. // file
  123. BOOL m_fUpgradeFromWks; // TRUE if we are upgrading from WKS
  124. BOOL m_fRemoving; // TRUE we are being removed
  125. ESRVSTATE m_eSrvState;
  126. HKEY m_hkeyRPCName; // NameService key
  127. // Browser config dialog members
  128. PWSTR m_szDomainList; // null-separated, double null
  129. // terminated list of OtherDomains
  130. // number of property sheet pages
  131. enum PAGES
  132. {
  133. c_cPages = 1
  134. };
  135. // Generic dialog data
  136. CPropSheetPage * m_apspObj[c_cPages];// pointer to each of the prop
  137. // sheet page objects
  138. tstring m_strBrowserParamsRestoreFile;
  139. tstring m_strNetLogonParamsRestoreFile;
  140. HRESULT HrApplyChanges(VOID);
  141. HRESULT HrSetupPropSheets(HPROPSHEETPAGE **pahpsp, INT cPages);
  142. VOID CleanupPropPages(VOID);
  143. HRESULT HrProcessAnswerFile(PCWSTR pszAnswerFile, PCWSTR pszAnswerSection);
  144. HRESULT HrRestoreRegistry(VOID);
  145. HRESULT HrSetNetLogonDependencies(VOID);
  146. // Dialog access functions for RPC config
  147. HRESULT HrGetRPCRegistryInfo(VOID);
  148. HRESULT HrSetRPCRegistryInfo(VOID);
  149. // Dialog access functions for Browser config
  150. HRESULT HrGetBrowserRegistryInfo(VOID);
  151. HRESULT HrSetBrowserRegistryInfo(VOID);
  152. // Help function used by NotifyBindingPath
  153. BOOL FIsComponentOnPath(INetCfgBindingPath * pncbp, PCWSTR szCompId);
  154. };
  155. HRESULT HrInstallDfs(VOID);
  156. HRESULT HrEnableBrowserService(VOID);
  157. HRESULT HrDisableBrowserService(VOID);