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.

441 lines
18 KiB

  1. //*****************************************************************************
  2. //
  3. // Microsoft Windows Media
  4. // Copyright (C) Microsoft Corporation. All rights reserved.
  5. //
  6. // FileName: streamCache.idl
  7. //
  8. // Abstract: Cache/Proxy Interface definition
  9. //
  10. //*****************************************************************************
  11. cpp_quote("//*****************************************************************************")
  12. cpp_quote("//")
  13. cpp_quote("// Microsoft Windows Media")
  14. cpp_quote("// Copyright (C) Microsoft Corporation. All rights reserved.")
  15. cpp_quote("//")
  16. cpp_quote("// Automatically generated by Midl from streamCache.idl" )
  17. cpp_quote("//")
  18. cpp_quote("// DO NOT EDIT THIS FILE.")
  19. cpp_quote("//")
  20. cpp_quote("//*****************************************************************************")
  21. import "objidl.idl";
  22. import "nsscore.idl";
  23. import "DataContainerVersion.idl";
  24. import "event.idl";
  25. import "WMSProxy.idl";
  26. interface IWMSCacheProxy;
  27. interface IWMSCacheProxyCallback;
  28. interface IWMSCacheProxyServer;
  29. interface IWMSCacheProxyServerCallback;
  30. interface IWMSCacheItemDescriptor;
  31. interface IWMSCacheItemCollection;
  32. cpp_quote( "EXTERN_GUID( IID_IWMSCacheProxy, 0x2E34AB83,0x0D3D,0x11d2,0x9E,0xEE,0x00,0x60,0x97,0xD2,0xD7,0xCF );" )
  33. cpp_quote( "EXTERN_GUID( IID_IWMSCacheProxyCallback, 0x2E34AB84,0x0D3D,0x11d2,0x9E,0xEE,0x00,0x60,0x97,0xD2,0xD7,0xCF );" )
  34. cpp_quote( "EXTERN_GUID( IID_IWMSCacheProxyServer, 0x68F2A550,0xD815,0x11D2,0xBE,0xF6,0x00,0xA0,0xC9,0x5E,0xC3,0x43 );" )
  35. cpp_quote( "EXTERN_GUID( IID_IWMSCacheProxyServerCallback, 0x68F2A551,0xD815,0x11D2,0xBE,0xF6,0x00,0xA0,0xC9,0x5E,0xC3,0x43 );" )
  36. cpp_quote( "EXTERN_GUID( IID_IWMSCacheItemDescriptor, 0xC3CBA330,0xAC05,0x11D2,0xBE,0xF0,0x00,0xA0,0xC9,0x5E,0xC3,0x43 );" )
  37. cpp_quote( "EXTERN_GUID( IID_IWMSCacheItemCollection, 0xE6E05D80,0xF45C,0x11D2,0xBE,0xFE,0x00,0xA0,0xC9,0x5E,0xC3,0x43 );" )
  38. ///////////////////////////////////////////////////////////////////////////////
  39. typedef [public] enum WMS_CACHE_QUERY_MISS_RESPONSE
  40. {
  41. WMS_CACHE_QUERY_MISS_SKIP,
  42. WMS_CACHE_QUERY_MISS_DISCONNECT,
  43. WMS_CACHE_QUERY_MISS_REDIRECT,
  44. WMS_CACHE_QUERY_MISS_REDIRECT_TO_PROXY,
  45. WMS_CACHE_QUERY_MISS_PLAY_BROADCAST,
  46. WMS_CACHE_QUERY_MISS_PLAY_ON_DEMAND,
  47. WMS_CACHE_QUERY_MISS_FORWARD_REQUEST,
  48. WMS_CACHE_QUERY_MISS_PROCESS_REQUEST
  49. } WMS_CACHE_QUERY_MISS_RESPONSE;
  50. ///////////////////////////////////////////////////////////////////////////////
  51. typedef [public] enum WMS_CACHE_QUERY_RESPONSE
  52. {
  53. WMS_CACHE_QUERY_HIT_PLAY_ON_DEMAND,
  54. WMS_CACHE_QUERY_HIT_PLAY_BROADCAST,
  55. WMS_CACHE_QUERY_HIT_PROCESS_REQUEST,
  56. WMS_CACHE_QUERY_MISS
  57. } WMS_CACHE_QUERY_RESPONSE;
  58. ///////////////////////////////////////////////////////////////////////////////
  59. typedef [public] enum WMS_CACHE_VERSION_COMPARE_RESPONSE
  60. {
  61. WMS_CACHE_VERSION_FAIL_TO_CHECK_VERSION,
  62. WMS_CACHE_VERSION_CACHE_STALE,
  63. WMS_CACHE_VERSION_CACHE_UP_TO_DATE,
  64. } WMS_CACHE_VERSION_COMPARE_RESPONSE;
  65. ///////////////////////////////////////////////////////////////////////////////
  66. typedef [public] enum WMS_CACHE_CONTENT_TYPE_FLAGS
  67. {
  68. WMS_CACHE_CONTENT_TYPE_BROADCAST = 0x1, // else on-demand
  69. WMS_CACHE_CONTENT_TYPE_PLAYLIST = 0x2
  70. } WMS_CACHE_CONTENT_TYPE_FLAGS;
  71. ///////////////////////////////////////////////////////////////////////////////
  72. typedef [public] enum WMS_CACHE_QUERY_TYPE_FLAGS
  73. {
  74. WMS_CACHE_QUERY_OPEN = 0x1,
  75. WMS_CACHE_QUERY_GET_CONTENT_INFO = 0x2,
  76. WMS_CACHE_QUERY_CACHE_EVENT = 0x4,
  77. WMS_CACHE_QUERY_REVERSE_PROXY = 0x8,
  78. WMS_CACHE_QUERY_LOCAL_EVENT = 0x10
  79. } WMS_CACHE_QUERY_TYPE_FLAGS;
  80. ///////////////////////////////////////////////////////////////////////////////
  81. typedef [public] enum WMS_CACHE_CONTENT_DOWNLOAD_FLAGS
  82. {
  83. WMS_CONTENT_DOWNLOAD_ABORT_IF_BCAST = 0x1
  84. } WMS_CACHE_CONTENT_DOWNLOAD_FLAGS;
  85. ///////////////////////////////////////////////////////////////////////////////
  86. typedef [public] enum WMS_CACHE_REMOTE_EVENT_FLAGS
  87. {
  88. WMS_CACHE_REMOTE_OPEN = 0x1,
  89. WMS_CACHE_REMOTE_CLOSE = 0x2,
  90. WMS_CACHE_REMOTE_LOG = 0x4
  91. } WMS_CACHE_REMOTE_EVENT_FLAGS;
  92. #if (__midl >= 501)
  93. midl_pragma warning( disable: 2279 )
  94. #endif
  95. //////////////////////////////////////////////////////////////////////////////
  96. //
  97. // This is built by a cache plugin.
  98. // It is called by the server's cache manager.
  99. //
  100. //////////////////////////////////////////////////////////////////////////////
  101. [
  102. object,
  103. pointer_default(unique),
  104. uuid(2E34AB83-0D3D-11d2-9EEE-006097D2D7CF),
  105. version(9.0),
  106. helpstring("Contains methods that administer a cache. This interface is implemented by a cache / proxy plug-in and called by the server.")
  107. ]
  108. interface IWMSCacheProxy : IUnknown
  109. {
  110. [helpstring("Called by the server to direct the plug-in to search the cache for specific content.")] HRESULT
  111. QueryCache(
  112. [in] BSTR bstrOriginUrl,
  113. [in] IWMSContext *pUserContext,
  114. [in] IWMSCommandContext *pCommandContext,
  115. [in] IWMSContext *pPresentationContext,
  116. [in] long lQueryType,
  117. [in] IWMSCacheProxyCallback *pCallback,
  118. [in] VARIANT varContext
  119. );
  120. [helpstring("Called by the server to direct the plug-in to specify its cache-miss policy.")] HRESULT
  121. QueryCacheMissPolicy(
  122. [in] BSTR bstrOriginUrl,
  123. [in] IWMSContext *pUserContext,
  124. [in] IWMSCommandContext *pCommandContext,
  125. [in] IWMSContext *pPresentationContext,
  126. [in] IUnknown *pCachePluginContext,
  127. [in] long lQueryType,
  128. [in] IWMSCacheProxyCallback *pCallback,
  129. [in] VARIANT varContext
  130. );
  131. //////////////////////////////////////////////////////////
  132. [helpstring("Called by the server to remove a specific cache item.")] HRESULT
  133. RemoveCacheItem(
  134. [in] BSTR bstrOriginUrl,
  135. [in] IWMSCacheProxyCallback *pCallback,
  136. [in] VARIANT varContext
  137. );
  138. [helpstring("Called by the server to remove all content from the cache.")] HRESULT
  139. RemoveAllCacheItems(
  140. [in] IWMSCacheProxyCallback *pCallback,
  141. [in] VARIANT varContext
  142. );
  143. [helpstring("Adds content to the cache.")] HRESULT
  144. AddCacheItem(
  145. [in] BSTR bstrOriginUrl,
  146. [in] BSTR bstrPrestuffUrl,
  147. [in] long lExpiration,
  148. [in] long lBandwidth,
  149. [in] long lRemoteEventFlags,
  150. [in] IWMSCacheProxyCallback *pCallback,
  151. [in] VARIANT varContext
  152. );
  153. // not used by the cache manager, just used for object model
  154. [helpstring("Called by the server to retrieve a Boolean value indicating whether the cache has adequate storage for a specific content item.")] HRESULT
  155. QuerySpaceForCacheItem(
  156. [in] long lContentSizeLow,
  157. [in] long lContentSizeHigh,
  158. [out] VARIANT_BOOL *pvarfSpaceAvail
  159. );
  160. [helpstring("Called by the server to retrieve information about a specific cache item.")] HRESULT
  161. FindCacheItem(
  162. [in] BSTR bstrOriginUrl,
  163. [out] IWMSCacheItemDescriptor **ppCacheItemDescriptor
  164. );
  165. [helpstring("Called by the server to create an IWMSCacheItemCollection object and retrieve a pointer to it.")] HRESULT
  166. CreateCacheItemCollection(
  167. [out] IWMSCacheItemCollection **ppCacheItemCollection
  168. );
  169. //////////////////////////////////////////////////////////
  170. [helpstring("Called by the server when a particular piece of content is finished being streamed from the cache.")] HRESULT
  171. OnCacheClientClose(
  172. [in] HRESULT resultHr,
  173. [in] IWMSContext *pUserContext,
  174. [in] IWMSContext *pPresentationContext
  175. );
  176. };
  177. #if (__midl >= 501)
  178. midl_pragma warning( default: 2279 )
  179. #endif
  180. //////////////////////////////////////////////////////////////////////////////
  181. //
  182. // This is built by the server's cache manager.
  183. // It is called by a cache plugin.
  184. //
  185. //////////////////////////////////////////////////////////////////////////////
  186. [
  187. object,
  188. pointer_default(unique),
  189. uuid(2E34AB84-0D3D-11d2-9EEE-006097D2D7CF),
  190. version(9.0),
  191. helpstring("Contains methods that enable a cache / proxy plug-in to respond to calls that the server makes through the IWMSCacheProxy interface. This interface is implemented by the server and called by a cache / proxy plug-in.")
  192. ]
  193. interface IWMSCacheProxyCallback : IUnknown
  194. {
  195. [helpstring("Called by the plug-in to respond when the server calls IWMSCacheProxy::QueryCache.")] HRESULT
  196. OnQueryCache(
  197. [in] long lHr, // HRESULT
  198. [in] WMS_CACHE_QUERY_RESPONSE Response,
  199. [in] BSTR bstrCacheUrl,
  200. [in] IWMSContext *pContentInfo,
  201. [in] IUnknown *pCachePluginContext,
  202. [in] VARIANT varContext
  203. );
  204. [helpstring("Called by the plug-in to respond when the server calls IWMSCacheProxy::QueryCacheMissPolicy.")] HRESULT
  205. OnQueryCacheMissPolicy(
  206. [in] long lHr, // HRESULT
  207. [in] WMS_CACHE_QUERY_MISS_RESPONSE CacheMissPolicy,
  208. [in] BSTR bstrUrl,
  209. [in] IWMSProxyContext * pProxyContext,
  210. [in] IWMSContext *pContentInfo,
  211. [in] VARIANT varContext
  212. );
  213. //////////////////////////////////////////////////////////
  214. [helpstring("Called by the plug-in to respond when the server calls IWMSCacheProxy::RemoveCacheItem.")] HRESULT
  215. OnRemoveCacheItem(
  216. [in] long lHr, // HRESULT
  217. [in] VARIANT varContext
  218. );
  219. [helpstring("Called by the plug-in to respond when the server calls IWMSCacheProxy::RemoveAllCacheItems.")] HRESULT
  220. OnRemoveAllCacheItems(
  221. [in] long lHr, // HRESULT
  222. [in] VARIANT varContext
  223. );
  224. [helpstring("Called by the plug-in to respond when the server calls IWMSCacheProxy::AddCacheItem.")] HRESULT
  225. OnAddCacheItem(
  226. [in] long lHr, // HRESULT
  227. [in] IWMSCacheItemDescriptor *pCacheItemDescriptor,
  228. [in] VARIANT varServerContext
  229. );
  230. };
  231. //////////////////////////////////////////////////////////////////////////////
  232. //
  233. // This is built by the server's cache manage.
  234. // It is called by a cache plugin.
  235. //
  236. //////////////////////////////////////////////////////////////////////////////
  237. [
  238. object,
  239. pointer_default(unique),
  240. uuid(68F2A550-D815-11D2-BEF6-00A0C95EC343),
  241. version(9.0),
  242. helpstring("Contains methods that validate client authorization, retrieve information about cached content, determine whether the content is current, and download content to a cache. This interface is implemented by the server and called by a cache / proxy plug-in.")
  243. ]
  244. interface IWMSCacheProxyServer : IUnknown
  245. {
  246. [helpstring("Called by the plug-in to retrieve content information.")] HRESULT
  247. GetContentInformation(
  248. [in] BSTR bstrOriginUrl,
  249. [in] IWMSContext *pPresentationContext,
  250. [in] IWMSCacheProxy *pICacheProxy,
  251. [in, optional] IWMSProxyContext *pIProxyContext,
  252. [in, optional] IWMSCacheProxyServerCallback *pCallback,
  253. [in, optional] VARIANT varContext
  254. );
  255. [helpstring("Called by the plug-in to determine whether content is up to date.")] HRESULT
  256. CompareContentInformation(
  257. [in] BSTR bstrOriginUrl,
  258. [in] IWMSContext *pContentInfo,
  259. [in] IWMSContext *pPresentationContext,
  260. [in] IWMSCacheProxy *pICacheProxy,
  261. [in, optional] IWMSProxyContext *pIProxyContext,
  262. [in, optional] IWMSCacheProxyServerCallback *pCallback,
  263. [in, optional] VARIANT varContext
  264. );
  265. [helpstring("Called by the plug-in to download content to a cache.")] HRESULT
  266. DownloadContent(
  267. [in] BSTR bstrOriginUrl,
  268. [in] BSTR bstrCacheUrl,
  269. [in] long lBandwidth,
  270. [in] long lQuotaLow,
  271. [in] long lQuotaHigh,
  272. [in] long lBitFlags,
  273. [in] IWMSCacheProxy *pICacheProxy,
  274. [in, optional] IWMSProxyContext *pIProxyContext,
  275. [in, optional] IWMSCacheProxyServerCallback *pCallback,
  276. [in, optional] VARIANT varContext
  277. );
  278. [helpstring("Called by the plug-in to stop the download process.")] HRESULT
  279. CancelDownloadContent(
  280. [in] IWMSContext *pArchiveContext,
  281. [in, optional] IWMSCacheProxyServerCallback *pCallback,
  282. [in, optional] VARIANT varContext
  283. );
  284. };
  285. //////////////////////////////////////////////////////////////////////////////
  286. //
  287. // This is built by the cache plugin.
  288. // It is called by the server's cache manager.
  289. //
  290. //////////////////////////////////////////////////////////////////////////////
  291. [
  292. object,
  293. pointer_default(unique),
  294. uuid(68F2A551-D815-11D2-BEF6-00A0C95EC343),
  295. version(9.0),
  296. helpstring("Contains methods that enable a cache / proxy plug-in to respond to calls that the server makes through the IWMSCacheProxyServer interface. This interface is implemented by a cache / proxy plug-in and called by the server.")
  297. ]
  298. interface IWMSCacheProxyServerCallback : IUnknown
  299. {
  300. [helpstring("Called by the server to respond when the plug-in calls IWMSCacheProxyServer::GetContentInformation.")] HRESULT
  301. OnGetContentInformation(
  302. [in] long lHr, // HRESULT
  303. [in] IWMSContext *pContentInfo,
  304. [in] VARIANT varContext
  305. );
  306. [helpstring("Called by the server to respond when the plug-in calls IWMSCacheProxyServer::CompareContentInformation.")] HRESULT
  307. OnCompareContentInformation(
  308. [in] long lHr, // HRESULT
  309. [in] WMS_CACHE_VERSION_COMPARE_RESPONSE CompareResponse,
  310. [in] IWMSContext *pNewContentInfo,
  311. [in] VARIANT varContext
  312. );
  313. [helpstring("Called by the server to provide progress when the plug-in calls IWMSCacheProxyServer::DownloadContent.")] HRESULT
  314. OnDownloadContentProgress(
  315. [in] long lHr, // HRESULT
  316. [in] WMS_RECORD_PROGRESS_OPCODE opCode,
  317. [in] IWMSContext *pArchiveContext,
  318. [in] VARIANT varContext
  319. );
  320. [helpstring("Called by the server when media items have finished downloading to the cache.")] HRESULT
  321. OnDownloadContentFinished(
  322. [in] long lHr, // HRESULT
  323. [in] SAFEARRAY(VARIANT) psaArchiveContexts,
  324. [in] VARIANT varContext
  325. );
  326. [helpstring("Called by the server to respond when the plug-in calls IWMSCacheProxyServer::CancelDownloadContent.")] HRESULT
  327. OnCancelDownloadContent(
  328. [in] long lHr, // HRESULT
  329. [in] VARIANT varContext
  330. );
  331. };
  332. //////////////////////////////////////////////////////////////////////////////
  333. //
  334. // This is built by the cache plugin.
  335. // It is used by the ObjectModel (& Admin) to get information about
  336. // what is currently cached.
  337. //
  338. //////////////////////////////////////////////////////////////////////////////
  339. [
  340. object,
  341. pointer_default(unique),
  342. uuid(C3CBA330-AC05-11D2-BEF0-00A0C95EC343),
  343. version(9.0),
  344. helpstring("Retrieves the size, version number, expiration date, and URL of cached content. This interface is implemented by a cache / proxy plug-in and called by the server.")
  345. ]
  346. interface IWMSCacheItemDescriptor : IUnknown
  347. {
  348. [helpstring("Retrieves the URL on the origin server from which the cached content was obtained.")] HRESULT
  349. GetOriginUrl( [out] BSTR *pbstrOriginUrl );
  350. [helpstring("Retrieves the URL identifying the location of the cached content on the server.")] HRESULT
  351. GetCacheUrl( [out] BSTR *pbstrCacheUrl );
  352. [helpstring("Retrieves information about the cached content.")] HRESULT
  353. GetContentInformation( [out] IWMSContext **ppContentInfo );
  354. [helpstring("Retrieves the size of the content, in bytes.")] HRESULT
  355. GetContentSize( [out] long *plContentSizeLow, [out] long *plContentSizeHigh );
  356. };
  357. //////////////////////////////////////////////////////////////////////////////
  358. //
  359. // This is built by a plugin.
  360. // It is used by the ObjectModel (& Admin) to get information about
  361. // what is currently being cached.
  362. //
  363. // It is the plugins choice wrt how to implement the cache item collection
  364. // In order to give the cache flexibility, it is possible that we could have
  365. // items disappear in this enumeration, i.e. GetItem will return NULL, or
  366. // have the count grow ....
  367. //
  368. //////////////////////////////////////////////////////////////////////////////
  369. [
  370. object,
  371. pointer_default(unique),
  372. uuid(E6E05D80-F45C-11D2-BEFE-00A0C95EC343),
  373. version(9.0),
  374. helpstring("Contains a collection of IWMSCacheItemDescriptor objects. This interface is implemented by a cache / proxy plug-in and called by the server.")
  375. ]
  376. interface IWMSCacheItemCollection : IUnknown
  377. {
  378. [helpstring("Retrieves the number of items in the collection.")] HRESULT
  379. GetCount( [out] long* plNumCacheItemDescriptors );
  380. [helpstring("Retrieves a specific item from the collection.")] HRESULT
  381. GetItem( [in] long lIndex, [out] IWMSCacheItemDescriptor **ppCacheItemDescriptor );
  382. };