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.

206 lines
8.1 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_MaxAutomaticRedirects,
  52. WinHttpRequestOption_MaxResponseHeaderSize,
  53. WinHttpRequestOption_MaxResponseDrainSize,
  54. WinHttpRequestOption_EnableHttp1_1,
  55. WinHttpRequestOption_EnableCertificateRevocationCheck
  56. } WinHttpRequestOption;
  57. typedef
  58. [uuid(9d8a6df8-13de-4b1f-a330-67c719d62514)]
  59. enum WinHttpRequestAutoLogonPolicy
  60. {
  61. AutoLogonPolicy_Always,
  62. AutoLogonPolicy_OnlyIfBypassProxy,
  63. AutoLogonPolicy_Never
  64. } WinHttpRequestAutoLogonPolicy;
  65. typedef
  66. [uuid(152a1ca2-55a9-43a3-b187-0605bb886349)]
  67. enum WinHttpRequestSslErrorFlags
  68. {
  69. SslErrorFlag_UnknownCA = 0x00000100,
  70. SslErrorFlag_CertWrongUsage = 0x00000200,
  71. SslErrorFlag_CertCNInvalid = 0x00001000,
  72. SslErrorFlag_CertDateInvalid = 0x00002000,
  73. SslErrorFlag_Ignore_All = 0x00003300
  74. } WinHttpRequestSslErrorFlags;
  75. typedef
  76. [uuid(6b2c51c1-a8ea-46bd-b928-c9b76f9f14dd)]
  77. enum WinHttpRequestSecureProtocols
  78. {
  79. SecureProtocol_SSL2 = 0x00000008,
  80. SecureProtocol_SSL3 = 0x00000020,
  81. SecureProtocol_TLS1 = 0x00000080,
  82. SecureProtocol_ALL = 0x000000A8
  83. } WinHttpRequestSecureProtocols;
  84. [
  85. object,
  86. uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396b),
  87. odl,
  88. dual,
  89. oleautomation,
  90. nonextensible,
  91. helpstring("IWinHttpRequest Interface"),
  92. pointer_default(unique)
  93. ]
  94. interface IWinHttpRequest : IDispatch
  95. {
  96. [id(DISPID_HTTPREQUEST_SETPROXY), helpstring("Specify proxy configuration")]
  97. HRESULT SetProxy([in] HTTPREQUEST_PROXY_SETTING ProxySetting,
  98. [in, optional] VARIANT ProxyServer,
  99. [in, optional] VARIANT BypassList);
  100. [id(DISPID_HTTPREQUEST_SETCREDENTIALS), helpstring("Specify authentication credentials")]
  101. HRESULT SetCredentials([in] BSTR UserName,
  102. [in] BSTR Password,
  103. [in] HTTPREQUEST_SETCREDENTIALS_FLAGS Flags);
  104. [id(DISPID_HTTPREQUEST_OPEN), helpstring("Open HTTP connection")]
  105. HRESULT Open([in] BSTR Method, [in] BSTR Url, [in, optional] VARIANT Async);
  106. [id(DISPID_HTTPREQUEST_SETREQUESTHEADER), helpstring("Add HTTP request header")]
  107. HRESULT SetRequestHeader([in] BSTR Header, [in] BSTR Value);
  108. [id(DISPID_HTTPREQUEST_GETRESPONSEHEADER), helpstring("Get HTTP response header")]
  109. HRESULT GetResponseHeader([in] BSTR Header, [out, retval] BSTR * Value);
  110. [id(DISPID_HTTPREQUEST_GETALLRESPONSEHEADERS), helpstring("Get all HTTP response headers")]
  111. HRESULT GetAllResponseHeaders([out, retval] BSTR * Headers);
  112. [id(DISPID_HTTPREQUEST_SEND), helpstring("Send HTTP request")]
  113. HRESULT Send([in, optional] VARIANT Body);
  114. [propget, id(DISPID_HTTPREQUEST_STATUS), helpstring("Get HTTP status code")]
  115. HRESULT Status([out, retval] long * Status);
  116. [propget, id(DISPID_HTTPREQUEST_STATUSTEXT), helpstring("Get HTTP status text")]
  117. HRESULT StatusText([out, retval] BSTR * Status);
  118. [propget, id(DISPID_HTTPREQUEST_RESPONSETEXT), helpstring("Get response body as a string")]
  119. HRESULT ResponseText([out, retval] BSTR * Body);
  120. [propget, id(DISPID_HTTPREQUEST_RESPONSEBODY), helpstring("Get response body as a safearray of UI1")]
  121. HRESULT ResponseBody([out, retval] VARIANT * Body);
  122. [propget, id(DISPID_HTTPREQUEST_RESPONSESTREAM), helpstring("Get response body as a stream")]
  123. HRESULT ResponseStream([out, retval] VARIANT * Body);
  124. [propget, id(DISPID_HTTPREQUEST_OPTION)]
  125. HRESULT Option([in] WinHttpRequestOption Option, [out, retval] VARIANT * Value);
  126. [propput, id(DISPID_HTTPREQUEST_OPTION)]
  127. HRESULT Option([in] WinHttpRequestOption Option, [in] VARIANT Value);
  128. [id(DISPID_HTTPREQUEST_WAITFORRESPONSE), helpstring("Wait for asynchronous send to complete, with optional timeout (in seconds)")]
  129. HRESULT WaitForResponse([in, optional] VARIANT Timeout, [out, retval] VARIANT_BOOL * Succeeded);
  130. [id(DISPID_HTTPREQUEST_ABORT), helpstring("Abort an asynchronous operation in progress")]
  131. HRESULT Abort();
  132. [id(DISPID_HTTPREQUEST_SETTIMEOUTS), helpstring("Specify timeout settings (in milliseconds)")]
  133. HRESULT SetTimeouts([in] long ResolveTimeout, [in] long ConnectTimeout, [in] long SendTimeout, [in] long ReceiveTimeout);
  134. [id(DISPID_HTTPREQUEST_SETCLIENTCERTIFICATE), helpstring("Specify a client certificate")]
  135. HRESULT SetClientCertificate([in] BSTR ClientCertificate);
  136. [id(DISPID_HTTPREQUEST_SETAUTOLOGONPOLICY), helpstring("Specify if credentials should be sent automatically")]
  137. HRESULT SetAutoLogonPolicy([in] WinHttpRequestAutoLogonPolicy AutoLogonPolicy);
  138. };
  139. [
  140. object,
  141. uuid(f97f4e15-b787-4212-80d1-d380cbbf982e),
  142. odl,
  143. oleautomation,
  144. nonextensible,
  145. helpstring("IWinHttpRequestEvents Interface"),
  146. pointer_default(unique)
  147. ]
  148. interface IWinHttpRequestEvents : IUnknown
  149. {
  150. void OnResponseStart([in] long Status, [in] BSTR ContentType);
  151. void OnResponseDataAvailable([in] SAFEARRAY(unsigned char) * Data);
  152. void OnResponseFinished();
  153. void OnError([in] long ErrorNumber, [in] BSTR ErrorDescription);
  154. };
  155. // WinHttpRequest Class
  156. [
  157. uuid(2087c2f4-2cef-4953-a8ab-66779b670495),
  158. helpstring("WinHttpRequest component")
  159. ]
  160. coclass WinHttpRequest
  161. {
  162. [default] interface IWinHttpRequest;
  163. [default, source] interface IWinHttpRequestEvents;
  164. };
  165. }