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.

125 lines
4.4 KiB

  1. DEFINE_AVIGUID(CLSID_EditStream, 0x0002000A, 0, 0);
  2. struct FAR ICEditStreamInternal : public IUnknown
  3. {
  4. STDMETHOD(GetInternalPointer)(LPVOID FAR * ppInternal) = 0;
  5. };
  6. ///////////////////////////////////////////////////////////////////////////
  7. ///////////////////////////////////////////////////////////////////////////
  8. ///////////////////////////////////////////////////////////////////////////
  9. typedef struct {
  10. PAVISTREAM pavi;
  11. LONG lStart;
  12. LONG lLength;
  13. LONG unused; // pad to power of two in size....
  14. RECT rcSource;
  15. RECT rcDest;
  16. } EDIT, FAR * LPEDIT;
  17. class FAR CEditStream : public virtual IAVIStream,
  18. public virtual IAVIEditStream,
  19. public virtual ICEditStreamInternal
  20. #ifdef CUSTOMMARSHAL
  21. , public virtual IMarshal
  22. #endif
  23. {
  24. public:
  25. static CEditStream FAR * NewEditStream(PAVISTREAM psSource);
  26. STDMETHODIMP QueryInterface(const IID FAR& riid, void FAR* FAR* ppv); \
  27. STDMETHODIMP_(ULONG) AddRef(); \
  28. STDMETHODIMP_(ULONG) Release();
  29. STDMETHODIMP Create (THIS_ LPARAM lParam1, LPARAM lParam2);
  30. STDMETHODIMP Info (THIS_ AVISTREAMINFOW FAR * psi, LONG lSize);
  31. STDMETHODIMP_(LONG) FindSample (THIS_ LONG lPos, LONG lFlags);
  32. STDMETHODIMP ReadFormat (THIS_ LONG lPos,
  33. LPVOID lpFormat, LONG FAR *cbFormat);
  34. STDMETHODIMP SetFormat (THIS_ LONG lPos,
  35. LPVOID lpFormat, LONG cbFormat);
  36. STDMETHODIMP Read (THIS_ LONG lStart, LONG lSamples,
  37. LPVOID lpBuffer, LONG cbBuffer,
  38. LONG FAR * plBytes, LONG FAR * plSamples);
  39. STDMETHODIMP Write (THIS_ LONG lStart, LONG lSamples,
  40. LPVOID lpBuffer, LONG cbBuffer,
  41. DWORD dwFlags,
  42. LONG FAR *plSampWritten,
  43. LONG FAR *plBytesWritten);
  44. STDMETHODIMP Delete (THIS_ LONG lStart, LONG lSamples);
  45. STDMETHODIMP ReadData (THIS_ DWORD fcc, LPVOID lp, LONG FAR *lpcb);
  46. STDMETHODIMP WriteData (THIS_ DWORD fcc, LPVOID lp, LONG cb);
  47. STDMETHODIMP Reserved1 (THIS);
  48. STDMETHODIMP Reserved2 (THIS);
  49. STDMETHODIMP Reserved3 (THIS);
  50. STDMETHODIMP Reserved4 (THIS);
  51. STDMETHODIMP Reserved5 (THIS);
  52. STDMETHODIMP Cut(LONG FAR *plStart, LONG FAR *plLength, PAVISTREAM FAR * ppResult);
  53. STDMETHODIMP Copy(LONG FAR *plStart, LONG FAR *plLength, PAVISTREAM FAR * ppResult);
  54. STDMETHODIMP Paste(LONG FAR *plPos, LONG FAR *plLength, PAVISTREAM pstream, LONG lStart, LONG lLength);
  55. STDMETHODIMP Clone(PAVISTREAM FAR *ppResult);
  56. STDMETHODIMP SetInfo(AVISTREAMINFOW FAR *lpInfo, LONG cbInfo);
  57. static HRESULT NewInstance(IUnknown FAR* pUnknownOuter,
  58. REFIID riid,
  59. LPVOID FAR* ppv);
  60. STDMETHODIMP GetInternalPointer(LPVOID FAR * ppv);
  61. #ifdef CUSTOMMARSHAL
  62. // *** IMarshal methods ***
  63. BOOL CanMarshalSimply();
  64. STDMETHODIMP GetUnmarshalClass (THIS_ REFIID riid, LPVOID pv,
  65. DWORD dwDestContext, LPVOID pvDestContext,
  66. DWORD mshlflags, LPCLSID pCid);
  67. STDMETHODIMP GetMarshalSizeMax (THIS_ REFIID riid, LPVOID pv,
  68. DWORD dwDestContext, LPVOID pvDestContext,
  69. DWORD mshlflags, LPDWORD pSize);
  70. STDMETHODIMP MarshalInterface (THIS_ LPSTREAM pStm, REFIID riid,
  71. LPVOID pv, DWORD dwDestContext, LPVOID pvDestContext,
  72. DWORD mshlflags);
  73. STDMETHODIMP UnmarshalInterface (THIS_ LPSTREAM pStm, REFIID riid,
  74. LPVOID FAR* ppv);
  75. STDMETHODIMP ReleaseMarshalData (THIS_ LPSTREAM pStm);
  76. STDMETHODIMP DisconnectObject (THIS_ DWORD dwReserved);
  77. #endif // CUSTOMMARSHAL
  78. private:
  79. CEditStream() {
  80. cedits = 0;
  81. maxedits = 0;
  82. edits = NULL;
  83. pgf = NULL;
  84. psgf = NULL;
  85. fFullFrames = FALSE;
  86. };
  87. HRESULT ResolveEdits(LONG lPos,
  88. PAVISTREAM FAR *ppavi, LONG FAR *plPos,
  89. LONG FAR *pl, BOOL fAllowEnd);
  90. HRESULT PossiblyRemoveEdit(LONG l);
  91. HRESULT AllocEditSpace(LONG l, LONG cNew);
  92. LPBITMAPINFOHEADER NEAR PASCAL CEditStream::CallGetFrame(
  93. PAVISTREAM p,
  94. LONG l);
  95. void CheckEditList();
  96. public:
  97. ULONG ulRefCount;
  98. //
  99. // instance data
  100. //
  101. AVISTREAMINFOW sinfo;
  102. LONG cedits;
  103. LONG maxedits;
  104. BOOL fFullFrames;
  105. EDIT _huge * edits;
  106. //
  107. // cached PGETFRAME
  108. PGETFRAME pgf;
  109. PAVISTREAM psgf;
  110. LPBITMAPINFOHEADER lpbiLast;
  111. };