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.

229 lines
6.8 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1998 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ExtObj.cpp
  7. //
  8. // Abstract:
  9. // Definition of the CExtObject class, which implements the
  10. // extension interfaces required by a Microsoft Windows NT Cluster
  11. // Administrator Extension DLL.
  12. //
  13. // Implementation File:
  14. // ExtObj.cpp
  15. //
  16. // Author:
  17. // David Potter (davidp) August 23, 1996
  18. //
  19. // Revision History:
  20. //
  21. // Notes:
  22. //
  23. /////////////////////////////////////////////////////////////////////////////
  24. #ifndef _EXTOBJ_H_
  25. #define _EXTOBJ_H_
  26. /////////////////////////////////////////////////////////////////////////////
  27. // Include Files
  28. /////////////////////////////////////////////////////////////////////////////
  29. #ifndef __cluadmex_h__
  30. #include <CluAdmEx.h> // for CLUADMEX_DATA and interfaces
  31. #endif
  32. #ifndef __extobj_idl_h__
  33. #include "ExtObjID.h"
  34. #endif
  35. #ifndef _BASEPAGE_H_
  36. #include "BasePage.h" // for CBasePropertyPage and CPageList
  37. #endif
  38. //#define _DEMO_CTX_MENUS
  39. /////////////////////////////////////////////////////////////////////////////
  40. // Forward Class Declarations
  41. /////////////////////////////////////////////////////////////////////////////
  42. class CExtObject;
  43. class CObjData;
  44. class CResData;
  45. /////////////////////////////////////////////////////////////////////////////
  46. // External Class Declarations
  47. /////////////////////////////////////////////////////////////////////////////
  48. class CBasePropertyPage;
  49. /////////////////////////////////////////////////////////////////////////////
  50. // class CObjData
  51. /////////////////////////////////////////////////////////////////////////////
  52. class CObjData
  53. {
  54. public:
  55. CString m_strName;
  56. CLUADMEX_OBJECT_TYPE m_cot;
  57. virtual ~CObjData(void) { }
  58. }; //*** CObjData
  59. /////////////////////////////////////////////////////////////////////////////
  60. // class CResData
  61. /////////////////////////////////////////////////////////////////////////////
  62. class CResData : public CObjData
  63. {
  64. public:
  65. HRESOURCE m_hresource;
  66. CString m_strResTypeName;
  67. }; //*** CResData
  68. /////////////////////////////////////////////////////////////////////////////
  69. // class CExtObject
  70. /////////////////////////////////////////////////////////////////////////////
  71. //REVIEW -- using pointers to ID's is necessary because some compilers don't like
  72. //references as template arguments.
  73. class CExtObject :
  74. public IWEExtendPropertySheet,
  75. public IWEExtendWizard,
  76. #ifdef _DEMO_CTX_MENUS
  77. public IWEExtendContextMenu,
  78. public IWEInvokeCommand,
  79. #endif
  80. public ISupportErrorInfo,
  81. public CComObjectRoot,
  82. public CComCoClass<CExtObject, &CLSID_CoCluAdmEx>
  83. {
  84. public:
  85. CExtObject(void);
  86. BEGIN_COM_MAP(CExtObject)
  87. COM_INTERFACE_ENTRY(IWEExtendPropertySheet)
  88. COM_INTERFACE_ENTRY(IWEExtendWizard)
  89. #ifdef _DEMO_CTX_MENUS
  90. COM_INTERFACE_ENTRY(IWEExtendContextMenu)
  91. COM_INTERFACE_ENTRY(IWEInvokeCommand)
  92. #endif
  93. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  94. END_COM_MAP()
  95. //DECLARE_NOT_AGGREGATABLE(CExtObject)
  96. // Remove the comment from the line above if you don't want your object to
  97. // support aggregation. The default is to support it
  98. DECLARE_REGISTRY(CExtObject, _T("CLUADMEX.Standard"), _T("CLUADMEX.Standard"), IDS_CLUADMEX_DESC, THREADFLAGS_APARTMENT)
  99. // ISupportsErrorInfo
  100. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  101. // IWEExtendPropertySheet
  102. public:
  103. STDMETHOD(CreatePropertySheetPages)(
  104. IN IUnknown * piData,
  105. IN IWCPropertySheetCallback * piCallback
  106. );
  107. // IWEExtendWizard
  108. public:
  109. STDMETHOD(CreateWizardPages)(
  110. IN IUnknown * piData,
  111. IN IWCWizardCallback * piCallback
  112. );
  113. #ifdef _DEMO_CTX_MENUS
  114. // IWEExtendContextMenu
  115. public:
  116. STDMETHOD(AddContextMenuItems)(
  117. IN IUnknown * piData,
  118. IN IWCContextMenuCallback * piCallback
  119. );
  120. // IWEInvokeCommand
  121. STDMETHOD(InvokeCommand)(
  122. IN ULONG nCommandID,
  123. IN IUnknown * piData
  124. );
  125. #endif
  126. // Attributes
  127. protected:
  128. IUnknown * m_piData;
  129. IWCWizardCallback * m_piWizardCallback;
  130. BOOL m_bWizard;
  131. DWORD m_istrResTypeName;
  132. // IGetClusterDataInfo data
  133. CString m_strClusterName;
  134. HCLUSTER m_hcluster;
  135. LCID m_lcid;
  136. HFONT m_hfont;
  137. HICON m_hicon;
  138. LONG m_cobj;
  139. CObjData * m_podObjData;
  140. CObjData * PodObjDataRW(void) const { return m_podObjData; }
  141. CResData * PrdResDataRW(void) const { return (CResData *) m_podObjData; }
  142. public:
  143. IUnknown * PiData(void) const { return m_piData; }
  144. IWCWizardCallback * PiWizardCallback(void) const { return m_piWizardCallback; }
  145. BOOL BWizard(void) const { return m_bWizard; }
  146. DWORD IstrResTypeName(void) const { return m_istrResTypeName; }
  147. // IGetClusterDataInfo data
  148. const CString & StrClusterName(void) const { return m_strClusterName; }
  149. HCLUSTER Hcluster(void) const { return m_hcluster; }
  150. LCID Lcid(void) const { return m_lcid; }
  151. HFONT Hfont(void) const { return m_hfont; }
  152. HICON Hicon(void) const { return m_hicon; }
  153. LONG Cobj(void) const { return m_cobj; }
  154. const CResData & RrdResData(void) const { return (const CResData &) *m_podObjData; }
  155. const CObjData * PodObjData(void) const { return m_podObjData; }
  156. const CResData * PrdResData(void) const { return (CResData *) m_podObjData; }
  157. HRESULT HrGetUIInfo(IUnknown * piData);
  158. HRESULT HrSaveData(IUnknown * piData);
  159. HRESULT HrGetObjectInfo(void);
  160. HRESULT HrGetClusterName(IN OUT IGetClusterDataInfo * pi);
  161. HRESULT HrGetObjectName(IN OUT IGetClusterObjectInfo * pi);
  162. HRESULT HrGetResourceTypeName(IN OUT IGetClusterResourceInfo * pi);
  163. HRESULT HrGetClusterVersion(OUT LPCLUSTERVERSIONINFO *ppCvi);
  164. BOOL BGetResourceNetworkName(OUT WCHAR * lpszNetName, IN OUT DWORD * pcchNetName);
  165. BOOL BIsClusterVersionMixed(void);
  166. BOOL BIsClusterVersionNT4Sp3(void);
  167. BOOL BIsClusterVersionNT4Sp4(void);
  168. //BOOL BIsClusterVersionNT4(void);
  169. BOOL BIsClusterVersionNT5(void);
  170. //BOOL BIsClusterHighestVersionNT4Sp3(void);
  171. //BOOL BIsClusterHighestVersionNT4Sp4(void);
  172. BOOL BIsClusterHighestVersionNT5(void);
  173. BOOL BIsClusterLowestVersionNT4Sp3(void);
  174. BOOL BIsClusterLowestVersionNT4Sp4(void);
  175. BOOL BIsClusterLowestVersionNT5(void);
  176. BOOL BIsNT5ClusterMember(void);
  177. //BOOL BIsNT4Sp4ClusterMember(void);
  178. //BOOL BIsNT4Sp3ClusterMember(void);
  179. BOOL BIsAnyNodeVersionLowerThanNT5(void);
  180. // Implementation
  181. protected:
  182. virtual ~CExtObject(void);
  183. CPageList m_lpg;
  184. LPCLUSTERVERSIONINFO m_pCvi;
  185. CPageList & Lpg(void) { return m_lpg; }
  186. }; //*** class CExtObject
  187. /////////////////////////////////////////////////////////////////////////////
  188. #endif // _EXTOBJ_H_