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.

201 lines
7.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows HTTP Services (WinHTTP)
  4. // Copyright (C) Microsoft Corporation. All rights reserved.
  5. //
  6. // File: httprequest.idl
  7. //
  8. //--------------------------------------------------------------------------
  9. cpp_quote("//+-------------------------------------------------------------------------")
  10. cpp_quote("//")
  11. cpp_quote("// Microsoft Windows HTTP Services (WinHTTP) version 5.1")
  12. cpp_quote("// Copyright (C) Microsoft Corporation. All rights reserved.")
  13. cpp_quote("//")
  14. cpp_quote("//--------------------------------------------------------------------------")
  15. #include "httprequestid.h"
  16. [
  17. uuid(662901fc-6951-4854-9eb2-d9a2570f2b2e),
  18. helpstring("Microsoft WinHTTP Services, version 5.1"),
  19. lcid(0x0000),
  20. version(5.1)
  21. ]
  22. library WinHttp
  23. {
  24. importlib ("stdole2.tlb");
  25. typedef [public] long HTTPREQUEST_PROXY_SETTING;
  26. const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_DEFAULT = 0x00000000;
  27. const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_PRECONFIG = 0x00000000;
  28. const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_DIRECT = 0x00000001;
  29. const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_PROXY = 0x00000002;
  30. typedef [public] long HTTPREQUEST_SETCREDENTIALS_FLAGS;
  31. const HTTPREQUEST_SETCREDENTIALS_FLAGS HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0x00000000;
  32. const HTTPREQUEST_SETCREDENTIALS_FLAGS HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 0x00000001;
  33. typedef
  34. [uuid(12782009-FE90-4877-9730-E5E183669B19), helpstring("WinHttpRequest Options")]
  35. enum WinHttpRequestOption
  36. {
  37. WinHttpRequestOption_UserAgentString,
  38. WinHttpRequestOption_URL,
  39. WinHttpRequestOption_URLCodePage,
  40. WinHttpRequestOption_EscapePercentInURL,
  41. WinHttpRequestOption_SslErrorIgnoreFlags,
  42. WinHttpRequestOption_SelectCertificate,
  43. WinHttpRequestOption_EnableRedirects,
  44. WinHttpRequestOption_UrlEscapeDisable,
  45. WinHttpRequestOption_UrlEscapeDisableQuery,
  46. WinHttpRequestOption_SecureProtocols,
  47. WinHttpRequestOption_EnableTracing,
  48. WinHttpRequestOption_RevertImpersonationOverSsl,
  49. WinHttpRequestOption_EnableHttpsToHttpRedirects,
  50. WinHttpRequestOption_EnablePassportAuthentication
  51. } WinHttpRequestOption;
  52. typedef
  53. [uuid(9d8a6df8-13de-4b1f-a330-67c719d62514)]
  54. enum WinHttpRequestAutoLogonPolicy
  55. {
  56. AutoLogonPolicy_Always,
  57. AutoLogonPolicy_OnlyIfBypassProxy,
  58. AutoLogonPolicy_Never
  59. } WinHttpRequestAutoLogonPolicy;
  60. typedef
  61. [uuid(152a1ca2-55a9-43a3-b187-0605bb886349)]
  62. enum WinHttpRequestSslErrorFlags
  63. {
  64. SslErrorFlag_UnknownCA = 0x00000100,
  65. SslErrorFlag_CertWrongUsage = 0x00000200,
  66. SslErrorFlag_CertCNInvalid = 0x00001000,
  67. SslErrorFlag_CertDateInvalid = 0x00002000,
  68. SslErrorFlag_Ignore_All = 0x00003300
  69. } WinHttpRequestSslErrorFlags;
  70. typedef
  71. [uuid(6b2c51c1-a8ea-46bd-b928-c9b76f9f14dd)]
  72. enum WinHttpRequestSecureProtocols
  73. {
  74. SecureProtocol_SSL2 = 0x00000008,
  75. SecureProtocol_SSL3 = 0x00000020,
  76. SecureProtocol_TLS1 = 0x00000080,
  77. SecureProtocol_ALL = 0x000000A8
  78. } WinHttpRequestSecureProtocols;
  79. [
  80. object,
  81. uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396b),
  82. odl,
  83. dual,
  84. oleautomation,
  85. nonextensible,
  86. helpstring("IWinHttpRequest Interface"),
  87. pointer_default(unique)
  88. ]
  89. interface IWinHttpRequest : IDispatch
  90. {
  91. [id(DISPID_HTTPREQUEST_SETPROXY), helpstring("Specify proxy configuration")]
  92. HRESULT SetProxy([in] HTTPREQUEST_PROXY_SETTING ProxySetting,
  93. [in, optional] VARIANT ProxyServer,
  94. [in, optional] VARIANT BypassList);
  95. [id(DISPID_HTTPREQUEST_SETCREDENTIALS), helpstring("Specify authentication credentials")]
  96. HRESULT SetCredentials([in] BSTR UserName,
  97. [in] BSTR Password,
  98. [in] HTTPREQUEST_SETCREDENTIALS_FLAGS Flags);
  99. [id(DISPID_HTTPREQUEST_OPEN), helpstring("Open HTTP connection")]
  100. HRESULT Open([in] BSTR Method, [in] BSTR Url, [in, optional] VARIANT Async);
  101. [id(DISPID_HTTPREQUEST_SETREQUESTHEADER), helpstring("Add HTTP request header")]
  102. HRESULT SetRequestHeader([in] BSTR Header, [in] BSTR Value);
  103. [id(DISPID_HTTPREQUEST_GETRESPONSEHEADER), helpstring("Get HTTP response header")]
  104. HRESULT GetResponseHeader([in] BSTR Header, [out, retval] BSTR * Value);
  105. [id(DISPID_HTTPREQUEST_GETALLRESPONSEHEADERS), helpstring("Get all HTTP response headers")]
  106. HRESULT GetAllResponseHeaders([out, retval] BSTR * Headers);
  107. [id(DISPID_HTTPREQUEST_SEND), helpstring("Send HTTP request")]
  108. HRESULT Send([in, optional] VARIANT Body);
  109. [propget, id(DISPID_HTTPREQUEST_STATUS), helpstring("Get HTTP status code")]
  110. HRESULT Status([out, retval] long * Status);
  111. [propget, id(DISPID_HTTPREQUEST_STATUSTEXT), helpstring("Get HTTP status text")]
  112. HRESULT StatusText([out, retval] BSTR * Status);
  113. [propget, id(DISPID_HTTPREQUEST_RESPONSETEXT), helpstring("Get response body as a string")]
  114. HRESULT ResponseText([out, retval] BSTR * Body);
  115. [propget, id(DISPID_HTTPREQUEST_RESPONSEBODY), helpstring("Get response body as a safearray of UI1")]
  116. HRESULT ResponseBody([out, retval] VARIANT * Body);
  117. [propget, id(DISPID_HTTPREQUEST_RESPONSESTREAM), helpstring("Get response body as a stream")]
  118. HRESULT ResponseStream([out, retval] VARIANT * Body);
  119. [propget, id(DISPID_HTTPREQUEST_OPTION)]
  120. HRESULT Option([in] WinHttpRequestOption Option, [out, retval] VARIANT * Value);
  121. [propput, id(DISPID_HTTPREQUEST_OPTION)]
  122. HRESULT Option([in] WinHttpRequestOption Option, [in] VARIANT Value);
  123. [id(DISPID_HTTPREQUEST_WAITFORRESPONSE), helpstring("Wait for asynchronous send to complete, with optional timeout (in seconds)")]
  124. HRESULT WaitForResponse([in, optional] VARIANT Timeout, [out, retval] VARIANT_BOOL * Succeeded);
  125. [id(DISPID_HTTPREQUEST_ABORT), helpstring("Abort an asynchronous operation in progress")]
  126. HRESULT Abort();
  127. [id(DISPID_HTTPREQUEST_SETTIMEOUTS), helpstring("Specify timeout settings (in milliseconds)")]
  128. HRESULT SetTimeouts([in] long ResolveTimeout, [in] long ConnectTimeout, [in] long SendTimeout, [in] long ReceiveTimeout);
  129. [id(DISPID_HTTPREQUEST_SETCLIENTCERTIFICATE), helpstring("Specify a client certificate")]
  130. HRESULT SetClientCertificate([in] BSTR ClientCertificate);
  131. [id(DISPID_HTTPREQUEST_SETAUTOLOGONPOLICY), helpstring("Specify if credentials should be sent automatically")]
  132. HRESULT SetAutoLogonPolicy([in] WinHttpRequestAutoLogonPolicy AutoLogonPolicy);
  133. };
  134. [
  135. object,
  136. uuid(f97f4e15-b787-4212-80d1-d380cbbf982e),
  137. odl,
  138. oleautomation,
  139. nonextensible,
  140. helpstring("IWinHttpRequestEvents Interface"),
  141. pointer_default(unique)
  142. ]
  143. interface IWinHttpRequestEvents : IUnknown
  144. {
  145. void OnResponseStart([in] long Status, [in] BSTR ContentType);
  146. void OnResponseDataAvailable([in] SAFEARRAY(unsigned char) * Data);
  147. void OnResponseFinished();
  148. void OnError([in] long ErrorNumber, [in] BSTR ErrorDescription);
  149. };
  150. // WinHttpRequest Class
  151. [
  152. uuid(2087c2f4-2cef-4953-a8ab-66779b670495),
  153. helpstring("WinHttpRequest component")
  154. ]
  155. coclass WinHttpRequest
  156. {
  157. [default] interface IWinHttpRequest;
  158. [default, source] interface IWinHttpRequestEvents;
  159. };
  160. }