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.

45 lines
1.6 KiB

  1. #ifndef __IPSTG_H__
  2. #define __IPSTG_H__
  3. //
  4. // CImpIPersistStorage works very well along-side an IPersistStreamInit
  5. // implementation.
  6. //
  7. // IE30's CShellEmbedding implemented this interface because it was
  8. // an embedding must-have. But none of our objects were marked as
  9. // embeddable, so we really didn't need it.
  10. //
  11. // I pulled the implementation to a new class that can easily be
  12. // included into any object that needs an IPersistStorange implementation
  13. // that delegates to the object's IPersistStreamInit implementation.
  14. //
  15. class CImpIPersistStorage : public IPersistStorage
  16. {
  17. public:
  18. // *** IUnknown ***
  19. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj) PURE;
  20. virtual STDMETHODIMP_(ULONG) AddRef(void) PURE;
  21. virtual STDMETHODIMP_(ULONG) Release(void) PURE;
  22. // *** IPersist ***
  23. virtual STDMETHODIMP GetClassID(CLSID *pClassID) PURE;
  24. // *** IPersistStorage ***
  25. virtual STDMETHODIMP IsDirty(void) PURE; // matches IPersistStreamInit
  26. virtual STDMETHODIMP InitNew(IStorage *pStg);
  27. virtual STDMETHODIMP Load(IStorage *pStg);
  28. virtual STDMETHODIMP Save(IStorage *pStgSave, BOOL fSameAsLoad);
  29. virtual STDMETHODIMP SaveCompleted(IStorage *pStgNew);
  30. virtual STDMETHODIMP HandsOffStorage(void);
  31. // These happen to match IPersistStreamInit methods.
  32. // They should update the dirty state of the object as
  33. // returned from IsDirty().
  34. //
  35. virtual STDMETHODIMP Load(IStream *pStm) PURE;
  36. virtual STDMETHODIMP Save(IStream *pStm, BOOL fClearDirty) PURE;
  37. virtual STDMETHODIMP InitNew(void) PURE;
  38. };
  39. #endif // __IPSTG_H__