rpcrt4/tests: Fix a few more broken tests on NT4.
[wine.git] / dlls / urlmon / http.c
blob272b338779c11c7b1776684a01af1283bdf5cffb
1 /*
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
21 * TODO:
22 * - Handle redirects as native.
25 #include "urlmon_main.h"
26 #include "wininet.h"
28 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
32 typedef struct {
33 Protocol base;
35 const IInternetProtocolVtbl *lpIInternetProtocolVtbl;
36 const IInternetPriorityVtbl *lpInternetPriorityVtbl;
37 const IWinInetHttpInfoVtbl *lpWinInetHttpInfoVtbl;
39 BOOL https;
40 IHttpNegotiate *http_negotiate;
41 LPWSTR full_header;
43 LONG ref;
44 } HttpProtocol;
46 #define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl)
47 #define INETHTTPINFO(x) ((IWinInetHttpInfo*) &(x)->lpWinInetHttpInfoVtbl)
49 /* Default headers from native */
50 static const WCHAR wszHeaders[] = {'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g',
51 ':',' ','g','z','i','p',',',' ','d','e','f','l','a','t','e',0};
53 static LPWSTR query_http_info(HttpProtocol *This, DWORD option)
55 LPWSTR ret = NULL;
56 DWORD len = 0;
57 BOOL res;
59 res = HttpQueryInfoW(This->base.request, option, NULL, &len, NULL);
60 if (!res && GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
61 ret = heap_alloc(len);
62 res = HttpQueryInfoW(This->base.request, option, ret, &len, NULL);
64 if(!res) {
65 TRACE("HttpQueryInfoW(%d) failed: %08x\n", option, GetLastError());
66 heap_free(ret);
67 return NULL;
70 return ret;
73 #define ASYNCPROTOCOL_THIS(iface) DEFINE_THIS2(HttpProtocol, base, iface)
75 static HRESULT HttpProtocol_open_request(Protocol *prot, LPCWSTR url, DWORD request_flags,
76 IInternetBindInfo *bind_info)
78 HttpProtocol *This = ASYNCPROTOCOL_THIS(prot);
79 LPWSTR addl_header = NULL, post_cookie = NULL, optional = NULL;
80 IServiceProvider *service_provider = NULL;
81 IHttpNegotiate2 *http_negotiate2 = NULL;
82 LPWSTR host, user, pass, path;
83 LPOLESTR accept_mimes[257];
84 URL_COMPONENTSW url_comp;
85 BYTE security_id[512];
86 DWORD len = 0;
87 ULONG num = 0;
88 BOOL res;
89 HRESULT hres;
91 static const WCHAR wszBindVerb[BINDVERB_CUSTOM][5] =
92 {{'G','E','T',0},
93 {'P','O','S','T',0},
94 {'P','U','T',0}};
96 memset(&url_comp, 0, sizeof(url_comp));
97 url_comp.dwStructSize = sizeof(url_comp);
98 url_comp.dwSchemeLength = url_comp.dwHostNameLength = url_comp.dwUrlPathLength =
99 url_comp.dwUserNameLength = url_comp.dwPasswordLength = 1;
100 if (!InternetCrackUrlW(url, 0, 0, &url_comp))
101 return MK_E_SYNTAX;
103 if(!url_comp.nPort)
104 url_comp.nPort = This->https ? INTERNET_DEFAULT_HTTPS_PORT : INTERNET_DEFAULT_HTTP_PORT;
106 host = heap_strndupW(url_comp.lpszHostName, url_comp.dwHostNameLength);
107 user = heap_strndupW(url_comp.lpszUserName, url_comp.dwUserNameLength);
108 pass = heap_strndupW(url_comp.lpszPassword, url_comp.dwPasswordLength);
109 This->base.connection = InternetConnectW(This->base.internet, host, url_comp.nPort, user, pass,
110 INTERNET_SERVICE_HTTP, This->https ? INTERNET_FLAG_SECURE : 0, (DWORD_PTR)&This->base);
111 heap_free(pass);
112 heap_free(user);
113 heap_free(host);
114 if(!This->base.connection) {
115 WARN("InternetConnect failed: %d\n", GetLastError());
116 return INET_E_CANNOT_CONNECT;
119 num = sizeof(accept_mimes)/sizeof(accept_mimes[0])-1;
120 hres = IInternetBindInfo_GetBindString(bind_info, BINDSTRING_ACCEPT_MIMES, accept_mimes, num, &num);
121 if(hres != S_OK) {
122 WARN("GetBindString BINDSTRING_ACCEPT_MIMES failed: %08x\n", hres);
123 return INET_E_NO_VALID_MEDIA;
125 accept_mimes[num] = 0;
127 path = heap_strndupW(url_comp.lpszUrlPath, url_comp.dwUrlPathLength);
128 if(This->https)
129 request_flags |= INTERNET_FLAG_SECURE;
130 This->base.request = HttpOpenRequestW(This->base.connection,
131 This->base.bind_info.dwBindVerb < BINDVERB_CUSTOM
132 ? wszBindVerb[This->base.bind_info.dwBindVerb] : This->base.bind_info.szCustomVerb,
133 path, NULL, NULL, (LPCWSTR *)accept_mimes, request_flags, (DWORD_PTR)&This->base);
134 heap_free(path);
135 while (num<sizeof(accept_mimes)/sizeof(accept_mimes[0]) && accept_mimes[num])
136 CoTaskMemFree(accept_mimes[num++]);
137 if (!This->base.request) {
138 WARN("HttpOpenRequest failed: %d\n", GetLastError());
139 return INET_E_RESOURCE_NOT_FOUND;
142 hres = IInternetProtocolSink_QueryInterface(This->base.protocol_sink, &IID_IServiceProvider,
143 (void **)&service_provider);
144 if (hres != S_OK) {
145 WARN("IInternetProtocolSink_QueryInterface IID_IServiceProvider failed: %08x\n", hres);
146 return hres;
149 hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
150 &IID_IHttpNegotiate, (void **)&This->http_negotiate);
151 if (hres != S_OK) {
152 WARN("IServiceProvider_QueryService IID_IHttpNegotiate failed: %08x\n", hres);
153 return hres;
156 hres = IHttpNegotiate_BeginningTransaction(This->http_negotiate, url, wszHeaders,
157 0, &addl_header);
158 if(hres != S_OK) {
159 WARN("IHttpNegotiate_BeginningTransaction failed: %08x\n", hres);
160 IServiceProvider_Release(service_provider);
161 return hres;
164 if(addl_header) {
165 int len_addl_header = strlenW(addl_header);
167 This->full_header = heap_alloc(len_addl_header*sizeof(WCHAR)+sizeof(wszHeaders));
169 lstrcpyW(This->full_header, addl_header);
170 lstrcpyW(&This->full_header[len_addl_header], wszHeaders);
171 CoTaskMemFree(addl_header);
172 }else {
173 This->full_header = (LPWSTR)wszHeaders;
176 hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate2,
177 &IID_IHttpNegotiate2, (void **)&http_negotiate2);
178 IServiceProvider_Release(service_provider);
179 if(hres != S_OK) {
180 WARN("IServiceProvider_QueryService IID_IHttpNegotiate2 failed: %08x\n", hres);
181 /* No goto done as per native */
182 }else {
183 len = sizeof(security_id)/sizeof(security_id[0]);
184 hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, security_id, &len, 0);
185 IHttpNegotiate2_Release(http_negotiate2);
186 if (hres != S_OK)
187 WARN("IHttpNegotiate2_GetRootSecurityId failed: %08x\n", hres);
190 /* FIXME: Handle security_id. Native calls undocumented function IsHostInProxyBypassList. */
192 if(This->base.bind_info.dwBindVerb == BINDVERB_POST) {
193 num = 0;
194 hres = IInternetBindInfo_GetBindString(bind_info, BINDSTRING_POST_COOKIE, &post_cookie, 1, &num);
195 if(hres == S_OK && num) {
196 if(!InternetSetOptionW(This->base.request, INTERNET_OPTION_SECONDARY_CACHE_KEY,
197 post_cookie, lstrlenW(post_cookie)))
198 WARN("InternetSetOption INTERNET_OPTION_SECONDARY_CACHE_KEY failed: %d\n", GetLastError());
199 CoTaskMemFree(post_cookie);
203 if(This->base.bind_info.dwBindVerb != BINDVERB_GET) {
204 /* Native does not use GlobalLock/GlobalUnlock, so we won't either */
205 if (This->base.bind_info.stgmedData.tymed != TYMED_HGLOBAL)
206 WARN("Expected This->base.bind_info.stgmedData.tymed to be TYMED_HGLOBAL, not %d\n",
207 This->base.bind_info.stgmedData.tymed);
208 else
209 optional = (LPWSTR)This->base.bind_info.stgmedData.u.hGlobal;
212 res = HttpSendRequestW(This->base.request, This->full_header, lstrlenW(This->full_header),
213 optional, optional ? This->base.bind_info.cbstgmedData : 0);
214 if(!res && GetLastError() != ERROR_IO_PENDING) {
215 WARN("HttpSendRequest failed: %d\n", GetLastError());
216 return INET_E_DOWNLOAD_FAILURE;
219 return S_OK;
222 static HRESULT HttpProtocol_start_downloading(Protocol *prot)
224 HttpProtocol *This = ASYNCPROTOCOL_THIS(prot);
225 LPWSTR content_type = 0, content_length = 0;
226 DWORD len = sizeof(DWORD);
227 DWORD status_code;
228 BOOL res;
229 HRESULT hres;
231 static const WCHAR wszDefaultContentType[] =
232 {'t','e','x','t','/','h','t','m','l',0};
234 if(!This->http_negotiate) {
235 WARN("Expected IHttpNegotiate pointer to be non-NULL\n");
236 return S_OK;
239 res = HttpQueryInfoW(This->base.request, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER,
240 &status_code, &len, NULL);
241 if(res) {
242 LPWSTR response_headers = query_http_info(This, HTTP_QUERY_RAW_HEADERS_CRLF);
243 if(response_headers) {
244 hres = IHttpNegotiate_OnResponse(This->http_negotiate, status_code, response_headers,
245 NULL, NULL);
246 heap_free(response_headers);
247 if (hres != S_OK) {
248 WARN("IHttpNegotiate_OnResponse failed: %08x\n", hres);
249 return S_OK;
252 }else {
253 WARN("HttpQueryInfo failed: %d\n", GetLastError());
256 if(This->https)
257 IInternetProtocolSink_ReportProgress(This->base.protocol_sink, BINDSTATUS_ACCEPTRANGES, NULL);
259 content_type = query_http_info(This, HTTP_QUERY_CONTENT_TYPE);
260 if(content_type) {
261 /* remove the charset, if present */
262 LPWSTR p = strchrW(content_type, ';');
263 if (p) *p = '\0';
265 IInternetProtocolSink_ReportProgress(This->base.protocol_sink,
266 (This->base.bindf & BINDF_FROMURLMON)
267 ? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE,
268 content_type);
269 heap_free(content_type);
270 }else {
271 WARN("HttpQueryInfo failed: %d\n", GetLastError());
272 IInternetProtocolSink_ReportProgress(This->base.protocol_sink,
273 (This->base.bindf & BINDF_FROMURLMON)
274 ? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE,
275 wszDefaultContentType);
278 content_length = query_http_info(This, HTTP_QUERY_CONTENT_LENGTH);
279 if(content_length) {
280 This->base.content_length = atoiW(content_length);
281 heap_free(content_length);
284 return S_OK;
287 static void HttpProtocol_close_connection(Protocol *prot)
289 HttpProtocol *This = ASYNCPROTOCOL_THIS(prot);
291 if(This->http_negotiate) {
292 IHttpNegotiate_Release(This->http_negotiate);
293 This->http_negotiate = 0;
296 if(This->full_header) {
297 if(This->full_header != wszHeaders)
298 heap_free(This->full_header);
299 This->full_header = 0;
303 #undef ASYNCPROTOCOL_THIS
305 static const ProtocolVtbl AsyncProtocolVtbl = {
306 HttpProtocol_open_request,
307 HttpProtocol_start_downloading,
308 HttpProtocol_close_connection
311 #define PROTOCOL_THIS(iface) DEFINE_THIS(HttpProtocol, IInternetProtocol, iface)
313 static HRESULT WINAPI HttpProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
315 HttpProtocol *This = PROTOCOL_THIS(iface);
317 *ppv = NULL;
318 if(IsEqualGUID(&IID_IUnknown, riid)) {
319 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
320 *ppv = PROTOCOL(This);
321 }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
322 TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
323 *ppv = PROTOCOL(This);
324 }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
325 TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
326 *ppv = PROTOCOL(This);
327 }else if(IsEqualGUID(&IID_IInternetPriority, riid)) {
328 TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv);
329 *ppv = PRIORITY(This);
330 }else if(IsEqualGUID(&IID_IWinInetInfo, riid)) {
331 TRACE("(%p)->(IID_IWinInetInfo %p)\n", This, ppv);
332 *ppv = INETHTTPINFO(This);
333 }else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) {
334 TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv);
335 *ppv = INETHTTPINFO(This);
338 if(*ppv) {
339 IInternetProtocol_AddRef(iface);
340 return S_OK;
343 WARN("not supported interface %s\n", debugstr_guid(riid));
344 return E_NOINTERFACE;
347 static ULONG WINAPI HttpProtocol_AddRef(IInternetProtocol *iface)
349 HttpProtocol *This = PROTOCOL_THIS(iface);
350 LONG ref = InterlockedIncrement(&This->ref);
351 TRACE("(%p) ref=%d\n", This, ref);
352 return ref;
355 static ULONG WINAPI HttpProtocol_Release(IInternetProtocol *iface)
357 HttpProtocol *This = PROTOCOL_THIS(iface);
358 LONG ref = InterlockedDecrement(&This->ref);
360 TRACE("(%p) ref=%d\n", This, ref);
362 if(!ref) {
363 protocol_close_connection(&This->base);
364 heap_free(This);
366 URLMON_UnlockModule();
369 return ref;
372 static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
373 IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
374 DWORD grfPI, HANDLE_PTR dwReserved)
376 HttpProtocol *This = PROTOCOL_THIS(iface);
378 static const WCHAR httpW[] = {'h','t','t','p',':'};
379 static const WCHAR httpsW[] = {'h','t','t','p','s',':'};
381 TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink,
382 pOIBindInfo, grfPI, dwReserved);
384 if(This->https
385 ? strncmpW(szUrl, httpsW, sizeof(httpsW)/sizeof(WCHAR))
386 : strncmpW(szUrl, httpW, sizeof(httpW)/sizeof(WCHAR)))
387 return MK_E_SYNTAX;
389 return protocol_start(&This->base, PROTOCOL(This), szUrl, pOIProtSink, pOIBindInfo);
392 static HRESULT WINAPI HttpProtocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
394 HttpProtocol *This = PROTOCOL_THIS(iface);
396 TRACE("(%p)->(%p)\n", This, pProtocolData);
398 return protocol_continue(&This->base, pProtocolData);
401 static HRESULT WINAPI HttpProtocol_Abort(IInternetProtocol *iface, HRESULT hrReason,
402 DWORD dwOptions)
404 HttpProtocol *This = PROTOCOL_THIS(iface);
405 FIXME("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
406 return E_NOTIMPL;
409 static HRESULT WINAPI HttpProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions)
411 HttpProtocol *This = PROTOCOL_THIS(iface);
413 TRACE("(%p)->(%08x)\n", This, dwOptions);
415 protocol_close_connection(&This->base);
416 return S_OK;
419 static HRESULT WINAPI HttpProtocol_Suspend(IInternetProtocol *iface)
421 HttpProtocol *This = PROTOCOL_THIS(iface);
422 FIXME("(%p)\n", This);
423 return E_NOTIMPL;
426 static HRESULT WINAPI HttpProtocol_Resume(IInternetProtocol *iface)
428 HttpProtocol *This = PROTOCOL_THIS(iface);
429 FIXME("(%p)\n", This);
430 return E_NOTIMPL;
433 static HRESULT WINAPI HttpProtocol_Read(IInternetProtocol *iface, void *pv,
434 ULONG cb, ULONG *pcbRead)
436 HttpProtocol *This = PROTOCOL_THIS(iface);
438 TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
440 return protocol_read(&This->base, pv, cb, pcbRead);
443 static HRESULT WINAPI HttpProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove,
444 DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
446 HttpProtocol *This = PROTOCOL_THIS(iface);
447 FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
448 return E_NOTIMPL;
451 static HRESULT WINAPI HttpProtocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
453 HttpProtocol *This = PROTOCOL_THIS(iface);
455 TRACE("(%p)->(%08x)\n", This, dwOptions);
457 return protocol_lock_request(&This->base);
460 static HRESULT WINAPI HttpProtocol_UnlockRequest(IInternetProtocol *iface)
462 HttpProtocol *This = PROTOCOL_THIS(iface);
464 TRACE("(%p)\n", This);
466 return protocol_unlock_request(&This->base);
469 #undef PROTOCOL_THIS
471 static const IInternetProtocolVtbl HttpProtocolVtbl = {
472 HttpProtocol_QueryInterface,
473 HttpProtocol_AddRef,
474 HttpProtocol_Release,
475 HttpProtocol_Start,
476 HttpProtocol_Continue,
477 HttpProtocol_Abort,
478 HttpProtocol_Terminate,
479 HttpProtocol_Suspend,
480 HttpProtocol_Resume,
481 HttpProtocol_Read,
482 HttpProtocol_Seek,
483 HttpProtocol_LockRequest,
484 HttpProtocol_UnlockRequest
487 #define PRIORITY_THIS(iface) DEFINE_THIS(HttpProtocol, InternetPriority, iface)
489 static HRESULT WINAPI HttpPriority_QueryInterface(IInternetPriority *iface, REFIID riid, void **ppv)
491 HttpProtocol *This = PRIORITY_THIS(iface);
492 return IInternetProtocol_QueryInterface(PROTOCOL(This), riid, ppv);
495 static ULONG WINAPI HttpPriority_AddRef(IInternetPriority *iface)
497 HttpProtocol *This = PRIORITY_THIS(iface);
498 return IInternetProtocol_AddRef(PROTOCOL(This));
501 static ULONG WINAPI HttpPriority_Release(IInternetPriority *iface)
503 HttpProtocol *This = PRIORITY_THIS(iface);
504 return IInternetProtocol_Release(PROTOCOL(This));
507 static HRESULT WINAPI HttpPriority_SetPriority(IInternetPriority *iface, LONG nPriority)
509 HttpProtocol *This = PRIORITY_THIS(iface);
511 TRACE("(%p)->(%d)\n", This, nPriority);
513 This->base.priority = nPriority;
514 return S_OK;
517 static HRESULT WINAPI HttpPriority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
519 HttpProtocol *This = PRIORITY_THIS(iface);
521 TRACE("(%p)->(%p)\n", This, pnPriority);
523 *pnPriority = This->base.priority;
524 return S_OK;
527 #undef PRIORITY_THIS
529 static const IInternetPriorityVtbl HttpPriorityVtbl = {
530 HttpPriority_QueryInterface,
531 HttpPriority_AddRef,
532 HttpPriority_Release,
533 HttpPriority_SetPriority,
534 HttpPriority_GetPriority
537 #define INETINFO_THIS(iface) DEFINE_THIS(HttpProtocol, WinInetHttpInfo, iface)
539 static HRESULT WINAPI HttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv)
541 HttpProtocol *This = INETINFO_THIS(iface);
542 return IBinding_QueryInterface(PROTOCOL(This), riid, ppv);
545 static ULONG WINAPI HttpInfo_AddRef(IWinInetHttpInfo *iface)
547 HttpProtocol *This = INETINFO_THIS(iface);
548 return IBinding_AddRef(PROTOCOL(This));
551 static ULONG WINAPI HttpInfo_Release(IWinInetHttpInfo *iface)
553 HttpProtocol *This = INETINFO_THIS(iface);
554 return IBinding_Release(PROTOCOL(This));
557 static HRESULT WINAPI HttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption,
558 void *pBuffer, DWORD *pcbBuffer)
560 HttpProtocol *This = INETINFO_THIS(iface);
561 FIXME("(%p)->(%x %p %p)\n", This, dwOption, pBuffer, pcbBuffer);
562 return E_NOTIMPL;
565 static HRESULT WINAPI HttpInfo_QueryInfo(IWinInetHttpInfo *iface, DWORD dwOption,
566 void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved)
568 HttpProtocol *This = INETINFO_THIS(iface);
569 FIXME("(%p)->(%x %p %p %p %p)\n", This, dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved);
570 return E_NOTIMPL;
573 #undef INETINFO_THIS
575 static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl = {
576 HttpInfo_QueryInterface,
577 HttpInfo_AddRef,
578 HttpInfo_Release,
579 HttpInfo_QueryOption,
580 HttpInfo_QueryInfo
583 static HRESULT create_http_protocol(BOOL https, void **ppobj)
585 HttpProtocol *ret;
587 ret = heap_alloc_zero(sizeof(HttpProtocol));
588 if(!ret)
589 return E_OUTOFMEMORY;
591 ret->base.vtbl = &AsyncProtocolVtbl;
592 ret->lpIInternetProtocolVtbl = &HttpProtocolVtbl;
593 ret->lpInternetPriorityVtbl = &HttpPriorityVtbl;
594 ret->lpWinInetHttpInfoVtbl = &WinInetHttpInfoVtbl;
596 ret->https = https;
597 ret->ref = 1;
599 *ppobj = PROTOCOL(ret);
601 URLMON_LockModule();
602 return S_OK;
605 HRESULT HttpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
607 TRACE("(%p %p)\n", pUnkOuter, ppobj);
609 return create_http_protocol(FALSE, ppobj);
612 HRESULT HttpSProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
614 TRACE("(%p %p)\n", pUnkOuter, ppobj);
616 return create_http_protocol(TRUE, ppobj);