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.

50 lines
1.4 KiB

  1. #ifndef _BMPSTRM_H_
  2. #define _BMPSTRM_H_
  3. class CBmpStream : public IStream
  4. {
  5. protected:
  6. CBmpStream();
  7. ~CBmpStream();
  8. public:
  9. static HRESULT Create(CBmpStream **ppvObject);
  10. HGLOBAL GetBuffer();
  11. VOID SetBuffer(HGLOBAL hBuffer, DWORD dwSize, DWORD dwOffBits);
  12. VOID FreeBuffer();
  13. HRESULT ReAllocBuffer(SIZE_T dwBytes);
  14. public:
  15. // IUnknown
  16. STDMETHOD(QueryInterface)(REFIID riid, void **ppvObject);
  17. STDMETHOD_(ULONG, AddRef)();
  18. STDMETHOD_(ULONG, Release)();
  19. // ISequentialStream
  20. STDMETHOD(Read)(void *pv, ULONG cb, ULONG *pcbRead);
  21. STDMETHOD(Write)(const void *pv, ULONG cb, ULONG *pcbWritten);
  22. // IStream
  23. STDMETHOD(Seek)(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition);
  24. STDMETHOD(SetSize)(ULARGE_INTEGER libNewSize);
  25. STDMETHOD(CopyTo)(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten);
  26. STDMETHOD(Commit)(DWORD grfCommitFlags);
  27. STDMETHOD(Revert)();
  28. STDMETHOD(LockRegion)(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
  29. STDMETHOD(UnlockRegion)(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
  30. STDMETHOD(Stat)(STATSTG *pstatstg, DWORD grfStatFlag);
  31. STDMETHOD(Clone)(IStream **ppstm);
  32. private:
  33. LONG m_cRef;
  34. HGLOBAL m_hBuffer;
  35. SIZE_T m_nSize;
  36. SIZE_T m_nPosition;
  37. BITMAPFILEHEADER m_Header;
  38. };
  39. #endif //_BMPSTRM_H_