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.

56 lines
1.2 KiB

  1. #include "priv.h"
  2. #include "ipstg.h"
  3. HRESULT CImpIPersistStorage::InitNew(IStorage *pStg)
  4. {
  5. return InitNew();
  6. }
  7. HRESULT CImpIPersistStorage::Load(IStorage *pStg)
  8. {
  9. HRESULT hres = E_INVALIDARG;
  10. if (EVAL(pStg))
  11. {
  12. IStream* pstm = NULL;
  13. hres = pStg->OpenStream(L"CONTENTS",0,STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &pstm);
  14. if (EVAL(SUCCEEDED(hres)))
  15. {
  16. pstm->Seek(c_li0, STREAM_SEEK_SET, NULL);
  17. hres = Load(pstm);
  18. pstm->Release();
  19. }
  20. }
  21. return hres;
  22. }
  23. HRESULT CImpIPersistStorage::Save(IStorage *pStgSave, BOOL fSameAsLoad)
  24. {
  25. HRESULT hres = E_INVALIDARG;
  26. if (EVAL(pStgSave))
  27. {
  28. IStream* pstm = NULL;
  29. hres = pStgSave->CreateStream(L"CONTENTS",STGM_CREATE|STGM_WRITE|STGM_SHARE_EXCLUSIVE, 0, 0, &pstm);
  30. if (EVAL(SUCCEEDED(hres)))
  31. {
  32. pstm->Seek(c_li0, STREAM_SEEK_SET, NULL);
  33. hres = Save(pstm, TRUE);
  34. pstm->Release();
  35. }
  36. }
  37. return hres;
  38. }
  39. HRESULT CImpIPersistStorage::SaveCompleted(IStorage *pStgNew)
  40. {
  41. return S_OK;
  42. }
  43. HRESULT CImpIPersistStorage::HandsOffStorage(void)
  44. {
  45. return S_OK;
  46. }