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.

82 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. stream.h
  5. Abstract:
  6. This module contains the definition for the Server
  7. Extension Object Stream class.
  8. Author:
  9. Don Dumitru (dondu@microsoft.com)
  10. Revision History:
  11. dondu 03/29/97 created
  12. --*/
  13. // stream.h : Declaration of the CSEOStream
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CStream
  16. class ATL_NO_VTABLE CSEOStream :
  17. public IStream,
  18. public CComObjectRootEx<CComMultiThreadModelNoCS>,
  19. public CComCoClass<CSEOStream, &CLSID_CSEOStream>
  20. {
  21. public:
  22. HRESULT FinalConstruct();
  23. void FinalRelease();
  24. void Cleanup();
  25. HRESULT Init(HANDLE hFile, LPCSTR pszFile, ULARGE_INTEGER libOffset, CSEOStream *pSubStream);
  26. HRESULT Init(HANDLE hFile, LPCWSTR pszFile, ULARGE_INTEGER libOffset, CSEOStream *pSubStream);
  27. HRESULT Open();
  28. HRESULT ReadOffset(void *pv, ULONG cb, ULONG *pcbRead, ULARGE_INTEGER *plibOffset);
  29. HRESULT WriteOffset(void const* pv, ULONG cb, ULONG *pcbWritten, ULARGE_INTEGER *plibOffset);
  30. HRESULT GetSize(ULARGE_INTEGER *plibSize);
  31. HRESULT CopyToOffset(IStream *pstm, ULARGE_INTEGER libOffset, ULARGE_INTEGER *plibRead, ULARGE_INTEGER *plibWritten, ULARGE_INTEGER *plibOffset);
  32. HRESULT CloneOffset(IStream **pstm, ULARGE_INTEGER libOffset);
  33. DECLARE_PROTECT_FINAL_CONSTRUCT();
  34. DECLARE_REGISTRY_RESOURCEID_EX(IDR_StdAfx,
  35. L"SEOStream Class",
  36. L"SEO.Stream.1",
  37. L"SEO.Stream");
  38. DECLARE_GET_CONTROLLING_UNKNOWN();
  39. BEGIN_COM_MAP(CSEOStream)
  40. COM_INTERFACE_ENTRY(IStream)
  41. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  42. END_COM_MAP()
  43. // IStream
  44. public:
  45. HRESULT STDMETHODCALLTYPE Read(void *pv, ULONG cb, ULONG *pcbRead);
  46. HRESULT STDMETHODCALLTYPE Write(void const* pv, ULONG cb, ULONG *pcbWritten);
  47. HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *pdlibNewPosition);
  48. HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER libNewSize);
  49. HRESULT STDMETHODCALLTYPE CopyTo(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten);
  50. HRESULT STDMETHODCALLTYPE Commit(DWORD grfCommitFlags);
  51. HRESULT STDMETHODCALLTYPE Revert(void);
  52. HRESULT STDMETHODCALLTYPE LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
  53. HRESULT STDMETHODCALLTYPE UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
  54. HRESULT STDMETHODCALLTYPE Stat(STATSTG * pstatstg, DWORD grfStatFlag);
  55. HRESULT STDMETHODCALLTYPE Clone(IStream **pstm);
  56. private:
  57. HANDLE m_hFile;
  58. LPSTR m_pszFile;
  59. ULARGE_INTEGER m_libOffset;
  60. HANDLE m_hEvent;
  61. CSEOStream *m_pSubStream;
  62. CComPtr<IUnknown> m_pUnkMarshaler;
  63. };