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.

293 lines
8.4 KiB

  1. // avifps.h - AVIStream proxy / stub header
  2. #include <ole2.h>
  3. #include <cobjps.h>
  4. #ifndef _WIN32
  5. #include "olepriv.h"
  6. #endif
  7. enum {
  8. IAVISTREAM_Create = 0,
  9. IAVISTREAM_Info,
  10. IAVISTREAM_FindSample,
  11. IAVISTREAM_ReadFormat,
  12. IAVISTREAM_SetFormat,
  13. IAVISTREAM_Read,
  14. IAVISTREAM_Write,
  15. IAVISTREAM_Delete,
  16. IAVISTREAM_ReadData,
  17. IAVISTREAM_WriteData,
  18. IAVISTREAM_Reserved1,
  19. IAVISTREAM_Reserved2,
  20. IAVISTREAM_Reserved3,
  21. IAVISTREAM_Reserved4,
  22. IAVISTREAM_Reserved5,
  23. IAVISTREAM_SetInfo
  24. };
  25. // interface proxy for IAVIStream; always aggregated
  26. class FAR CPrxAVIStream : public IAVIStream
  27. {
  28. public:
  29. static IRpcProxyBuffer FAR* Create(IUnknown FAR* pUnkOuter);
  30. // IUnknown methods (for external interface(s))
  31. STDMETHOD(QueryInterface) ( REFIID iid, LPVOID FAR* ppvObj);
  32. STDMETHOD_(ULONG,AddRef) (void);
  33. STDMETHOD_(ULONG,Release) (void);
  34. // IAVIStream methods
  35. STDMETHOD(Create) (THIS_ LPARAM lParam1, LPARAM lParam2);
  36. STDMETHOD(Info) (THIS_ AVISTREAMINFOW FAR * psi, LONG lSize);
  37. STDMETHOD_(LONG, FindSample)(THIS_ LONG lPos, LONG lFlags);
  38. STDMETHOD(ReadFormat) (THIS_ LONG lPos,
  39. LPVOID lpFormat, LONG FAR *lpcbFormat);
  40. STDMETHOD(SetFormat) (THIS_ LONG lPos,
  41. LPVOID lpFormat, LONG cbFormat);
  42. STDMETHOD(Read) (THIS_ LONG lStart, LONG lSamples,
  43. LPVOID lpBuffer, LONG cbBuffer,
  44. LONG FAR * plBytes, LONG FAR * plSamples);
  45. STDMETHOD(Write) (THIS_ LONG lStart, LONG lSamples,
  46. LPVOID lpBuffer, LONG cbBuffer,
  47. DWORD dwFlags,
  48. LONG FAR *plSampWritten,
  49. LONG FAR *plBytesWritten);
  50. STDMETHOD(Delete) (THIS_ LONG lStart, LONG lSamples);
  51. STDMETHOD(ReadData) (THIS_ DWORD fcc, LPVOID lp, LONG FAR *lpcb);
  52. STDMETHOD(WriteData) (THIS_ DWORD fcc, LPVOID lp, LONG cb);
  53. #ifdef _WIN32
  54. STDMETHODIMP SetInfo(AVISTREAMINFOW FAR *lpInfo, LONG cbInfo);
  55. #else
  56. STDMETHOD(Reserved1) (THIS);
  57. STDMETHOD(Reserved2) (THIS);
  58. STDMETHOD(Reserved3) (THIS);
  59. STDMETHOD(Reserved4) (THIS);
  60. STDMETHOD(Reserved5) (THIS);
  61. #endif
  62. private:
  63. CPrxAVIStream(IUnknown FAR* pUnkOuter);
  64. ~CPrxAVIStream();
  65. // IRpcProxyBuffer which is also the controlling unknown
  66. struct CProxyImpl : IRpcProxyBuffer
  67. {
  68. public:
  69. CProxyImpl(CPrxAVIStream FAR* pPrxAVIStream)
  70. { m_pPrxAVIStream = pPrxAVIStream; }
  71. STDMETHOD(QueryInterface)(REFIID iid, LPVOID FAR* ppv);
  72. STDMETHOD_(ULONG,AddRef)(void);
  73. STDMETHOD_(ULONG,Release)(void);
  74. STDMETHOD(Connect)(IRpcChannelBuffer FAR* pRpcChannelBuffer);
  75. STDMETHOD_(void, Disconnect)(void);
  76. private:
  77. CPrxAVIStream FAR* m_pPrxAVIStream;
  78. };
  79. friend CProxyImpl;
  80. CProxyImpl m_Proxy;
  81. // private state:
  82. ULONG m_refs;
  83. IUnknown FAR* m_pUnkOuter;
  84. IRpcChannelBuffer FAR* m_pRpcChannelBuffer;
  85. AVISTREAMINFOW m_sh;
  86. };
  87. // interface stub for IAVIStream
  88. class FAR CStubAVIStream : public IRpcStubBuffer
  89. {
  90. public:
  91. static HRESULT Create(IUnknown FAR* pUnkObject, IRpcStubBuffer FAR* FAR* ppStub);
  92. STDMETHOD(QueryInterface) (REFIID iid, LPVOID FAR* ppv);
  93. STDMETHOD_(ULONG,AddRef) (void);
  94. STDMETHOD_(ULONG,Release) (void);
  95. STDMETHOD(Connect)(IUnknown FAR* pUnkObject);
  96. STDMETHOD_(void, Disconnect)(void);
  97. STDMETHOD(Invoke)(RPCOLEMESSAGE FAR *pMessage, IRpcChannelBuffer FAR *pChannel);
  98. STDMETHOD_(IRpcStubBuffer FAR *, IsIIDSupported)(REFIID iid);
  99. STDMETHOD_(ULONG, CountRefs)(void);
  100. STDMETHOD(DebugServerQueryInterface)(LPVOID FAR *ppv);
  101. STDMETHOD_(void, DebugServerRelease)(LPVOID pv);
  102. private:
  103. CStubAVIStream(void);
  104. ~CStubAVIStream(void);
  105. ULONG m_refs;
  106. IAVIStream FAR* m_pAVIStream;
  107. };
  108. // Proxy/Stub Factory for pssamp.dll: supports IPSFactory only.
  109. class FAR CPSFactory : public IPSFactoryBuffer
  110. {
  111. public:
  112. CPSFactory();
  113. STDMETHOD(QueryInterface)(REFIID iid, LPVOID FAR* ppv);
  114. STDMETHOD_(ULONG,AddRef)(void);
  115. STDMETHOD_(ULONG,Release)(void);
  116. STDMETHOD(CreateProxy)(IUnknown FAR* pUnkOuter, REFIID iid,
  117. IRpcProxyBuffer FAR* FAR* ppProxy, LPVOID FAR* ppv);
  118. STDMETHOD(CreateStub)(REFIID iid, IUnknown FAR* pUnkServer,
  119. IRpcStubBuffer FAR* FAR* ppStub);
  120. private:
  121. ULONG m_refs;
  122. };
  123. DEFINE_AVIGUID(CLSID_AVIStreamPS, 0x0002000D, 0, 0);
  124. enum {
  125. IAVIFILE_Open = 0,
  126. IAVIFILE_Info,
  127. IAVIFILE_GetStream,
  128. IAVIFILE_CreateStream,
  129. IAVIFILE_Save,
  130. IAVIFILE_ReadData,
  131. IAVIFILE_WriteData,
  132. IAVIFILE_EndRecord,
  133. IAVIFILE_Reserved1,
  134. IAVIFILE_Reserved2,
  135. IAVIFILE_Reserved3,
  136. IAVIFILE_Reserved4,
  137. IAVIFILE_Reserved5
  138. };
  139. // interface proxy for IAVIFile; always aggregated
  140. class FAR CPrxAVIFile : public IAVIFile
  141. {
  142. public:
  143. static IRpcProxyBuffer FAR* Create(IUnknown FAR* pUnkOuter);
  144. // IUnknown methods (for external interface(s))
  145. STDMETHOD(QueryInterface) ( REFIID iid, LPVOID FAR* ppvObj);
  146. STDMETHOD_(ULONG,AddRef) (void);
  147. STDMETHOD_(ULONG,Release) (void);
  148. // IAVIFile methods
  149. #ifndef _WIN32
  150. STDMETHOD(Open) (THIS_
  151. LPCTSTR szFile,
  152. UINT mode);
  153. #endif
  154. STDMETHOD(Info) (THIS_
  155. AVIFILEINFOW FAR * pfi,
  156. LONG lSize);
  157. STDMETHOD(GetStream) (THIS_
  158. PAVISTREAM FAR * ppStream,
  159. DWORD fccType,
  160. LONG lParam);
  161. STDMETHOD(CreateStream) (THIS_
  162. PAVISTREAM FAR * ppStream,
  163. AVISTREAMINFOW FAR * psi);
  164. #ifndef _WIN32
  165. STDMETHOD(Save) (THIS_
  166. LPCTSTR szFile,
  167. AVICOMPRESSOPTIONS FAR *lpOptions,
  168. AVISAVECALLBACK lpfnCallback);
  169. #endif
  170. STDMETHOD(WriteData) (THIS_
  171. DWORD ckid,
  172. LPVOID lpData,
  173. LONG cbData);
  174. STDMETHOD(ReadData) (THIS_
  175. DWORD ckid,
  176. LPVOID lpData,
  177. LONG FAR *lpcbData);
  178. STDMETHOD(EndRecord) (THIS);
  179. #ifdef _WIN32
  180. STDMETHODIMP DeleteStream (THIS_
  181. DWORD fccType,
  182. LONG lParam);
  183. #else
  184. STDMETHODIMP Reserved1 (THIS);
  185. STDMETHODIMP Reserved2 (THIS);
  186. STDMETHODIMP Reserved3 (THIS);
  187. STDMETHODIMP Reserved4 (THIS);
  188. STDMETHODIMP Reserved5 (THIS);
  189. #endif
  190. private:
  191. CPrxAVIFile(IUnknown FAR* pUnkOuter);
  192. ~CPrxAVIFile();
  193. // IRpcProxyBuffer which is also the controlling unknown
  194. struct CProxyImpl : IRpcProxyBuffer
  195. {
  196. public:
  197. CProxyImpl(CPrxAVIFile FAR* pPrxAVIFile)
  198. { m_pPrxAVIFile = pPrxAVIFile; }
  199. STDMETHOD(QueryInterface)(REFIID iid, LPVOID FAR* ppv);
  200. STDMETHOD_(ULONG,AddRef)(void);
  201. STDMETHOD_(ULONG,Release)(void);
  202. STDMETHOD(Connect)(IRpcChannelBuffer FAR* pRpcChannelBuffer);
  203. STDMETHOD_(void, Disconnect)(void);
  204. private:
  205. CPrxAVIFile FAR* m_pPrxAVIFile;
  206. };
  207. friend CProxyImpl;
  208. CProxyImpl m_Proxy;
  209. // private state:
  210. ULONG m_refs;
  211. IUnknown FAR* m_pUnkOuter;
  212. IRpcChannelBuffer FAR* m_pRpcChannelBuffer;
  213. AVIFILEINFOW m_fi;
  214. };
  215. // interface stub for IAVIFile
  216. class FAR CStubAVIFile : public IRpcStubBuffer
  217. {
  218. public:
  219. static HRESULT Create(IUnknown FAR* pUnkObject, IRpcStubBuffer FAR* FAR* ppStub);
  220. STDMETHOD(QueryInterface) (REFIID iid, LPVOID FAR* ppv);
  221. STDMETHOD_(ULONG,AddRef) (void);
  222. STDMETHOD_(ULONG,Release) (void);
  223. STDMETHOD(Connect)(IUnknown FAR* pUnkObject);
  224. STDMETHOD_(void, Disconnect)(void);
  225. STDMETHOD(Invoke)(RPCOLEMESSAGE FAR *pMessage, IRpcChannelBuffer FAR *pChannel);
  226. STDMETHOD_(IRpcStubBuffer FAR *, IsIIDSupported)(REFIID iid);
  227. STDMETHOD_(ULONG, CountRefs)(void);
  228. STDMETHOD(DebugServerQueryInterface)(LPVOID FAR *ppv);
  229. STDMETHOD_(void, DebugServerRelease)(LPVOID pv);
  230. private:
  231. CStubAVIFile(void);
  232. ~CStubAVIFile(void);
  233. ULONG m_refs;
  234. IAVIFile FAR* m_pAVIFile;
  235. };