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.

562 lines
20 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-2002.
  5. //
  6. // File: compdata.h
  7. //
  8. // Contents:
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef __COMPDATA_H_INCLUDED__
  12. #define __COMPDATA_H_INCLUDED__
  13. #include "cmponent.h" // LoadIconsIntoImageList
  14. #include "certifct.h"
  15. #include "CTL.h"
  16. #include "CRL.h"
  17. #include "AutoCert.h"
  18. #include "certmgrd.h"
  19. #include "options.h"
  20. #include "cookie.h" // Added by ClassView
  21. #include "StoreRSOP.h"
  22. #include "RSOPObject.h"
  23. #include "SaferLevel.h"
  24. #include "SaferEntryCertificatePropertyPage.h"
  25. #include "SaferEntryPathPropertyPage.h"
  26. #include "SaferEntryHashPropertyPage.h"
  27. #include "SaferEntryInternetZonePropertyPage.h"
  28. #define HINT_CHANGE_VIEW_TYPE 0x00000001
  29. #define HINT_CHANGE_STORE_TYPE 0x00000002
  30. #define HINT_SHOW_ARCHIVE_CERTS 0x00000004
  31. #define HINT_PASTE_COOKIE 0x00000008
  32. #define HINT_EFS_ADD_DEL_POLICY 0x00000010
  33. #define HINT_IMPORT 0x00000020
  34. #define HINT_CHANGE_COMPUTER 0x00000040
  35. #define HINT_REFRESH_STORES 0x00000080
  36. #define HINT_CERT_ENROLLED_USAGE_MODE 0x00000100
  37. class CCertStoreGPE; // forward declaration
  38. class CFindDialog; // forward declaration
  39. class CCertMgrComponentData:
  40. public CComponentData,
  41. public IExtendContextMenu,
  42. public IExtendPropertySheet,
  43. public PersistStream,
  44. public CHasMachineName
  45. {
  46. friend CCertMgrComponent;
  47. friend CViewOptionsDlg;
  48. friend CFindDialog;
  49. friend CSaferEntryCertificatePropertyPage;
  50. friend CSaferEntryPathPropertyPage;
  51. friend CSaferEntryHashPropertyPage;
  52. friend CSaferEntryInternetZonePropertyPage;
  53. public:
  54. IGPEInformation* GetGPEInformation ()
  55. {
  56. if ( m_pGPEInformation )
  57. m_pGPEInformation->AddRef ();
  58. return m_pGPEInformation;
  59. }
  60. IRSOPInformation* GetRSOPInformation (bool bIsComputer)
  61. {
  62. if ( bIsComputer )
  63. {
  64. if ( m_pRSOPInformationComputer )
  65. m_pRSOPInformationComputer->AddRef ();
  66. return m_pRSOPInformationComputer;
  67. }
  68. else
  69. {
  70. if ( m_pRSOPInformationUser )
  71. m_pRSOPInformationUser->AddRef ();
  72. return m_pRSOPInformationUser;
  73. }
  74. }
  75. CertificateManagerObjectType GetObjectType (LPDATAOBJECT pDataObject);
  76. // Use DECLARE_NOT_AGGREGATABLE(CCertMgrComponentData)
  77. // if you don't want your object to support aggregation
  78. //DECLARE_AGGREGATABLE(CCertMgrComponentData)
  79. //DECLARE_REGISTRY(CCertMgrComponentData, _T("CERTMGR.CertMgrObject.1"), _T("CERTMGR.CertMgrObject.1"), IDS_CERTMGR_DESC, THREADFLAGS_BOTH)
  80. CCertMgrComponentData();
  81. virtual ~CCertMgrComponentData();
  82. BEGIN_COM_MAP(CCertMgrComponentData)
  83. COM_INTERFACE_ENTRY(IExtendPropertySheet)
  84. // security review 2/27/2002 BryanWal ok
  85. COM_INTERFACE_ENTRY(IPersistStream)
  86. COM_INTERFACE_ENTRY_CHAIN(CComponentData)
  87. COM_INTERFACE_ENTRY(IExtendContextMenu)
  88. END_COM_MAP()
  89. #if DBG==1
  90. ULONG InternalAddRef()
  91. {
  92. return CComObjectRoot::InternalAddRef();
  93. }
  94. ULONG InternalRelease()
  95. {
  96. return CComObjectRoot::InternalRelease();
  97. }
  98. int dbg_InstID;
  99. #endif // DBG==1
  100. // IComponentData
  101. STDMETHOD(CreateComponent)(LPCOMPONENT* ppComponent);
  102. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject);
  103. // IExtendPropertySheet
  104. STDMETHOD(CreatePropertyPages)(LPPROPERTYSHEETCALLBACK pCall, LONG_PTR handle, LPDATAOBJECT pDataObject);
  105. STDMETHOD(QueryPagesFor)(LPDATAOBJECT pDataObject);
  106. // IExtendContextMenu
  107. public:
  108. const CRSOPObjectArray* GetRSOPObjectArrayComputer () const
  109. {
  110. return &m_rsopObjectArrayComputer;
  111. }
  112. const CRSOPObjectArray* GetRSOPObjectArrayUser () const
  113. {
  114. return &m_rsopObjectArrayUser;
  115. }
  116. CCertMgrCookie* GetRootCookie ()
  117. {
  118. return m_pRootCookie;
  119. }
  120. void RemoveResultCookies (LPRESULTDATA pResultData);
  121. bool ShowArchivedCerts () const;
  122. HRESULT CreateContainers (
  123. HSCOPEITEM hScopeItem,
  124. CCertStore& rTargetStore);
  125. HRESULT EnumerateLogicalStores (CTypedPtrList<CPtrList, CCertStore*>* pStoreList);
  126. CString GetThisComputer() const;
  127. void SetResultData (LPRESULTDATA pResultData);
  128. CUsageCookie* FindDuplicateUsage (HSCOPEITEM hParent, LPCWSTR pszName);
  129. LPCONSOLENAMESPACE GetConsoleNameSpace () const;
  130. DWORD GetLocation () const;
  131. CString GetManagedComputer () const;
  132. CString GetManagedService () const;
  133. CString GetCommandLineFileName () const;
  134. HRESULT RefreshScopePane (LPDATAOBJECT pDataObject);
  135. STDMETHOD(AddMenuItems)(LPDATAOBJECT pDataObject,
  136. LPCONTEXTMENUCALLBACK pCallbackUnknown,
  137. long *pInsertionAllowed);
  138. STDMETHOD(Command)(long nCommandID, LPDATAOBJECT pDataObject);
  139. HRESULT STDMETHODCALLTYPE Load(IStream __RPC_FAR *pStg);
  140. HRESULT STDMETHODCALLTYPE Save(IStream __RPC_FAR *pStgSave, BOOL fSameAsLoad);
  141. // needed for Initialize()
  142. virtual HRESULT LoadIcons(LPIMAGELIST pImageList, BOOL fLoadLargeIcons);
  143. // needed for Notify()
  144. virtual HRESULT OnNotifyExpand(LPDATAOBJECT pDataObject, BOOL bExpanding, HSCOPEITEM hParent);
  145. // needed for GetDisplayInfo(), must be defined by subclass
  146. virtual BSTR QueryResultColumnText(CCookie& basecookieref, int nCol );
  147. virtual int QueryImage(CCookie& basecookieref, BOOL fOpenImage);
  148. virtual CCookie& QueryBaseRootCookie();
  149. inline CCertMgrCookie* ActiveCookie( CCookie* pBaseCookie )
  150. {
  151. return (CCertMgrCookie*)ActiveBaseCookie( pBaseCookie );
  152. }
  153. inline CCertMgrCookie& QueryRootCookie()
  154. {
  155. ASSERT (m_pRootCookie);
  156. return *m_pRootCookie;
  157. }
  158. virtual HRESULT OnNotifyRelease(LPDATAOBJECT pDataObject, HSCOPEITEM hItem);
  159. // CHasMachineName
  160. DECLARE_FORWARDS_MACHINE_NAME( (m_pRootCookie) )
  161. // ISnapinHelp2
  162. STDMETHOD(GetLinkedTopics)(LPOLESTR* lpCompiledHelpFiles);
  163. STDMETHOD(GetHelpTopic)(LPOLESTR* lpCompiledHelpFile);
  164. bool ComputerIsStandAlone () const
  165. {
  166. return m_bMachineIsStandAlone;
  167. }
  168. void IncrementOpenSaferPageCount ()
  169. {
  170. ASSERT (m_nOpenSaferPageRefCount >= 0);
  171. m_critSec.Lock ();
  172. m_nOpenSaferPageRefCount++;
  173. m_critSec.Unlock ();
  174. }
  175. void DecrementOpenSaferPageCount ()
  176. {
  177. ASSERT (m_nOpenSaferPageRefCount > 0);
  178. m_critSec.Lock ();
  179. if ( m_nOpenSaferPageRefCount > 0 )
  180. m_nOpenSaferPageRefCount--;
  181. m_critSec.Unlock ();
  182. }
  183. int GetOpenSaferPageCount () const
  184. {
  185. return m_nOpenSaferPageRefCount;
  186. }
  187. protected:
  188. bool m_bSaferSupported;
  189. DWORD* m_pdwSaferLevels;
  190. DWORD m_dwDefaultSaferLevel;
  191. CRSOPObjectArray m_rsopObjectArrayComputer;
  192. CRSOPObjectArray m_rsopObjectArrayUser;
  193. LPCONSOLE m_pComponentConsole;
  194. IGPEInformation* m_pGPEInformation;
  195. HRESULT AddACRSCTLPropPages (
  196. CAutoCertRequest* pACR,
  197. LPPROPERTYSHEETCALLBACK pCallBack);
  198. HRESULT AddAutoenrollmentSettingsPropPages (
  199. LPPROPERTYSHEETCALLBACK pCallBack,
  200. bool fIsComputerType);
  201. HRESULT ValidateCertChain (
  202. PCCERT_CONTEXT pCertContext);
  203. HRESULT AddCertPropPages (
  204. CCertificate* pCert,
  205. LPPROPERTYSHEETCALLBACK pCallBack,
  206. LPDATAOBJECT pDataObject,
  207. LONG_PTR lNotifyHandle);
  208. HRESULT AddCTLPropPages (
  209. CCTL* pCTL,
  210. LPPROPERTYSHEETCALLBACK pCallback);
  211. HRESULT AddEFSSettingsPropPages (
  212. LPPROPERTYSHEETCALLBACK pCallback,
  213. bool fIsComputerType);
  214. HRESULT AddGPEStorePropPages(
  215. LPPROPERTYSHEETCALLBACK pCallBack,
  216. CCertStore* pStore);
  217. HRESULT AddSingleMenuItem (
  218. LPCONTEXTMENUCALLBACK pContextMenuCallback,
  219. LONG lInsertionPointID,
  220. int menuTextID,
  221. int menuHintID,
  222. int menuID);
  223. HRESULT AddSaferEnforcementPropPages (
  224. LPPROPERTYSHEETCALLBACK pCallBack,
  225. bool bIsComputerType);
  226. HRESULT AddSaferDefinedFileTypesPropPages (
  227. LPPROPERTYSHEETCALLBACK pCallBack,
  228. bool bIsComputerType);
  229. HRESULT AddSaferEntryPropertyPage (
  230. LPPROPERTYSHEETCALLBACK pCallback,
  231. CCertMgrCookie* pCookie,
  232. LPDATAOBJECT pDataObject,
  233. LONG_PTR lNotifyHandle);
  234. HRESULT AddSaferNewEntryMenuItems (
  235. LPCONTEXTMENUCALLBACK pContextMenuCallback,
  236. LONG lInsertionPointID);
  237. HRESULT AddSaferTrustedPublisherPropPages (
  238. LPPROPERTYSHEETCALLBACK pCallBack,
  239. bool fIsMachineType);
  240. HRESULT AddScopeNode (
  241. CCertMgrCookie* pCookie,
  242. const CString& strServerName,
  243. HSCOPEITEM hParent);
  244. HRESULT AddSeparator (
  245. LPCONTEXTMENUCALLBACK pContextMenuCallback);
  246. HRESULT AddSnapMgrPropPages (
  247. LPPROPERTYSHEETCALLBACK pCallBack);
  248. HRESULT BuildWMIList (LPDATAOBJECT pDataObject, bool bIsComputer);
  249. HRESULT ChangeRootNodeName (
  250. const CString& newName);
  251. HRESULT CompleteEFSRecoveryAgent (
  252. CCertStoreGPE* pStore,
  253. PCCERT_CONTEXT pCertContext);
  254. bool ContainerExists (
  255. HSCOPEITEM hParent,
  256. CertificateManagerObjectType objectType);
  257. CCertMgrCookie* ConvertCookie (
  258. LPDATAOBJECT pDataObject);
  259. HRESULT DeleteChildren (
  260. HSCOPEITEM hParent);
  261. HRESULT DeleteCTLFromResultPane (
  262. CCTL* pCTL,
  263. LPDATAOBJECT pDataObject);
  264. HRESULT DeleteKeyFromRSABASE (
  265. PCCERT_CONTEXT pCertContext);
  266. HRESULT DeleteScopeItems (HSCOPEITEM hScopeItem = 0);
  267. void DisplayAccessDenied();
  268. void DisplaySystemError (
  269. DWORD dwErr);
  270. HRESULT ExpandScopeNodes (
  271. CCertMgrCookie* pParentCookie,
  272. HSCOPEITEM hParent,
  273. const CString& strServerName,
  274. DWORD dwLocation,
  275. const GUID& guidObjectType);
  276. virtual bool FoundInRSOPFilter (BSTR /*bstrKey*/) const
  277. {
  278. return false;
  279. }
  280. HRESULT GetResultData (LPRESULTDATA* ppResultData);
  281. bool IsSecurityConfigurationEditorNodetype (
  282. const GUID& refguid) const;
  283. HRESULT IsUserAdministrator (
  284. BOOL& bIsAdministrator);
  285. HRESULT OnACRSEdit (
  286. LPDATAOBJECT pDataObject);
  287. HRESULT OnAddDomainEncryptedDataRecoveryAgent(
  288. LPDATAOBJECT pDataObject);
  289. HRESULT OnCTLEdit (
  290. LPDATAOBJECT pDataObject);
  291. HRESULT OnDeleteEFSPolicy (
  292. LPDATAOBJECT pDataObject,
  293. bool bCommitChanges);
  294. HRESULT OnEnroll (
  295. LPDATAOBJECT pDataObject,
  296. bool bNewKey,
  297. bool bShowUI = true);
  298. HRESULT OnExport (
  299. LPDATAOBJECT pDataObject);
  300. HRESULT OnPulseAutoEnroll();
  301. HRESULT OnFind (
  302. LPDATAOBJECT pDataObject);
  303. HRESULT OnChangeComputer (
  304. LPDATAOBJECT pDataObject);
  305. HRESULT OnImport (
  306. LPDATAOBJECT pDataObject);
  307. HRESULT OnInitEFSPolicy (
  308. LPDATAOBJECT pDataObject);
  309. HRESULT OnNewACRS (
  310. LPDATAOBJECT pDataObject);
  311. HRESULT OnNewCTL (
  312. LPDATAOBJECT pDataObject);
  313. HRESULT OnCreateNewSaferPolicy (
  314. LPDATAOBJECT pDataObject);
  315. HRESULT OnDeleteSaferPolicy (
  316. LPDATAOBJECT pDataObject);
  317. HRESULT OnNewSaferEntry (
  318. long nCommandID,
  319. LPDATAOBJECT pDataObject);
  320. HRESULT OnNotifyPreload(
  321. LPDATAOBJECT pDataObject,
  322. HSCOPEITEM hRootScopeItem);
  323. HRESULT OnOptions (LPDATAOBJECT pDataObject);
  324. virtual HRESULT OnPropertyChange (LPARAM param);
  325. HRESULT OnRenew (
  326. LPDATAOBJECT pDataObject,
  327. bool bNewKey);
  328. HRESULT QueryMultiSelectDataObject(
  329. MMC_COOKIE cookie,
  330. DATA_OBJECT_TYPES type,
  331. LPDATAOBJECT* ppDataObject);
  332. HRESULT ReleaseResultCookie (
  333. CBaseCookieBlock * pResultCookie,
  334. CCookie& rootCookie,
  335. HCERTSTORE hStoreHandle,
  336. POSITION pos2);
  337. HRESULT RemoveCertChainFromPolicy (
  338. PCCERT_CONTEXT pCertContext,
  339. CERT_CONTEXT_LIST& certChainsThatCantBeDeleted);
  340. // The following members are used to support Command Line override.
  341. // This code was copied from ..\mmcfmgmt\compdata.h.
  342. enum // Bit fields for m_dwFlagsPersist
  343. {
  344. mskfAllowOverrideMachineName = 0x0001
  345. };
  346. DWORD m_dwFlagsPersist; // General-purpose flags to be persisted into .msc file
  347. CString m_strMachineNamePersist; // Machine name to persist into .msc file
  348. BOOL m_fAllowOverrideMachineName; // TRUE => Allow the machine name to be overriden by the command line
  349. CString m_strLinkedHelpFile; // Return in GetLinkedTopic ()
  350. void SetPersistentFlags(DWORD dwFlags)
  351. {
  352. m_dwFlagsPersist = dwFlags;
  353. m_fAllowOverrideMachineName = !!(m_dwFlagsPersist & mskfAllowOverrideMachineName);
  354. }
  355. DWORD GetPersistentFlags()
  356. {
  357. if (m_fAllowOverrideMachineName)
  358. m_dwFlagsPersist |= mskfAllowOverrideMachineName;
  359. else
  360. m_dwFlagsPersist &= ~mskfAllowOverrideMachineName;
  361. return m_dwFlagsPersist;
  362. }
  363. LPHEADERCTRL m_pHeader;
  364. private:
  365. DWORD m_dwRSOPFlagsComputer;
  366. DWORD m_dwRSOPFlagsUser;
  367. bool m_bIsRSOP;
  368. bool m_bMachineIsStandAlone;
  369. bool m_fInvalidComputer;
  370. CCertStore* m_pFileBasedStore;
  371. CCertStore* m_pGPERootStore;
  372. CCertStore* m_pGPETrustStore;
  373. CCertStore* m_pGPEACRSUserStore;
  374. CCertStore* m_pGPEACRSComputerStore;
  375. PCRYPTUI_MMCCALLBACK_STRUCT m_pCryptUIMMCCallbackStruct;
  376. bool m_bMultipleObjectsSelected;
  377. HRESULT AddCertificateTaskMenuItems (LPCONTEXTMENUCALLBACK pContextMenuCallback,
  378. const bool bIsMyStore, bool bIsReadOnly, CCertificate* pCert);
  379. HRESULT AddCTLTaskMenuItems (LPCONTEXTMENUCALLBACK pContextMenuCallback, bool bIsReadOnly);
  380. HRESULT AddContainersToScopePane (
  381. HSCOPEITEM hParent,
  382. CCertMgrCookie& parentCookie,
  383. bool bDeleteAndExpand);
  384. HRESULT AddPhysicalStoresToScopePane (HSCOPEITEM hParent, CCertMgrCookie& parentCookie, const SPECIAL_STORE_TYPE storeType);
  385. HRESULT AddLogicalStoresToScopePane (HSCOPEITEM hParent, CCertMgrCookie& parentCookie);
  386. HRESULT AddSaferLevelPropPage (
  387. LPPROPERTYSHEETCALLBACK pCallback,
  388. CSaferLevel* pSaferLevel,
  389. LONG_PTR lNotifyHandle,
  390. LPDATAOBJECT pDataObject);
  391. HRESULT AddUsagesToScopePane (HSCOPEITEM hParent, CCertMgrCookie& parentCookie);
  392. HRESULT FindRSOPObjectByHashAndDisplayPrecedencePage (
  393. const CString& szHash,
  394. const bool bIsComputer,
  395. LPPROPERTYSHEETCALLBACK pCallback);
  396. HRESULT GetValuesAndInsertInRSOPObjectList (
  397. IWbemClassObject* pObject,
  398. CRSOPObjectArray& rRsopObjectArray,
  399. bool bIsComputer);
  400. HRESULT GetGPOFriendlyName (PCWSTR pwszOID, PWSTR *ppwszGPOName, bool bIsComputer);
  401. HRESULT OnSetSaferLevelDefault (LPDATAOBJECT pDataObject);
  402. HRESULT SaferEnumerateLevels (bool bIsMachine);
  403. DWORD m_dwSCEMode;
  404. CString m_szManagedServiceDisplayName;
  405. BOOL m_bIsUserAdministrator;
  406. CString m_szManagedServicePersist;
  407. CString m_szFileName;
  408. BOOL m_bShowPhysicalStoresPersist;
  409. BOOL m_bShowArchivedCertsPersist;
  410. CString m_szManagedComputer;
  411. CString m_szThisComputer;
  412. CString m_szLoggedInUser;
  413. CString m_szManagedUser;
  414. DWORD m_dwLocationPersist;
  415. HSCOPEITEM m_hRootScopeItem;
  416. CCertMgrCookie* m_pRootCookie;
  417. int m_activeViewPersist;
  418. LPRESULTDATA m_pResultData;
  419. IRSOPInformation* m_pRSOPInformationComputer;
  420. IRSOPInformation* m_pRSOPInformationUser;
  421. IWbemServices * m_pIWbemServicesComputer;
  422. IWbemServices * m_pIWbemServicesUser;
  423. BSTR m_pbstrLanguage;
  424. BSTR m_pbstrQuery;
  425. BSTR m_pbstrValueName;
  426. BSTR m_pbstrRegistryKey;
  427. BSTR m_pbstrValue;
  428. BSTR m_pbstrPrecedence;
  429. BSTR m_pbstrGPOid;
  430. int m_nOpenSaferPageRefCount;
  431. CCriticalSection m_critSec;
  432. }; // CCertMgrComponentData
  433. /////////////////////////////////////////////////////////////////////
  434. class CCertMgrSnapin: public CCertMgrComponentData,
  435. public CComCoClass<CCertMgrSnapin, &CLSID_CertificateManager>
  436. {
  437. public:
  438. CCertMgrSnapin() : CCertMgrComponentData ()
  439. {
  440. SetHtmlHelpFileName (CM_HELP_FILE);
  441. m_strLinkedHelpFile = CM_LINKED_HELP_FILE;
  442. };
  443. virtual ~CCertMgrSnapin() {};
  444. // Use DECLARE_NOT_AGGREGATABLE(CCertMgrSnapin) if you don't want your object
  445. // to support aggregation
  446. DECLARE_AGGREGATABLE(CCertMgrSnapin)
  447. DECLARE_REGISTRY(CCertMgrSnapin, _T("CERTMGR.CertMgrObject.1"), _T("CERTMGR.CertMgrObject.1"), IDS_CERTMGR_DESC, THREADFLAGS_BOTH)
  448. virtual BOOL IsServiceSnapin() { return FALSE; }
  449. // IPersistStream or IPersistStorage
  450. STDMETHOD(GetClassID)(CLSID __RPC_FAR *pClassID)
  451. {
  452. *pClassID = CLSID_CertificateManager;
  453. return S_OK;
  454. }
  455. };
  456. class CCertMgrPKPolExtension: public CCertMgrComponentData,
  457. public CComCoClass<CCertMgrPKPolExtension, &CLSID_CertificateManagerPKPOLExt>
  458. {
  459. public:
  460. CCertMgrPKPolExtension() : CCertMgrComponentData ()
  461. {
  462. SetHtmlHelpFileName (PKP_HELP_FILE);
  463. m_strLinkedHelpFile = PKP_LINKED_HELP_FILE;
  464. };
  465. virtual ~CCertMgrPKPolExtension() {};
  466. // Use DECLARE_NOT_AGGREGATABLE(CCertMgrPKPolExtension) if you don't want your object
  467. // to support aggregation
  468. DECLARE_AGGREGATABLE(CCertMgrPKPolExtension)
  469. DECLARE_REGISTRY(CCertMgrPKPolExtension, _T("CERTMGR.CertMgrPKPolExtObject.1"), _T("CERTMGR.CertMgrPKPolExtObject.1"), IDS_CERTMGR_DESC, THREADFLAGS_BOTH)
  470. virtual BOOL IsServiceSnapin() { return FALSE; }
  471. virtual BOOL IsExtensionSnapin() { return TRUE; }
  472. // IPersistStream or IPersistStorage
  473. STDMETHOD(GetClassID)(CLSID __RPC_FAR *pClassID)
  474. {
  475. *pClassID = CLSID_CertificateManagerPKPOLExt;
  476. return S_OK;
  477. }
  478. virtual bool FoundInRSOPFilter (BSTR bstrKey) const;
  479. };
  480. class CSaferWindowsExtension: public CCertMgrComponentData,
  481. public CComCoClass<CSaferWindowsExtension, &CLSID_SaferWindowsExtension>
  482. {
  483. public:
  484. CSaferWindowsExtension();
  485. virtual ~CSaferWindowsExtension() {};
  486. // Use DECLARE_NOT_AGGREGATABLE(CSaferWindowsExtension) if you don't want your object
  487. // to support aggregation
  488. DECLARE_AGGREGATABLE(CSaferWindowsExtension)
  489. DECLARE_REGISTRY(CSaferWindowsExtension, _T("CERTMGR.CertMgrSaferWindowsExtensionObject.1"),
  490. _T("CERTMGR.CertMgrSaferWindowsExtensionObject.1"), IDS_CERTMGR_SAFER_WINDOWS_DESC, THREADFLAGS_BOTH)
  491. virtual BOOL IsServiceSnapin() { return FALSE; }
  492. virtual BOOL IsExtensionSnapin() { return TRUE; }
  493. // IPersistStream or IPersistStorage
  494. STDMETHOD(GetClassID)(CLSID __RPC_FAR *pClassID)
  495. {
  496. *pClassID = CLSID_SaferWindowsExtension;
  497. return S_OK;
  498. }
  499. virtual bool FoundInRSOPFilter (BSTR bstrKey) const;
  500. };
  501. #endif // ~__COMPDATA_H_INCLUDED__