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.

114 lines
3.3 KiB

  1. // Compdata.h : Declaration of the CCompdata
  2. //
  3. // Component data is per snapin
  4. #ifndef __COMPDATA_H_
  5. #define __COMPDATA_H_
  6. #include <mmc.h>
  7. #include "tarray.h"
  8. #include "resource.h" // main symbols
  9. #include "basenode.h"
  10. #include "connode.h"
  11. #define ROOT_NODE_NAME_LEN 128
  12. #define CONNECTED_IMAGE 2
  13. #define NOT_CONNECTED_IMAGE 1
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CCompdata
  16. class ATL_NO_VTABLE CCompdata :
  17. public CComObjectRootEx<CComSingleThreadModel>,
  18. public CComCoClass<CCompdata, &CLSID_Compdata>,
  19. public IComponentData,
  20. public ISnapinAbout,
  21. public ISnapinHelp,
  22. public IPersistStreamInit,
  23. public IExtendPropertySheet
  24. {
  25. public:
  26. CCompdata();
  27. ~CCompdata();
  28. DECLARE_REGISTRY_RESOURCEID(IDR_TSMMCREG)
  29. DECLARE_NOT_AGGREGATABLE(CCompdata)
  30. DECLARE_PROTECT_FINAL_CONSTRUCT()
  31. BEGIN_COM_MAP(CCompdata)
  32. COM_INTERFACE_ENTRY( IComponentData )
  33. COM_INTERFACE_ENTRY( ISnapinAbout )
  34. COM_INTERFACE_ENTRY( IPersistStreamInit )
  35. COM_INTERFACE_ENTRY( IExtendPropertySheet )
  36. COM_INTERFACE_ENTRY( ISnapinHelp )
  37. END_COM_MAP()
  38. // ICompdata
  39. public:
  40. STDMETHOD( CompareObjects )( LPDATAOBJECT , LPDATAOBJECT );
  41. STDMETHOD( GetDisplayInfo )( LPSCOPEDATAITEM );
  42. STDMETHOD( QueryDataObject )( MMC_COOKIE , DATA_OBJECT_TYPES , LPDATAOBJECT * );
  43. STDMETHOD( Notify )( LPDATAOBJECT , MMC_NOTIFY_TYPE , LPARAM , LPARAM );
  44. STDMETHOD( CreateComponent )( LPCOMPONENT * );
  45. STDMETHOD( Initialize )( LPUNKNOWN );
  46. STDMETHOD( Destroy )();
  47. // ISnapinAbout
  48. STDMETHOD( GetSnapinDescription )( LPOLESTR * );
  49. STDMETHOD( GetProvider )( LPOLESTR * );
  50. STDMETHOD( GetSnapinVersion )( LPOLESTR * );
  51. STDMETHOD( GetSnapinImage )( HICON * );
  52. STDMETHOD( GetStaticFolderImage )( HBITMAP * , HBITMAP *, HBITMAP *, COLORREF * );
  53. STDMETHOD( GetHelpTopic( LPOLESTR *ppszHelpFile));
  54. BOOL ExpandScopeTree( LPDATAOBJECT , BOOL , HSCOPEITEM );
  55. // IPersistStreamInit
  56. STDMETHOD(GetClassID)(CLSID *pClassID);
  57. STDMETHOD(IsDirty)();
  58. STDMETHOD(Load)(IStream *pStm);
  59. STDMETHOD(Save)(IStream *pStm, BOOL fClearDirty);
  60. STDMETHOD(GetSizeMax)(ULARGE_INTEGER *pcbSize);
  61. STDMETHOD(InitNew)();
  62. STDMETHOD(SetDirty)(BOOL dirty);
  63. // IExtendPropertySheet
  64. STDMETHOD( CreatePropertyPages )( LPPROPERTYSHEETCALLBACK , LONG_PTR , LPDATAOBJECT );
  65. STDMETHOD( QueryPagesFor )( LPDATAOBJECT );
  66. static BOOL IsTSClientConnected(CConNode* pConNode);
  67. HRESULT AddNewConnection();
  68. private:
  69. HRESULT InsertConnectionScopeNode(CConNode* pNode);
  70. BOOL AddImages(IImageList* pImageList );
  71. BOOL OnDelete( LPDATAOBJECT pDo );
  72. BOOL DeleteConnode(CConNode* pConNode);
  73. HRESULT EncryptAndStorePass(LPTSTR szPass, CConNode* pNode);
  74. private:
  75. LPCONSOLE m_pConsole;
  76. LPCONSOLENAMESPACE m_pConsoleNameSpace;
  77. LPDISPLAYHELP m_pDisplayHelp;
  78. CBaseNode *m_pMainRoot;
  79. //
  80. // If data is dirty (i.e changes made that need to be persisted) this flag is set
  81. //
  82. BOOL m_bIsDirty;
  83. //
  84. // ID of the root node
  85. //
  86. HSCOPEITEM m_rootID;
  87. TCHAR m_szRootNodeName[ROOT_NODE_NAME_LEN];
  88. CArrayT<CConNode*> m_conNodesArray;
  89. };
  90. #endif //__COMPDATA_H_