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.

212 lines
6.1 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1997 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_CoIISClEx4>
  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.IIS5"), _T("CLUADMEX.IIS"), IDS_CLUADMEX_COMOBJ_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. CString m_strNodeName;
  135. HCLUSTER m_hcluster;
  136. LCID m_lcid;
  137. HFONT m_hfont;
  138. HICON m_hicon;
  139. LONG m_cobj;
  140. CResData m_rdResData;
  141. CObjData * PodObjDataRW(void) const { return (CObjData *) &m_rdResData; }
  142. CResData * PrdResDataRW(void) const { return (CResData *) &m_rdResData; }
  143. public:
  144. IUnknown * PiData(void) const { return m_piData; }
  145. IWCWizardCallback * PiWizardCallback(void) const { return m_piWizardCallback; }
  146. BOOL BWizard(void) const { return m_bWizard; }
  147. DWORD IstrResTypeName(void) const { return m_istrResTypeName; }
  148. // IGetClusterDataInfo data
  149. const CString & StrClusterName(void) const { return m_strClusterName; }
  150. const CString & StrNodeName(void) const { return m_strNodeName; }
  151. HCLUSTER Hcluster(void) const { return m_hcluster; }
  152. LCID Lcid(void) const { return m_lcid; }
  153. HFONT Hfont(void) const { return m_hfont; }
  154. HICON Hicon(void) const { return m_hicon; }
  155. LONG Cobj(void) const { return m_cobj; }
  156. const CResData & RrdResData(void) const { return m_rdResData; }
  157. const CObjData * PodObjData(void) const { return &m_rdResData; }
  158. const CResData * PrdResData(void) const { return (CResData *) &m_rdResData; }
  159. HRESULT HrGetUIInfo(IUnknown * piData);
  160. HRESULT HrSaveData(IUnknown * piData);
  161. HRESULT HrGetObjectInfo(void);
  162. HRESULT HrGetClusterName(IN OUT IGetClusterDataInfo * pi);
  163. HRESULT HrGetObjectName(IN OUT IGetClusterObjectInfo * pi);
  164. HRESULT HrGetResourceTypeName(IN OUT IGetClusterResourceInfo * pi);
  165. BOOL BGetResourceNetworkName(OUT WCHAR * lpszNetName, IN OUT DWORD * pcchNetName);
  166. // Implementation
  167. protected:
  168. virtual ~CExtObject(void);
  169. CPageList m_lpg;
  170. CPageList & Lpg(void) { return m_lpg; }
  171. }; //*** class CExtObject
  172. /////////////////////////////////////////////////////////////////////////////
  173. #endif // _EXTOBJ_H_