upnphost.idl 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (c) Microsoft Corporation. All rights reserved.
  5. //
  6. // File: U P N P H O S T . I D L
  7. //
  8. // Contents: Objects and interfaces for hosting UPnP Devices
  9. //
  10. //----------------------------------------------------------------------------
  11. cpp_quote("//+-------------------------------------------------------------------------")
  12. cpp_quote("//")
  13. cpp_quote("// Microsoft Windows")
  14. cpp_quote("// Copyright (c) Microsoft Corporation. All rights reserved.")
  15. cpp_quote("//")
  16. cpp_quote("//--------------------------------------------------------------------------")
  17. #ifndef DO_NO_IMPORTS
  18. import "ocidl.idl";
  19. #endif
  20. // Reserved GUIDS for our use
  21. //
  22. // 204810b3-73b2-11d4-bf42-00b0d0118b56 LIBID_UPnPHostLib
  23. // 204810b4-73b2-11d4-bf42-00b0d0118b56 IID_IUPnPEventSink
  24. // 204810b5-73b2-11d4-bf42-00b0d0118b56 IID_IUPnPEventSource
  25. // 204810b6-73b2-11d4-bf42-00b0d0118b56 IID_IUPnPRegistrar
  26. // 204810b7-73b2-11d4-bf42-00b0d0118b56 IID_IUPnPReregistrar
  27. // 204810b8-73b2-11d4-bf42-00b0d0118b56 IID_IUPnPDeviceProvider
  28. // 204810b9-73b2-11d4-bf42-00b0d0118b56 CLSID_UPnPRegistrar
  29. // 204810ba-73b2-11d4-bf42-00b0d0118b56 IID_IUPnPDeviceControl
  30. // 204810bb-73b2-11d4-bf42-00b0d0118b56
  31. // 204810bc-73b2-11d4-bf42-00b0d0118b56
  32. // 204810bd-73b2-11d4-bf42-00b0d0118b56
  33. // 204810be-73b2-11d4-bf42-00b0d0118b56
  34. // 204810bf-73b2-11d4-bf42-00b0d0118b56
  35. // 204810c0-73b2-11d4-bf42-00b0d0118b56
  36. // 204810c1-73b2-11d4-bf42-00b0d0118b56
  37. // 204810c2-73b2-11d4-bf42-00b0d0118b56
  38. // 204810c3-73b2-11d4-bf42-00b0d0118b56
  39. // 204810c4-73b2-11d4-bf42-00b0d0118b56
  40. // 204810c5-73b2-11d4-bf42-00b0d0118b56
  41. // 204810c6-73b2-11d4-bf42-00b0d0118b56
  42. // 204810c7-73b2-11d4-bf42-00b0d0118b56
  43. // 204810c8-73b2-11d4-bf42-00b0d0118b56
  44. // 204810c9-73b2-11d4-bf42-00b0d0118b56
  45. // 204810ca-73b2-11d4-bf42-00b0d0118b56
  46. // 204810cb-73b2-11d4-bf42-00b0d0118b56
  47. // 204810cc-73b2-11d4-bf42-00b0d0118b56
  48. // 204810cd-73b2-11d4-bf42-00b0d0118b56
  49. // ....
  50. // 20481499-73b2-11d4-bf42-00b0d0118b56
  51. // 2048149a-73b2-11d4-bf42-00b0d0118b56
  52. /////////////////////////////////////
  53. // Interface forward declarations
  54. interface IUPnPEventSink;
  55. interface IUPnPEventSource;
  56. interface IUPnPRegistrar;
  57. interface IUPnPReregistrar;
  58. interface IUPnPDeviceControl;
  59. interface IUPnPDeviceProvider;
  60. interface IUPnPRemoteEndpointInfo;
  61. ////////////////////////////////////
  62. // Error definitions
  63. cpp_quote("#define UPNP_E_REQUIRED_ELEMENT_ERROR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA020)")
  64. cpp_quote("#define UPNP_E_DUPLICATE_NOT_ALLOWED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA021)")
  65. cpp_quote("#define UPNP_E_DUPLICATE_SERVICE_ID MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA022)")
  66. cpp_quote("#define UPNP_E_INVALID_DESCRIPTION MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA023)")
  67. cpp_quote("#define UPNP_E_INVALID_SERVICE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA024)")
  68. cpp_quote("#define UPNP_E_INVALID_ICON MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA025)")
  69. cpp_quote("#define UPNP_E_INVALID_XML MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA026)")
  70. cpp_quote("#define UPNP_E_INVALID_ROOT_NAMESPACE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA027)")
  71. cpp_quote("#define UPNP_E_SUFFIX_TOO_LONG MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA028)")
  72. cpp_quote("#define UPNP_E_URLBASE_PRESENT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA029)")
  73. cpp_quote("#define UPNP_E_VALUE_TOO_LONG MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA030)")
  74. cpp_quote("#define UPNP_E_DEVICE_RUNNING MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA031)")
  75. ////////////////////////////////////
  76. // Interface definitions
  77. [
  78. uuid(204810b4-73b2-11d4-bf42-00b0d0118b56),
  79. pointer_default(unique)
  80. ]
  81. interface IUPnPEventSink: IUnknown
  82. {
  83. [helpstring("method OnStateChanged"), hidden]
  84. HRESULT OnStateChanged(
  85. [in] DWORD cChanges,
  86. [in, size_is(cChanges)] DISPID rgdispidChanges[]);
  87. [helpstring("method OnStateChangedSafe")]
  88. HRESULT OnStateChangedSafe(
  89. [in] VARIANT varsadispidChanges);
  90. }
  91. [
  92. uuid(204810b5-73b2-11d4-bf42-00b0d0118b56),
  93. pointer_default(unique)
  94. ]
  95. interface IUPnPEventSource: IUnknown
  96. {
  97. [helpstring("method Advise")]
  98. HRESULT Advise(
  99. [in] IUPnPEventSink * pesSubscriber);
  100. [helpstring("method Unadvise")]
  101. HRESULT Unadvise(
  102. [in] IUPnPEventSink * pesSubscriber);
  103. }
  104. [
  105. uuid(204810b6-73b2-11d4-bf42-00b0d0118b56),
  106. pointer_default(unique)
  107. ]
  108. interface IUPnPRegistrar : IUnknown
  109. {
  110. HRESULT RegisterDevice(
  111. [in] BSTR bstrXMLDesc,
  112. [in] BSTR bstrProgIDDeviceControlClass,
  113. [in] BSTR bstrInitString,
  114. [in] BSTR bstrContainerId,
  115. [in] BSTR bstrResourcePath,
  116. [in] long nLifeTime,
  117. [out, retval] BSTR * pbstrDeviceIdentifier);
  118. HRESULT RegisterRunningDevice(
  119. [in] BSTR bstrXMLDesc,
  120. [in] IUnknown * punkDeviceControl,
  121. [in] BSTR bstrInitString,
  122. [in] BSTR bstrResourcePath,
  123. [in] long nLifeTime,
  124. [out, retval] BSTR * pbstrDeviceIdentifier);
  125. HRESULT RegisterDeviceProvider(
  126. [in] BSTR bstrProviderName,
  127. [in] BSTR bstrProgIDProviderClass,
  128. [in] BSTR bstrInitString,
  129. [in] BSTR bstrContainerId);
  130. HRESULT GetUniqueDeviceName(
  131. [in] BSTR bstrDeviceIdentifier,
  132. [in] BSTR bstrTemplateUDN,
  133. [out, retval] BSTR * pbstrUDN);
  134. HRESULT UnregisterDevice(
  135. [in] BSTR bstrDeviceIdentifier,
  136. [in] BOOL fPermanent);
  137. HRESULT UnregisterDeviceProvider(
  138. [in] BSTR bstrProviderName);
  139. }
  140. [
  141. uuid(204810b7-73b2-11d4-bf42-00b0d0118b56),
  142. pointer_default(unique)
  143. ]
  144. interface IUPnPReregistrar : IUnknown
  145. {
  146. HRESULT ReregisterDevice(
  147. [in] BSTR bstrDeviceIdentifier,
  148. [in] BSTR bstrXMLDesc,
  149. [in] BSTR bstrProgIDDeviceControlClass,
  150. [in] BSTR bstrInitString,
  151. [in] BSTR bstrContainerId,
  152. [in] BSTR bstrResourcePath,
  153. [in] long nLifeTime);
  154. HRESULT ReregisterRunningDevice(
  155. [in] BSTR bstrDeviceIdentifier,
  156. [in] BSTR bstrXMLDesc,
  157. [in] IUnknown * punkDeviceControl,
  158. [in] BSTR bstrInitString,
  159. [in] BSTR bstrResourcePath,
  160. [in] long nLifeTime);
  161. }
  162. [
  163. uuid(204810ba-73b2-11d4-bf42-00b0d0118b56),
  164. pointer_default(unique),
  165. ]
  166. interface IUPnPDeviceControl : IUnknown
  167. {
  168. HRESULT Initialize(
  169. [in] BSTR bstrXMLDesc,
  170. [in] BSTR bstrDeviceIdentifier,
  171. [in] BSTR bstrInitString);
  172. HRESULT GetServiceObject(
  173. [in] BSTR bstrUDN,
  174. [in] BSTR bstrServiceId,
  175. [out, retval] IDispatch ** ppdispService);
  176. }
  177. [
  178. uuid(204810b8-73b2-11d4-bf42-00b0d0118b56),
  179. pointer_default(unique),
  180. ]
  181. interface IUPnPDeviceProvider : IUnknown
  182. {
  183. HRESULT Start([in] BSTR bstrInitString);
  184. HRESULT Stop();
  185. }
  186. // IUPnPRemoteEndpointInfo
  187. [
  188. uuid(c92eb863-0269-4aff-9c72-75321bba2952),
  189. pointer_default(unique)
  190. ]
  191. interface IUPnPRemoteEndpointInfo : IUnknown
  192. {
  193. HRESULT GetDwordValue([in] BSTR bstrValueName,
  194. [out] DWORD *pdwValue);
  195. HRESULT GetStringValue([in] BSTR bstrValueName,
  196. [out] BSTR *pbstrValue);
  197. HRESULT GetGuidValue([in] BSTR bstrValueName,
  198. [out] GUID *pguidValue);
  199. };
  200. ////////////////////////////////////////
  201. // Type library
  202. #ifndef DO_NO_IMPORTS
  203. [
  204. uuid(204810b3-73b2-11d4-bf42-00b0d0118b56),
  205. version(1.0),
  206. helpstring("UPnP 1.0 Type Library")
  207. ]
  208. library UPnPHostLib
  209. {
  210. importlib("stdole32.tlb");
  211. importlib("stdole2.tlb");
  212. interface IUPnPEventSink;
  213. interface IUPnPEventSource;
  214. interface IUPnPRegistrar;
  215. interface IUPnPReregistrar;
  216. interface IUPnPDeviceControl;
  217. interface IUPnPDeviceProvider;
  218. interface IUPnPRemoteEndpointInfo;
  219. [
  220. uuid(204810b9-73b2-11d4-bf42-00b0d0118b56)
  221. ]
  222. coclass UPnPRegistrar
  223. {
  224. [default] interface IUnknown;
  225. };
  226. [
  227. uuid(2e5e84e9-4049-4244-b728-2d24227157c7)
  228. ]
  229. coclass UPnPRemoteEndpointInfo
  230. {
  231. [default] interface IUnknown;
  232. };
  233. };
  234. #endif // DO_NO_IMPORTS