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.

157 lines
6.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2000.
  5. //
  6. // File: httprequest.idl
  7. //
  8. //--------------------------------------------------------------------------
  9. cpp_quote("//+-------------------------------------------------------------------------")
  10. cpp_quote("//")
  11. cpp_quote("// Microsoft Windows")
  12. cpp_quote("// Copyright (C) Microsoft Corporation, 2000.")
  13. cpp_quote("//")
  14. cpp_quote("//--------------------------------------------------------------------------")
  15. #include "httprequestid.h"
  16. [
  17. uuid(c92a03cf-b92b-404f-9ac5-58664a592e4c),
  18. helpstring("Microsoft WinHttpRequest component, version 5.0"),
  19. lcid(0x0000),
  20. version(5.0)
  21. ]
  22. library WinHttp
  23. {
  24. importlib ("stdole32.tlb");
  25. importlib ("stdole2.tlb");
  26. typedef [public] long HTTPREQUEST_PROXY_SETTING;
  27. const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_DEFAULT = 0x00000000;
  28. const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_PRECONFIG = 0x00000000;
  29. const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_DIRECT = 0x00000001;
  30. const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_PROXY = 0x00000002;
  31. typedef [public] long HTTPREQUEST_SETCREDENTIALS_FLAGS;
  32. const HTTPREQUEST_SETCREDENTIALS_FLAGS HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0x00000000;
  33. const HTTPREQUEST_SETCREDENTIALS_FLAGS HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 0x00000001;
  34. typedef
  35. [uuid(12782009-FE90-4877-9730-E5E183669B19), helpstring("WinHttpRequest Options")]
  36. enum WinHttpRequestOption
  37. {
  38. WinHttpRequestOption_UserAgentString,
  39. WinHttpRequestOption_URL,
  40. WinHttpRequestOption_URLCodePage,
  41. WinHttpRequestOption_EscapePercentInURL,
  42. WinHttpRequestOption_SslErrorIgnoreFlags,
  43. WinHttpRequestOption_SelectCertificate,
  44. WinHttpRequestOption_EnableRedirects
  45. } WinHttpRequestOption;
  46. [
  47. object,
  48. uuid(06f29373-5c5a-4b54-b025-6ef1bf8abf0e),
  49. odl,
  50. dual,
  51. oleautomation,
  52. nonextensible,
  53. helpstring("IWinHttpRequest Interface"),
  54. pointer_default(unique)
  55. ]
  56. interface IWinHttpRequest : IDispatch
  57. {
  58. [id(DISPID_HTTPREQUEST_SETPROXY), helpstring("Specify proxy configuration")]
  59. HRESULT SetProxy([in] HTTPREQUEST_PROXY_SETTING ProxySetting,
  60. [in, optional] VARIANT varProxyServer,
  61. [in, optional] VARIANT varBypassList);
  62. [id(DISPID_HTTPREQUEST_SETCREDENTIALS), helpstring("Specify authentication credentials")]
  63. HRESULT SetCredentials([in] BSTR bstrUserName,
  64. [in] BSTR bstrPassword,
  65. [in] HTTPREQUEST_SETCREDENTIALS_FLAGS Flags);
  66. [id(DISPID_HTTPREQUEST_OPEN), helpstring("Open HTTP connection")]
  67. HRESULT Open([in] BSTR bstrMethod, [in] BSTR bstrUrl, [in, optional] VARIANT varAsync);
  68. [id(DISPID_HTTPREQUEST_SETREQUESTHEADER), helpstring("Add HTTP request header")]
  69. HRESULT SetRequestHeader([in] BSTR bstrHeader, [in] BSTR bstrValue);
  70. [id(DISPID_HTTPREQUEST_GETRESPONSEHEADER), helpstring("Get HTTP response header")]
  71. HRESULT GetResponseHeader([in] BSTR bstrHeader, [out, retval] BSTR * pbstrValue);
  72. [id(DISPID_HTTPREQUEST_GETALLRESPONSEHEADERS), helpstring("Get all HTTP response headers")]
  73. HRESULT GetAllResponseHeaders([out, retval] BSTR * pbstrHeaders);
  74. [id(DISPID_HTTPREQUEST_SEND), helpstring("Send HTTP request")]
  75. HRESULT Send([in, optional] VARIANT varBody);
  76. [propget, id(DISPID_HTTPREQUEST_STATUS), helpstring("Get HTTP status code")]
  77. HRESULT Status([out, retval] long * plStatus);
  78. [propget, id(DISPID_HTTPREQUEST_STATUSTEXT), helpstring("Get HTTP status text")]
  79. HRESULT StatusText([out, retval] BSTR * pbstrStatus);
  80. [propget, id(DISPID_HTTPREQUEST_RESPONSETEXT), helpstring("Get response body as a string")]
  81. HRESULT ResponseText([out, retval] BSTR * pbstrBody);
  82. [propget, id(DISPID_HTTPREQUEST_RESPONSEBODY), helpstring("Get response body as a safearray of UI1")]
  83. HRESULT ResponseBody([out, retval] VARIANT * pvarBody);
  84. [propget, id(DISPID_HTTPREQUEST_RESPONSESTREAM), helpstring("Get response body as a stream")]
  85. HRESULT ResponseStream([out, retval] VARIANT * pvarBody);
  86. [propget, id(DISPID_HTTPREQUEST_OPTION)]
  87. HRESULT Option([in] WinHttpRequestOption Option, [out, retval] VARIANT * Value);
  88. [propput, id(DISPID_HTTPREQUEST_OPTION)]
  89. HRESULT Option([in] WinHttpRequestOption Option, [in] VARIANT Value);
  90. [id(DISPID_HTTPREQUEST_WAITFORRESPONSE), helpstring("Wait for asynchronous send to complete, with optional timeout (in seconds)")]
  91. HRESULT WaitForResponse([in, optional] VARIANT Timeout, [out, retval] VARIANT_BOOL * Succeeded);
  92. [id(DISPID_HTTPREQUEST_ABORT), helpstring("Abort an asynchronous operation in progress")]
  93. HRESULT Abort();
  94. [id(DISPID_HTTPREQUEST_SETTIMEOUTS), helpstring("Specify timeout settings (in milliseconds)")]
  95. HRESULT SetTimeouts([in] long ResolveTimeout, [in] long ConnectTimeout, [in] long SendTimeout, [in] long ReceiveTimeout);
  96. };
  97. [
  98. object,
  99. uuid(cff7bd4c-6689-4bbe-91c2-0f559e8b88a7),
  100. odl,
  101. oleautomation,
  102. nonextensible,
  103. helpstring("IWinHttpRequestEvents Interface"),
  104. pointer_default(unique)
  105. ]
  106. interface IWinHttpRequestEvents : IUnknown
  107. {
  108. void OnResponseStart([in] long Status, [in] BSTR ContentType);
  109. void OnResponseDataAvailable([in] SAFEARRAY(unsigned char) * Data);
  110. void OnResponseFinished();
  111. };
  112. // WinHttpRequest Class
  113. [
  114. uuid(91e2ead3-ab7e-4d5c-88de-f7fa382172bc),
  115. helpstring("WinHttpRequest class.")
  116. ]
  117. coclass WinHttpRequest
  118. {
  119. [default] interface IWinHttpRequest;
  120. [default, source] interface IWinHttpRequestEvents;
  121. };
  122. }