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.

117 lines
3.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-2001.
  5. //
  6. // File: dataobj.h
  7. //
  8. // Contents:
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef __DATAOBJ_H_INCLUDED__
  12. #define __DATAOBJ_H_INCLUDED__
  13. // For use in multiple selection.
  14. LPDATAOBJECT ExtractMultiSelect (LPDATAOBJECT lpDataObject);
  15. class CCertMgrDataObject : public CDataObject
  16. {
  17. DECLARE_NOT_AGGREGATABLE(CCertMgrDataObject)
  18. public:
  19. // debug refcount
  20. #if DBG==1
  21. ULONG InternalAddRef()
  22. {
  23. return CComObjectRoot::InternalAddRef();
  24. }
  25. ULONG InternalRelease()
  26. {
  27. return CComObjectRoot::InternalRelease();
  28. }
  29. int dbg_InstID;
  30. #endif // DBG==1
  31. CCertMgrDataObject();
  32. virtual ~CCertMgrDataObject();
  33. STDMETHODIMP Next(ULONG celt, MMC_COOKIE* rgelt, ULONG *pceltFetched);
  34. STDMETHODIMP Skip(ULONG celt);
  35. STDMETHODIMP Reset(void);
  36. void AddCookie(CCertMgrCookie* pCookie);
  37. virtual HRESULT Initialize (
  38. CCertMgrCookie* pcookie,
  39. DATA_OBJECT_TYPES type,
  40. BOOL fAllowOverrideMachineName,
  41. DWORD dwLocation,
  42. CString szManagedUser,
  43. CString szManagedComputer,
  44. CString szManagedService,
  45. CCertMgrComponentData& refComponentData);
  46. // IDataObject interface implementation
  47. HRESULT STDMETHODCALLTYPE GetDataHere(
  48. FORMATETC __RPC_FAR *pFormatEtcIn,
  49. STGMEDIUM __RPC_FAR *pMedium);
  50. HRESULT PutDisplayName(STGMEDIUM* pMedium);
  51. HRESULT PutServiceName(STGMEDIUM* pMedium);
  52. void SetMultiSelData(BYTE* pbMultiSelData, UINT cbMultiSelData);
  53. STDMETHODIMP GetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium);
  54. STDMETHOD(IsMultiSelect)(void)
  55. {
  56. return (m_rgCookies.GetSize() > 1) ? S_OK : S_FALSE;
  57. }
  58. protected:
  59. HRESULT CreateMultiSelectObject(LPSTGMEDIUM lpMedium);
  60. HRESULT Create (const void* pBuffer, int len, LPSTGMEDIUM lpMedium);
  61. HRESULT CreateGPTUnknown(LPSTGMEDIUM lpMedium) ;
  62. HRESULT CreateRSOPUnknown(LPSTGMEDIUM lpMedium) ;
  63. CCertMgrCookie* m_pCookie; // the CCookieBlock is AddRef'ed for the life of the DataObject
  64. CertificateManagerObjectType m_objecttype;
  65. DATA_OBJECT_TYPES m_dataobjecttype;
  66. BOOL m_fAllowOverrideMachineName; // From CCertMgrComponentData
  67. GUID m_SnapInCLSID;
  68. public:
  69. HRESULT SetGPTInformation (IGPEInformation* pGPTInformation);
  70. HRESULT SetRSOPInformation (IRSOPInformation* pRSOPInformation);
  71. // Clipboard formats
  72. static CLIPFORMAT m_CFDisplayName;
  73. static CLIPFORMAT m_CFMachineName;
  74. static CLIPFORMAT m_CFMultiSel; // Required for multiple selection
  75. static CLIPFORMAT m_CFMultiSelDobj; // Required for multiple selection
  76. static CLIPFORMAT m_CFSCEModeType; // For SCE snapin mode type
  77. static CLIPFORMAT m_CFSCE_GPTUnknown; // For IUnknown of GPT (which SCE extends)
  78. static CLIPFORMAT m_CFSCE_RSOPUnknown; // For IUnknown of GPT (which SCE extends)
  79. static CLIPFORMAT m_CFMultiSelDataObjs;// for Multiple selection
  80. private:
  81. // data member used by IEnumCookies
  82. ULONG m_iCurr;
  83. CCookiePtrArray m_rgCookies;
  84. bool m_bMultiSelDobj;
  85. IGPEInformation* m_pGPEInformation;
  86. IRSOPInformation* m_pRSOPInformation;
  87. BYTE* m_pbMultiSelData;
  88. UINT m_cbMultiSelData;
  89. CString m_szManagedComputer;
  90. CString m_szManagedUser;
  91. CString m_szManagedService;
  92. DWORD m_dwLocation;
  93. public:
  94. void SetMultiSelDobj()
  95. {
  96. m_bMultiSelDobj = true;
  97. }
  98. }; // CCertMgrDataObject
  99. #endif // ~__DATAOBJ_H_INCLUDED__