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.

620 lines
23 KiB

  1. //____________________________________________________________________________
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: MTNode.h
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 9/13/1996 RaviR Created
  15. //
  16. //____________________________________________________________________________
  17. #ifndef _MTNODE_H_
  18. #define _MTNODE_H_
  19. #pragma once
  20. #include "refcount.h" // CRefCountedPtr
  21. #include "xmlimage.h" // CXMLImageList
  22. #define MMC_SYSTEMROOT_VARIABLE _T("systemroot")
  23. #define MMC_SYSTEMROOT_VARIABLE_PERC _T("%systemroot%")
  24. #define MMC_WINDIR_VARIABLE_PERC _T("%windir%")
  25. ///////////////////////////////////////////////////////////////////////////////
  26. // Classes referd to here declared in other local files.
  27. class CSnapIn; // from SnapIn.h
  28. class CSnapInsCache; // from SnapIn.h
  29. class CComponent; // from Node.h
  30. class CNode; // from Node.h
  31. class CSnapInNode; // from Node.h
  32. class CDoc;
  33. class CSPImageCache; // from ScopImag.h
  34. class CExtensionsCache;
  35. class CPersistor;
  36. class CBookmark; // from bookmark.h
  37. class CSnapinProperties; // from siprop.h
  38. ///////////////////////////////////////////////////////////////////////////////
  39. // Classes declared in this file
  40. class CComponentData;
  41. class CMTNode;
  42. class CMTSnapInNode;
  43. ///////////////////////////////////////////////////////////////////////////////
  44. // typedefs
  45. typedef CMTNode * PMTNODE;
  46. typedef CTypedPtrList<MMC::CPtrList, CNode*> CNodeList;
  47. typedef CList<HMTNODE, HMTNODE> CHMTNODEList;
  48. typedef CComponentData* PCCOMPONENTDATA;
  49. typedef std::vector<PCCOMPONENTDATA> CComponentDataArray;
  50. typedef CArray<GUID, GUID&> CGuidArray;
  51. HRESULT CreateSnapIn (const CLSID& clsid, IComponentData** ppICD,
  52. bool fCreateDummyOnFailure = true);
  53. HRESULT LoadRequiredExtensions(CSnapIn* pSnapIn, IComponentData* pICD, CSnapInsCache* pCache = NULL);
  54. HRESULT AddRequiredExtension(CSnapIn* pSnapIn, CLSID& rcslid);
  55. void DisplayPolicyErrorMessage(const CLSID& clsid, bool bExtension);
  56. #include "snapinpersistence.h"
  57. //____________________________________________________________________________
  58. //
  59. // Class: CComponentData
  60. //____________________________________________________________________________
  61. //
  62. class CComponentData
  63. {
  64. DECLARE_NOT_COPIABLE (CComponentData)
  65. DECLARE_NOT_ASSIGNABLE (CComponentData)
  66. public:
  67. // Constructor & Destructor
  68. CComponentData(CSnapIn * pSnapIn);
  69. ~CComponentData();
  70. // Attributes
  71. void SetComponentID(COMPONENTID nID)
  72. {
  73. ASSERT(nID >= 0);
  74. ASSERT(nID < 1000);
  75. m_ComponentID = nID;
  76. }
  77. void SetIComponentData(IComponentData* pICD) { m_spIComponentData = pICD; }
  78. BOOL IsInitialized()
  79. {
  80. return (m_spIFramePrivate != NULL);
  81. }
  82. CSnapIn* GetSnapIn(void) const { return m_spSnapIn; }
  83. const CLSID& GetCLSID() const { return m_spSnapIn->GetSnapInCLSID(); }
  84. IComponentData* GetIComponentData(void) const { return m_spIComponentData; }
  85. IFramePrivate* GetIFramePrivate(void) const { return m_spIFramePrivate; }
  86. IImageListPrivate* GetIImageListPrivate(void);
  87. COMPONENTID GetComponentID(void) const { return m_ComponentID; }
  88. LPUNKNOWN GetUnknownToLoad(void) const { return m_spIComponentData; }
  89. // IComponentData interface methods
  90. HRESULT Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  91. HRESULT QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject);
  92. HRESULT GetNodeType(MMC_COOKIE cookie, GUID* pGuid);
  93. HRESULT GetDisplayInfo(SCOPEDATAITEM* pScopeDataItem);
  94. // IComponentData2 helpers
  95. SC ScQueryDispatch(MMC_COOKIE, DATA_OBJECT_TYPES type, PPDISPATCH ppScopeNodeObject);
  96. // Operations
  97. // Initialization
  98. HRESULT Init(HMTNODE hMTNode);
  99. void ResetComponentID(COMPONENTID id)
  100. {
  101. m_spIFramePrivate->SetComponentID(m_ComponentID = id);
  102. }
  103. // loaded from stream/storage; initailized with the new one; or does not need initialization
  104. bool IsIComponentDataInitialized()
  105. {
  106. return m_bIComponentDataInitialized;
  107. }
  108. // loaded from stream/storage; initailized with the new one; or does not need initialization
  109. void SetIComponentDataInitialized()
  110. {
  111. m_bIComponentDataInitialized = true;
  112. }
  113. private:
  114. // Implementation
  115. CSnapInPtr m_spSnapIn;
  116. IComponentDataPtr m_spIComponentData;
  117. IFramePrivatePtr m_spIFramePrivate;
  118. COMPONENTID m_ComponentID;
  119. bool m_bIComponentDataInitialized;
  120. }; // class CComponentData
  121. /*+-------------------------------------------------------------------------*
  122. * class CMTNode
  123. *
  124. *
  125. * PURPOSE:
  126. *
  127. *+-------------------------------------------------------------------------*/
  128. class CMTNode : public XMLListCollectionBase
  129. {
  130. DECLARE_NOT_COPIABLE (CMTNode)
  131. DECLARE_NOT_ASSIGNABLE (CMTNode)
  132. protected:
  133. // codes corresponding to legacy node types.
  134. enum eNodeCodes
  135. {
  136. NODE_CODE_SNAPIN = 1,
  137. NODE_CODE_FOLDER = 2, // codes 2,3,4 are no longer correspond to
  138. NODE_CODE_HTML = 3, // MTNode derived classes, but are retained
  139. NODE_CODE_OCX = 4, // for converting old .msc files
  140. NODE_CODE_ENUMERATED = 10
  141. };
  142. public:
  143. static CMTNode* FromScopeItem (HSCOPEITEM item);
  144. static HSCOPEITEM ToScopeItem (const CMTNode* pMTNode) { return (reinterpret_cast<HSCOPEITEM>(pMTNode)); }
  145. static CMTNode* FromHandle (HMTNODE hMTNode) { return (reinterpret_cast<CMTNode*>(hMTNode)); }
  146. static HMTNODE ToHandle (const CMTNode* pMTNode) { return (reinterpret_cast<HMTNODE>(const_cast<CMTNode*>(pMTNode))); }
  147. // Constructor
  148. CMTNode();
  149. virtual HRESULT Init(void);
  150. // Attributes
  151. virtual BOOL IsStaticNode() const {return FALSE;}
  152. BOOL IsDynamicNode() const {return !IsStaticNode();}
  153. virtual HRESULT IsExpandable();
  154. HRESULT QueryDataObject(DATA_OBJECT_TYPES type, LPDATAOBJECT* ppdtobj);
  155. // Images
  156. UINT GetImage(void) { return m_nImage; }
  157. UINT GetOpenImage(void) { return m_nOpenImage; }
  158. UINT GetState(void);
  159. void SetImage(UINT nImage) { m_nImage = nImage; }
  160. void SetOpenImage(UINT nImage) { m_nOpenImage = nImage; }
  161. void SetState(UINT nState) { m_nState = nState; }
  162. void SetOwnerID(long id) { m_idOwner = id; }
  163. long GetOwnerID(void) const { return m_idOwner; }
  164. void SetPrimaryComponentData(CComponentData* pDI) { m_pPrimaryComponentData = pDI; }
  165. CComponentData* GetPrimaryComponentData() const { return m_pPrimaryComponentData; }
  166. virtual tstring GetDisplayName();
  167. virtual void SetDisplayName(LPCTSTR pszName);
  168. protected:
  169. tstring GetCachedDisplayName() const {return m_strName.str();}
  170. void SetCachedDisplayName(LPCTSTR pszName);
  171. public:
  172. BOOL IsInitialized() { return m_bInit; }
  173. int GetDynExtCLSID ( LPCLSID *ppCLSID );
  174. void SetNoPrimaryChildren(BOOL bState = TRUE);
  175. HRESULT OnRename(long fRename, LPOLESTR pszNewName);
  176. SC ScQueryDispatch(DATA_OBJECT_TYPES type, PPDISPATCH ppScopeNodeObject);
  177. HRESULT AddExtension(LPCLSID lpclsid);
  178. CSnapIn* GetPrimarySnapIn(void) const { return m_pPrimaryComponentData->GetSnapIn(); }
  179. COMPONENTID GetPrimaryComponentID();
  180. CMTSnapInNode* GetStaticParent(void);
  181. const CLSID& GetPrimarySnapInCLSID(void);
  182. LPARAM GetUserParam(void) const { return m_lUserParam; }
  183. void SetUserParam(LPARAM lParam) { m_lUserParam = lParam; }
  184. HRESULT GetNodeType(GUID* pGuid);
  185. SC ScGetPropertyFromINodeProperties(LPDATAOBJECT pDataObject, BSTR bstrPropertyName, PBSTR pbstrPropertyValue);
  186. // Operations
  187. virtual CNode * GetNode(CViewData* pViewData,
  188. BOOL fRootNode = FALSE); // Method to create a node for this Master Node.
  189. HRESULT Expand(void);
  190. HRESULT Expand (CComponentData*, IDataObject*, BOOL);
  191. virtual bool AllowNewWindowFromHere() const { return (true); }
  192. // Reference counting methods.
  193. USHORT AddRef();
  194. USHORT Release();
  195. // Tree traversal methods.
  196. PMTNODE Next() const {return m_pNext;}
  197. PMTNODE Child() const {return m_pChild;}
  198. PMTNODE Parent() const {return m_pParent;}
  199. void AttachNext(PMTNODE pmn) {m_pNext = pmn;}
  200. void AttachChild(PMTNODE pmn) {m_pChild = pmn;}
  201. void AttachParent(PMTNODE pmn) {m_pParent = pmn;}
  202. CMTNode * NextStaticNode();
  203. // Iterators that expand
  204. PMTNODE GetNext() const {return Next();}
  205. PMTNODE GetChild();
  206. void CreatePathList(CHMTNODEList& path);
  207. // Returns true if the stucture of tree needs to be saved,
  208. // or if any of the nodes need to be saved.
  209. // Derived classes which want to do more complex IsDirty() testing
  210. // may over-ride this function.
  211. virtual HRESULT IsDirty();
  212. HRESULT InitNew(PersistData*); // Saves the stream information for later use and sets the dirty flag.
  213. static SC ScLoad(PersistData*, CMTNode** ppRootNode); // Creates a new tree structure from the provided storage and returns it in ppRootNode.
  214. void ResetExpandedAtLeastOnce() {_SetFlag(FLAG_EXPANDED_AT_LEAST_ONCE, FALSE);}
  215. void SetExpandedAtLeastOnce() {_SetFlag(FLAG_EXPANDED_AT_LEAST_ONCE, TRUE);}
  216. BOOL WasExpandedAtLeastOnce() {return _IsFlagSet(FLAG_EXPANDED_AT_LEAST_ONCE);}
  217. void SetPropertyPageIsDisplayed(BOOL bSet) {_SetFlag(FLAG_PROPERTY_PAGE_IS_DISPLAYED, bSet);}
  218. BOOL IsPropertyPageDisplayed() {return _IsFlagSet(FLAG_PROPERTY_PAGE_IS_DISPLAYED);}
  219. // Flag to monitor if MMCN_REMOVE_CHILDREN was sent to the snapin owning the node
  220. void SetRemovingChildren(bool b) {_SetFlag(FLAG_REMOVING_CHILDREN, b);}
  221. bool AreChildrenBeingRemoved();
  222. // Unique ID helper functions. (Each node will be assigned an unique id
  223. // within the .msc file.)
  224. static MTNODEID GetNextID() throw() {return m_NextID++;}
  225. static void ResetID() throw() {m_NextID = ROOTNODEID;}
  226. CMTNode* Find(MTNODEID id);
  227. MTNODEID GetID() const throw() {return m_ID;}
  228. void SetID(MTNODEID key) {m_ID = key;}
  229. HRESULT DestroyElements(); // recursive function
  230. HRESULT DoDestroyElements(); // non-recursvie part
  231. // Deletes any persistence data stored in the current file
  232. void SetDirty(bool bIsDirty = true) {m_bIsDirty = bIsDirty;}
  233. void ClearDirty() {m_bIsDirty = false;}
  234. virtual void NotifyAddedToTree() {}
  235. virtual HRESULT CloseView(int viewID);
  236. virtual HRESULT DeleteView(int viewID);
  237. virtual bool DoDelete(HWND hwnd) { return true; }
  238. virtual void OnChildrenChanged() {}
  239. CMTNode* GetLastChild();
  240. virtual CSnapInNode* FindNode(int nViewID) { return NULL; }
  241. // Unique ID for the node instance.
  242. CBookmark* GetBookmark();
  243. virtual void Reset();
  244. protected:
  245. virtual ~CMTNode();
  246. virtual HRESULT InitNew() {return S_OK;} // Provides the derived nodes the opportunity to initialize the persistent resources.
  247. virtual SC ScLoad();
  248. public:
  249. virtual void Persist(CPersistor& persistor); // persists the node
  250. virtual void OnNewElement(CPersistor& persistor);
  251. static void PersistNewNode(CPersistor &persistor, CMTNode** ppNode);
  252. DEFINE_XML_TYPE(XML_TAG_MT_NODE);
  253. static wchar_t* GetViewStorageName(wchar_t* name, int idView);
  254. static wchar_t* GetComponentStreamName(wchar_t* name, const CLSID& clsid);
  255. static wchar_t* GetComponentStorageName(wchar_t* name, const CLSID& clsid);
  256. static int GetViewIdFromStorageName(const wchar_t* name);
  257. protected:
  258. // Allows the tree to re-attach to a persistence source.
  259. IStream* GetTreeStream() {return m_spTreeStream;}
  260. BOOL GetDirty() {return m_bIsDirty;}
  261. wchar_t* GetStorageName(wchar_t* name) {return _ltow(GetID(), name, 36);}
  262. IStorage* GetNodeStorage() {return m_spNodeStorage;}
  263. IStorage* GetViewStorage() {return m_spViewStorage;}
  264. IStorage* GetStorageForCD() {return m_spCDStorage;}
  265. PersistData* GetPersistData() {return m_spPersistData;}
  266. bool Loaded() {return m_bLoaded;}
  267. bool AreExtensionsExpanded(void) const { return m_bExtensionsExpanded; }
  268. // Implementation
  269. private:
  270. PMTNODE m_pNext;
  271. PMTNODE m_pChild;
  272. PMTNODE m_pParent;
  273. std::auto_ptr<CBookmarkEx> m_bookmark; // For node instance persistance
  274. PersistDataPtr m_spPersistData;
  275. IStoragePtr m_spNodeStorage;
  276. IStoragePtr m_spViewStorage;
  277. IStoragePtr m_spCDStorage;
  278. IStreamPtr m_spTreeStream;
  279. bool m_bIsDirty;
  280. USHORT m_cRef;
  281. USHORT m_usFlags; // m_bExpandedAtLeastOnce;
  282. enum ENUM_FLAGS
  283. {
  284. FLAG_EXPANDED_AT_LEAST_ONCE = 0x0001,
  285. FLAG_PROPERTY_PAGE_IS_DISPLAYED = 0x0002,
  286. FLAG_REMOVING_CHILDREN = 0x0004,
  287. };
  288. void _SetFlag(ENUM_FLAGS flag, BOOL bSet);
  289. BOOL _IsFlagSet(ENUM_FLAGS flag){return ((m_usFlags & flag) == flag);}
  290. MTNODEID m_ID; // Unique id for this node within the .msc file.
  291. bool m_bLoaded; // when true, load should be called instead of init new
  292. static MTNODEID m_NextID; // The last unique identifier given out.
  293. HRESULT OpenStorageForNode(); // Opens the storage for this specific instance of a node.
  294. HRESULT OpenStorageForView(); // Opens the view storage for this specific instance of a node.
  295. HRESULT OpenStorageForCD(); // Opens the view storage for this specific instance of a node.
  296. private:
  297. HRESULT OpenTreeStream(); // Opens the stream to be used to contain this nodes data.
  298. void SetParent(CMTNode* pParent);// Sets the parent for this and all next nodes.
  299. protected:
  300. UINT m_nImage;
  301. UINT m_nOpenImage;
  302. UINT m_nState;
  303. CStringTableString m_strName; // Display name
  304. protected:
  305. enum StreamVersionIndicator
  306. {
  307. Stream_V0100 = 1, // MMC 1.0
  308. Stream_V0110 = 2, // MMC 1.1
  309. Stream_CurrentVersion = Stream_V0110,
  310. VersionedStreamMarker = 0xFFFFFFFF,
  311. };
  312. private:
  313. long m_idOwner; // One of the SnapIns.
  314. LPARAM m_lUserParam;
  315. CComponentData* m_pPrimaryComponentData;
  316. BOOL m_bInit;
  317. bool m_bExtensionsExpanded;
  318. CGuidArray m_arrayDynExtCLSID;
  319. unsigned short m_usExpandFlags;
  320. enum ENUM_EXPAND_FLAGS
  321. {
  322. FLAG_NO_CHILDREN_FROM_PRIMARY = 0x0001,
  323. FLAG_NO_NAMESPACE_EXTNS = 0x0002,
  324. FLAG_NAMESPACE_EXTNS_CHECKED = 0x0004
  325. };
  326. }; // class CMTNode
  327. /*+-------------------------------------------------------------------------*
  328. * class ViewRootStorage
  329. *
  330. *
  331. * PURPOSE:
  332. *
  333. *+-------------------------------------------------------------------------*/
  334. class ViewRootStorage
  335. {
  336. public:
  337. ViewRootStorage() {}
  338. ~ViewRootStorage()
  339. {
  340. Clear();
  341. }
  342. void Initialize(IStorage* pRootStorage)
  343. {
  344. ASSERT(m_spRootStorage == NULL);
  345. ASSERT(pRootStorage != NULL);
  346. m_spRootStorage = pRootStorage;
  347. }
  348. IStorage* GetRootStorage()
  349. {
  350. return m_spRootStorage;
  351. }
  352. bool Insert(IStorage* pViewStorage, int idView)
  353. {
  354. ASSERT(pViewStorage != NULL);
  355. if ( NULL == m_Views.Find(idView))
  356. {
  357. return m_Views.Insert(IStoragePtr(pViewStorage), idView);
  358. }
  359. return true;
  360. }
  361. bool Remove(int idView)
  362. {
  363. const bool bRemoved = m_Views.Remove(idView);
  364. return bRemoved;
  365. }
  366. IStorage* FindViewStorage(int idView) const
  367. {
  368. CAdapt<IStoragePtr> *pspStorage = m_Views.Find(idView);
  369. return (pspStorage ? pspStorage->m_T : NULL);
  370. }
  371. void Clear()
  372. {
  373. m_Views.Clear();
  374. m_spRootStorage = NULL;
  375. }
  376. private:
  377. // CAdapt is used to hide operator&() - which will be invoked by map
  378. // implementation to get address of the element.
  379. // Smart pointer's operator&() releases reference plus returns wrong type for a map.
  380. Map<CAdapt<IStoragePtr>, int> m_Views;
  381. IStoragePtr m_spRootStorage;
  382. }; // class ViewRootStorage
  383. /*+-------------------------------------------------------------------------*
  384. * class CMTSnapInNode
  385. *
  386. *
  387. * PURPOSE: The root node of a primary snap-in. Added to the console and
  388. * the scope tree by MMC. Only a snap-in that is added from the
  389. * Add/Remove snapin page of the Snapin manager has a static node;
  390. * extensions of any type do not.
  391. *
  392. *+-------------------------------------------------------------------------*/
  393. class CMTSnapInNode : public CMTNode, public CTiedObject
  394. {
  395. DECLARE_NOT_COPIABLE (CMTSnapInNode)
  396. DECLARE_NOT_ASSIGNABLE (CMTSnapInNode)
  397. public:
  398. // Constructor & Destructor
  399. CMTSnapInNode(Properties* pProps);
  400. ~CMTSnapInNode();
  401. // SnapIn object model methods
  402. public:
  403. SC ScGetSnapIn(PPSNAPIN ppSnapIn);
  404. SC Scget_Name( PBSTR pbstrName);
  405. SC Scget_Extensions( PPEXTENSIONS ppExtensions);
  406. SC Scget_SnapinCLSID(PBSTR pbstrSnapinCLSID);
  407. SC Scget_Properties( PPPROPERTIES ppProperties);
  408. SC ScEnableAllExtensions (BOOL bEnable);
  409. // helper for CMMCSnapIn
  410. SC ScGetSnapinClsid(CLSID& clsid);
  411. static SC ScGetCMTSnapinNode(PSNAPIN pSnapIn, CMTSnapInNode **ppMTSnapInNode);
  412. public:
  413. // Attributes
  414. virtual BOOL IsStaticNode() const { return TRUE; }
  415. UINT GetResultImage(CNode* pNode, IImageListPrivate* pImageList);
  416. void SetResultImage(UINT index) { m_resultImage = index; }
  417. void SetPrimarySnapIn(CSnapIn * pSI);
  418. CNodeList& GetNodeList(void) { return m_NodeList; }
  419. virtual HRESULT IsExpandable();
  420. // Operations
  421. // Initialize
  422. virtual HRESULT Init(void);
  423. // Create a node for this master node.
  424. virtual CNode * GetNode(CViewData* pViewData, BOOL fRootNode = FALSE);
  425. virtual tstring GetDisplayName();
  426. virtual void SetDisplayName(LPCTSTR pszName);
  427. void AddNode(CNode * pNode);
  428. void RemoveNode(CNode * pNode);
  429. virtual CSnapInNode* FindNode(int nViewID);
  430. int GetNumberOfComponentDatas() { return m_ComponentDataArray.size(); }
  431. COMPONENTID AddComponentDataToArray(CComponentData* pCCD);
  432. CComponentData* GetComponentData(const CLSID& clsid);
  433. CComponentData* GetComponentData(COMPONENTID nID);
  434. CComponent* GetComponent(UINT nViewID, COMPONENTID nID, CSnapIn* pSnapIn);
  435. virtual HRESULT CloseView(int viewID);
  436. virtual HRESULT DeleteView(int viewID);
  437. // Loads from existing stream/storage or initializes with the new one
  438. SC ScInitIComponentData( CComponentData* pCD );
  439. SC ScInitIComponent(CComponent* pComponent, int viewID);
  440. virtual void Reset();
  441. void CompressComponentDataArray();
  442. BOOL IsPreloadRequired () const;
  443. void SetPreloadRequired (bool bPreload) { m_ePreloadState = (bPreload) ? ePreload_True : ePreload_False;}
  444. SC ScConvertLegacyNode(const CLSID &clsid);
  445. // Implementation
  446. protected:
  447. // virtual HRESULT InitNew();
  448. virtual HRESULT IsDirty();
  449. virtual SC ScLoad();
  450. virtual void Persist(CPersistor& persistor);
  451. private:
  452. SC ScInitProperties();
  453. SC ScCreateSnapinProperties(CSnapinProperties** ppSIProps);
  454. SC ScAddImagesToImageList();
  455. SC ScReadStreamsAndStoragesFromConsole();
  456. // Loads from existing sream/storage of initializes with the new one.
  457. SC ScInitComponentOrComponentData( IUnknown *pSnapin, CMTSnapinNodeStreamsAndStorages *pStreamsAndStorages,
  458. int idView , const CLSID& clsid );
  459. private:
  460. enum PersistType
  461. {
  462. PT_None,
  463. PT_IStream,
  464. PT_IStreamInit,
  465. PT_IStorage
  466. };
  467. enum PreloadState
  468. {
  469. ePreload_Unknown = -1, // don't know if MMCN_PRELOAD is required yet
  470. ePreload_False = 0, // MMCN_PRELOAD not required
  471. ePreload_True = 1, // MMCN_PRELOAD required
  472. };
  473. SC ScQueryPreloadRequired (PreloadState& ePreload) const;
  474. SC ScHandleCustomImages (const CLSID& clsidSnapin);
  475. SC ScHandleCustomImages (HBITMAP hbmSmall, HBITMAP hbmSmallOpen, HBITMAP hbmLarge, COLORREF crMask);
  476. HRESULT AreIComponentDatasDirty();
  477. HRESULT AreIComponentsDirty();
  478. HRESULT IsIUnknownDirty(IUnknown* pUnk);
  479. SC ScSaveIComponentDatas();
  480. SC ScSaveIComponentData( CComponentData* pCD );
  481. SC ScSaveIComponents();
  482. SC ScSaveIComponent( CComponent* pCComponent, int viewID );
  483. SC ScAskSnapinToSaveData( IUnknown *pSnapin, CMTSnapinNodeStreamsAndStorages *pStreamsAndStorages,
  484. int idView , const CLSID& clsid, CSnapIn *pCSnapin );
  485. private:
  486. PropertiesPtr m_spProps;
  487. SnapInPtr m_spSnapIn;
  488. CComponentDataArray m_ComponentDataArray;
  489. CNodeList m_NodeList;
  490. ViewRootStorage m_ComponentStorage;
  491. CXMLImageList m_imlSmall; // small, open images
  492. CXMLImageList m_imlLarge; // large image
  493. UINT m_resultImage;
  494. CDPersistor m_CDPersistor;
  495. CComponentPersistor m_ComponentPersistor;
  496. mutable PreloadState m_ePreloadState;
  497. BOOL m_bHasBitmaps;
  498. bool m_fCallbackForDisplayName; // snap-in gave us MMC_TEXTCALLBACK for node name?
  499. }; // class CMTSnapInNode
  500. #include "mtnode.inl"
  501. #endif // _MTNODE_H_