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.

231 lines
6.0 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // DataObj.h
  7. //
  8. // Abstract:
  9. // Definition of the CDataObject class, which is the IDataObject
  10. // class used to transfer data between CluAdmin and the extension DLL
  11. // handlers.
  12. //
  13. // Author:
  14. // David Potter (davidp) June 4, 1996
  15. //
  16. // Implementation File:
  17. // DataObj.cpp
  18. //
  19. // Revision History:
  20. //
  21. // Notes:
  22. //
  23. /////////////////////////////////////////////////////////////////////////////
  24. #ifndef _DATAOBJ_H_
  25. #define _DATAOBJ_H_
  26. /////////////////////////////////////////////////////////////////////////////
  27. // Include Files
  28. /////////////////////////////////////////////////////////////////////////////
  29. #ifndef __cluadmex_h__
  30. #include "CluAdmEx.h"
  31. #endif
  32. #ifndef __cluadmid_h__
  33. #include "CluAdmID.h"
  34. #endif
  35. #ifndef _RESOURCE_H_
  36. #include "resource.h"
  37. #define _RESOURCE_H_
  38. #endif
  39. /////////////////////////////////////////////////////////////////////////////
  40. // Type Declarations
  41. /////////////////////////////////////////////////////////////////////////////
  42. typedef BOOL (*PFGETRESOURCENETWORKNAME)(
  43. OUT BSTR lpszNetName,
  44. IN OUT DWORD * pcchNetName,
  45. IN OUT PVOID pvContext
  46. );
  47. /////////////////////////////////////////////////////////////////////////////
  48. // Forward Class Declarations
  49. /////////////////////////////////////////////////////////////////////////////
  50. class CDataObject;
  51. /////////////////////////////////////////////////////////////////////////////
  52. // External Class Declarations
  53. /////////////////////////////////////////////////////////////////////////////
  54. class CClusterItem;
  55. /////////////////////////////////////////////////////////////////////////////
  56. //
  57. // class CDataObject
  58. //
  59. // Purpose:
  60. // Encapsulates the IDataObject interface for exchanging data with
  61. // extension DLL handlers.
  62. //
  63. /////////////////////////////////////////////////////////////////////////////
  64. class CDataObject :
  65. public CObject,
  66. public IGetClusterUIInfo,
  67. public IGetClusterDataInfo,
  68. public IGetClusterObjectInfo,
  69. public IGetClusterNodeInfo,
  70. public IGetClusterGroupInfo,
  71. public IGetClusterResourceInfo,
  72. public IGetClusterNetworkInfo,
  73. public IGetClusterNetInterfaceInfo,
  74. public ISupportErrorInfo,
  75. public CComObjectRoot,
  76. public CComCoClass<CDataObject, &CLSID_CoCluAdminData>
  77. {
  78. DECLARE_DYNAMIC(CDataObject)
  79. public:
  80. // Constructors
  81. CDataObject(void); // protected constructor used by dynamic creation
  82. virtual ~CDataObject(void);
  83. // Second-phase constructor.
  84. void Init(
  85. IN OUT CClusterItem * pci,
  86. IN LCID lcid,
  87. IN HFONT hfont,
  88. IN HICON hicon
  89. );
  90. BEGIN_COM_MAP(CDataObject)
  91. COM_INTERFACE_ENTRY(IGetClusterUIInfo)
  92. COM_INTERFACE_ENTRY(IGetClusterDataInfo)
  93. COM_INTERFACE_ENTRY(IGetClusterObjectInfo)
  94. COM_INTERFACE_ENTRY(IGetClusterNodeInfo)
  95. COM_INTERFACE_ENTRY(IGetClusterGroupInfo)
  96. COM_INTERFACE_ENTRY(IGetClusterResourceInfo)
  97. COM_INTERFACE_ENTRY(IGetClusterNetworkInfo)
  98. COM_INTERFACE_ENTRY(IGetClusterNetInterfaceInfo)
  99. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  100. END_COM_MAP()
  101. //DECLARE_NOT_AGGREGATABLE(CDataObject)
  102. // Remove the comment from the line above if you don't want your object to
  103. // support aggregation. The default is to support it
  104. DECLARE_REGISTRY(CDataObject, _T("CLUADMIN.Data"), _T("CLUADMIN.Data"), IDS_CLUADMIN_DESC, THREADFLAGS_BOTH)
  105. // Attributes
  106. protected:
  107. CClusterItem * m_pci; // Cluster item for which a prop sheet is being displayed.
  108. LCID m_lcid; // Locale ID of resources to be loaded by extension.
  109. HFONT m_hfont; // Font for all text.
  110. HICON m_hicon; // Icon for upper left corner.
  111. PFGETRESOURCENETWORKNAME m_pfGetResNetName; // Pointer to static function for getting net name for resource.
  112. PVOID m_pvGetResNetNameContext; // Context for m_pfGetResNetName;
  113. CClusterItem * Pci(void) { return m_pci; }
  114. LCID Lcid(void) { return m_lcid; }
  115. HFONT Hfont(void) { return m_hfont; }
  116. HICON Hicon(void) { return m_hicon; }
  117. public:
  118. PFGETRESOURCENETWORKNAME PfGetResNetName(void) const { return m_pfGetResNetName; }
  119. void SetPfGetResNetName(PFGETRESOURCENETWORKNAME pfGetResNetName, PVOID pvContext)
  120. {
  121. m_pfGetResNetName = pfGetResNetName;
  122. m_pvGetResNetNameContext = pvContext;
  123. }
  124. // Operations
  125. public:
  126. // Overrides
  127. // ClassWizard generated virtual function overrides
  128. //{{AFX_VIRTUAL(CDataObject)
  129. //}}AFX_VIRTUAL
  130. // ISupportsErrorInfo
  131. public:
  132. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  133. // IGetClusterUIInfo
  134. public:
  135. STDMETHOD_(LCID, GetLocale)(void);
  136. STDMETHOD_(HFONT, GetFont)(void);
  137. STDMETHOD_(HICON, GetIcon)(void);
  138. // IGetClusterDataInfo
  139. public:
  140. STDMETHOD(GetClusterName)(
  141. OUT BSTR lpszName,
  142. IN OUT LONG * plMaxLength
  143. );
  144. STDMETHOD_(HCLUSTER, GetClusterHandle)(void);
  145. STDMETHOD_(LONG, GetObjectCount)(void);
  146. // IGetClusterObjectInfo
  147. public:
  148. STDMETHOD(GetObjectName)(
  149. IN LONG lObjIndex,
  150. OUT BSTR lpszName,
  151. IN OUT LONG * plMaxLength
  152. );
  153. STDMETHOD_(CLUADMEX_OBJECT_TYPE, GetObjectType)(
  154. IN LONG lObjIndex
  155. );
  156. // IGetClusterNodeInfo
  157. public:
  158. STDMETHOD_(HNODE, GetNodeHandle)(
  159. IN LONG lObjIndex
  160. );
  161. // IGetClusterGroupInfo
  162. public:
  163. STDMETHOD_(HGROUP, GetGroupHandle)(
  164. IN LONG lObjIndex
  165. );
  166. // IGetClusterResourceInfo
  167. public:
  168. STDMETHOD_(HRESOURCE, GetResourceHandle)(
  169. IN LONG lObjIndex
  170. );
  171. STDMETHOD(GetResourceTypeName)(
  172. IN LONG lObjIndex,
  173. OUT BSTR lpszResourceTypeName,
  174. IN OUT LONG * pcchName
  175. );
  176. STDMETHOD_(BOOL, GetResourceNetworkName)(
  177. IN LONG lobjIndex,
  178. OUT BSTR lpszNetName,
  179. IN OUT ULONG * pcchNetName
  180. );
  181. // IGetClusterNetworkInfo
  182. public:
  183. STDMETHOD_(HNETWORK, GetNetworkHandle)(
  184. IN LONG lObjIndex
  185. );
  186. // IGetClusterNetInterfaceInfo
  187. public:
  188. STDMETHOD_(HNETINTERFACE, GetNetInterfaceHandle)(
  189. IN LONG lObjIndex
  190. );
  191. // Implementation
  192. protected:
  193. AFX_MODULE_STATE * m_pModuleState; // Required for resetting our state during callbacks.
  194. }; //*** class CDataObject
  195. /////////////////////////////////////////////////////////////////////////////
  196. #endif // _DATAOBJ_H_