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.

110 lines
2.8 KiB

  1. //+============================================================================
  2. //
  3. // File: SSMapStm.hxx
  4. //
  5. // Purpose: Define the CSSMappedStream class.
  6. // This class provides a IMappedStream implementation
  7. // which maps an IStream from a Structured Storage.
  8. //
  9. //+============================================================================
  10. #ifndef _SS_MPD_STM_HXX_
  11. #define _SS_MPD_STM_HXX_
  12. // --------
  13. // Includes
  14. // --------
  15. #include <propset.h> // Appendix B Property set structure definitions
  16. #ifndef _MAC
  17. #include <ddeml.h> // For CP_WINUNICODE
  18. #include <objidl.h> // OLE Interfaces
  19. #endif
  20. #include <byteordr.hxx> // Byte-swapping routines
  21. EXTERN_C const IID IID_IMappedStream;
  22. // ---------------
  23. // CSSMappedStream
  24. // ---------------
  25. class CSSMappedStream : public IMappedStream
  26. {
  27. // Constructors
  28. public:
  29. CSSMappedStream( IStream *pstm );
  30. ~CSSMappedStream();
  31. // -------------
  32. // IMappedStream
  33. // -------------
  34. public:
  35. STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject);
  36. STDMETHODIMP_(ULONG) AddRef(void);
  37. STDMETHODIMP_(ULONG) Release(void);
  38. STDMETHODIMP_(VOID) Open(IN NTPROP np, OUT LONG *phr);
  39. STDMETHODIMP_(VOID) Close(OUT LONG *phr);
  40. STDMETHODIMP_(VOID) ReOpen(IN OUT VOID **ppv, OUT LONG *phr);
  41. STDMETHODIMP_(VOID) Quiesce(VOID);
  42. STDMETHODIMP_(VOID) Map(IN BOOLEAN fCreate, OUT VOID **ppv);
  43. STDMETHODIMP_(VOID) Unmap(IN BOOLEAN fFlush, IN OUT VOID **ppv);
  44. STDMETHODIMP_(VOID) Flush(OUT LONG *phr);
  45. STDMETHODIMP_(ULONG) GetSize(OUT LONG *phr);
  46. STDMETHODIMP_(VOID) SetSize(IN ULONG cb, IN BOOLEAN fPersistent, IN OUT VOID **ppv, OUT LONG *phr);
  47. STDMETHODIMP_(NTSTATUS) Lock(IN BOOLEAN fExclusive);
  48. STDMETHODIMP_(NTSTATUS) Unlock(VOID);
  49. STDMETHODIMP_(VOID) QueryTimeStamps(OUT STATPROPSETSTG *pspss, BOOLEAN fNonSimple) const;
  50. STDMETHODIMP_(BOOLEAN) QueryModifyTime(OUT LONGLONG *pll) const;
  51. STDMETHODIMP_(BOOLEAN) QuerySecurity(OUT ULONG *pul) const;
  52. STDMETHODIMP_(BOOLEAN) IsWriteable(VOID) const;
  53. STDMETHODIMP_(BOOLEAN) IsModified(VOID) const;
  54. STDMETHODIMP_(VOID) SetModified(OUT LONG *phr);
  55. STDMETHODIMP_(HANDLE) GetHandle(VOID) const;
  56. #if DBGPROP
  57. STDMETHODIMP_(BOOLEAN) SetChangePending(BOOLEAN fChangePending);
  58. STDMETHODIMP_(BOOLEAN) IsNtMappedStream(VOID) const;
  59. #endif
  60. // Internal Methods
  61. protected:
  62. VOID Initialize();
  63. HRESULT Write();
  64. // Internal Data
  65. protected:
  66. LONG _cRefs;
  67. IStream *_pstm;
  68. BYTE *_pbMappedStream;
  69. ULONG _cbMappedStream;
  70. ULONG _cbActualStreamSize;
  71. VOID *_powner;
  72. BOOL _fLowMem;
  73. BOOL _fDirty;
  74. #if DBGPROP
  75. BOOL _fChangePending;
  76. #endif
  77. };
  78. #endif // #ifndef _SS_MPD_STM_HXX_