1 | /*
|
---|
2 | * Copyright 2011 Hans Leidekker for CodeWeavers
|
---|
3 | *
|
---|
4 | * This library is free software; you can redistribute it and/or
|
---|
5 | * modify it under the terms of the GNU Lesser General Public
|
---|
6 | * License as published by the Free Software Foundation; either
|
---|
7 | * version 2.1 of the License, or (at your option) any later version.
|
---|
8 | *
|
---|
9 | * This library is distributed in the hope that it will be useful,
|
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
12 | * Lesser General Public License for more details.
|
---|
13 | *
|
---|
14 | * You should have received a copy of the GNU Lesser General Public
|
---|
15 | * License along with this library; if not, write to the Free Software
|
---|
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
17 | */
|
---|
18 |
|
---|
19 | /*
|
---|
20 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | #include "httprequestid.h"
|
---|
29 |
|
---|
30 | import "oaidl.idl";
|
---|
31 |
|
---|
32 | #ifndef __WIDL__
|
---|
33 | #define threading(model)
|
---|
34 | #define progid(str)
|
---|
35 | #define vi_progid(str)
|
---|
36 | #endif
|
---|
37 |
|
---|
38 | [
|
---|
39 | uuid(662901fc-6951-4854-9eb2-d9a2570f2b2e),
|
---|
40 | helpstring("Microsoft WinHTTP Services, version 5.1"),
|
---|
41 | lcid(0x0000),
|
---|
42 | version(5.1)
|
---|
43 | ]
|
---|
44 | library WinHttp {
|
---|
45 |
|
---|
46 | importlib ("stdole2.tlb");
|
---|
47 |
|
---|
48 | typedef [public] LONG HTTPREQUEST_PROXY_SETTING;
|
---|
49 | const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_DEFAULT = 0x00000000;
|
---|
50 | const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_PRECONFIG = 0x00000000;
|
---|
51 | const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_DIRECT = 0x00000001;
|
---|
52 | const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_PROXY = 0x00000002;
|
---|
53 |
|
---|
54 | typedef [public] LONG HTTPREQUEST_SETCREDENTIALS_FLAGS;
|
---|
55 | const HTTPREQUEST_SETCREDENTIALS_FLAGS HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0x00000000;
|
---|
56 | const HTTPREQUEST_SETCREDENTIALS_FLAGS HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 0x00000001;
|
---|
57 |
|
---|
58 | typedef
|
---|
59 | [uuid(12782009-fe90-4877-9730-e5e183669b19)]
|
---|
60 | enum WinHttpRequestOption
|
---|
61 | {
|
---|
62 | WinHttpRequestOption_UserAgentString,
|
---|
63 | WinHttpRequestOption_URL,
|
---|
64 | WinHttpRequestOption_URLCodePage,
|
---|
65 | WinHttpRequestOption_EscapePercentInURL,
|
---|
66 | WinHttpRequestOption_SslErrorIgnoreFlags,
|
---|
67 | WinHttpRequestOption_SelectCertificate,
|
---|
68 | WinHttpRequestOption_EnableRedirects,
|
---|
69 | WinHttpRequestOption_UrlEscapeDisable,
|
---|
70 | WinHttpRequestOption_UrlEscapeDisableQuery,
|
---|
71 | WinHttpRequestOption_SecureProtocols,
|
---|
72 | WinHttpRequestOption_EnableTracing,
|
---|
73 | WinHttpRequestOption_RevertImpersonationOverSsl,
|
---|
74 | WinHttpRequestOption_EnableHttpsToHttpRedirects,
|
---|
75 | WinHttpRequestOption_EnablePassportAuthentication,
|
---|
76 | WinHttpRequestOption_MaxAutomaticRedirects,
|
---|
77 | WinHttpRequestOption_MaxResponseHeaderSize,
|
---|
78 | WinHttpRequestOption_MaxResponseDrainSize,
|
---|
79 | WinHttpRequestOption_EnableHttp1_1,
|
---|
80 | WinHttpRequestOption_EnableCertificateRevocationCheck,
|
---|
81 | WinHttpRequestOption_RejectUserpwd
|
---|
82 | } WinHttpRequestOption;
|
---|
83 |
|
---|
84 | typedef
|
---|
85 | [uuid(9d8a6df8-13de-4b1f-a330-67c719d62514)]
|
---|
86 | enum WinHttpRequestAutoLogonPolicy
|
---|
87 | {
|
---|
88 | AutoLogonPolicy_Always,
|
---|
89 | AutoLogonPolicy_OnlyIfBypassProxy,
|
---|
90 | AutoLogonPolicy_Never
|
---|
91 | } WinHttpRequestAutoLogonPolicy;
|
---|
92 |
|
---|
93 | [
|
---|
94 | object,
|
---|
95 | uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396b),
|
---|
96 | odl,
|
---|
97 | dual,
|
---|
98 | oleautomation,
|
---|
99 | nonextensible,
|
---|
100 | pointer_default(unique)
|
---|
101 | ]
|
---|
102 | interface IWinHttpRequest : IDispatch
|
---|
103 | {
|
---|
104 | [id(DISPID_HTTPREQUEST_SETPROXY)]
|
---|
105 | HRESULT SetProxy(
|
---|
106 | [in] HTTPREQUEST_PROXY_SETTING proxy_setting,
|
---|
107 | [in, optional] VARIANT proxy_server,
|
---|
108 | [in, optional] VARIANT bypass_list);
|
---|
109 |
|
---|
110 | [id(DISPID_HTTPREQUEST_SETCREDENTIALS)]
|
---|
111 | HRESULT SetCredentials(
|
---|
112 | [in] BSTR username,
|
---|
113 | [in] BSTR password,
|
---|
114 | [in] HTTPREQUEST_SETCREDENTIALS_FLAGS flags);
|
---|
115 |
|
---|
116 | [id(DISPID_HTTPREQUEST_OPEN)]
|
---|
117 | HRESULT Open(
|
---|
118 | [in] BSTR method,
|
---|
119 | [in] BSTR url,
|
---|
120 | [in, optional] VARIANT async);
|
---|
121 |
|
---|
122 | [id(DISPID_HTTPREQUEST_SETREQUESTHEADER)]
|
---|
123 | HRESULT SetRequestHeader(
|
---|
124 | [in] BSTR header,
|
---|
125 | [in] BSTR value);
|
---|
126 |
|
---|
127 | [id(DISPID_HTTPREQUEST_GETRESPONSEHEADER)]
|
---|
128 | HRESULT GetResponseHeader(
|
---|
129 | [in] BSTR header,
|
---|
130 | [out, retval] BSTR *value);
|
---|
131 |
|
---|
132 | [id(DISPID_HTTPREQUEST_GETALLRESPONSEHEADERS)]
|
---|
133 | HRESULT GetAllResponseHeaders(
|
---|
134 | [out, retval] BSTR *headers);
|
---|
135 |
|
---|
136 | [id(DISPID_HTTPREQUEST_SEND)]
|
---|
137 | HRESULT Send(
|
---|
138 | [in, optional] VARIANT body);
|
---|
139 |
|
---|
140 | [propget, id(DISPID_HTTPREQUEST_STATUS)]
|
---|
141 | HRESULT Status(
|
---|
142 | [out, retval] LONG *status);
|
---|
143 |
|
---|
144 | [propget, id(DISPID_HTTPREQUEST_STATUSTEXT)]
|
---|
145 | HRESULT StatusText(
|
---|
146 | [out, retval] BSTR *status);
|
---|
147 |
|
---|
148 | [propget, id(DISPID_HTTPREQUEST_RESPONSETEXT)]
|
---|
149 | HRESULT ResponseText(
|
---|
150 | [out, retval] BSTR *body);
|
---|
151 |
|
---|
152 | [propget, id(DISPID_HTTPREQUEST_RESPONSEBODY)]
|
---|
153 | HRESULT ResponseBody(
|
---|
154 | [out, retval] VARIANT *body);
|
---|
155 |
|
---|
156 | [propget, id(DISPID_HTTPREQUEST_RESPONSESTREAM)]
|
---|
157 | HRESULT ResponseStream(
|
---|
158 | [out, retval] VARIANT *body);
|
---|
159 |
|
---|
160 | [propget, id(DISPID_HTTPREQUEST_OPTION)]
|
---|
161 | HRESULT Option(
|
---|
162 | [in] WinHttpRequestOption option,
|
---|
163 | [out, retval] VARIANT *value);
|
---|
164 |
|
---|
165 | [propput, id(DISPID_HTTPREQUEST_OPTION)]
|
---|
166 | HRESULT Option(
|
---|
167 | [in] WinHttpRequestOption option,
|
---|
168 | [in] VARIANT value);
|
---|
169 |
|
---|
170 | [id(DISPID_HTTPREQUEST_WAITFORRESPONSE)]
|
---|
171 | HRESULT WaitForResponse(
|
---|
172 | [in, optional] VARIANT timeout,
|
---|
173 | [out, retval] VARIANT_BOOL *succeeded);
|
---|
174 |
|
---|
175 | [id(DISPID_HTTPREQUEST_ABORT)]
|
---|
176 | HRESULT Abort();
|
---|
177 |
|
---|
178 | [id(DISPID_HTTPREQUEST_SETTIMEOUTS)]
|
---|
179 | HRESULT SetTimeouts(
|
---|
180 | [in] LONG resolve_timeout,
|
---|
181 | [in] LONG connect_timeout,
|
---|
182 | [in] LONG send_timeout,
|
---|
183 | [in] LONG receive_timeout);
|
---|
184 |
|
---|
185 | [id(DISPID_HTTPREQUEST_SETCLIENTCERTIFICATE)]
|
---|
186 | HRESULT SetClientCertificate(
|
---|
187 | [in] BSTR certificate);
|
---|
188 |
|
---|
189 | [id(DISPID_HTTPREQUEST_SETAUTOLOGONPOLICY)]
|
---|
190 | HRESULT SetAutoLogonPolicy(
|
---|
191 | [in] WinHttpRequestAutoLogonPolicy policy);
|
---|
192 | }
|
---|
193 | [
|
---|
194 | helpstring("WinHttpRequest Component version 5.1"),
|
---|
195 | threading(apartment),
|
---|
196 | progid("WinHttp.WinHttpRequest.5.1"),
|
---|
197 | uuid(2087c2f4-2cef-4953-a8ab-66779b670495)
|
---|
198 | ]
|
---|
199 | coclass WinHttpRequest { interface IWinHttpRequest; }
|
---|
200 |
|
---|
201 | } /* WinHttp */
|
---|