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.

40 lines
1.6 KiB

  1. #ifndef _STREAM_H_
  2. #define _STREAM_H_
  3. class CMemStream : public IStream {
  4. public:
  5. STDMETHOD (QueryInterface)(REFIID riid, void **ppvObj);
  6. STDMETHOD_(ULONG, AddRef)();
  7. STDMETHOD_(ULONG, Release)();
  8. STDMETHOD (Read)(void *pv, ULONG cb, ULONG *pcbRead);
  9. STDMETHOD (Write)(void const *pv, ULONG cb, ULONG *pcbWritten);
  10. STDMETHOD (Seek)(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition);
  11. STDMETHOD (SetSize)(ULARGE_INTEGER libNewSize);
  12. STDMETHOD (CopyTo)(IStream *, ULARGE_INTEGER, ULARGE_INTEGER *, ULARGE_INTEGER *);
  13. STDMETHOD (Commit)(DWORD);
  14. STDMETHOD (Revert)();
  15. STDMETHOD (LockRegion)(ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
  16. STDMETHOD (UnlockRegion)(ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
  17. STDMETHOD (Stat)(STATSTG *, DWORD);
  18. STDMETHOD (Clone)(IStream **);
  19. LPBYTE GrowBuffer(ULONG);
  20. private:
  21. BOOL WriteToReg();
  22. public:
  23. UINT cRef; // Reference count
  24. LPBYTE pBuf; // Buffer pointer
  25. UINT cbAlloc; // The allocated size of the buffer
  26. UINT cbData; // The used size of the buffer
  27. UINT iSeek; // Where we are in the buffer.
  28. DWORD grfMode; // mode used at creation (for Stat, and to enforce)
  29. // Extra variables that are used for loading and saving to ini files.
  30. HKEY hkey; // Key for writing to registry.
  31. BITBOOL fDontCloseKey; // if caller passes in a key
  32. TCHAR szValue[1]; // for reg stream
  33. };
  34. #endif /* _STREAM_H_ */