Source code of Windows XP (NT5)
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.

233 lines
7.6 KiB

  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. ////////////////////////////////////
  61. // Error definitions
  62. cpp_quote("#define UPNP_E_REQUIRED_ELEMENT_ERROR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA020)")
  63. cpp_quote("#define UPNP_E_DUPLICATE_NOT_ALLOWED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA021)")
  64. cpp_quote("#define UPNP_E_DUPLICATE_SERVICE_ID MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA022)")
  65. cpp_quote("#define UPNP_E_INVALID_DESCRIPTION MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA023)")
  66. cpp_quote("#define UPNP_E_INVALID_SERVICE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA024)")
  67. cpp_quote("#define UPNP_E_INVALID_ICON MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA025)")
  68. cpp_quote("#define UPNP_E_INVALID_XML MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA026)")
  69. cpp_quote("#define UPNP_E_INVALID_ROOT_NAMESPACE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA027)")
  70. cpp_quote("#define UPNP_E_SUFFIX_TOO_LONG MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA028)")
  71. cpp_quote("#define UPNP_E_URLBASE_PRESENT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA029)")
  72. cpp_quote("#define UPNP_E_VALUE_TOO_LONG MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA030)")
  73. cpp_quote("#define UPNP_E_DEVICE_RUNNING MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA031)")
  74. ////////////////////////////////////
  75. // Interface definitions
  76. [
  77. uuid(204810b4-73b2-11d4-bf42-00b0d0118b56),
  78. pointer_default(unique)
  79. ]
  80. interface IUPnPEventSink: IUnknown
  81. {
  82. [helpstring("method OnStateChanged"), hidden]
  83. HRESULT OnStateChanged(
  84. [in] DWORD cChanges,
  85. [in, size_is(cChanges)] DISPID rgdispidChanges[]);
  86. [helpstring("method OnStateChangedSafe")]
  87. HRESULT OnStateChangedSafe(
  88. [in] VARIANT varsadispidChanges);
  89. }
  90. [
  91. uuid(204810b5-73b2-11d4-bf42-00b0d0118b56),
  92. pointer_default(unique)
  93. ]
  94. interface IUPnPEventSource: IUnknown
  95. {
  96. [helpstring("method Advise")]
  97. HRESULT Advise(
  98. [in] IUPnPEventSink * pesSubscriber);
  99. [helpstring("method Unadvise")]
  100. HRESULT Unadvise(
  101. [in] IUPnPEventSink * pesSubscriber);
  102. }
  103. [
  104. uuid(204810b6-73b2-11d4-bf42-00b0d0118b56),
  105. pointer_default(unique)
  106. ]
  107. interface IUPnPRegistrar : IUnknown
  108. {
  109. HRESULT RegisterDevice(
  110. [in] BSTR bstrXMLDesc,
  111. [in] BSTR bstrProgIDDeviceControlClass,
  112. [in] BSTR bstrInitString,
  113. [in] BSTR bstrContainerId,
  114. [in] BSTR bstrResourcePath,
  115. [in] long nLifeTime,
  116. [out, retval] BSTR * pbstrDeviceIdentifier);
  117. HRESULT RegisterRunningDevice(
  118. [in] BSTR bstrXMLDesc,
  119. [in] IUnknown * punkDeviceControl,
  120. [in] BSTR bstrInitString,
  121. [in] BSTR bstrResourcePath,
  122. [in] long nLifeTime,
  123. [out, retval] BSTR * pbstrDeviceIdentifier);
  124. HRESULT RegisterDeviceProvider(
  125. [in] BSTR bstrProviderName,
  126. [in] BSTR bstrProgIDProviderClass,
  127. [in] BSTR bstrInitString,
  128. [in] BSTR bstrContainerId);
  129. HRESULT GetUniqueDeviceName(
  130. [in] BSTR bstrDeviceIdentifier,
  131. [in] BSTR bstrTemplateUDN,
  132. [out, retval] BSTR * pbstrUDN);
  133. HRESULT UnregisterDevice(
  134. [in] BSTR bstrDeviceIdentifier,
  135. [in] BOOL fPermanent);
  136. HRESULT UnregisterDeviceProvider(
  137. [in] BSTR bstrProviderName);
  138. }
  139. [
  140. uuid(204810b7-73b2-11d4-bf42-00b0d0118b56),
  141. pointer_default(unique)
  142. ]
  143. interface IUPnPReregistrar : IUnknown
  144. {
  145. HRESULT ReregisterDevice(
  146. [in] BSTR bstrDeviceIdentifier,
  147. [in] BSTR bstrXMLDesc,
  148. [in] BSTR bstrProgIDDeviceControlClass,
  149. [in] BSTR bstrInitString,
  150. [in] BSTR bstrContainerId,
  151. [in] BSTR bstrResourcePath,
  152. [in] long nLifeTime);
  153. HRESULT ReregisterRunningDevice(
  154. [in] BSTR bstrDeviceIdentifier,
  155. [in] BSTR bstrXMLDesc,
  156. [in] IUnknown * punkDeviceControl,
  157. [in] BSTR bstrInitString,
  158. [in] BSTR bstrResourcePath,
  159. [in] long nLifeTime);
  160. }
  161. [
  162. uuid(204810ba-73b2-11d4-bf42-00b0d0118b56),
  163. pointer_default(unique),
  164. ]
  165. interface IUPnPDeviceControl : IUnknown
  166. {
  167. HRESULT Initialize(
  168. [in] BSTR bstrXMLDesc,
  169. [in] BSTR bstrDeviceIdentifier,
  170. [in] BSTR bstrInitString);
  171. HRESULT GetServiceObject(
  172. [in] BSTR bstrUDN,
  173. [in] BSTR bstrServiceId,
  174. [out, retval] IDispatch ** ppdispService);
  175. }
  176. [
  177. uuid(204810b8-73b2-11d4-bf42-00b0d0118b56),
  178. pointer_default(unique),
  179. ]
  180. interface IUPnPDeviceProvider : IUnknown
  181. {
  182. HRESULT Start([in] BSTR bstrInitString);
  183. HRESULT Stop();
  184. }
  185. ////////////////////////////////////////
  186. // Type library
  187. #ifndef DO_NO_IMPORTS
  188. [
  189. uuid(204810b3-73b2-11d4-bf42-00b0d0118b56),
  190. version(1.0),
  191. helpstring("UPnP 1.0 Type Library")
  192. ]
  193. library UPnPHostLib
  194. {
  195. importlib("stdole32.tlb");
  196. importlib("stdole2.tlb");
  197. interface IUPnPEventSink;
  198. interface IUPnPEventSource;
  199. interface IUPnPRegistrar;
  200. interface IUPnPReregistrar;
  201. interface IUPnPDeviceControl;
  202. interface IUPnPDeviceProvider;
  203. [
  204. uuid(204810b9-73b2-11d4-bf42-00b0d0118b56)
  205. ]
  206. coclass UPnPRegistrar
  207. {
  208. [default] interface IUnknown;
  209. };
  210. };
  211. #endif // DO_NO_IMPORTS