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.

94 lines
2.4 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) Microsoft Corporation, 1998, 1999
  4. //
  5. // Module: rwstream.h
  6. //
  7. // Description: Contains definition of the read only / write only
  8. // mailmsg property stream in epoxy shared memory.
  9. //
  10. // 10/20/98 - MaheshJ Created
  11. // 8/17/99 - MikeSwa Modified to use files instead of shared memory
  12. //----------------------------------------------------------------------------
  13. #ifndef __PROPSTRM_H__
  14. #define __PROPSTRM_H__
  15. #define FILE_PROPERTY_STREAM 'mrtS'
  16. #define FILE_PROPERTY_STREAM_FREE 'mtS!'
  17. //---[ CFilePropertyStream ]--------------------------------------------------
  18. //
  19. //
  20. // Description:
  21. // Implementation of IMailMsgPropertyStream that saves property
  22. // stream to a file
  23. // Hungarian:
  24. // fstrm, pfstrm
  25. //
  26. //-----------------------------------------------------------------------------
  27. class CFilePropertyStream :
  28. public CBaseObject,
  29. public IMailMsgPropertyStream
  30. {
  31. public:
  32. CFilePropertyStream();
  33. ~CFilePropertyStream();
  34. HRESULT HrInitialize(LPSTR szFileName);
  35. //
  36. // IUnknown
  37. //
  38. HRESULT STDMETHODCALLTYPE QueryInterface(
  39. REFIID iid,
  40. void **ppvObject
  41. );
  42. ULONG STDMETHODCALLTYPE AddRef() {return CBaseObject::AddRef();};
  43. ULONG STDMETHODCALLTYPE Release() {return CBaseObject::Release();};
  44. //
  45. // IMailMsgPropertyStream
  46. //
  47. HRESULT STDMETHODCALLTYPE GetSize(
  48. IMailMsgProperties *pMsg,
  49. DWORD *pdwSize,
  50. IMailMsgNotify *pNotify
  51. );
  52. HRESULT STDMETHODCALLTYPE ReadBlocks(
  53. IMailMsgProperties *pMsg,
  54. DWORD dwCount,
  55. DWORD *pdwOffset,
  56. DWORD *pdwLength,
  57. BYTE **ppbBlock,
  58. IMailMsgNotify *pNotify
  59. );
  60. HRESULT STDMETHODCALLTYPE WriteBlocks(
  61. IMailMsgProperties *pMsg,
  62. DWORD dwCount,
  63. DWORD *pdwOffset,
  64. DWORD *pdwLength,
  65. BYTE **ppbBlock,
  66. IMailMsgNotify *pNotify
  67. );
  68. HRESULT STDMETHODCALLTYPE StartWriteBlocks(
  69. IMailMsgProperties *pMsg,
  70. DWORD dwBlocksToWrite,
  71. DWORD dwTotalBytesToWrite
  72. );
  73. HRESULT STDMETHODCALLTYPE EndWriteBlocks(IN IMailMsgProperties *pMsg);
  74. HRESULT STDMETHODCALLTYPE CancelWriteBlocks(IMailMsgProperties *pMsg);
  75. private:
  76. DWORD m_dwSignature;
  77. HANDLE m_hDestFile;
  78. };
  79. #endif //__PROPSTRM_H__