2 * Copyright 2005 Jacek Caban
3 * Copyright 2007 Misha Koshelev
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "urlmon_main.h"
23 #define NO_SHLWAPI_REG
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
33 IInternetProtocolEx IInternetProtocolEx_iface;
34 IInternetPriority IInternetPriority_iface;
35 IWinInetHttpInfo IWinInetHttpInfo_iface;
38 IHttpNegotiate *http_negotiate;
44 static inline HttpProtocol *impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
46 return CONTAINING_RECORD(iface, HttpProtocol, IInternetProtocolEx_iface);
49 static inline HttpProtocol *impl_from_IInternetPriority(IInternetPriority *iface)
51 return CONTAINING_RECORD(iface, HttpProtocol, IInternetPriority_iface);
54 static inline HttpProtocol *impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
56 return CONTAINING_RECORD(iface, HttpProtocol, IWinInetHttpInfo_iface);
59 /* Default headers from native */
60 static const WCHAR wszHeaders[] = {'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g',
61 ':',' ','g','z','i','p',',',' ','d','e','f','l','a','t','e',0};
63 static LPWSTR query_http_info(HttpProtocol *This, DWORD option)
69 res = HttpQueryInfoW(This->base.request, option, NULL, &len, NULL);
70 if (!res && GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
71 ret = heap_alloc(len);
72 res = HttpQueryInfoW(This->base.request, option, ret, &len, NULL);
75 TRACE("HttpQueryInfoW(%d) failed: %08x\n", option, GetLastError());
83 static ULONG send_http_request(HttpProtocol *This)
85 INTERNET_BUFFERSW send_buffer = {sizeof(INTERNET_BUFFERSW)};
88 send_buffer.lpcszHeader = This->full_header;
89 send_buffer.dwHeadersLength = send_buffer.dwHeadersTotal = strlenW(This->full_header);
91 if(This->base.bind_info.dwBindVerb != BINDVERB_GET) {
92 switch(This->base.bind_info.stgmedData.tymed) {
94 /* Native does not use GlobalLock/GlobalUnlock, so we won't either */
95 send_buffer.lpvBuffer = This->base.bind_info.stgmedData.u.hGlobal;
96 send_buffer.dwBufferLength = send_buffer.dwBufferTotal = This->base.bind_info.cbstgmedData;
101 send_buffer.dwBufferTotal = This->base.bind_info.cbstgmedData;
102 if(!This->base.post_stream) {
103 This->base.post_stream = This->base.bind_info.stgmedData.u.pstm;
104 IStream_AddRef(This->base.post_stream);
108 IStream_Seek(This->base.post_stream, offset, STREAM_SEEK_SET, NULL);
112 FIXME("Unsupported This->base.bind_info.stgmedData.tymed %d\n", This->base.bind_info.stgmedData.tymed);
116 if(This->base.post_stream)
117 res = HttpSendRequestExW(This->base.request, &send_buffer, NULL, 0, 0);
119 res = HttpSendRequestW(This->base.request, send_buffer.lpcszHeader, send_buffer.dwHeadersLength,
120 send_buffer.lpvBuffer, send_buffer.dwBufferLength);
122 return res ? 0 : GetLastError();
125 static inline HttpProtocol *impl_from_Protocol(Protocol *prot)
127 return CONTAINING_RECORD(prot, HttpProtocol, base);
130 static HRESULT HttpProtocol_open_request(Protocol *prot, IUri *uri, DWORD request_flags,
131 HINTERNET internet_session, IInternetBindInfo *bind_info)
133 HttpProtocol *This = impl_from_Protocol(prot);
134 LPWSTR addl_header = NULL, post_cookie = NULL;
135 IServiceProvider *service_provider = NULL;
136 IHttpNegotiate2 *http_negotiate2 = NULL;
137 BSTR url, host, user, pass, path;
138 LPOLESTR accept_mimes[257];
139 const WCHAR **accept_types;
140 BYTE security_id[512];
146 static const WCHAR wszBindVerb[BINDVERB_CUSTOM][5] =
151 hres = IUri_GetPort(uri, &port);
155 hres = IUri_GetHost(uri, &host);
159 hres = IUri_GetUserName(uri, &user);
160 if(SUCCEEDED(hres)) {
161 hres = IUri_GetPassword(uri, &pass);
163 if(SUCCEEDED(hres)) {
164 This->base.connection = InternetConnectW(internet_session, host, port, user, pass,
165 INTERNET_SERVICE_HTTP, This->https ? INTERNET_FLAG_SECURE : 0, (DWORD_PTR)&This->base);
173 if(!This->base.connection) {
174 WARN("InternetConnect failed: %d\n", GetLastError());
175 return INET_E_CANNOT_CONNECT;
178 num = sizeof(accept_mimes)/sizeof(accept_mimes[0])-1;
179 hres = IInternetBindInfo_GetBindString(bind_info, BINDSTRING_ACCEPT_MIMES, accept_mimes, num, &num);
180 if(hres == INET_E_USE_DEFAULT_SETTING) {
181 static const WCHAR default_accept_mimeW[] = {'*','/','*',0};
182 static const WCHAR *default_accept_mimes[] = {default_accept_mimeW, NULL};
184 accept_types = default_accept_mimes;
186 }else if(hres == S_OK) {
187 accept_types = (const WCHAR**)accept_mimes;
189 WARN("GetBindString BINDSTRING_ACCEPT_MIMES failed: %08x\n", hres);
190 return INET_E_NO_VALID_MEDIA;
192 accept_mimes[num] = 0;
195 request_flags |= INTERNET_FLAG_SECURE;
197 hres = IUri_GetPathAndQuery(uri, &path);
198 if(SUCCEEDED(hres)) {
199 This->base.request = HttpOpenRequestW(This->base.connection,
200 This->base.bind_info.dwBindVerb < BINDVERB_CUSTOM
201 ? wszBindVerb[This->base.bind_info.dwBindVerb] : This->base.bind_info.szCustomVerb,
202 path, NULL, NULL, accept_types, request_flags, (DWORD_PTR)&This->base);
206 CoTaskMemFree(accept_mimes[num]);
209 if (!This->base.request) {
210 WARN("HttpOpenRequest failed: %d\n", GetLastError());
211 return INET_E_RESOURCE_NOT_FOUND;
214 hres = IInternetProtocolSink_QueryInterface(This->base.protocol_sink, &IID_IServiceProvider,
215 (void **)&service_provider);
217 WARN("IInternetProtocolSink_QueryInterface IID_IServiceProvider failed: %08x\n", hres);
221 hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
222 &IID_IHttpNegotiate, (void **)&This->http_negotiate);
224 WARN("IServiceProvider_QueryService IID_IHttpNegotiate failed: %08x\n", hres);
225 IServiceProvider_Release(service_provider);
229 hres = IUri_GetAbsoluteUri(uri, &url);
231 IServiceProvider_Release(service_provider);
235 hres = IHttpNegotiate_BeginningTransaction(This->http_negotiate, url, wszHeaders,
239 WARN("IHttpNegotiate_BeginningTransaction failed: %08x\n", hres);
240 IServiceProvider_Release(service_provider);
245 int len_addl_header = strlenW(addl_header);
247 This->full_header = heap_alloc(len_addl_header*sizeof(WCHAR)+sizeof(wszHeaders));
249 lstrcpyW(This->full_header, addl_header);
250 lstrcpyW(&This->full_header[len_addl_header], wszHeaders);
251 CoTaskMemFree(addl_header);
253 This->full_header = (LPWSTR)wszHeaders;
256 hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate2,
257 &IID_IHttpNegotiate2, (void **)&http_negotiate2);
258 IServiceProvider_Release(service_provider);
260 WARN("IServiceProvider_QueryService IID_IHttpNegotiate2 failed: %08x\n", hres);
261 /* No goto done as per native */
263 len = sizeof(security_id)/sizeof(security_id[0]);
264 hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, security_id, &len, 0);
265 IHttpNegotiate2_Release(http_negotiate2);
267 WARN("IHttpNegotiate2_GetRootSecurityId failed: %08x\n", hres);
270 /* FIXME: Handle security_id. Native calls undocumented function IsHostInProxyBypassList. */
272 if(This->base.bind_info.dwBindVerb == BINDVERB_POST) {
274 hres = IInternetBindInfo_GetBindString(bind_info, BINDSTRING_POST_COOKIE, &post_cookie, 1, &num);
275 if(hres == S_OK && num) {
276 if(!InternetSetOptionW(This->base.request, INTERNET_OPTION_SECONDARY_CACHE_KEY,
277 post_cookie, lstrlenW(post_cookie)))
278 WARN("InternetSetOption INTERNET_OPTION_SECONDARY_CACHE_KEY failed: %d\n", GetLastError());
279 CoTaskMemFree(post_cookie);
284 res = InternetSetOptionW(This->base.request, INTERNET_OPTION_HTTP_DECODING, &b, sizeof(b));
286 WARN("InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %08x\n", GetLastError());
288 error = send_http_request(This);
290 if(error == ERROR_IO_PENDING || error == ERROR_SUCCESS)
293 WARN("HttpSendRequest failed: %d\n", error);
294 return INET_E_DOWNLOAD_FAILURE;
297 static HRESULT HttpProtocol_end_request(Protocol *protocol)
301 res = HttpEndRequestW(protocol->request, NULL, 0, 0);
302 if(!res && GetLastError() != ERROR_IO_PENDING) {
303 FIXME("HttpEndRequest failed: %u\n", GetLastError());
310 static HRESULT HttpProtocol_start_downloading(Protocol *prot)
312 HttpProtocol *This = impl_from_Protocol(prot);
313 LPWSTR content_type, content_length, ranges;
314 DWORD len = sizeof(DWORD);
319 static const WCHAR wszDefaultContentType[] =
320 {'t','e','x','t','/','h','t','m','l',0};
322 if(!This->http_negotiate) {
323 WARN("Expected IHttpNegotiate pointer to be non-NULL\n");
327 res = HttpQueryInfoW(This->base.request, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER,
328 &status_code, &len, NULL);
330 LPWSTR response_headers = query_http_info(This, HTTP_QUERY_RAW_HEADERS_CRLF);
331 if(response_headers) {
332 hres = IHttpNegotiate_OnResponse(This->http_negotiate, status_code, response_headers,
334 heap_free(response_headers);
336 WARN("IHttpNegotiate_OnResponse failed: %08x\n", hres);
341 WARN("HttpQueryInfo failed: %d\n", GetLastError());
344 ranges = query_http_info(This, HTTP_QUERY_ACCEPT_RANGES);
346 IInternetProtocolSink_ReportProgress(This->base.protocol_sink, BINDSTATUS_ACCEPTRANGES, NULL);
350 content_type = query_http_info(This, HTTP_QUERY_CONTENT_TYPE);
352 /* remove the charset, if present */
353 LPWSTR p = strchrW(content_type, ';');
356 IInternetProtocolSink_ReportProgress(This->base.protocol_sink,
357 (This->base.bindf & BINDF_FROMURLMON)
358 ? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE,
360 heap_free(content_type);
362 WARN("HttpQueryInfo failed: %d\n", GetLastError());
363 IInternetProtocolSink_ReportProgress(This->base.protocol_sink,
364 (This->base.bindf & BINDF_FROMURLMON)
365 ? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE,
366 wszDefaultContentType);
369 content_length = query_http_info(This, HTTP_QUERY_CONTENT_LENGTH);
371 This->base.content_length = atoiW(content_length);
372 heap_free(content_length);
378 static void HttpProtocol_close_connection(Protocol *prot)
380 HttpProtocol *This = impl_from_Protocol(prot);
382 if(This->http_negotiate) {
383 IHttpNegotiate_Release(This->http_negotiate);
384 This->http_negotiate = 0;
387 if(This->full_header) {
388 if(This->full_header != wszHeaders)
389 heap_free(This->full_header);
390 This->full_header = 0;
394 static void HttpProtocol_on_error(Protocol *prot, DWORD error)
396 FIXME("(%p) %d - stub\n", prot, error);
399 static const ProtocolVtbl AsyncProtocolVtbl = {
400 HttpProtocol_open_request,
401 HttpProtocol_end_request,
402 HttpProtocol_start_downloading,
403 HttpProtocol_close_connection,
404 HttpProtocol_on_error
407 static HRESULT WINAPI HttpProtocol_QueryInterface(IInternetProtocolEx *iface, REFIID riid, void **ppv)
409 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
412 if(IsEqualGUID(&IID_IUnknown, riid)) {
413 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
414 *ppv = &This->IInternetProtocolEx_iface;
415 }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
416 TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
417 *ppv = &This->IInternetProtocolEx_iface;
418 }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
419 TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
420 *ppv = &This->IInternetProtocolEx_iface;
421 }else if(IsEqualGUID(&IID_IInternetProtocolEx, riid)) {
422 TRACE("(%p)->(IID_IInternetProtocolEx %p)\n", This, ppv);
423 *ppv = &This->IInternetProtocolEx_iface;
424 }else if(IsEqualGUID(&IID_IInternetPriority, riid)) {
425 TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv);
426 *ppv = &This->IInternetPriority_iface;
427 }else if(IsEqualGUID(&IID_IWinInetInfo, riid)) {
428 TRACE("(%p)->(IID_IWinInetInfo %p)\n", This, ppv);
429 *ppv = &This->IWinInetHttpInfo_iface;
430 }else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) {
431 TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv);
432 *ppv = &This->IWinInetHttpInfo_iface;
436 IInternetProtocol_AddRef(iface);
440 WARN("not supported interface %s\n", debugstr_guid(riid));
441 return E_NOINTERFACE;
444 static ULONG WINAPI HttpProtocol_AddRef(IInternetProtocolEx *iface)
446 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
447 LONG ref = InterlockedIncrement(&This->ref);
448 TRACE("(%p) ref=%d\n", This, ref);
452 static ULONG WINAPI HttpProtocol_Release(IInternetProtocolEx *iface)
454 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
455 LONG ref = InterlockedDecrement(&This->ref);
457 TRACE("(%p) ref=%d\n", This, ref);
460 protocol_close_connection(&This->base);
463 URLMON_UnlockModule();
469 static HRESULT WINAPI HttpProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szUrl,
470 IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
471 DWORD grfPI, HANDLE_PTR dwReserved)
473 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
477 TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink,
478 pOIBindInfo, grfPI, dwReserved);
480 hres = CreateUri(szUrl, 0, 0, &uri);
484 hres = IInternetProtocolEx_StartEx(&This->IInternetProtocolEx_iface, uri, pOIProtSink,
485 pOIBindInfo, grfPI, (HANDLE*)dwReserved);
491 static HRESULT WINAPI HttpProtocol_Continue(IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
493 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
495 TRACE("(%p)->(%p)\n", This, pProtocolData);
497 return protocol_continue(&This->base, pProtocolData);
500 static HRESULT WINAPI HttpProtocol_Abort(IInternetProtocolEx *iface, HRESULT hrReason,
503 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
505 TRACE("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
507 return protocol_abort(&This->base, hrReason);
510 static HRESULT WINAPI HttpProtocol_Terminate(IInternetProtocolEx *iface, DWORD dwOptions)
512 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
514 TRACE("(%p)->(%08x)\n", This, dwOptions);
516 protocol_close_connection(&This->base);
520 static HRESULT WINAPI HttpProtocol_Suspend(IInternetProtocolEx *iface)
522 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
523 FIXME("(%p)\n", This);
527 static HRESULT WINAPI HttpProtocol_Resume(IInternetProtocolEx *iface)
529 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
530 FIXME("(%p)\n", This);
534 static HRESULT WINAPI HttpProtocol_Read(IInternetProtocolEx *iface, void *pv,
535 ULONG cb, ULONG *pcbRead)
537 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
539 TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
541 return protocol_read(&This->base, pv, cb, pcbRead);
544 static HRESULT WINAPI HttpProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGER dlibMove,
545 DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
547 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
548 FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
552 static HRESULT WINAPI HttpProtocol_LockRequest(IInternetProtocolEx *iface, DWORD dwOptions)
554 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
556 TRACE("(%p)->(%08x)\n", This, dwOptions);
558 return protocol_lock_request(&This->base);
561 static HRESULT WINAPI HttpProtocol_UnlockRequest(IInternetProtocolEx *iface)
563 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
565 TRACE("(%p)\n", This);
567 return protocol_unlock_request(&This->base);
570 static HRESULT WINAPI HttpProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUri,
571 IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
572 DWORD grfPI, HANDLE *dwReserved)
574 HttpProtocol *This = impl_from_IInternetProtocolEx(iface);
578 TRACE("(%p)->(%p %p %p %08x %p)\n", This, pUri, pOIProtSink,
579 pOIBindInfo, grfPI, dwReserved);
581 hres = IUri_GetScheme(pUri, &scheme);
584 if(scheme != (This->https ? URL_SCHEME_HTTPS : URL_SCHEME_HTTP))
587 return protocol_start(&This->base, (IInternetProtocol*)&This->IInternetProtocolEx_iface, pUri,
588 pOIProtSink, pOIBindInfo);
591 static const IInternetProtocolExVtbl HttpProtocolVtbl = {
592 HttpProtocol_QueryInterface,
594 HttpProtocol_Release,
596 HttpProtocol_Continue,
598 HttpProtocol_Terminate,
599 HttpProtocol_Suspend,
603 HttpProtocol_LockRequest,
604 HttpProtocol_UnlockRequest,
608 static HRESULT WINAPI HttpPriority_QueryInterface(IInternetPriority *iface, REFIID riid, void **ppv)
610 HttpProtocol *This = impl_from_IInternetPriority(iface);
611 return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
614 static ULONG WINAPI HttpPriority_AddRef(IInternetPriority *iface)
616 HttpProtocol *This = impl_from_IInternetPriority(iface);
617 return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
620 static ULONG WINAPI HttpPriority_Release(IInternetPriority *iface)
622 HttpProtocol *This = impl_from_IInternetPriority(iface);
623 return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
626 static HRESULT WINAPI HttpPriority_SetPriority(IInternetPriority *iface, LONG nPriority)
628 HttpProtocol *This = impl_from_IInternetPriority(iface);
630 TRACE("(%p)->(%d)\n", This, nPriority);
632 This->base.priority = nPriority;
636 static HRESULT WINAPI HttpPriority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
638 HttpProtocol *This = impl_from_IInternetPriority(iface);
640 TRACE("(%p)->(%p)\n", This, pnPriority);
642 *pnPriority = This->base.priority;
646 static const IInternetPriorityVtbl HttpPriorityVtbl = {
647 HttpPriority_QueryInterface,
649 HttpPriority_Release,
650 HttpPriority_SetPriority,
651 HttpPriority_GetPriority
654 static HRESULT WINAPI HttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv)
656 HttpProtocol *This = impl_from_IWinInetHttpInfo(iface);
657 return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
660 static ULONG WINAPI HttpInfo_AddRef(IWinInetHttpInfo *iface)
662 HttpProtocol *This = impl_from_IWinInetHttpInfo(iface);
663 return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
666 static ULONG WINAPI HttpInfo_Release(IWinInetHttpInfo *iface)
668 HttpProtocol *This = impl_from_IWinInetHttpInfo(iface);
669 return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
672 static HRESULT WINAPI HttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption,
673 void *pBuffer, DWORD *pcbBuffer)
675 HttpProtocol *This = impl_from_IWinInetHttpInfo(iface);
676 FIXME("(%p)->(%x %p %p)\n", This, dwOption, pBuffer, pcbBuffer);
680 static HRESULT WINAPI HttpInfo_QueryInfo(IWinInetHttpInfo *iface, DWORD dwOption,
681 void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved)
683 HttpProtocol *This = impl_from_IWinInetHttpInfo(iface);
684 FIXME("(%p)->(%x %p %p %p %p)\n", This, dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved);
688 static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl = {
689 HttpInfo_QueryInterface,
692 HttpInfo_QueryOption,
696 static HRESULT create_http_protocol(BOOL https, void **ppobj)
700 ret = heap_alloc_zero(sizeof(HttpProtocol));
702 return E_OUTOFMEMORY;
704 ret->base.vtbl = &AsyncProtocolVtbl;
705 ret->IInternetProtocolEx_iface.lpVtbl = &HttpProtocolVtbl;
706 ret->IInternetPriority_iface.lpVtbl = &HttpPriorityVtbl;
707 ret->IWinInetHttpInfo_iface.lpVtbl = &WinInetHttpInfoVtbl;
712 *ppobj = &ret->IInternetProtocolEx_iface;
718 HRESULT HttpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
720 TRACE("(%p %p)\n", pUnkOuter, ppobj);
722 return create_http_protocol(FALSE, ppobj);
725 HRESULT HttpSProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
727 TRACE("(%p %p)\n", pUnkOuter, ppobj);
729 return create_http_protocol(TRUE, ppobj);