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.

194 lines
5.9 KiB

  1. #ifndef _CCOMPDTA_H
  2. #define _CCOMPDTA_H
  3. // forward decls
  4. class CWirelessManagerFolder;
  5. class CSnapObject;
  6. class CComponentDataImpl:
  7. public IComponentData,
  8. #ifdef WIZ97WIZARDS
  9. public IExtendPropertySheet2,
  10. #else
  11. public IExtendPropertySheet,
  12. #endif
  13. public IExtendContextMenu,
  14. public IPersistStream,
  15. public ISnapinHelp,
  16. public CComObjectRoot
  17. {
  18. BEGIN_COM_MAP(CComponentDataImpl)
  19. COM_INTERFACE_ENTRY(IComponentData)
  20. #ifdef WIZ97WIZARDS
  21. COM_INTERFACE_ENTRY(IExtendPropertySheet2)
  22. #else
  23. COM_INTERFACE_ENTRY(IExtendPropertySheet)
  24. #endif
  25. COM_INTERFACE_ENTRY(IExtendContextMenu)
  26. COM_INTERFACE_ENTRY(ISnapinHelp)
  27. COM_INTERFACE_ENTRY(IPersistStream)
  28. END_COM_MAP()
  29. friend class CComponentImpl;
  30. friend class CDataObject;
  31. CComponentDataImpl();
  32. ~CComponentDataImpl();
  33. public:
  34. virtual const CLSID& GetCoClassID() = 0;
  35. public:
  36. // IComponentData interface members
  37. STDMETHOD(Initialize)(LPUNKNOWN pUnknown);
  38. STDMETHOD(CreateComponent)(LPCOMPONENT* ppComponent);
  39. STDMETHOD(Notify)(LPDATAOBJECT pDataobject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  40. STDMETHOD(Destroy)();
  41. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject);
  42. STDMETHOD(GetDisplayInfo)(SCOPEDATAITEM* pScopeDataItem);
  43. STDMETHOD(CompareObjects)(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB);
  44. // IExtendPropertySheet interface
  45. public:
  46. STDMETHOD(QueryPagesFor)(LPDATAOBJECT pDataobject);
  47. STDMETHOD(CreatePropertyPages)(LPPROPERTYSHEETCALLBACK lpProvider, LONG_PTR handle, LPDATAOBJECT pDataobject);
  48. #ifdef WIZ97WIZARDS
  49. STDMETHOD(GetWatermarks)(LPDATAOBJECT pDataobject, HBITMAP* lphWatermark, HBITMAP* lphHeader, HPALETTE* lphPalette, BOOL* bStretch);
  50. #endif
  51. // IExtendContextMenu
  52. public:
  53. STDMETHOD(AddMenuItems)(LPDATAOBJECT pDataObject, LPCONTEXTMENUCALLBACK pCallbackUnknown, long *pInsertionAllowed);
  54. STDMETHOD(Command)(long nCommandID, LPDATAOBJECT pDataObject);
  55. public:
  56. // IPersistStream interface members
  57. STDMETHOD(GetClassID)(CLSID *pClassID);
  58. STDMETHOD(IsDirty)();
  59. STDMETHOD(Load)(IStream *pStm);
  60. STDMETHOD(Save)(IStream *pStm, BOOL fClearDirty);
  61. STDMETHOD(GetSizeMax)(ULARGE_INTEGER *pcbSize);
  62. // ISnapinHelp interface member
  63. public:
  64. STDMETHOD(GetHelpTopic)(LPOLESTR* lpCompiledHelpFile);
  65. #if DBG==1
  66. public:
  67. ULONG InternalAddRef()
  68. {
  69. return CComObjectRoot::InternalAddRef();
  70. }
  71. ULONG InternalRelease()
  72. {
  73. return CComObjectRoot::InternalRelease();
  74. }
  75. #endif // DBG==1
  76. private:
  77. LPCONSOLENAMESPACE m_pConsoleNameSpace; // My interface pointer to the scope pane
  78. LPCONSOLE m_pConsole; // My interface pointer to the console
  79. HSCOPEITEM m_pRootFolderScopeItem;
  80. BOOL m_bIsDirty;
  81. BOOL m_bRsop;
  82. void SetDirty(BOOL b = TRUE) { m_bIsDirty = b; }
  83. void ClearDirty() { m_bIsDirty = FALSE; }
  84. BOOL InternalIsDirty() { return m_bIsDirty; }
  85. void AddScopeItemToResultPane(MMC_COOKIE cookie);
  86. // BOOL IsScopePaneNode(LPDATAOBJECT pDataobject);
  87. HRESULT GetDomainDnsName(CString & strName);
  88. HRESULT GetDomainGPOName(CString & strName);
  89. public:
  90. CComObject <CWirelessManagerFolder>* GetStaticScopeObject () {return m_pScopeRootFolder;};
  91. // the returned interface will be valid for the duration of the call, but if you intend on
  92. // storing it you must AddRef
  93. IGPEInformation* UseGPEInformationInterface() {return m_pGPEInformation;};
  94. IRSOPInformation* UseRSOPInformationInterface() {return m_pRSOPInformation;};
  95. BOOL IsRsop() { return m_bRsop; };
  96. LPCONSOLE GetConsole() {return m_pConsole;};
  97. LPCONSOLENAMESPACE GetConsoleNameSpace () {return m_pConsoleNameSpace;};
  98. void EnumLocation (enum STORAGE_LOCATION enumLocation);
  99. enum STORAGE_LOCATION EnumLocation()
  100. {
  101. return m_enumLocation;
  102. }
  103. void RemoteMachineName (CString sRemoteMachineName) {m_sRemoteMachineName = sRemoteMachineName;}
  104. CString RemoteMachineName () {return m_sRemoteMachineName;}
  105. void DomainGPOName (CString sDomainGPOName) {m_sDomainGPOName = sDomainGPOName;}
  106. CString DomainGPOName () {return m_sDomainGPOName;}
  107. LPPROPERTYSHEETPROVIDER m_pPrshtProvider;
  108. HANDLE GetPolicyStoreHandle()
  109. {
  110. return(m_hPolicyStore);
  111. }
  112. DWORD OpenPolicyStore();
  113. void IssueStorageWarning (BOOL bWarn)
  114. {
  115. m_bStorageWarningIssued = !bWarn;
  116. }
  117. BOOL m_bStorageWarningIssued;
  118. BOOL m_bLocationStorageWarningIssued;
  119. BOOL m_bAttemptReconnect;
  120. private:
  121. CComObject <CWirelessManagerFolder>* m_pScopeRootFolder;
  122. IGPEInformation* m_pGPEInformation;
  123. IRSOPInformation* m_pRSOPInformation;
  124. enum STORAGE_LOCATION m_enumLocation;
  125. HANDLE m_hPolicyStore;
  126. IWbemServices *m_pWbemServices;
  127. CString m_sRemoteMachineName;
  128. CString m_sDomainGPOName;
  129. BOOL m_bDontDisplayRootFolderProperties;
  130. BOOL m_bNeedCleanUpWSA;
  131. #ifdef _DEBUG
  132. friend class CDataObject;
  133. int m_cDataObjects;
  134. #endif
  135. // for winsock
  136. WSADATA wsaData;
  137. };
  138. // TODO: declare registry values appear to conflict with step four and others
  139. class CComponentDataPrimaryImpl : public CComponentDataImpl,
  140. public CComCoClass<CComponentDataPrimaryImpl, &CLSID_Snapin>
  141. {
  142. public:
  143. DECLARE_REGISTRY(CComponentImpl, _T("Wireless.Snapin.1"), _T("Wireless.Snapin"), IDS_SNAPIN_DESC, THREADFLAGS_BOTH)
  144. CComponentDataPrimaryImpl();
  145. virtual const CLSID & GetCoClassID(){ return CLSID_Snapin; }
  146. };
  147. class CComponentDataExtensionImpl : public CComponentDataImpl,
  148. public CComCoClass<CComponentDataExtensionImpl, &CLSID_Extension>
  149. {
  150. public:
  151. DECLARE_REGISTRY(CComponentImpl, _T("Wireless.Extension.1"), _T("Wireless.Extension"), IDS_SNAPIN_DESC, THREADFLAGS_BOTH)
  152. virtual const CLSID & GetCoClassID(){ return CLSID_Extension; }
  153. };
  154. #endif
  155.