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.

105 lines
2.3 KiB

  1. #include "privcpp.h"
  2. // Constructor
  3. CPackage_IPersistFile::CPackage_IPersistFile(CPackage *pPackage) :
  4. _pPackage(pPackage)
  5. {
  6. ASSERT(_cRef == 0);
  7. }
  8. CPackage_IPersistFile::~CPackage_IPersistFile()
  9. {
  10. DebugMsg(DM_TRACE,"CPackage_IPersistFile destroyed with ref count %d",_cRef);
  11. }
  12. //////////////////////////////////
  13. //
  14. // IUnknown Methods...
  15. //
  16. HRESULT CPackage_IPersistFile::QueryInterface(REFIID iid, void ** ppv)
  17. {
  18. return _pPackage->QueryInterface(iid,ppv); // delegate to CPackage
  19. }
  20. ULONG CPackage_IPersistFile::AddRef(void)
  21. {
  22. _cRef++; // interface ref count for debug
  23. return _pPackage->AddRef(); // delegate to CPackage
  24. }
  25. ULONG CPackage_IPersistFile::Release(void)
  26. {
  27. _cRef--; // interface ref count for debug
  28. return _pPackage->Release(); // delegate to CPackage
  29. }
  30. //////////////////////////////////
  31. //
  32. // IPersistFile Methods...
  33. //
  34. HRESULT CPackage_IPersistFile::GetClassID(LPCLSID pClassID)
  35. {
  36. DebugMsg(DM_TRACE, "pack ps - GetClassID() called.");
  37. if (pClassID == NULL)
  38. return E_INVALIDARG;
  39. *pClassID = CLSID_CPackage;
  40. return S_OK;
  41. }
  42. HRESULT CPackage_IPersistFile::IsDirty(void)
  43. {
  44. DebugMsg(DM_TRACE, "pack ps - IsDirty() called.");
  45. return E_NOTIMPL;
  46. }
  47. HRESULT CPackage_IPersistFile::Load(LPCOLESTR pszFileName, DWORD dwMode)
  48. {
  49. HRESULT hr;
  50. DebugMsg(DM_TRACE, "pack pf - Load() called.");
  51. if (!pszFileName) {
  52. DebugMsg(DM_TRACE," bad pointer!!");
  53. return E_POINTER;
  54. }
  55. //
  56. // We blow off the mode flags
  57. //
  58. hr = _pPackage->EmbedInitFromFile(pszFileName, TRUE);
  59. DebugMsg(DM_TRACE, " leaving Load()");
  60. return hr;
  61. }
  62. HRESULT CPackage_IPersistFile::Save(LPCOLESTR pszFileName, BOOL fRemember)
  63. {
  64. DebugMsg(DM_TRACE, "pack pf - Save() called.");
  65. return E_NOTIMPL;
  66. }
  67. HRESULT CPackage_IPersistFile::SaveCompleted(LPCOLESTR pszFileName)
  68. {
  69. DebugMsg(DM_TRACE, "pack pf - SaveCompleted() called.");
  70. return E_NOTIMPL;
  71. }
  72. HRESULT CPackage_IPersistFile::GetCurFile(LPOLESTR *ppszFileName)
  73. {
  74. DebugMsg(DM_TRACE, "pack pf - GetCurFile() called.");
  75. if (!ppszFileName)
  76. return E_POINTER;
  77. *ppszFileName = NULL; // null the out param
  78. return E_NOTIMPL;
  79. }