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.

83 lines
1.2 KiB

  1. #ifndef __VOLCOM_H__
  2. #define __VOLCOM_H__
  3. #include "sysstruc.h"
  4. #include "VolList.h"
  5. #include "DataIo.h"
  6. #include "errmacro.h"
  7. class CVolume;
  8. class EsiVolumeDataObject : public EsiDataObject
  9. {
  10. public:
  11. EsiVolumeDataObject( CVolume* pVol )
  12. {
  13. _ASSERTE( pVol );
  14. m_pVolOwner = pVol;
  15. }
  16. //
  17. // Overridden to use our volume to direct messages to.
  18. //
  19. STDMETHOD(SetData)(LPFORMATETC pformatetc, STGMEDIUM FAR * pmedium, BOOL fRelease);
  20. protected:
  21. //
  22. // The volume all communications will be sent to.
  23. //
  24. CVolume* m_pVolOwner;
  25. };
  26. class EsiVolumeClassFactory : public CClassFactory
  27. {
  28. public:
  29. EsiVolumeClassFactory( CVolume* pVol )
  30. {
  31. _ASSERTE( pVol );
  32. m_pVolOwner = pVol;
  33. }
  34. //
  35. // Overridden to create a data object containing a volume.
  36. //
  37. STDMETHODIMP CreateInstance (LPUNKNOWN punkOuter, REFIID iid, void **ppv);
  38. protected:
  39. //
  40. // The volume used when creating the dataobject.
  41. //
  42. CVolume* m_pVolOwner;
  43. };
  44. class COleStr
  45. {
  46. public:
  47. COleStr()
  48. {
  49. m_pStr = NULL;
  50. }
  51. virtual ~COleStr()
  52. {
  53. if ( m_pStr != NULL )
  54. CoTaskMemFree( m_pStr );
  55. }
  56. operator LPOLESTR()
  57. {
  58. return( m_pStr );
  59. }
  60. operator LPOLESTR*()
  61. {
  62. return( &m_pStr );
  63. }
  64. long GetLength()
  65. {
  66. return( wcslen( m_pStr ) );
  67. }
  68. LPOLESTR m_pStr;
  69. };
  70. #endif //__VOLCOM_H__