ReactOS 0.4.16-dev-401-g45b008d
url.c
Go to the documentation of this file.
1/*
2 * UrlMon URL tests
3 *
4 * Copyright 2004 Kevin Koltzau
5 * Copyright 2004-2007 Jacek Caban for CodeWeavers
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include <stdarg.h>
23#include <stdio.h>
24
25#define COBJMACROS
26#define NONAMELESSUNION
27#define CONST_VTABLE
28
29#include "windef.h"
30#include "winbase.h"
31#include "initguid.h"
32#include "urlmon.h"
33#include "wininet.h"
34#include "mshtml.h"
35#include "shlwapi.h"
36
37#include "wine/test.h"
38
39static HRESULT (WINAPI *pCreateAsyncBindCtxEx)(IBindCtx *, DWORD,
41static HRESULT (WINAPI *pCreateUri)(LPCWSTR, DWORD, DWORD_PTR, IUri**);
42
43DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
44DEFINE_GUID(CLSID_IdentityUnmarshal,0x0000001b,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
45DEFINE_GUID(IID_IBindStatusCallbackHolder,0x79eac9cc,0xbaf9,0x11ce,0x8c,0x82,0x00,0xaa,0x00,0x4b,0xa9,0x0b);
46static const IID IID_undocumentedIE11 = {0xd5ae15f6,0x2032,0x488e,{0x8f,0x96,0xf9,0x24,0x06,0xd8,0xd8,0xb4}};
48
49#define DEFINE_EXPECT(func) \
50 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
51
52#define SET_EXPECT(func) \
53 do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)
54
55#define CHECK_EXPECT2(func) \
56 do { \
57 ok(expect_ ##func, "unexpected call " #func "\n"); \
58 called_ ## func = TRUE; \
59 }while(0)
60
61#define CHECK_EXPECT(func) \
62 do { \
63 CHECK_EXPECT2(func); \
64 expect_ ## func = FALSE; \
65 }while(0)
66
67#define CHECK_CALLED(func) \
68 do { \
69 ok(called_ ## func, "expected " #func "\n"); \
70 expect_ ## func = called_ ## func = FALSE; \
71 }while(0)
72
73#define CHECK_NOT_CALLED(func) \
74 do { \
75 ok(!called_ ## func, "unexpected " #func "\n"); \
76 expect_ ## func = called_ ## func = FALSE; \
77 }while(0)
78
79#define CHECK_CALLED_BROKEN(func) \
80 do { \
81 ok(called_ ## func || broken(!called_ ## func), "expected " #func "\n"); \
82 expect_ ## func = called_ ## func = FALSE; \
83 }while(0)
84
85#define CLEAR_CALLED(func) \
86 expect_ ## func = called_ ## func = FALSE
87
88DEFINE_EXPECT(QueryInterface_IServiceProvider);
89DEFINE_EXPECT(QueryInterface_IHttpNegotiate);
90DEFINE_EXPECT(QueryInterface_IBindStatusCallback);
91DEFINE_EXPECT(QueryInterface_IBindStatusCallbackEx);
92DEFINE_EXPECT(QueryInterface_IBindStatusCallbackHolder);
93DEFINE_EXPECT(QueryInterface_IAuthenticate);
94DEFINE_EXPECT(QueryInterface_IInternetProtocol);
95DEFINE_EXPECT(QueryInterface_IWindowForBindingUI);
96DEFINE_EXPECT(QueryInterface_IHttpSecurity);
97DEFINE_EXPECT(QueryService_IAuthenticate);
98DEFINE_EXPECT(QueryService_IInternetProtocol);
99DEFINE_EXPECT(QueryService_IInternetBindInfo);
100DEFINE_EXPECT(QueryService_IWindowForBindingUI);
101DEFINE_EXPECT(QueryService_IHttpSecurity);
102DEFINE_EXPECT(BeginningTransaction);
103DEFINE_EXPECT(OnResponse);
104DEFINE_EXPECT(QueryInterface_IHttpNegotiate2);
105DEFINE_EXPECT(GetRootSecurityId);
106DEFINE_EXPECT(GetBindInfo);
107DEFINE_EXPECT(GetBindInfoEx);
108DEFINE_EXPECT(OnStartBinding);
109DEFINE_EXPECT(OnProgress_FINDINGRESOURCE);
110DEFINE_EXPECT(OnProgress_CONNECTING);
111DEFINE_EXPECT(OnProgress_REDIRECTING);
112DEFINE_EXPECT(OnProgress_SENDINGREQUEST);
113DEFINE_EXPECT(OnProgress_MIMETYPEAVAILABLE);
114DEFINE_EXPECT(OnProgress_BEGINDOWNLOADDATA);
115DEFINE_EXPECT(OnProgress_DOWNLOADINGDATA);
116DEFINE_EXPECT(OnProgress_ENDDOWNLOADDATA);
117DEFINE_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
118DEFINE_EXPECT(OnStopBinding);
119DEFINE_EXPECT(OnDataAvailable);
120DEFINE_EXPECT(OnObjectAvailable);
121DEFINE_EXPECT(Obj_OnStartBinding);
122DEFINE_EXPECT(Obj_OnStopBinding);
123DEFINE_EXPECT(Obj_GetBindInfo);
124DEFINE_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
125DEFINE_EXPECT(Obj_OnProgress_ENDDOWNLOADDATA);
126DEFINE_EXPECT(Obj_OnProgress_SENDINGREQUEST);
127DEFINE_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
128DEFINE_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
129DEFINE_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
130DEFINE_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
131DEFINE_EXPECT(Obj_OnProgress_FINDINGRESOURCE);
132DEFINE_EXPECT(Obj_OnProgress_CONNECTING);
133DEFINE_EXPECT(Obj_OnProgress_REDIRECTING);
134DEFINE_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
138DEFINE_EXPECT(Terminate);
142DEFINE_EXPECT(CreateInstance);
144DEFINE_EXPECT(PutProperty_MIMETYPEPROP);
145DEFINE_EXPECT(PutProperty_CLASSIDPROP);
147DEFINE_EXPECT(GetWindow_IHttpSecurity);
148DEFINE_EXPECT(GetWindow_IWindowForBindingUI);
149DEFINE_EXPECT(GetWindow_ICodeInstall);
150DEFINE_EXPECT(OnSecurityProblem);
151
152static const WCHAR winetest_data_urlW[] =
153 {'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g','/',
154 't','e','s','t','s','/','d','a','t','a','.','p','h','p',0};
155static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
156
157static const WCHAR wszTextHtml[] = {'t','e','x','t','/','h','t','m','l',0};
158
159static WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 };
160
161static const WCHAR wszWineHQSite[] =
162 {'w','w','w','.','w','i','n','e','h','q','.','o','r','g',0};
163static const WCHAR wszWineHQIP[] =
164 {'4','.','1','5','.','1','8','4','.','7','7',0};
165static const CHAR wszIndexHtmlA[] = "index.html";
166static const WCHAR cache_fileW[] = {'c',':','\\','c','a','c','h','e','.','h','t','m',0};
167static const CHAR dwl_htmlA[] = "dwl.html";
168static const WCHAR dwl_htmlW[] = {'d','w','l','.','h','t','m','l',0};
169static const CHAR test_txtA[] = "test.txt";
170static const WCHAR emptyW[] = {0};
171
175static const WCHAR *reported_url;
176static CHAR mime_type[512];
194static const char *test_file;
195
197
198static enum {
209
210static enum {
215
216static BOOL proxy_active(void)
217{
220 DWORD size;
221
222 if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
224 return FALSE;
225
226 size = sizeof(DWORD);
228 proxy_enable = 0;
229
231
232 return proxy_enable != 0;
233}
234
235static BOOL is_urlmon_protocol(int prot)
236{
237 return prot == FILE_TEST || prot == HTTP_TEST || prot == HTTPS_TEST || prot == FTP_TEST || prot == MK_TEST;
238}
239
241{
242 HRESULT hr;
243 IMoniker *mon1 = NULL;
244 IMoniker *mon2 = NULL;
245
247 ok(hr == E_INVALIDARG,
248 "Expected CreateURLMoniker to return E_INVALIDARG, got 0x%08x\n", hr);
249
250 mon1 = (IMoniker *)0xdeadbeef;
251 hr = CreateURLMoniker(NULL, NULL, &mon1);
252 ok(hr == E_INVALIDARG,
253 "Expected CreateURLMoniker to return E_INVALIDARG, got 0x%08x\n", hr);
254 ok(mon1 == NULL, "Expected the output pointer to be NULL, got %p\n", mon1);
255
257 ok(hr == E_INVALIDARG,
258 "Expected CreateURLMoniker to return E_INVALIDARG, got 0x%08x\n", hr);
259
260 hr = CreateURLMoniker(NULL, emptyW, &mon1);
261 ok(hr == S_OK ||
262 broken(hr == MK_E_SYNTAX), /* IE5/IE5.01/IE6 SP2 */
263 "Expected CreateURLMoniker to return S_OK, got 0x%08x\n", hr);
264 if(mon1) IMoniker_Release(mon1);
265
266 hr = CreateURLMoniker(NULL, url1, &mon1);
267 ok(hr == S_OK, "failed to create moniker: 0x%08x\n", hr);
268 if(hr == S_OK) {
269 hr = CreateURLMoniker(mon1, url2, &mon2);
270 ok(hr == S_OK, "failed to create moniker: 0x%08x\n", hr);
271 }
272 if(mon1) IMoniker_Release(mon1);
273 if(mon2) IMoniker_Release(mon2);
274}
275
276static void test_create(void)
277{
278 static const WCHAR relativeW[] = {'a','/','b','.','t','x','t',0};
280 IMoniker *mon;
281 IBindCtx *bctx;
282 HRESULT hr;
283
284 static const WCHAR TEST_PART_URL_1[] = {'/','t','e','s','t','s','/','d','a','t','a','.','p','h','p',0};
285
287
288 mon = (void*)0xdeadbeef;
289 hr = CreateURLMoniker(NULL, relativeW, &mon);
290 ok(hr == S_OK, "got 0x%08x\n", hr);
291
292 hr = CreateBindCtx(0, &bctx);
293 ok(hr == S_OK, "got 0x%08x\n", hr);
294
295 stream = (void*)0xdeadbeef;
296 hr = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, (void**)&stream);
297 todo_wine ok(hr == INET_E_UNKNOWN_PROTOCOL, "got 0x%08x\n", hr);
298 ok(stream == NULL, "got %p\n", stream);
299
300 hr = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, NULL);
301 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
302
303 stream = (void*)0xdeadbeef;
304 hr = IMoniker_BindToStorage(mon, NULL, NULL, &IID_IStream, (void**)&stream);
305 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
306 ok(stream == NULL || broken(stream == (void*)0xdeadbeef) /* starting XP SP3 it's set to null */,
307 "got %p\n", stream);
308
309 IMoniker_Release(mon);
310
311 mon = (void*)0xdaedbeef;
313 ok(hr == S_OK, "got 0x%08x\n", hr);
314
315 stream = (void*)0xdeadbeef;
316 hr = IMoniker_BindToStorage(mon, NULL, NULL, &IID_IStream, (void**)&stream);
317 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
318 ok(stream == NULL || broken(stream == (void*)0xdeadbeef) /* starting XP SP3 it's set to null */,
319 "got %p\n", stream);
320
321 hr = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, NULL);
322 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
323
324 IMoniker_Release(mon);
325 IBindCtx_Release(bctx);
326}
327
329{
330 ok(0, "unexpected call\n");
331 return E_NOINTERFACE;
332}
333
335{
336 return 2;
337}
338
340{
341 return 1;
342}
343
345{
347 ok(!nPriority, "nPriority = %d\n", nPriority);
348 return S_OK;
349}
350
352{
353 ok(0, "unexpected call\n");
354 return S_OK;
355}
356
357static const IInternetPriorityVtbl InternetPriorityVtbl = {
363};
364
366
368{
369 static const IID IID_undocumentedIE10 = {0x7daf9908,0x8415,0x4005,{0x95,0xae,0xbd,0x27,0xf6,0xe3,0xdc,0x00}};
370
371 *ppv = NULL;
372
373 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IInternetProtocol, riid)) {
374 *ppv = iface;
375 return S_OK;
376 }
377
378 if(IsEqualGUID(&IID_IInternetPriority, riid)) {
380 return E_NOINTERFACE;
381
383 return S_OK;
384 }
385
386 if(IsEqualGUID(&IID_IInternetProtocolEx, riid))
387 return E_NOINTERFACE; /* TODO */
388
389 if(IsEqualGUID(&IID_undocumentedIE10, riid)) {
390 trace("QI(%s)\n", wine_dbgstr_guid(riid));
391 return E_NOINTERFACE; /* TODO */
392 }
393
394 ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
395 return E_NOINTERFACE;
396}
397
399{
400 return 2;
401}
402
404{
405 return 1;
406}
407
408static void test_switch_fail(void)
409{
411 PROTOCOLDATA protocoldata = {0};
413
414 static BOOL tested_switch_fail;
415
416 if(tested_switch_fail)
417 return;
418
419 tested_switch_fail = TRUE;
420
421 hres = IBinding_QueryInterface(current_binding, &IID_IInternetProtocolSink, (void**)&binding_sink);
422 ok(hres == S_OK, "Could not get IInternetProtocolSink iface: %08x\n", hres);
423 if(SUCCEEDED(hres)) {
424 hres = IInternetProtocolSink_Switch(binding_sink, &protocoldata);
425 ok(hres == E_FAIL, "Switch failed: %08x, expected E_FAIL\n", hres);
426 IInternetProtocolSink_Release(binding_sink);
427 }
428}
429
431{
432 PROTOCOLDATA protocoldata = {0};
434
435 if(!no_callback) {
437 SET_EXPECT(Obj_OnProgress_FINDINGRESOURCE);
438 else
439 SET_EXPECT(OnProgress_FINDINGRESOURCE);
440 }
441 hres = IInternetProtocolSink_ReportProgress(protocol_sink,
442 BINDSTATUS_FINDINGRESOURCE, wszWineHQSite);
443 ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
444 if(!no_callback) {
445 ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
447 CHECK_CALLED(Obj_OnProgress_FINDINGRESOURCE);
448 else
449 CHECK_CALLED(OnProgress_FINDINGRESOURCE);
450 }
451
452 if(!no_callback) {
454 SET_EXPECT(Obj_OnProgress_CONNECTING);
455 else
456 SET_EXPECT(OnProgress_CONNECTING);
457 }
458 hres = IInternetProtocolSink_ReportProgress(protocol_sink,
459 BINDSTATUS_CONNECTING, wszWineHQIP);
460 ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
461 if(!no_callback) {
462 ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
464 CHECK_CALLED(Obj_OnProgress_CONNECTING);
465 else
466 CHECK_CALLED(OnProgress_CONNECTING);
467 }
468
469 if(!no_callback) {
471 SET_EXPECT(Obj_OnProgress_SENDINGREQUEST);
472 else
473 SET_EXPECT(OnProgress_SENDINGREQUEST);
474 }
475 hres = IInternetProtocolSink_ReportProgress(protocol_sink,
476 BINDSTATUS_SENDINGREQUEST, NULL);
477 ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
478 if(!no_callback) {
479 ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
481 CHECK_CALLED(Obj_OnProgress_SENDINGREQUEST);
482 else
483 CHECK_CALLED(OnProgress_SENDINGREQUEST);
484 }
485
486 if(test_redirect) {
488 SET_EXPECT(Obj_OnProgress_REDIRECTING);
489 else
490 SET_EXPECT(OnProgress_REDIRECTING);
491 hres = IInternetProtocolSink_ReportProgress(protocol_sink, BINDSTATUS_REDIRECTING, winetest_data_urlW);
492 ok(hres == S_OK, "ReportProgress(BINDSTATUS_REFIRECTING) failed: %08x\n", hres);
493 ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
495 CHECK_CALLED(Obj_OnProgress_REDIRECTING);
496 else
497 CHECK_CALLED(OnProgress_REDIRECTING);
498 }
499
501
502 SET_EXPECT(Continue);
503 prot_state = 1;
504 hres = IInternetProtocolSink_Switch(protocol_sink, &protocoldata);
505 ok(hres == S_OK, "Switch failed: %08x\n", hres);
506 ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
507
508 CHECK_CALLED(Continue);
510 if(bind_to_object) {
511 CHECK_CALLED(Obj_OnProgress_MIMETYPEAVAILABLE);
512 CHECK_CALLED(Obj_OnProgress_BEGINDOWNLOADDATA);
513 CHECK_CALLED(Obj_OnProgress_CLASSIDAVAILABLE);
514 CHECK_CALLED(Obj_OnProgress_BEGINSYNCOPERATION);
515 CHECK_CALLED(CreateInstance);
516 CHECK_CALLED(PutProperty_MIMETYPEPROP);
517 CHECK_CALLED_BROKEN(PutProperty_CLASSIDPROP);
518 CHECK_CALLED(Load);
519 CHECK_CALLED(Obj_OnProgress_ENDSYNCOPERATION);
520 CHECK_CALLED(OnObjectAvailable);
521 CHECK_CALLED(Obj_OnStopBinding);
522 }else if(!no_callback) {
523 CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
524 CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
525 CHECK_CALLED(OnDataAvailable);
526 }else {
528 }
529
530 SET_EXPECT(Continue);
531 prot_state = 2;
532 hres = IInternetProtocolSink_Switch(protocol_sink, &protocoldata);
533 ok(hres == S_OK, "Switch failed: %08x\n", hres);
534 ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
535 CHECK_CALLED(Continue);
536 if(test_abort) {
537 CHECK_CALLED(OnProgress_DOWNLOADINGDATA);
538 CHECK_CALLED(OnStopBinding);
540 return 0;
541 }else {
543 if(!no_callback) {
544 CHECK_CALLED(OnProgress_DOWNLOADINGDATA);
545 CHECK_CALLED(OnDataAvailable);
546 }
547 }
548
549 SET_EXPECT(Continue);
550 prot_state = 2;
551 hres = IInternetProtocolSink_Switch(protocol_sink, &protocoldata);
552 ok(hres == S_OK, "Switch failed: %08x\n", hres);
553 ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
554 CHECK_CALLED(Continue);
556 if(!no_callback) {
557 CHECK_CALLED(OnProgress_DOWNLOADINGDATA);
558 CHECK_CALLED(OnDataAvailable);
559 }
560
561 SET_EXPECT(Continue);
562 prot_state = 3;
563 hres = IInternetProtocolSink_Switch(protocol_sink, &protocoldata);
564 ok(hres == S_OK, "Switch failed: %08x\n", hres);
565 ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
566 CHECK_CALLED(Continue);
568 if(!no_callback) {
569 CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
570 CHECK_CALLED(OnDataAvailable);
571 CHECK_CALLED(OnStopBinding);
572 }
573
575
577 return 0;
578}
579
581 IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
583{
584 BINDINFO bindinfo;
585 DWORD bind_info, bscf = BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION;
587
588 static const STGMEDIUM stgmed_zero = {0};
589 static const SECURITY_ATTRIBUTES sa_zero = {0};
590
592
593 read = 0;
594
595 reported_url = szUrl;
596 if(!filedwl_api) /* FIXME */
597 ok(szUrl && !lstrcmpW(szUrl, current_url), "wrong url %s\n", wine_dbgstr_w(szUrl));
598 ok(pOIProtSink != NULL, "pOIProtSink == NULL\n");
599 ok(pOIBindInfo != NULL, "pOIBindInfo == NULL\n");
600 ok(grfPI == 0, "grfPI=%d, expected 0\n", grfPI);
601 ok(dwReserved == 0, "dwReserved=%lx, expected 0\n", dwReserved);
602
603 if(!filedwl_api && binding_hres != S_OK) {
604 SET_EXPECT(OnStopBinding);
605 SET_EXPECT(Terminate);
606 hres = IInternetProtocolSink_ReportResult(pOIProtSink, binding_hres, 0, NULL);
607 ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
608 CHECK_CALLED(OnStopBinding);
609 CHECK_CALLED(Terminate);
610
611 return S_OK;
612 }
613
614 memset(&bindinfo, 0, sizeof(bindinfo));
615 bindinfo.cbSize = 0;
616 hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &bind_info, &bindinfo);
617 ok(hres == E_INVALIDARG, "GetBindInfo returned: %08x, expected E_INVALIDARG\n", hres);
618
619 memset(&bindinfo, 0, sizeof(bindinfo));
620 bindinfo.cbSize = sizeof(bindinfo);
621 hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &bind_info, &bindinfo);
622 ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
623
624 ok(bind_info & BINDF_FROMURLMON, "BINDF_FROMURLMON is not set\n");
625
626 if(filedwl_api || !is_urlmon_protocol(test_protocol) || tymed != TYMED_ISTREAM ||
627 !(bindf&BINDF_ASYNCSTORAGE) || !(bindf&BINDF_PULLDATA))
628 ok(bind_info & BINDF_NEEDFILE, "BINDF_NEEDFILE is not set\n");
629 else if(test_protocol != MK_TEST) /* IE10 sets BINDF_NEEDFILE for mk: protocol */
630 ok(!(bind_info & BINDF_NEEDFILE), "BINDF_NEEDFILE is set\n");
631
632 bind_info &= ~(BINDF_NEEDFILE|BINDF_FROMURLMON);
634 ok(bind_info == BINDF_PULLDATA, "bind_info = %x, expected BINDF_PULLDATA\n", bind_info);
635 else
636 ok(bind_info == (bindf & ~(BINDF_NEEDFILE|BINDF_FROMURLMON)), "bind_info = %x, expected %x\n",
637 bind_info, (bindf & ~(BINDF_NEEDFILE|BINDF_FROMURLMON)));
638
639 ok(bindinfo.cbSize == sizeof(bindinfo), "bindinfo.cbSize = %d\n", bindinfo.cbSize);
640 ok(!bindinfo.szExtraInfo, "bindinfo.szExtraInfo = %p\n", bindinfo.szExtraInfo);
641 ok(!memcmp(&bindinfo.stgmedData, &stgmed_zero, sizeof(STGMEDIUM)), "wrong stgmedData\n");
642 ok(!bindinfo.grfBindInfoF, "bindinfo.grfBindInfoF = %d\n", bindinfo.grfBindInfoF);
643 ok(!bindinfo.dwBindVerb, "bindinfo.dwBindVerb = %d\n", bindinfo.dwBindVerb);
644 ok(!bindinfo.szCustomVerb, "bindinfo.szCustomVerb = %p\n", bindinfo.szCustomVerb);
645 ok(!bindinfo.cbstgmedData, "bindinfo.cbstgmedData = %d\n", bindinfo.cbstgmedData);
646 ok(bindinfo.dwOptions == (bind_to_object ? 0x100000 : 0), "bindinfo.dwOptions = %x\n", bindinfo.dwOptions);
647 ok(!bindinfo.dwOptionsFlags, "bindinfo.dwOptionsFlags = %d\n", bindinfo.dwOptionsFlags);
648 ok(!bindinfo.dwCodePage, "bindinfo.dwCodePage = %d\n", bindinfo.dwCodePage);
649 ok(!memcmp(&bindinfo.securityAttributes, &sa_zero, sizeof(sa_zero)), "wrong bindinfo.securityAttributes\n");
650 ok(IsEqualGUID(&bindinfo.iid, &IID_NULL), "wrong bindinfo.iid\n");
651 ok(!bindinfo.pUnk, "bindinfo.pUnk = %p\n", bindinfo.pUnk);
652 ok(!bindinfo.dwReserved, "bindinfo.dwReserved = %d\n", bindinfo.dwReserved);
653
655 return E_FAIL;
656
657 switch(test_protocol) {
658 case MK_TEST:
659 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
660 BINDSTATUS_DIRECTBIND, NULL);
661 ok(hres == S_OK,
662 "ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n", hres);
663
664 case FILE_TEST:
665 case ITS_TEST:
667 SET_EXPECT(Obj_OnProgress_SENDINGREQUEST);
668 else
669 SET_EXPECT(OnProgress_SENDINGREQUEST);
670 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
671 BINDSTATUS_SENDINGREQUEST, emptyW);
672 ok(hres == S_OK,
673 "ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n", hres);
675 CHECK_CALLED(Obj_OnProgress_SENDINGREQUEST);
676 else
677 CHECK_CALLED(OnProgress_SENDINGREQUEST);
679 IInternetProtocolSink_AddRef(pOIProtSink);
680 protocol_sink = pOIProtSink;
681 default:
682 break;
683 }
684
688 IHttpNegotiate2 *http_negotiate2;
690 LPWSTR ua = (LPWSTR)0xdeadbeef, accept_mimes[256];
691 LPWSTR additional_headers = (LPWSTR)0xdeadbeef;
692 BYTE sec_id[100];
693 DWORD fetched = 256, size = 100;
694 DWORD tid;
695
696 static const WCHAR wszMimes[] = {'*','/','*',0};
697
698 SET_EXPECT(QueryService_IInternetBindInfo);
699 hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_USER_AGENT,
700 &ua, 1, &fetched);
701 CLEAR_CALLED(QueryService_IInternetBindInfo); /* IE <8 */
702
704 "GetBindString(BINDSTRING_USER_AGETNT) failed: %08x\n", hres);
705 ok(fetched == 256, "fetched = %d, expected 254\n", fetched);
706 ok(ua == (LPWSTR)0xdeadbeef, "ua = %p\n", ua);
707
708 hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
709 accept_mimes, 256, &fetched);
710 ok(hres == S_OK,
711 "GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
712 ok(fetched == 1, "fetched = %d, expected 1\n", fetched);
713 ok(!lstrcmpW(wszMimes, accept_mimes[0]), "unexpected mimes\n");
714 CoTaskMemFree(accept_mimes[0]);
715
716 hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
717 NULL, 256, &fetched);
719 "GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
720
721 hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
722 accept_mimes, 256, NULL);
724 "GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
725
726 hres = IInternetBindInfo_QueryInterface(pOIBindInfo, &IID_IServiceProvider,
727 (void**)&service_provider);
728 ok(hres == S_OK, "QueryInterface failed: %08x\n", hres);
729
730 SET_EXPECT(QueryInterface_IHttpNegotiate);
731 hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
732 &IID_IHttpNegotiate, (void**)&http_negotiate);
733 CLEAR_CALLED(QueryInterface_IHttpNegotiate); /* IE <8 */
734 ok(hres == S_OK, "QueryService failed: %08x\n", hres);
735
736 if(!no_callback) {
737 SET_EXPECT(BeginningTransaction);
738 SET_EXPECT(QueryInterface_IHttpNegotiate);
739 }
740 hres = IHttpNegotiate_BeginningTransaction(http_negotiate, current_url,
741 NULL, 0, &additional_headers);
742 if(!no_callback) {
743 CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate);
744 CHECK_CALLED(BeginningTransaction);
745 }
746 IHttpNegotiate_Release(http_negotiate);
747 ok(hres == S_OK, "BeginningTransction failed: %08x\n", hres);
748 ok(additional_headers == NULL, "additional_headers=%p\n", additional_headers);
749
750 SET_EXPECT(QueryInterface_IHttpNegotiate2);
751 hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate2,
752 &IID_IHttpNegotiate2, (void**)&http_negotiate2);
753 CLEAR_CALLED(QueryInterface_IHttpNegotiate2); /* IE <8 */
754 ok(hres == S_OK, "QueryService failed: %08x\n", hres);
755
756 size = 512;
757 if(!no_callback) {
758 SET_EXPECT(QueryInterface_IHttpNegotiate2);
759 SET_EXPECT(GetRootSecurityId);
760 }
761 hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, sec_id, &size, 0);
762 if(!no_callback) {
763 CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate2);
764 CHECK_CALLED(GetRootSecurityId);
765 }
766 IHttpNegotiate2_Release(http_negotiate2);
767 ok(hres == E_FAIL, "GetRootSecurityId failed: %08x, expected E_FAIL\n", hres);
768 ok(size == (no_callback ? 512 : 13), "size=%d\n", size);
769
770 if(!no_callback) {
771 SET_EXPECT(QueryService_IHttpSecurity);
772 SET_EXPECT(QueryInterface_IHttpSecurity);
773 }
774 hres = IServiceProvider_QueryService(service_provider, &IID_IHttpSecurity,
775 &IID_IHttpSecurity, (void**)&http_security);
776 ok(hres == (no_callback ? E_NOINTERFACE : S_OK), "QueryService failed: 0x%08x\n", hres);
777 if(!no_callback) {
778 CHECK_CALLED(QueryService_IHttpSecurity);
779 CHECK_CALLED(QueryInterface_IHttpSecurity);
780 }
781
782 IServiceProvider_Release(service_provider);
783
784 IInternetProtocolSink_AddRef(pOIProtSink);
785 protocol_sink = pOIProtSink;
786
787 if(async_switch) {
788 PROTOCOLDATA data;
789
790 memset(&data, 0, sizeof(data));
791 data.grfFlags = PI_FORCE_ASYNC;
792 prot_state = 0;
793 hres = IInternetProtocolSink_Switch(pOIProtSink, &data);
794 ok(hres == S_OK, "Switch failed: %08x\n", hres);
795 SET_EXPECT(Continue);
797 return E_PENDING;
798 } else {
800 return S_OK;
801 }
802 }
803
804 if(test_protocol == FILE_TEST) {
805 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
806 BINDSTATUS_CACHEFILENAMEAVAILABLE, file_url+7);
807 ok(hres == S_OK,
808 "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n", hres);
809
811 SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
812 else
813 SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
814 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
815 BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, wszTextHtml);
816 ok(hres == S_OK,
817 "ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE) failed: %08x\n", hres);
819 CHECK_CALLED(Obj_OnProgress_MIMETYPEAVAILABLE);
820 else
821 CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
822 }else if(test_protocol == WINETEST_SYNC_TEST) {
823 SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
824 hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, wszTextHtml);
825 ok(hres == S_OK,
826 "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
827 CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
828 }else {
829 hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
830 ok(hres == S_OK,
831 "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
832 }
833
835 bscf |= BSCF_DATAFULLYAVAILABLE;
837 bscf = BSCF_FIRSTDATANOTIFICATION|BSCF_DATAFULLYAVAILABLE;
838
840 if(bind_to_object) {
842 SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
843 SET_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
845 SET_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
846 SET_EXPECT(Obj_OnProgress_ENDDOWNLOADDATA);
847 SET_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
848 SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
849 SET_EXPECT(CreateInstance);
850 SET_EXPECT(PutProperty_MIMETYPEPROP);
851 SET_EXPECT(PutProperty_CLASSIDPROP);
852 SET_EXPECT(Load);
853 SET_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
854 SET_EXPECT(OnObjectAvailable);
855 SET_EXPECT(Obj_OnStopBinding);
856 }else {
858 SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
859 SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
861 SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
862 SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
864 if(!filedwl_api)
865 SET_EXPECT(OnDataAvailable);
866 if(test_protocol != WINETEST_SYNC_TEST) /* Set in Read after ReportResult call */
867 SET_EXPECT(OnStopBinding);
868 }
869
870 hres = IInternetProtocolSink_ReportData(pOIProtSink, bscf, 13, 13);
871 ok(hres == S_OK, "ReportData failed: %08x\n", hres);
872
874 if(bind_to_object) {
876 CHECK_CALLED(Obj_OnProgress_MIMETYPEAVAILABLE);
877 CHECK_CALLED(Obj_OnProgress_BEGINDOWNLOADDATA);
879 CHECK_CALLED(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
880 CHECK_CALLED(Obj_OnProgress_ENDDOWNLOADDATA);
881 CHECK_CALLED(Obj_OnProgress_CLASSIDAVAILABLE);
882 CHECK_CALLED(Obj_OnProgress_BEGINSYNCOPERATION);
883 CHECK_CALLED(CreateInstance);
884 CHECK_CALLED(PutProperty_MIMETYPEPROP);
885 CHECK_CALLED_BROKEN(PutProperty_CLASSIDPROP);
886 CHECK_CALLED(Load);
887 CHECK_CALLED(Obj_OnProgress_ENDSYNCOPERATION);
888 CHECK_CALLED(OnObjectAvailable);
889 CHECK_CALLED(Obj_OnStopBinding);
890 }else {
892 CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
893 CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
895 CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
896 CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
898 if(!filedwl_api)
899 CHECK_CALLED(OnDataAvailable);
900 CHECK_CALLED(OnStopBinding);
901 }
902
903 if(test_protocol == ITS_TEST) {
905 hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_BEGINDOWNLOADDATA, NULL);
906 ok(hres == S_OK, "ReportProgress(BINDSTATUS_BEGINDOWNLOADDATA) failed: %08x\n", hres);
908 }else if(!bind_to_object && test_protocol == FILE_TEST) {
910 hres = IInternetProtocolSink_ReportData(pOIProtSink, bscf, 13, 13);
911 ok(hres == S_OK, "ReportData failed: %08x\n", hres);
913 }
914
916 SET_EXPECT(Terminate);
917 hres = IInternetProtocolSink_ReportResult(pOIProtSink, S_OK, 0, NULL);
918 ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
919 CHECK_CALLED(Terminate);
920 }
921
922 return S_OK;
923}
924
926 PROTOCOLDATA *pProtocolData)
927{
928 DWORD bscf = 0;
930
931 CHECK_EXPECT(Continue);
932
933 ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
934
935 if(!bind_to_object)
937
938 ok(pProtocolData != NULL, "pProtocolData == NULL\n");
939 if(!pProtocolData)
940 return S_OK;
941
942 switch(prot_state) {
943 case 0:
944 hres = IInternetProtocolSink_ReportProgress(protocol_sink,
945 BINDSTATUS_SENDINGREQUEST, NULL);
946 ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
947
948 hres = IInternetProtocolSink_ReportProgress(protocol_sink,
949 BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
950 ok(hres == S_OK,
951 "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
952
953 bscf |= BSCF_FIRSTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION;
954 break;
955 case 1: {
958 static const WCHAR header[] = {'?',0};
959
960 hres = IInternetProtocolSink_QueryInterface(protocol_sink, &IID_IServiceProvider,
961 (void**)&service_provider);
962 ok(hres == S_OK, "Could not get IServiceProvicder\n");
963
964 hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
965 &IID_IHttpNegotiate, (void**)&http_negotiate);
966 ok(hres == S_OK, "Could not get IHttpNegotiate\n");
967
968 if(!no_callback) {
969 SET_EXPECT(QueryInterface_IHttpNegotiate);
970 SET_EXPECT(OnResponse);
971 }
972 hres = IHttpNegotiate_OnResponse(http_negotiate, 200, header, NULL, NULL);
973 if(!no_callback) {
974 CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate);
975 CHECK_CALLED(OnResponse);
976 }
977 IHttpNegotiate_Release(http_negotiate);
978 ok(hres == S_OK, "OnResponse failed: %08x\n", hres);
979
981 hres = IInternetProtocolSink_ReportProgress(protocol_sink, BINDSTATUS_ACCEPTRANGES, NULL);
982 ok(hres == S_OK, "ReportProgress(BINDSTATUS_ACCEPTRANGES) failed: %08x\n", hres);
983 }
984
985 hres = IInternetProtocolSink_ReportProgress(protocol_sink,
986 BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
987 ok(hres == S_OK,
988 "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
989
990 hres = IInternetProtocolSink_ReportProgress(protocol_sink,
991 BINDSTATUS_CACHEFILENAMEAVAILABLE, use_cache_file ? cache_file_name : cache_fileW);
992 ok(hres == S_OK, "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n", hres);
993
994 bscf |= BSCF_FIRSTDATANOTIFICATION;
995 break;
996 }
997 case 2:
998 case 3:
999 bscf = BSCF_INTERMEDIATEDATANOTIFICATION;
1000 break;
1001 }
1002
1003 hres = IInternetProtocolSink_ReportData(protocol_sink, bscf, 100, 400);
1004 ok(hres == S_OK, "ReportData failed: %08x\n", hres);
1005
1006 if(prot_state != 2 || !test_abort)
1008 switch(prot_state) {
1009 case 0:
1010 hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
1011 ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1012 SET_EXPECT(OnProgress_SENDINGREQUEST);
1013 SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
1014 SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
1016 SET_EXPECT(OnStopBinding);
1017 break;
1018 case 1:
1019 if(bind_to_object) {
1020 SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
1021 SET_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
1022 SET_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
1023 SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
1024 SET_EXPECT(CreateInstance);
1025 SET_EXPECT(PutProperty_MIMETYPEPROP);
1026 SET_EXPECT(PutProperty_CLASSIDPROP);
1027 SET_EXPECT(Load);
1028 SET_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
1029 SET_EXPECT(OnObjectAvailable);
1030 SET_EXPECT(Obj_OnStopBinding);
1031 }else if(!no_callback) {
1032 SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
1033 SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
1035 }else {
1037 }
1038 break;
1039 case 2:
1040 if(!no_callback)
1041 SET_EXPECT(OnProgress_DOWNLOADINGDATA);
1042 break;
1043 case 3:
1044 SET_EXPECT(OnProgress_DOWNLOADINGDATA);
1045 SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
1046 }
1047 if(!no_callback) {
1048 if((!bind_to_object || prot_state >= 2) && (!test_abort || prot_state != 2))
1049 SET_EXPECT(OnDataAvailable);
1050 if(prot_state == 3 || (test_abort && prot_state == 2))
1051 SET_EXPECT(OnStopBinding);
1052 }
1053 return S_OK;
1054}
1055
1058{
1059 HRESULT hres;
1060
1061 CHECK_EXPECT(Abort);
1062
1063 ok(hrReason == E_ABORT, "hrReason = %08x\n", hrReason);
1064 ok(!dwOptions, "dwOptions = %x\n", dwOptions);
1065
1066 hres = IInternetProtocolSink_ReportResult(protocol_sink, E_ABORT, ERROR_SUCCESS, NULL);
1067 ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1068
1069 return S_OK;
1070}
1071
1073{
1074 CHECK_EXPECT(Terminate);
1075
1076 ok(dwOptions == 0, "dwOptions=%d, expected 0\n", dwOptions);
1077
1078 if(protocol_sink) {
1079 IInternetProtocolSink_Release(protocol_sink);
1081 }
1082
1083 if(no_callback)
1085 return S_OK;
1086}
1087
1089{
1090 ok(0, "unexpected call\n");
1091 return E_NOTIMPL;
1092}
1093
1095{
1096 ok(0, "unexpected call\n");
1097 return E_NOTIMPL;
1098}
1099
1101 ULONG cb, ULONG *pcbRead)
1102{
1103 HRESULT hres;
1104
1105 static const char data[] = "<HTML></HTML>";
1106
1108
1109 ok(pv != NULL, "pv == NULL\n");
1110 ok(cb != 0, "cb == 0\n");
1111 ok(pcbRead != NULL, "pcbRead == NULL\n");
1112
1113 if(async_switch) {
1114 if(prot_state++ > 1) {
1115 *pcbRead = 0;
1116 return S_FALSE;
1117 } else {
1118 memset(pv, '?', cb);
1119 *pcbRead = cb;
1120 return S_OK;
1121 }
1122 }
1123
1125 static BOOL pending = TRUE;
1126
1127 pending = !pending;
1128
1129 switch(prot_state) {
1130 case 1:
1131 case 2:
1132 if(pending) {
1133 *pcbRead = 10;
1134 memset(pv, '?', 10);
1135 if(prot_state == 2 && no_callback)
1137 return E_PENDING;
1138 }else {
1139 memset(pv, '?', cb);
1140 *pcbRead = cb;
1141 read++;
1142 return S_OK;
1143 }
1144 case 3:
1145 prot_state++;
1146
1147 *pcbRead = 0;
1148
1149 hres = IInternetProtocolSink_ReportData(protocol_sink,
1150 BSCF_LASTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION, 2000, 2000);
1151 ok(hres == S_OK, "ReportData failed: %08x\n", hres);
1152
1153 hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
1154 ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1155
1156 return S_FALSE;
1157 case 4:
1158 *pcbRead = 0;
1159 return S_FALSE;
1160 }
1161 }
1162
1163 if(read) {
1164 *pcbRead = 0;
1165 return S_FALSE;
1166 }
1167
1169 hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
1170 ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1171
1172 SET_EXPECT(OnStopBinding);
1173 }
1174
1175 ok(*pcbRead == 0, "*pcbRead=%d, expected 0\n", *pcbRead);
1176 read += *pcbRead = sizeof(data)-1;
1177 memcpy(pv, data, sizeof(data));
1178 return S_OK;
1179}
1180
1182 LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
1183{
1184 ok(0, "unexpected call\n");
1185 return E_NOTIMPL;
1186}
1187
1189{
1191 if(no_callback)
1193 return S_OK;
1194}
1195
1197{
1199 return S_OK;
1200}
1201
1202static const IInternetProtocolVtbl ProtocolVtbl = {
1216};
1217
1219
1221{
1223 || IsEqualGUID(&IID_IHttpNegotiate, riid)
1224 || IsEqualGUID(&IID_IHttpNegotiate2, riid)) {
1225 *ppv = iface;
1226 return S_OK;
1227 }
1228
1229 ok(0, "unexpected call\n");
1230 return E_NOINTERFACE;
1231}
1232
1234{
1235 return 2;
1236}
1237
1239{
1240 return 1;
1241}
1242
1244 LPCWSTR szHeaders, DWORD dwReserved, LPWSTR *pszAdditionalHeaders)
1245{
1247 CHECK_EXPECT2(BeginningTransaction);
1248 else
1249 CHECK_EXPECT(BeginningTransaction);
1250
1251 ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1252
1253 ok(!lstrcmpW(szURL, current_url), "szURL != current_url\n");
1254 ok(!dwReserved, "dwReserved=%d, expected 0\n", dwReserved);
1255 ok(pszAdditionalHeaders != NULL, "pszAdditionalHeaders == NULL\n");
1256 if(pszAdditionalHeaders)
1257 ok(*pszAdditionalHeaders == NULL, "*pszAdditionalHeaders != NULL\n");
1258
1259 return S_OK;
1260}
1261
1263 LPCWSTR szResponseHeaders, LPCWSTR szRequestHeaders, LPWSTR *pszAdditionalRequestHeaders)
1264{
1265 CHECK_EXPECT(OnResponse);
1266
1267 ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1268
1269 ok(dwResponseCode == 200, "dwResponseCode=%d, expected 200\n", dwResponseCode);
1270 ok(szResponseHeaders != NULL, "szResponseHeaders == NULL\n");
1271 ok(szRequestHeaders == NULL, "szRequestHeaders != NULL\n");
1272 /* Note: in protocol.c tests, OnResponse pszAdditionalRequestHeaders _is_ NULL */
1273 ok(pszAdditionalRequestHeaders != NULL, "pszAdditionalHeaders == NULL\n");
1274 if(pszAdditionalRequestHeaders)
1275 ok(*pszAdditionalRequestHeaders == NULL, "*pszAdditionalHeaders != NULL\n");
1276
1277 return S_OK;
1278}
1279
1281 BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
1282{
1283 static const BYTE sec_id[] = {'h','t','t','p',':','t','e','s','t',1,0,0,0};
1284
1285 CHECK_EXPECT(GetRootSecurityId);
1286
1287 ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1288
1289 ok(!dwReserved, "dwReserved=%ld, expected 0\n", dwReserved);
1290 ok(pbSecurityId != NULL, "pbSecurityId == NULL\n");
1291 ok(pcbSecurityId != NULL, "pcbSecurityId == NULL\n");
1292
1293 if(pbSecurityId == (void*)0xdeadbeef)
1294 return E_NOTIMPL;
1295
1296 if(pcbSecurityId) {
1297 ok(*pcbSecurityId == 512, "*pcbSecurityId=%d, expected 512\n", *pcbSecurityId);
1298 *pcbSecurityId = sizeof(sec_id);
1299 }
1300
1301 if(pbSecurityId)
1302 memcpy(pbSecurityId, sec_id, sizeof(sec_id));
1303
1304 return E_FAIL;
1305}
1306
1307static IHttpNegotiate2Vtbl HttpNegotiateVtbl = {
1314};
1315
1317
1319{
1320 ok(0, "Unexpected call\n");
1321 *ppv = NULL;
1322 if(IsEqualGUID(&IID_IHttpSecurity, riid) ||
1323 IsEqualGUID(&IID_IWindowForBindingUI, riid) ||
1325 {
1326 *ppv = iface;
1327 return S_OK;
1328 }
1329
1330 ok(0, "Unexpected interface requested.\n");
1331
1332 return E_NOINTERFACE;
1333}
1334
1336{
1337 return 2;
1338}
1339
1341{
1342 return 1;
1343}
1344
1346{
1347 if(IsEqualGUID(rguidReason, &IID_IHttpSecurity))
1348 CHECK_EXPECT(GetWindow_IHttpSecurity);
1349 else if(IsEqualGUID(rguidReason, &IID_IWindowForBindingUI))
1350 CHECK_EXPECT2(GetWindow_IWindowForBindingUI);
1351 else if(IsEqualGUID(rguidReason, &IID_ICodeInstall))
1352 CHECK_EXPECT(GetWindow_ICodeInstall);
1353 else
1354 ok(0, "Unexpected rguidReason: %s\n", wine_dbgstr_guid(rguidReason));
1355
1356 *phwnd = NULL;
1357 return S_OK;
1358}
1359
1361{
1362 CHECK_EXPECT(OnSecurityProblem);
1363 if(!security_problem) {
1365 broken(dwProblem == ERROR_INTERNET_SEC_CERT_ERRORS) /* Some versions of IE6 */,
1366 "Got problem: %d\n", dwProblem);
1367 security_problem = dwProblem;
1368
1369 if(dwProblem == ERROR_INTERNET_SEC_CERT_ERRORS)
1370 binding_hres = INET_E_SECURITY_PROBLEM;
1371 }else
1372 ok(dwProblem == security_problem, "Got problem: %d\n", dwProblem);
1373
1375}
1376
1377static const IHttpSecurityVtbl HttpSecurityVtbl = {
1383};
1384
1386
1388{
1389 ok(0, "unexpected call\n");
1390 return E_NOINTERFACE;
1391}
1392
1394{
1395 return 2;
1396}
1397
1399{
1400 return 1;
1401}
1402
1404 REFGUID guidService, REFIID riid, void **ppv)
1405{
1406 if(IsEqualGUID(&IID_IAuthenticate, guidService)) {
1407 CHECK_EXPECT(QueryService_IAuthenticate);
1408 return E_NOTIMPL;
1409 }
1410
1411 if(IsEqualGUID(&IID_IInternetProtocol, guidService)) {
1412 CHECK_EXPECT2(QueryService_IInternetProtocol);
1413 return E_NOTIMPL;
1414 }
1415
1416 if(IsEqualGUID(&IID_IInternetBindInfo, guidService)) {
1417 CHECK_EXPECT(QueryService_IInternetBindInfo);
1418 return E_NOTIMPL;
1419 }
1420
1421 if(IsEqualGUID(&IID_IWindowForBindingUI, guidService)) {
1422 CHECK_EXPECT2(QueryService_IWindowForBindingUI);
1423 *ppv = &HttpSecurity;
1424 return S_OK;
1425 }
1426
1427 if(IsEqualGUID(&IID_IHttpSecurity, guidService)) {
1428 CHECK_EXPECT(QueryService_IHttpSecurity);
1429 *ppv = &HttpSecurity;
1430 return S_OK;
1431 }
1432
1433 if(IsEqualGUID(&IID_IGetBindHandle, guidService)) {
1434 trace("QueryService(IID_IGetBindHandle)\n");
1435 *ppv = NULL;
1436 return E_NOINTERFACE;
1437 }
1438
1439 if(IsEqualGUID(&IID_undocumentedIE11, guidService)) {
1440 trace("QueryService(IID_undocumentedIE11)\n");
1441 *ppv = NULL;
1442 return E_NOINTERFACE;
1443 }
1444
1445 ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService));
1446 return E_NOINTERFACE;
1447}
1448
1449static IServiceProviderVtbl ServiceProviderVtbl = {
1454};
1455
1457
1459
1461{
1462 DWORD status, size;
1464
1465 /* QueryInfo changes its behavior during this request */
1466 if(progress == BINDSTATUS_SENDINGREQUEST)
1467 return;
1468
1470 && progress!=BINDSTATUS_MIMETYPEAVAILABLE)
1471 expect = E_FAIL;
1472 else if(test_protocol == FTP_TEST)
1473 expect = S_FALSE;
1474 else
1475 expect = S_OK;
1476
1477 size = sizeof(DWORD);
1478 hres = IWinInetHttpInfo_QueryInfo(http_info, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER,
1479 &status, &size, NULL, NULL);
1480 ok(hres == expect || ((progress == BINDSTATUS_COOKIE_SENT || progress == BINDSTATUS_PROXYDETECTING) && hres == S_FALSE),
1481 "progress %u: hres = %x, expected %x\n", progress, hres, expect);
1482 if(hres == S_OK) {
1483 if(download_state == BEFORE_DOWNLOAD && progress != BINDSTATUS_MIMETYPEAVAILABLE && progress != BINDSTATUS_DECODING)
1484 ok(status == 0, "progress %u: status = %d\n", progress, status);
1485 else
1486 ok(status == HTTP_STATUS_OK, "progress %u: status = %d\n", progress, status);
1487 ok(size == sizeof(DWORD), "size = %d\n", size);
1488 }
1489
1490 size = sizeof(DWORD);
1491 hres = IWinInetHttpInfo_QueryOption(http_info, INTERNET_OPTION_HANDLE_TYPE, &status, &size);
1492 if(test_protocol == FTP_TEST) {
1493 if(download_state==BEFORE_DOWNLOAD && progress!=BINDSTATUS_MIMETYPEAVAILABLE)
1494 ok(hres == E_FAIL, "hres = %x\n", hres);
1495 else
1496 ok(hres == S_OK, "hres = %x\n", hres);
1497
1498 if(hres == S_OK)
1499 ok(status == INTERNET_HANDLE_TYPE_FTP_FILE, "status = %d\n", status);
1500 } else {
1501 ok(hres == S_OK, "hres = %x\n", hres);
1502 ok(status == INTERNET_HANDLE_TYPE_HTTP_REQUEST, "status = %d\n", status);
1503 }
1504}
1505
1507{
1508 static const IID IID_undocumentedIE10 = {0xf286fa56,0xc1fd,0x4270,{0x8e,0x67,0xb3,0xeb,0x79,0x0a,0x81,0xe8}};
1509
1510 ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1511
1512 if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
1513 CHECK_EXPECT2(QueryInterface_IInternetProtocol);
1514 if(emulate_protocol) {
1515 *ppv = &Protocol;
1516 return S_OK;
1517 }else {
1518 return E_NOINTERFACE;
1519 }
1520 }else if (IsEqualGUID(&IID_IServiceProvider, riid)) {
1521 CHECK_EXPECT2(QueryInterface_IServiceProvider);
1522 *ppv = &ServiceProvider;
1523 return S_OK;
1524 }else if (IsEqualGUID(&IID_IHttpNegotiate, riid)) {
1525 CHECK_EXPECT2(QueryInterface_IHttpNegotiate);
1526 *ppv = &HttpNegotiate;
1527 return S_OK;
1528 }else if (IsEqualGUID(&IID_IHttpNegotiate2, riid)) {
1529 CHECK_EXPECT(QueryInterface_IHttpNegotiate2);
1530 *ppv = &HttpNegotiate;
1531 return S_OK;
1532 }else if (IsEqualGUID(&IID_IAuthenticate, riid)) {
1533 CHECK_EXPECT(QueryInterface_IAuthenticate);
1534 return E_NOINTERFACE;
1535 }else if(IsEqualGUID(&IID_IBindStatusCallback, riid)) {
1536 if(strict_bsc_qi)
1537 CHECK_EXPECT2(QueryInterface_IBindStatusCallback);
1538 *ppv = iface;
1539 return S_OK;
1541 CHECK_EXPECT2(QueryInterface_IBindStatusCallbackHolder);
1542 return E_NOINTERFACE;
1543 }else if(IsEqualGUID(&IID_IBindStatusCallbackEx, riid)) {
1544 CHECK_EXPECT(QueryInterface_IBindStatusCallbackEx);
1545 if(!use_bscex)
1546 return E_NOINTERFACE;
1547 *ppv = iface;
1548 return S_OK;
1549 }else if(IsEqualGUID(&IID_IInternetBindInfo, riid)) {
1550 /* TODO */
1551 }else if(IsEqualGUID(&IID_IWindowForBindingUI, riid)) {
1552 CHECK_EXPECT2(QueryInterface_IWindowForBindingUI);
1553 return E_NOINTERFACE;
1554 }else if(IsEqualGUID(&IID_IHttpSecurity, riid)) {
1555 CHECK_EXPECT2(QueryInterface_IHttpSecurity);
1556 return E_NOINTERFACE;
1557 }else if(IsEqualGUID(&IID_IGetBindHandle, riid)) {
1558 trace("QI(IID_IGetBindHandle)\n");
1559 *ppv = NULL;
1560 return E_NOINTERFACE;
1561 }else if(IsEqualGUID(&IID_undocumentedIE10, riid)) {
1562 trace("QI(IID_undocumentedIE10)\n");
1563 *ppv = NULL;
1564 return E_NOINTERFACE;
1566 trace("QI(IID_undocumentedIE11)\n");
1567 *ppv = NULL;
1568 return E_NOINTERFACE;
1569 }else {
1570 ok(0, "unexpected interface %s\n", wine_dbgstr_guid(riid));
1571 }
1572
1573 return E_NOINTERFACE;
1574}
1575
1577{
1578 return 2;
1579}
1580
1582{
1583 return 1;
1584}
1585
1587 IBinding *pib)
1588{
1589 IWinInetHttpInfo *http_info;
1590 HRESULT hres;
1591 IMoniker *mon;
1592 DWORD res;
1593 CLSID clsid;
1594 LPOLESTR res_str;
1595
1596 if(iface == &objbsc)
1597 CHECK_EXPECT(Obj_OnStartBinding);
1598 else
1599 CHECK_EXPECT(OnStartBinding);
1600
1601 ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1602
1603 ok(pib != NULL, "pib should not be NULL\n");
1604 ok(dwReserved == 0xff, "dwReserved=%x\n", dwReserved);
1605
1606 if(pib == (void*)0xdeadbeef)
1607 return S_OK;
1608
1609 current_binding = pib;
1610
1611 hres = IBinding_QueryInterface(pib, &IID_IMoniker, (void**)&mon);
1612 ok(hres == E_NOINTERFACE, "IBinding should not have IMoniker interface\n");
1613 if(SUCCEEDED(hres))
1614 IMoniker_Release(mon);
1615
1616 hres = IBinding_QueryInterface(pib, &IID_IWinInetHttpInfo, (void**)&http_info);
1617 ok(hres == E_NOINTERFACE, "Could not get IID_IWinInetHttpInfo: %08x\n", hres);
1618
1619 if(0) { /* crashes with native urlmon */
1620 hres = IBinding_GetBindResult(pib, NULL, &res, &res_str, NULL);
1621 ok(hres == E_INVALIDARG, "GetBindResult failed: %08x\n", hres);
1622 }
1623 hres = IBinding_GetBindResult(pib, &clsid, NULL, &res_str, NULL);
1624 ok(hres == E_INVALIDARG, "GetBindResult failed: %08x\n", hres);
1625 hres = IBinding_GetBindResult(pib, &clsid, &res, NULL, NULL);
1626 ok(hres == E_INVALIDARG, "GetBindResult failed: %08x\n", hres);
1627 hres = IBinding_GetBindResult(pib, &clsid, &res, &res_str, (void*)0xdeadbeef);
1628 ok(hres == E_INVALIDARG, "GetBindResult failed: %08x\n", hres);
1629
1630 hres = IBinding_GetBindResult(pib, &clsid, &res, &res_str, NULL);
1631 ok(hres == S_OK, "GetBindResult failed: %08x, expected S_OK\n", hres);
1632 ok(IsEqualCLSID(&clsid, &CLSID_NULL), "incorrect clsid: %s\n", wine_dbgstr_guid(&clsid));
1633 ok(!res, "incorrect res: %x\n", res);
1634 ok(!res_str, "incorrect res_str: %s\n", wine_dbgstr_w(res_str));
1635
1636 if(abort_start) {
1638 return abort_hres;
1639 }
1640
1641 return S_OK;
1642}
1643
1645{
1646 ok(0, "unexpected call\n");
1647 return E_NOTIMPL;
1648}
1649
1651{
1652 ok(0, "unexpected call\n");
1653 return E_NOTIMPL;
1654}
1655
1657 ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
1658{
1659 ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1660
1661 switch(ulStatusCode) {
1662 case BINDSTATUS_FINDINGRESOURCE:
1663 if(iface == &objbsc)
1664 CHECK_EXPECT(Obj_OnProgress_FINDINGRESOURCE);
1665 else if(test_protocol == FTP_TEST)
1666 todo_wine CHECK_EXPECT(OnProgress_FINDINGRESOURCE);
1668 todo_wine CHECK_EXPECT(OnProgress_FINDINGRESOURCE);
1669 else
1670 CHECK_EXPECT(OnProgress_FINDINGRESOURCE);
1673 break;
1674 case BINDSTATUS_CONNECTING:
1675 if(iface == &objbsc)
1676 CHECK_EXPECT(Obj_OnProgress_CONNECTING);
1677 else if(test_protocol == FTP_TEST)
1678 todo_wine CHECK_EXPECT(OnProgress_CONNECTING);
1679 else if(onsecurityproblem_hres == S_OK)
1680 CHECK_EXPECT2(OnProgress_CONNECTING);
1681 else
1682 CHECK_EXPECT(OnProgress_CONNECTING);
1685 break;
1686 case BINDSTATUS_REDIRECTING:
1687 if(iface == &objbsc)
1688 CHECK_EXPECT(Obj_OnProgress_REDIRECTING);
1689 else
1690 CHECK_EXPECT(OnProgress_REDIRECTING);
1691 ok(!lstrcmpW(szStatusText, winetest_data_urlW), "unexpected status text %s\n",
1692 wine_dbgstr_w(szStatusText));
1694 && (!bind_to_object || iface == &objbsc))
1696 break;
1697 case BINDSTATUS_SENDINGREQUEST:
1698 if(iface == &objbsc)
1699 CHECK_EXPECT(Obj_OnProgress_SENDINGREQUEST);
1700 else if(test_protocol == FTP_TEST)
1701 CHECK_EXPECT2(OnProgress_SENDINGREQUEST);
1702 else
1703 CHECK_EXPECT(OnProgress_SENDINGREQUEST);
1706
1707 if(abort_progress) {
1708 if(filedwl_api)
1710 return E_ABORT;
1711 }
1712
1713 break;
1714 case BINDSTATUS_MIMETYPEAVAILABLE:
1715 if(iface == &objbsc)
1716 CHECK_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
1717 else
1718 CHECK_EXPECT(OnProgress_MIMETYPEAVAILABLE);
1719 if(!bind_to_object)
1720 ok(download_state == BEFORE_DOWNLOAD, "Download state was %d, expected BEFORE_DOWNLOAD\n",
1722 WideCharToMultiByte(CP_ACP, 0, szStatusText, -1, mime_type, sizeof(mime_type)-1, NULL, NULL);
1723 break;
1724 case BINDSTATUS_BEGINDOWNLOADDATA:
1725 if(iface == &objbsc)
1726 CHECK_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
1727 else
1728 CHECK_EXPECT(OnProgress_BEGINDOWNLOADDATA);
1729 ok(szStatusText != NULL, "szStatusText == NULL\n");
1730 if(szStatusText) {
1731 if(filedwl_api) {
1732 /* FIXME */
1733 }else {
1734 ok(!lstrcmpW(szStatusText, current_url), "wrong szStatusText %s\n", wine_dbgstr_w(szStatusText));
1735 }
1736 }
1737 if(!bind_to_object)
1738 ok(download_state == BEFORE_DOWNLOAD, "Download state was %d, expected BEFORE_DOWNLOAD\n",
1741 break;
1742 case BINDSTATUS_DOWNLOADINGDATA:
1743 CHECK_EXPECT2(OnProgress_DOWNLOADINGDATA);
1744 ok(iface != &objbsc, "unexpected call\n");
1745 ok(download_state == DOWNLOADING, "Download state was %d, expected DOWNLOADING\n",
1747 if(test_abort) {
1748 HRESULT hres;
1749
1750 SET_EXPECT(Abort);
1751 hres = IBinding_Abort(current_binding);
1752 ok(hres == S_OK, "Abort failed: %08x\n", hres);
1753 CHECK_CALLED(Abort);
1754
1755 hres = IBinding_Abort(current_binding);
1756 ok(hres == E_FAIL, "Abort failed: %08x\n", hres);
1757
1759 }
1760 break;
1761 case BINDSTATUS_ENDDOWNLOADDATA:
1762 if(iface == &objbsc)
1763 CHECK_EXPECT(Obj_OnProgress_ENDDOWNLOADDATA);
1764 else
1765 CHECK_EXPECT(OnProgress_ENDDOWNLOADDATA);
1766 ok(szStatusText != NULL, "szStatusText == NULL\n");
1767 if(szStatusText) {
1768 if(filedwl_api) {
1769 /* FIXME */
1770 }else {
1771 ok(!lstrcmpW(szStatusText, current_url), "wrong szStatusText %s\n", wine_dbgstr_w(szStatusText));
1772 }
1773 }
1774 ok(download_state == DOWNLOADING, "Download state was %d, expected DOWNLOADING\n",
1777 break;
1778 case BINDSTATUS_CACHEFILENAMEAVAILABLE:
1780 if(iface == &objbsc)
1781 CHECK_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
1782 else
1783 CHECK_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
1784 }else { /* FIXME */
1785 CLEAR_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
1786 CLEAR_CALLED(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
1787 }
1788
1789 ok(szStatusText != NULL, "szStatusText == NULL\n");
1790 if(szStatusText && test_protocol == FILE_TEST)
1791 ok(!lstrcmpW(file_url+7, szStatusText), "wrong szStatusText %s\n", wine_dbgstr_w(szStatusText));
1792 break;
1793 case BINDSTATUS_CLASSIDAVAILABLE:
1794 {
1795 CLSID clsid;
1796 HRESULT hr;
1797 if(iface != &objbsc)
1798 ok(0, "unexpected call\n");
1799 else
1800 CHECK_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
1801 hr = CLSIDFromString((LPCOLESTR)szStatusText, &clsid);
1802 ok(hr == S_OK, "CLSIDFromString failed with error 0x%08x\n", hr);
1803 ok(IsEqualCLSID(&clsid, &CLSID_HTMLDocument),
1804 "Expected clsid to be CLSID_HTMLDocument instead of %s\n", wine_dbgstr_guid(&clsid));
1805 break;
1806 }
1807 case BINDSTATUS_BEGINSYNCOPERATION:
1808 CHECK_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
1809 if(iface != &objbsc)
1810 ok(0, "unexpected call\n");
1811 ok(szStatusText == NULL, "Expected szStatusText to be NULL\n");
1812 break;
1813 case BINDSTATUS_ENDSYNCOPERATION:
1814 CHECK_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
1815 if(iface != &objbsc)
1816 ok(0, "unexpected call\n");
1817 ok(szStatusText == NULL, "Expected szStatusText to be NULL\n");
1818 break;
1819 case BINDSTATUS_PROXYDETECTING:
1820 trace("BINDSTATUS_PROXYDETECTING\n");
1821 break;
1822 case BINDSTATUS_COOKIE_SENT:
1823 trace("BINDSTATUS_COOKIE_SENT\n");
1824 break;
1825 case BINDSTATUS_DECODING:
1826 trace("BINDSTATUS_DECODING\n");
1827 break;
1828 default:
1829 ok(0, "unexpected code %d\n", ulStatusCode);
1830 };
1831
1832 if(current_binding) {
1833 IWinInetHttpInfo *http_info;
1834 HRESULT hres;
1835
1836 hres = IBinding_QueryInterface(current_binding, &IID_IWinInetHttpInfo, (void**)&http_info);
1838 ok(hres == S_OK, "Could not get IWinInetHttpInfo iface: %08x\n", hres);
1839 test_WinInetHttpInfo(http_info, ulStatusCode);
1840 } else
1842 "QueryInterface(IID_IWinInetHttpInfo) returned: %08x, expected E_NOINTERFACE\n", hres);
1843 if(SUCCEEDED(hres))
1844 IWinInetHttpInfo_Release(http_info);
1845 }
1846
1847 return S_OK;
1848}
1849
1851{
1852 if(iface == &objbsc) {
1853 CHECK_EXPECT(Obj_OnStopBinding);
1855 }else {
1856 CHECK_EXPECT(OnStopBinding);
1858 }
1859
1860 ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1861
1863 todo_wine ok(hresult == S_OK, "Got %08x\n", hresult);
1864 return S_OK;
1865 }
1866
1867 /* ignore DNS failure */
1869 return S_OK;
1870
1871 if(filedwl_api) {
1873 ok(SUCCEEDED(hresult), "binding failed: %08x\n", hresult);
1874 else if(abort_start && abort_hres == E_NOTIMPL)
1875 todo_wine ok(hresult == S_FALSE, "binding failed: %08x, expected S_FALSE\n", hresult);
1876 else
1877 ok(hresult == E_ABORT, "binding failed: %08x, expected E_ABORT\n", hresult);
1878 } else
1879 ok(hresult == binding_hres, "binding failed: %08x, expected %08x\n", hresult, binding_hres);
1880 ok(szError == NULL, "szError should be NULL\n");
1881
1882 if(current_binding) {
1883 CLSID clsid;
1884 DWORD res;
1885 LPOLESTR res_str;
1886 HRESULT hres;
1887
1888 hres = IBinding_GetBindResult(current_binding, &clsid, &res, &res_str, NULL);
1889 ok(hres == S_OK, "GetBindResult failed: %08x, expected S_OK\n", hres);
1890 ok(res == hresult, "res = %08x, expected %08x\n", res, binding_hres);
1891 ok(!res_str, "incorrect res_str = %s\n", wine_dbgstr_w(res_str));
1892
1893 if(hresult==S_OK || (abort_start && hresult!=S_FALSE) || hresult == REGDB_E_CLASSNOTREG) {
1895 "incorrect protocol CLSID: %s, expected CLSID_NULL\n",
1897 }else if(emulate_protocol) {
1898 todo_wine ok(IsEqualCLSID(&clsid, &CLSID_FtpProtocol),
1899 "incorrect protocol CLSID: %s, expected CLSID_FtpProtocol\n",
1901 }else if(test_protocol == FTP_TEST) {
1902 ok(IsEqualCLSID(&clsid, &CLSID_FtpProtocol),
1903 "incorrect protocol CLSID: %s, expected CLSID_FtpProtocol\n",
1905 }else if(test_protocol == FILE_TEST) {
1906 ok(IsEqualCLSID(&clsid, &CLSID_FileProtocol),
1907 "incorrect protocol CLSID: %s, expected CLSID_FileProtocol\n",
1909 }else if(test_protocol == HTTP_TEST) {
1910 ok(IsEqualCLSID(&clsid, &CLSID_HttpProtocol),
1911 "incorrect protocol CLSID: %s, expected CLSID_HttpProtocol\n",
1913 }else if(test_protocol == HTTPS_TEST) {
1914 ok(IsEqualCLSID(&clsid, &CLSID_HttpSProtocol),
1915 "incorrect protocol CLSID: %s, expected CLSID_HttpSProtocol\n",
1917 }else if(test_protocol == ABOUT_TEST) {
1919 "incorrect protocol CLSID: %s, expected CLSID_AboutProtocol\n",
1921 }else {
1922 ok(0, "unexpected (%d)\n", test_protocol);
1923 }
1924 }
1925
1928 if(iface != &objbsc)
1929 ok( WaitForSingleObject(complete_event2, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
1930 }
1931
1935 ok(file == INVALID_HANDLE_VALUE, "expected INVALID_HANDLE_VALUE, got %p\n", file);
1936 ok(GetLastError() == ERROR_SHARING_VIOLATION, "expected ERROR_SHARING_VIOLATION, got %u\n", GetLastError());
1937 http_cache_file[0] = 0;
1938 }
1939
1940 return S_OK;
1941}
1942
1943static HRESULT WINAPI statusclb_GetBindInfo(IBindStatusCallbackEx *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
1944{
1945 DWORD cbSize;
1946
1947 if(iface == &objbsc)
1948 CHECK_EXPECT(Obj_GetBindInfo);
1949 else
1950 CHECK_EXPECT(GetBindInfo);
1951
1952 ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1953
1954 *grfBINDF = bindf;
1955 cbSize = pbindinfo->cbSize;
1956 memset(pbindinfo, 0, cbSize);
1957 pbindinfo->cbSize = cbSize;
1958
1959 return S_OK;
1960}
1961
1963{
1964 ULARGE_INTEGER new_pos;
1966 HRESULT hres;
1967
1968 pos.QuadPart = 0;
1969 new_pos.QuadPart = 0xdeadbeef;
1970 hres = IStream_Seek(stream, pos, STREAM_SEEK_SET, &new_pos);
1971 ok(hres == S_OK, "Seek failed: %08x\n", hres);
1972 ok(!new_pos.QuadPart, "new_pos.QuadPart != 0\n");
1973
1974 pos.QuadPart = 0;
1975 new_pos.QuadPart = 0xdeadbeef;
1976 hres = IStream_Seek(stream, pos, STREAM_SEEK_END, &new_pos);
1977 ok(hres == S_OK, "Seek failed: %08x\n", hres);
1978 ok(new_pos.QuadPart, "new_pos.QuadPart = 0\n");
1979
1980 pos.QuadPart = 0;
1981 new_pos.QuadPart = 0xdeadbeef;
1982 hres = IStream_Seek(stream, pos, 100, &new_pos);
1983 ok(hres == E_FAIL, "Seek failed: %08x\n", hres);
1984 ok(new_pos.QuadPart == 0xdeadbeef, "unexpected new_pos.QuadPart\n");
1985}
1986
1988 DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
1989{
1990 HRESULT hres;
1991 DWORD readed;
1992 BYTE buf[512];
1993 CHAR clipfmt[512];
1994
1995 if(iface == &objbsc)
1996 ok(0, "unexpected call\n");
1997
1998 CHECK_EXPECT2(OnDataAvailable);
1999
2000 ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
2001
2003 "Download state was %d, expected DOWNLOADING or END_DOWNLOAD\n",
2006
2008 ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION|BSCF_LASTDATANOTIFICATION), "grfBSCF = %x\n", grfBSCF);
2009
2010 ok(pformatetc != NULL, "pformatetx == NULL\n");
2011 if(pformatetc) {
2012 if (mime_type[0]) {
2013 INT ret;
2014 clipfmt[0] = 0;
2015 ret = GetClipboardFormatNameA(pformatetc->cfFormat, clipfmt, sizeof(clipfmt)-1);
2016 ok(ret, "GetClipboardFormatName failed, error %d\n", GetLastError());
2017 ok(!strcmp(clipfmt, mime_type), "clipformat %x != mime_type, \"%s\" != \"%s\"\n",
2018 pformatetc->cfFormat, clipfmt, mime_type);
2019 } else {
2020 ok(pformatetc->cfFormat == 0, "clipformat=%x\n", pformatetc->cfFormat);
2021 }
2022 ok(pformatetc->ptd == NULL, "ptd = %p\n", pformatetc->ptd);
2023 ok(pformatetc->dwAspect == 1, "dwAspect=%u\n", pformatetc->dwAspect);
2024 ok(pformatetc->lindex == -1, "lindex=%d\n", pformatetc->lindex);
2025 ok(pformatetc->tymed == tymed, "tymed=%u, expected %u\n", pformatetc->tymed, tymed);
2026 }
2027
2028 ok(pstgmed != NULL, "stgmeg == NULL\n");
2029 ok(pstgmed->tymed == tymed, "tymed=%u, expected %u\n", pstgmed->tymed, tymed);
2030 ok(pstgmed->pUnkForRelease != NULL, "pUnkForRelease == NULL\n");
2031
2032 switch(pstgmed->tymed) {
2033 case TYMED_ISTREAM: {
2034 IStream *stream = U(*pstgmed).pstm;
2035
2036 ok(stream != NULL, "U(*pstgmed).pstm == NULL\n");
2037
2038 if(grfBSCF & BSCF_FIRSTDATANOTIFICATION) {
2039 STATSTG stat;
2040
2041 hres = IStream_Write(stream, buf, 10, NULL);
2043 "Write failed: %08x, expected STG_E_ACCESSDENIED\n", hres);
2044
2045 hres = IStream_Commit(stream, 0);
2046 ok(hres == E_NOTIMPL, "Commit failed: %08x, expected E_NOTIMPL\n", hres);
2047
2048 hres = IStream_Revert(stream);
2049 ok(hres == E_NOTIMPL, "Revert failed: %08x, expected E_NOTIMPL\n", hres);
2050
2051 hres = IStream_Stat(stream, NULL, STATFLAG_NONAME);
2052 ok(hres == E_FAIL, "hres = %x\n", hres);
2054 hres = IStream_Stat(stream, &stat, STATFLAG_DEFAULT);
2055 ok(hres == S_OK, "hres = %x\n", hres);
2056 ok(!lstrcmpW(stat.pwcsName, cache_file_name),
2057 "stat.pwcsName = %s, cache_file_name = %s\n",
2059 CoTaskMemFree(stat.pwcsName);
2060 ok(U(stat.cbSize).LowPart == (bindf&BINDF_ASYNCHRONOUS?0:6500),
2061 "stat.cbSize.LowPart = %u\n", U(stat.cbSize).LowPart);
2062 } else {
2063 hres = IStream_Stat(stream, &stat, STATFLAG_NONAME);
2064 ok(hres == S_OK, "hres = %x\n", hres);
2065 ok(!stat.pwcsName || broken(stat.pwcsName!=NULL),
2066 "stat.pwcsName = %s\n", wine_dbgstr_w(stat.pwcsName));
2067 }
2068 ok(stat.type == STGTY_STREAM, "stat.type = %x\n", stat.type);
2069 ok(U(stat.cbSize).HighPart == 0, "stat.cbSize.HighPart != 0\n");
2070 ok(stat.grfMode == (U(stat.cbSize).LowPart?GENERIC_READ:0), "stat.grfMode = %x\n", stat.grfMode);
2071 ok(stat.grfLocksSupported == 0, "stat.grfLocksSupported = %x\n", stat.grfLocksSupported);
2072 ok(stat.grfStateBits == 0, "stat.grfStateBits = %x\n", stat.grfStateBits);
2073 ok(stat.reserved == 0, "stat.reserved = %x\n", stat.reserved);
2074 }
2075
2076 if(callback_read) {
2077 do {
2078 hres = IStream_Read(stream, buf, 512, &readed);
2079 if(test_protocol == HTTP_TEST && emulate_protocol && readed)
2080 ok(buf[0] == (use_cache_file && !(bindf&BINDF_ASYNCHRONOUS) ? 'X' : '?'), "buf[0] = '%c'\n", buf[0]);
2081 }while(hres == S_OK);
2082 ok(hres == S_FALSE || hres == E_PENDING, "IStream_Read returned %08x\n", hres);
2083 }
2084
2085 if(use_cache_file && (grfBSCF & BSCF_FIRSTDATANOTIFICATION) && !(bindf & BINDF_PULLDATA))
2087 break;
2088 }
2089 case TYMED_FILE:
2091 ok(!lstrcmpW(pstgmed->u.lpszFileName, file_url+7),
2092 "unexpected file name %s\n", wine_dbgstr_w(pstgmed->u.lpszFileName));
2093 else if(emulate_protocol)
2094 ok(!lstrcmpW(pstgmed->u.lpszFileName, cache_fileW),
2095 "unexpected file name %s\n", wine_dbgstr_w(pstgmed->u.lpszFileName));
2096 else if(test_protocol == HTTP_TEST)
2097 lstrcpyW(http_cache_file, pstgmed->u.lpszFileName);
2098 else
2099 ok(pstgmed->u.lpszFileName != NULL, "lpszFileName == NULL\n");
2100 }
2101
2105
2106 return S_OK;
2107}
2108
2110{
2111 CHECK_EXPECT(OnObjectAvailable);
2112
2113 if(iface != &objbsc)
2114 ok(0, "unexpected call\n");
2115
2116 ok(IsEqualGUID(&IID_IUnknown, riid), "riid = %s\n", wine_dbgstr_guid(riid));
2117 ok(punk != NULL, "punk == NULL\n");
2118
2119 return S_OK;
2120}
2121
2122static HRESULT WINAPI statusclb_GetBindInfoEx(IBindStatusCallbackEx *iface, DWORD *grfBINDF, BINDINFO *pbindinfo,
2123 DWORD *grfBINDF2, DWORD *pdwReserved)
2124{
2125 CHECK_EXPECT(GetBindInfoEx);
2126
2127 ok(grfBINDF != NULL, "grfBINDF == NULL\n");
2128 ok(grfBINDF2 != NULL, "grfBINDF2 == NULL\n");
2129 ok(pbindinfo != NULL, "pbindinfo == NULL\n");
2130 ok(pdwReserved != NULL, "dwReserved == NULL\n");
2131
2132 return S_OK;
2133}
2134
2135static const IBindStatusCallbackExVtbl BindStatusCallbackVtbl = {
2148};
2149
2153
2155{
2156 *ppv = NULL;
2157 ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2158 return E_NOINTERFACE;
2159}
2160
2162{
2163 return 2;
2164}
2165
2167{
2168 return 1;
2169}
2170
2171static HRESULT WINAPI MonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val)
2172{
2173 switch(mkp) {
2174 case MIMETYPEPROP:
2175 CHECK_EXPECT(PutProperty_MIMETYPEPROP);
2176 ok(!lstrcmpW(val, wszTextHtml), "val = %s\n", wine_dbgstr_w(val));
2177 break;
2178 case CLASSIDPROP:
2179 CHECK_EXPECT(PutProperty_CLASSIDPROP);
2180 break;
2181 default:
2182 break;
2183 }
2184
2185 return S_OK;
2186}
2187
2188static const IMonikerPropVtbl MonikerPropVtbl = {
2193};
2194
2196
2198{
2199 *ppv = NULL;
2200
2201 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IPersistMoniker, riid))
2202 *ppv = iface;
2203 else if(IsEqualGUID(&IID_IMonikerProp, riid))
2204 *ppv = &MonikerProp;
2205
2206 if(*ppv)
2207 return S_OK;
2208
2209 ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2210 return E_NOINTERFACE;
2211}
2212
2214{
2215 return 2;
2216}
2217
2219{
2220 return 1;
2221}
2222
2224{
2225 ok(0, "unexpected call\n");
2226 return E_NOTIMPL;
2227}
2228
2230{
2231 ok(0, "unexpected call\n");
2232 return E_NOTIMPL;
2233}
2234
2236 IMoniker *pimkName, LPBC pibc, DWORD grfMode)
2237{
2238 IUnknown *unk;
2239 HRESULT hres;
2240
2241 static WCHAR cbinding_contextW[] =
2242 {'C','B','i','n','d','i','n','g',' ','C','o','n','t','e','x','t',0};
2243
2244 CHECK_EXPECT(Load);
2245 ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
2246
2248 ok(!fFullyAvailable, "fFullyAvailable = %x\n", fFullyAvailable);
2249 else
2250 ok(fFullyAvailable, "fFullyAvailable = %x\n", fFullyAvailable);
2251 ok(pimkName != NULL, "pimkName == NULL\n");
2252 ok(pibc != NULL, "pibc == NULL\n");
2253 ok(grfMode == 0x12, "grfMode = %x\n", grfMode);
2254
2255 hres = IBindCtx_GetObjectParam(pibc, cbinding_contextW, &unk);
2256 ok(hres == S_OK, "GetObjectParam(CBinding Context) failed: %08x\n", hres);
2257 if(SUCCEEDED(hres)) {
2258 IBinding *binding;
2259
2260 hres = IUnknown_QueryInterface(unk, &IID_IBinding, (void**)&binding);
2261 ok(hres == S_OK, "Could not get IBinding: %08x\n", hres);
2262
2263 IBinding_Release(binding);
2264 IUnknown_Release(unk);
2265 }
2266
2267 SET_EXPECT(QueryInterface_IServiceProvider);
2269 ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
2270 CHECK_CALLED(QueryInterface_IServiceProvider);
2271
2272 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2273 SET_EXPECT(GetBindInfo);
2274 SET_EXPECT(OnStartBinding);
2275 if(test_redirect)
2276 SET_EXPECT(OnProgress_REDIRECTING);
2277 SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
2279 SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
2281 SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
2283 SET_EXPECT(OnDataAvailable);
2285 SET_EXPECT(OnStopBinding);
2286
2287 hres = IMoniker_BindToStorage(pimkName, pibc, NULL, &IID_IStream, (void**)&unk);
2288 ok(hres == S_OK, "Load failed: %08x\n", hres);
2289
2290 CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */
2291 CHECK_CALLED(GetBindInfo);
2292 CHECK_CALLED(OnStartBinding);
2293 if(test_redirect)
2294 CHECK_CALLED(OnProgress_REDIRECTING);
2295 CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
2297 CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
2299 CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
2301 CHECK_CALLED(OnDataAvailable);
2303 CHECK_CALLED(OnStopBinding);
2304
2305 if(unk)
2306 IUnknown_Release(unk);
2307
2308 return S_OK;
2309}
2310
2311static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName, LPBC pbc, BOOL fRemember)
2312{
2313 ok(0, "unexpected call\n");
2314 return E_NOTIMPL;
2315}
2316
2318{
2319 ok(0, "unexpected call\n");
2320 return E_NOTIMPL;
2321}
2322
2324{
2325 ok(0, "unexpected call\n");
2326 return E_NOTIMPL;
2327}
2328
2329static const IPersistMonikerVtbl PersistMonikerVtbl = {
2339};
2340
2342
2344{
2345 *ppv = NULL;
2346
2348 *ppv = iface;
2349 return S_OK;
2350 }
2351
2352 if(IsEqualGUID(&IID_IMarshal, riid))
2353 return E_NOINTERFACE;
2355 return E_NOINTERFACE;
2356
2357 ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2358 return E_NOTIMPL;
2359}
2360
2362{
2363 return 2;
2364}
2365
2367{
2368 return 1;
2369}
2370
2372{
2373 CHECK_EXPECT(CreateInstance);
2374 ok(!outer, "outer = %p\n", outer);
2375 ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
2376 *ppv = &PersistMoniker;
2377 return S_OK;
2378}
2379
2381{
2382 ok(0, "unexpected call\n");
2383 return S_OK;
2384}
2385
2386static const IClassFactoryVtbl ClassFactoryVtbl = {
2392};
2393
2395
2397{
2398 *ppv = NULL;
2399
2401 *ppv = iface;
2402 return S_OK;
2403 }
2404
2405 if(IsEqualGUID(&IID_IInternetProtocolInfo, riid))
2406 return E_NOINTERFACE;
2407
2408 ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2409 return E_NOTIMPL;
2410}
2411
2413{
2414 if(IsEqualGUID(&IID_IInternetProtocolInfo, riid))
2415 return E_NOINTERFACE;
2416
2417 ok(outer != NULL, "outer == NULL\n");
2418 ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
2419 *ppv = &Protocol;
2420 return S_OK;
2421}
2422
2423static const IClassFactoryVtbl ProtocolCFVtbl = {
2429};
2430
2432
2434{
2435 IBindCtx *bctx = (IBindCtx*)0x0ff00ff0;
2436 IUnknown *unk;
2437 HRESULT hres;
2438 ULONG ref;
2439 BIND_OPTS bindopts;
2440
2441 hres = CreateAsyncBindCtx(0, NULL, NULL, &bctx);
2442 ok(hres == E_INVALIDARG, "CreateAsyncBindCtx failed. expected: E_INVALIDARG, got: %08x\n", hres);
2443 ok(bctx == (IBindCtx*)0x0ff00ff0, "bctx should not be changed\n");
2444
2446 ok(hres == E_INVALIDARG, "CreateAsyncBindCtx failed. expected: E_INVALIDARG, got: %08x\n", hres);
2447
2448 SET_EXPECT(QueryInterface_IServiceProvider);
2450 ok(hres == S_OK, "CreateAsyncBindCtx failed: %08x\n", hres);
2451 CHECK_CALLED(QueryInterface_IServiceProvider);
2452
2453 bindopts.cbStruct = sizeof(bindopts);
2454 hres = IBindCtx_GetBindOptions(bctx, &bindopts);
2455 ok(hres == S_OK, "IBindCtx_GetBindOptions failed: %08x\n", hres);
2456 ok(bindopts.grfFlags == BIND_MAYBOTHERUSER,
2457 "bindopts.grfFlags = %08x, expected: BIND_MAYBOTHERUSER\n", bindopts.grfFlags);
2458 ok(bindopts.grfMode == (STGM_READWRITE | STGM_SHARE_EXCLUSIVE),
2459 "bindopts.grfMode = %08x, expected: STGM_READWRITE | STGM_SHARE_EXCLUSIVE\n",
2460 bindopts.grfMode);
2461 ok(bindopts.dwTickCountDeadline == 0,
2462 "bindopts.dwTickCountDeadline = %08x, expected: 0\n", bindopts.dwTickCountDeadline);
2463
2464 hres = IBindCtx_QueryInterface(bctx, &IID_IAsyncBindCtx, (void**)&unk);
2465 ok(hres == E_NOINTERFACE, "QueryInterface(IID_IAsyncBindCtx) failed: %08x, expected E_NOINTERFACE\n", hres);
2466 if(SUCCEEDED(hres))
2467 IUnknown_Release(unk);
2468
2469 ref = IBindCtx_Release(bctx);
2470 ok(ref == 0, "bctx should be destroyed here\n");
2471}
2472
2474{
2475 IBindCtx *bctx = NULL, *bctx2 = NULL, *bctx_arg = NULL;
2476 IUnknown *unk;
2477 BIND_OPTS bindopts;
2478 HRESULT hres;
2479
2480 static WCHAR testW[] = {'t','e','s','t',0};
2481
2482 if (!pCreateAsyncBindCtxEx) {
2483 win_skip("CreateAsyncBindCtxEx not present\n");
2484 return;
2485 }
2486
2487 hres = pCreateAsyncBindCtxEx(NULL, 0, NULL, NULL, NULL, 0);
2488 ok(hres == E_INVALIDARG, "CreateAsyncBindCtx failed: %08x, expected E_INVALIDARG\n", hres);
2489
2490 hres = pCreateAsyncBindCtxEx(NULL, 0, NULL, NULL, &bctx, 0);
2491 ok(hres == S_OK, "CreateAsyncBindCtxEx failed: %08x\n", hres);
2492
2493 if(SUCCEEDED(hres)) {
2494 bindopts.cbStruct = sizeof(bindopts);
2495 hres = IBindCtx_GetBindOptions(bctx, &bindopts);
2496 ok(hres == S_OK, "IBindCtx_GetBindOptions failed: %08x\n", hres);
2497 ok(bindopts.grfFlags == BIND_MAYBOTHERUSER,
2498 "bindopts.grfFlags = %08x, expected: BIND_MAYBOTHERUSER\n", bindopts.grfFlags);
2499 ok(bindopts.grfMode == (STGM_READWRITE | STGM_SHARE_EXCLUSIVE),
2500 "bindopts.grfMode = %08x, expected: STGM_READWRITE | STGM_SHARE_EXCLUSIVE\n",
2501 bindopts.grfMode);
2502 ok(bindopts.dwTickCountDeadline == 0,
2503 "bindopts.dwTickCountDeadline = %08x, expected: 0\n", bindopts.dwTickCountDeadline);
2504
2505 IBindCtx_Release(bctx);
2506 }
2507
2508 CreateBindCtx(0, &bctx_arg);
2509 hres = pCreateAsyncBindCtxEx(NULL, 0, NULL, NULL, &bctx, 0);
2510 ok(hres == S_OK, "CreateAsyncBindCtxEx failed: %08x\n", hres);
2511
2512 if(SUCCEEDED(hres)) {
2513 bindopts.cbStruct = sizeof(bindopts);
2514 hres = IBindCtx_GetBindOptions(bctx, &bindopts);
2515 ok(hres == S_OK, "IBindCtx_GetBindOptions failed: %08x\n", hres);
2516 ok(bindopts.grfFlags == BIND_MAYBOTHERUSER,
2517 "bindopts.grfFlags = %08x, expected: BIND_MAYBOTHERUSER\n", bindopts.grfFlags);
2518 ok(bindopts.grfMode == (STGM_READWRITE | STGM_SHARE_EXCLUSIVE),
2519 "bindopts.grfMode = %08x, expected: STGM_READWRITE | STGM_SHARE_EXCLUSIVE\n",
2520 bindopts.grfMode);
2521 ok(bindopts.dwTickCountDeadline == 0,
2522 "bindopts.dwTickCountDeadline = %08x, expected: 0\n", bindopts.dwTickCountDeadline);
2523
2524 IBindCtx_Release(bctx);
2525 }
2526
2527 IBindCtx_Release(bctx_arg);
2528
2529 SET_EXPECT(QueryInterface_IServiceProvider);
2530 hres = pCreateAsyncBindCtxEx(NULL, 0, (IBindStatusCallback*)&bsc, NULL, &bctx, 0);
2531 ok(hres == S_OK, "CreateAsyncBindCtxEx failed: %08x\n", hres);
2532 CHECK_CALLED(QueryInterface_IServiceProvider);
2533
2534 hres = IBindCtx_QueryInterface(bctx, &IID_IAsyncBindCtx, (void**)&unk);
2535 ok(hres == S_OK, "QueryInterface(IID_IAsyncBindCtx) failed: %08x\n", hres);
2536 if(SUCCEEDED(hres))
2537 IUnknown_Release(unk);
2538
2539 IBindCtx_Release(bctx);
2540
2541 hres = CreateBindCtx(0, &bctx2);
2542 ok(hres == S_OK, "CreateBindCtx failed: %08x\n", hres);
2543
2544 hres = pCreateAsyncBindCtxEx(bctx2, 0, NULL, NULL, &bctx, 0);
2545 ok(hres == S_OK, "CreateAsyncBindCtxEx failed: %08x\n", hres);
2546
2547 hres = IBindCtx_RegisterObjectParam(bctx2, testW, (IUnknown*)&Protocol);
2548 ok(hres == S_OK, "RegisterObjectParam failed: %08x\n", hres);
2549
2550 hres = IBindCtx_GetObjectParam(bctx, testW, &unk);
2551 ok(hres == S_OK, "GetObjectParam failed: %08x\n", hres);
2552 ok(unk == (IUnknown*)&Protocol, "unexpected unk %p\n", unk);
2553
2554 IBindCtx_Release(bctx);
2555 IBindCtx_Release(bctx2);
2556}
2557
2559{
2560 IBindStatusCallbackEx *bscex;
2561 BINDINFO bindinfo = {sizeof(bindinfo)};
2562 DWORD bindf, bindf2, dw;
2563 HRESULT hres;
2564
2565 hres = IBindStatusCallback_QueryInterface(holder, &IID_IBindStatusCallbackEx, (void**)&bscex);
2566 if(FAILED(hres)) {
2567 win_skip("IBindStatusCallbackEx not supported\n");
2568 return;
2569 }
2570
2571 use_bscex = TRUE;
2572
2573 bindf = 0;
2574 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2575 SET_EXPECT(GetBindInfoEx);
2576 hres = IBindStatusCallback_GetBindInfo(holder, &bindf, &bindinfo);
2577 ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
2578 CHECK_CALLED(QueryInterface_IBindStatusCallbackEx);
2579 CHECK_CALLED(GetBindInfoEx);
2580
2581 bindf = bindf2 = dw = 0;
2582 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2583 SET_EXPECT(GetBindInfoEx);
2584 hres = IBindStatusCallbackEx_GetBindInfoEx(bscex, &bindf, &bindinfo, &bindf2, &dw);
2585 ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
2586 CHECK_CALLED(QueryInterface_IBindStatusCallbackEx);
2587 CHECK_CALLED(GetBindInfoEx);
2588
2589 use_bscex = FALSE;
2590
2591 bindf = bindf2 = dw = 0xdeadbeef;
2592 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2593 SET_EXPECT(GetBindInfo);
2594 hres = IBindStatusCallbackEx_GetBindInfoEx(bscex, &bindf, &bindinfo, &bindf2, &dw);
2595 ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
2596 CHECK_CALLED(QueryInterface_IBindStatusCallbackEx);
2597 CHECK_CALLED(GetBindInfo);
2598 ok(bindf2 == 0xdeadbeef, "bindf2 = %x\n", bindf2);
2599 ok(dw == 0xdeadbeef, "dw = %x\n", dw);
2600
2601 IBindStatusCallbackEx_Release(bscex);
2602}
2603
2605{
2606 IServiceProvider *serv_prov;
2607 IHttpNegotiate *http_negotiate, *http_negotiate_serv;
2608 IHttpNegotiate2 *http_negotiate2, *http_negotiate2_serv;
2609 IAuthenticate *authenticate, *authenticate_serv;
2612 BINDINFO bindinfo = {sizeof(bindinfo)};
2613 BOOL ret = TRUE;
2614 LPWSTR wstr;
2615 DWORD dw;
2616 HRESULT hres;
2617
2618 hres = IBindStatusCallback_QueryInterface(holder, &IID_IServiceProvider, (void**)&serv_prov);
2619 ok(hres == S_OK, "Could not get IServiceProvider interface: %08x\n", hres);
2620
2621 dw = 0xdeadbeef;
2622 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2623 SET_EXPECT(GetBindInfo);
2624 hres = IBindStatusCallback_GetBindInfo(holder, &dw, &bindinfo);
2625 ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
2626 CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */
2627 CHECK_CALLED(GetBindInfo);
2628
2629 test_GetBindInfoEx(holder);
2630
2631 SET_EXPECT(OnStartBinding);
2632 hres = IBindStatusCallback_OnStartBinding(holder, 0, (void*)0xdeadbeef);
2633 ok(hres == S_OK, "OnStartBinding failed: %08x\n", hres);
2634 CHECK_CALLED(OnStartBinding);
2635
2636 hres = IBindStatusCallback_QueryInterface(holder, &IID_IHttpNegotiate, (void**)&http_negotiate);
2637 ok(hres == S_OK, "Could not get IHttpNegotiate interface: %08x\n", hres);
2638
2639 SET_EXPECT(QueryInterface_IHttpNegotiate);
2640 hres = IServiceProvider_QueryService(serv_prov, &IID_IHttpNegotiate, &IID_IHttpNegotiate,
2641 (void**)&http_negotiate_serv);
2642 ok(hres == S_OK, "Could not get IHttpNegotiate service: %08x\n", hres);
2643 CLEAR_CALLED(QueryInterface_IHttpNegotiate); /* IE <8 */
2644
2645 ok(http_negotiate == http_negotiate_serv, "http_negotiate != http_negotiate_serv\n");
2646
2647 wstr = (void*)0xdeadbeef;
2648 SET_EXPECT(QueryInterface_IHttpNegotiate);
2649 SET_EXPECT(BeginningTransaction);
2650 hres = IHttpNegotiate_BeginningTransaction(http_negotiate_serv, current_url, emptyW, 0, &wstr);
2651 CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate); /* IE8 */
2652 CHECK_CALLED(BeginningTransaction);
2653 ok(hres == S_OK, "BeginningTransaction failed: %08x\n", hres);
2654 ok(wstr == NULL, "wstr = %p\n", wstr);
2655
2656 IHttpNegotiate_Release(http_negotiate_serv);
2657
2658 hres = IServiceProvider_QueryService(serv_prov, &IID_IHttpNegotiate, &IID_IHttpNegotiate,
2659 (void**)&http_negotiate_serv);
2660 ok(hres == S_OK, "Could not get IHttpNegotiate service: %08x\n", hres);
2661 ok(http_negotiate == http_negotiate_serv, "http_negotiate != http_negotiate_serv\n");
2662 IHttpNegotiate_Release(http_negotiate_serv);
2663
2664 hres = IBindStatusCallback_QueryInterface(holder, &IID_IHttpNegotiate2, (void**)&http_negotiate2);
2665 if(SUCCEEDED(hres)) {
2667
2668 SET_EXPECT(QueryInterface_IHttpNegotiate2);
2669 hres = IServiceProvider_QueryService(serv_prov, &IID_IHttpNegotiate2, &IID_IHttpNegotiate2,
2670 (void**)&http_negotiate2_serv);
2671 ok(hres == S_OK, "Could not get IHttpNegotiate2 service: %08x\n", hres);
2672 CLEAR_CALLED(QueryInterface_IHttpNegotiate2); /* IE <8 */
2673 ok(http_negotiate2 == http_negotiate2_serv, "http_negotiate != http_negotiate_serv\n");
2674
2675 SET_EXPECT(QueryInterface_IHttpNegotiate2);
2676 SET_EXPECT(GetRootSecurityId);
2677 hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, (void*)0xdeadbeef, (void*)0xdeadbeef, 0);
2678 ok(hres == E_NOTIMPL, "GetRootSecurityId failed: %08x\n", hres);
2679 CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate2); /* IE8 */
2680 CHECK_CALLED(GetRootSecurityId);
2681
2682 IHttpNegotiate2_Release(http_negotiate2_serv);
2683 IHttpNegotiate2_Release(http_negotiate2);
2684 }else {
2685 skip("Could not get IHttpNegotiate2\n");
2686 ret = FALSE;
2687 }
2688
2689 SET_EXPECT(OnProgress_FINDINGRESOURCE);
2690 hres = IBindStatusCallback_OnProgress(holder, 0, 0, BINDSTATUS_FINDINGRESOURCE, NULL);
2691 ok(hres == S_OK, "OnProgress failed: %08x\n", hres);
2692 CHECK_CALLED(OnProgress_FINDINGRESOURCE);
2693
2694 SET_EXPECT(QueryInterface_IHttpNegotiate);
2695 SET_EXPECT(OnResponse);
2696 wstr = (void*)0xdeadbeef;
2697 hres = IHttpNegotiate_OnResponse(http_negotiate, 200, emptyW, NULL, NULL);
2698 ok(hres == S_OK, "OnResponse failed: %08x\n", hres);
2699 CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate); /* IE8 */
2700 CHECK_CALLED(OnResponse);
2701
2702 IHttpNegotiate_Release(http_negotiate);
2703
2704 hres = IBindStatusCallback_QueryInterface(holder, &IID_IAuthenticate, (void**)&authenticate);
2705 ok(hres == S_OK, "Could not get IAuthenticate interface: %08x\n", hres);
2706
2707 SET_EXPECT(QueryInterface_IAuthenticate);
2708 SET_EXPECT(QueryService_IAuthenticate);
2709 hres = IServiceProvider_QueryService(serv_prov, &IID_IAuthenticate, &IID_IAuthenticate,
2710 (void**)&authenticate_serv);
2711 ok(hres == S_OK, "Could not get IAuthenticate service: %08x\n", hres);
2712 CLEAR_CALLED(QueryInterface_IAuthenticate); /* IE <8 */
2713 CLEAR_CALLED(QueryService_IAuthenticate); /* IE <8 */
2714 ok(authenticate == authenticate_serv, "authenticate != authenticate_serv\n");
2715 IAuthenticate_Release(authenticate_serv);
2716
2717 hres = IServiceProvider_QueryService(serv_prov, &IID_IAuthenticate, &IID_IAuthenticate,
2718 (void**)&authenticate_serv);
2719 ok(hres == S_OK, "Could not get IAuthenticate service: %08x\n", hres);
2720 ok(authenticate == authenticate_serv, "authenticate != authenticate_serv\n");
2721
2722 IAuthenticate_Release(authenticate);
2723 IAuthenticate_Release(authenticate_serv);
2724
2725 hres = IBindStatusCallback_QueryInterface(holder, &IID_IInternetBindInfo, (void**)&bind_info);
2726 ok(hres == S_OK || broken(hres == E_NOINTERFACE /* win2k */), "Could not get IInternetBindInfo interface: %08x\n", hres);
2727
2728 if(SUCCEEDED(hres)) {
2729 hres = IInternetBindInfo_GetBindString(bind_info, BINDSTRING_USER_AGENT, &wstr, 1, &dw);
2730 ok(hres == E_NOINTERFACE, "GetBindString(BINDSTRING_USER_AGENT) failed: %08x\n", hres);
2731
2732 IInternetBindInfo_Release(bind_info);
2733 }
2734
2735 SET_EXPECT(OnStopBinding);
2736 hres = IBindStatusCallback_OnStopBinding(holder, S_OK, NULL);
2737 ok(hres == S_OK, "OnStopBinding failed: %08x\n", hres);
2738 CHECK_CALLED(OnStopBinding);
2739
2740 SET_EXPECT(QueryInterface_IInternetProtocol);
2741 SET_EXPECT(QueryService_IInternetProtocol);
2742 hres = IServiceProvider_QueryService(serv_prov, &IID_IInternetProtocol, &IID_IInternetProtocol,
2743 (void**)&protocol);
2744 ok(hres == E_NOINTERFACE, "QueryService(IInternetProtocol) failed: %08x\n", hres);
2745 CHECK_CALLED(QueryInterface_IInternetProtocol);
2746 CHECK_CALLED(QueryService_IInternetProtocol);
2747
2748 IServiceProvider_Release(serv_prov);
2749 return ret;
2750}
2751
2753{
2754 IBindStatusCallback *prevbsc, *clb, *prev_clb;
2755 IBindCtx *bindctx;
2756 BOOL ret = TRUE;
2757 IUnknown *unk;
2758 HRESULT hres;
2759
2761
2762 hres = CreateBindCtx(0, &bindctx);
2763 ok(hres == S_OK, "BindCtx failed: %08x\n", hres);
2764
2765 SET_EXPECT(QueryInterface_IServiceProvider);
2766
2767 hres = IBindCtx_RegisterObjectParam(bindctx, BSCBHolder, (IUnknown*)&bsc);
2768 ok(hres == S_OK, "RegisterObjectParam failed: %08x\n", hres);
2769
2770 SET_EXPECT(QueryInterface_IBindStatusCallback);
2771 SET_EXPECT(QueryInterface_IBindStatusCallbackHolder);
2772 prevbsc = (void*)0xdeadbeef;
2773 hres = RegisterBindStatusCallback(bindctx, (IBindStatusCallback*)&bsc, &prevbsc, 0);
2774 ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
2775 ok(prevbsc == (IBindStatusCallback*)&bsc, "prevbsc=%p\n", prevbsc);
2776 CHECK_CALLED(QueryInterface_IBindStatusCallback);
2777 CHECK_CALLED(QueryInterface_IBindStatusCallbackHolder);
2778
2779 CHECK_CALLED(QueryInterface_IServiceProvider);
2780
2781 hres = IBindCtx_GetObjectParam(bindctx, BSCBHolder, &unk);
2782 ok(hres == S_OK, "GetObjectParam failed: %08x\n", hres);
2783
2784 hres = IUnknown_QueryInterface(unk, &IID_IBindStatusCallback, (void**)&clb);
2785 IUnknown_Release(unk);
2786 ok(hres == S_OK, "QueryInterface(IID_IBindStatusCallback) failed: %08x\n", hres);
2787 ok(clb != (IBindStatusCallback*)&bsc, "bsc == clb\n");
2788
2789 if(!test_bscholder(clb))
2790 ret = FALSE;
2791
2792 IBindStatusCallback_Release(clb);
2793
2795 ok(hres == S_OK, "RevokeBindStatusCallback failed: %08x\n", hres);
2796
2797 unk = (void*)0xdeadbeef;
2798 hres = IBindCtx_GetObjectParam(bindctx, BSCBHolder, &unk);
2799 ok(hres == E_FAIL, "GetObjectParam failed: %08x\n", hres);
2800 ok(unk == NULL, "unk != NULL\n");
2801
2802 if(unk)
2803 IUnknown_Release(unk);
2804
2805 hres = RevokeBindStatusCallback(bindctx, (void*)0xdeadbeef);
2806 ok(hres == S_OK, "RevokeBindStatusCallback failed: %08x\n", hres);
2807
2808 hres = RevokeBindStatusCallback(NULL, (void*)0xdeadbeef);
2809 ok(hres == E_INVALIDARG, "RevokeBindStatusCallback failed: %08x\n", hres);
2810
2812 ok(hres == E_INVALIDARG, "RevokeBindStatusCallback failed: %08x\n", hres);
2813
2814 SET_EXPECT(QueryInterface_IServiceProvider);
2815 prevbsc = (void*)0xdeadbeef;
2816 hres = RegisterBindStatusCallback(bindctx, (IBindStatusCallback*)&bsc, &prevbsc, 0);
2817 ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
2818 ok(!prevbsc, "prevbsc=%p\n", prevbsc);
2819 CHECK_CALLED(QueryInterface_IServiceProvider);
2820
2821 hres = IBindCtx_GetObjectParam(bindctx, BSCBHolder, &unk);
2822 ok(hres == S_OK, "GetObjectParam failed: %08x\n", hres);
2823
2824 hres = IUnknown_QueryInterface(unk, &IID_IBindStatusCallback, (void**)&prev_clb);
2825 IUnknown_Release(unk);
2826 ok(hres == S_OK, "QueryInterface(IID_IBindStatusCallback) failed: %08x\n", hres);
2827 ok(prev_clb != (IBindStatusCallback*)&bsc, "bsc == clb\n");
2828
2829 SET_EXPECT(QueryInterface_IServiceProvider);
2830 prevbsc = (void*)0xdeadbeef;
2831 hres = RegisterBindStatusCallback(bindctx, (IBindStatusCallback*)&bsc2, &prevbsc, 0);
2832 ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
2833 ok(prevbsc == (IBindStatusCallback*)&bsc, "prevbsc != bsc\n");
2834 CHECK_CALLED(QueryInterface_IServiceProvider);
2835
2836 hres = IBindCtx_GetObjectParam(bindctx, BSCBHolder, &unk);
2837 ok(hres == S_OK, "GetObjectParam failed: %08x\n", hres);
2838
2839 hres = IUnknown_QueryInterface(unk, &IID_IBindStatusCallback, (void**)&clb);
2840 IUnknown_Release(unk);
2841 ok(hres == S_OK, "QueryInterface(IID_IBindStatusCallback) failed: %08x\n", hres);
2842 ok(prev_clb == clb, "bsc != clb\n");
2843
2844 IBindStatusCallback_Release(clb);
2845 IBindStatusCallback_Release(prev_clb);
2846
2847 IBindCtx_Release(bindctx);
2848
2850 return ret;
2851}
2852
2853#define BINDTEST_EMULATE 0x0001
2854#define BINDTEST_TOOBJECT 0x0002
2855#define BINDTEST_FILEDWLAPI 0x0004
2856#define BINDTEST_HTTPRESPONSE 0x0008
2857#define BINDTEST_REDIRECT 0x0010
2858#define BINDTEST_USE_CACHE 0x0020
2859#define BINDTEST_NO_CALLBACK_READ 0x0040
2860#define BINDTEST_NO_CALLBACK 0x0080
2861#define BINDTEST_ABORT 0x0100
2862#define BINDTEST_INVALID_CN 0x0200
2863#define BINDTEST_ABORT_START 0x0400
2864#define BINDTEST_ABORT_PROGRESS 0x0800
2865#define BINDTEST_ASYNC_SWITCH 0x1000
2866#define BINDTEST_ALLOW_FINDINGRESOURCE 0x2000
2867
2869{
2870 const char *url_a = NULL;
2871
2879 mime_type[0] = 0;
2882 tymed = t;
2885
2886 switch(protocol) {
2887 case HTTP_TEST:
2888 if(post_test)
2889 url_a = "http://test.winehq.org/tests/post.php";
2890 else
2892 break;
2893 case ABOUT_TEST:
2894 url_a = "about:blank";
2895 break;
2896 case FILE_TEST:
2898 break;
2899 case MK_TEST:
2900 url_a = "mk:@MSITStore:test.chm::/blank.html";
2901 break;
2902 case ITS_TEST:
2903 url_a = "its:test.chm::/blank.html";
2904 break;
2905 case HTTPS_TEST:
2906 url_a = (flags & BINDTEST_INVALID_CN) ? "https://4.15.184.77/favicon.ico" : "https://test.winehq.org/tests/hello.html";
2907 break;
2908 case FTP_TEST:
2909 url_a = "ftp://ftp.winehq.org/welcome%2emsg";
2910 break;
2911 default:
2912 url_a = "winetest:test";
2913 }
2914
2915 if(url_a)
2917
2922 test_abort = (flags & BINDTEST_ABORT) != 0;
2927 prot_state = 0;
2929
2930 trace("URL: %s\n", wine_dbgstr_w(current_url));
2931}
2932
2934{
2935 IMoniker *mon;
2936 HRESULT hres;
2937 LPOLESTR display_name;
2938 IBindCtx *bctx = NULL;
2939 MSG msg;
2940 IBindStatusCallback *previousclb;
2941 IUnknown *unk = (IUnknown*)0x00ff00ff;
2942 BOOL allow_finding_resource;
2943 IBinding *bind;
2944
2946 allow_finding_resource = (flags & BINDTEST_ALLOW_FINDINGRESOURCE) != 0;
2947
2948 if(no_callback) {
2949 hres = CreateBindCtx(0, &bctx);
2950 ok(hres == S_OK, "CreateBindCtx failed: %08x\n", hres);
2951 }else {
2952 SET_EXPECT(QueryInterface_IServiceProvider);
2954 ok(hres == S_OK, "CreateAsyncBindCtx failed: %08x\n\n", hres);
2955 CHECK_CALLED(QueryInterface_IServiceProvider);
2956 if(FAILED(hres))
2957 return;
2958
2959 SET_EXPECT(QueryInterface_IServiceProvider);
2960 hres = RegisterBindStatusCallback(bctx, (IBindStatusCallback*)&bsc, &previousclb, 0);
2961 ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
2962 ok(previousclb == (IBindStatusCallback*)&bsc, "previousclb(%p) != sclb(%p)\n", previousclb, &bsc);
2963 CHECK_CALLED(QueryInterface_IServiceProvider);
2964 if(previousclb)
2965 IBindStatusCallback_Release(previousclb);
2966 }
2967
2969 ok(hres == S_OK, "failed to create moniker: %08x\n", hres);
2970 if(FAILED(hres))
2971 return;
2972
2973 if(protocol == FTP_TEST)
2974 {
2975 /* FTP urls don't have any escape characters so convert the url to what is expected */
2976 DWORD size = 0;
2978 }
2979
2980 hres = IMoniker_QueryInterface(mon, &IID_IBinding, (void**)&bind);
2981 ok(hres == E_NOINTERFACE, "IMoniker should not have IBinding interface\n");
2982 if(SUCCEEDED(hres))
2983 IBinding_Release(bind);
2984
2985 hres = IMoniker_GetDisplayName(mon, bctx, NULL, &display_name);
2986 ok(hres == S_OK, "GetDisplayName failed %08x\n", hres);
2987 ok(!lstrcmpW(display_name, current_url), "GetDisplayName got wrong name %s, expected %s\n",
2988 wine_dbgstr_w(display_name), wine_dbgstr_w(current_url));
2989 CoTaskMemFree(display_name);
2990
2991 if(tymed == TYMED_FILE && (test_protocol == ABOUT_TEST || test_protocol == ITS_TEST))
2992 binding_hres = INET_E_DATA_NOT_AVAILABLE;
2996 binding_hres = INET_E_SECURITY_PROBLEM;
2997 else
2998 binding_hres = INET_E_INVALID_CERTIFICATE;
2999 }
3000
3001
3003 SET_EXPECT(OnStopBinding);
3004 if(!no_callback) {
3005 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
3006 SET_EXPECT(GetBindInfo);
3007 SET_EXPECT(QueryInterface_IInternetProtocol);
3008 if(!emulate_protocol)
3009 SET_EXPECT(QueryService_IInternetProtocol);
3010 SET_EXPECT(OnStartBinding);
3011 }
3012 if(emulate_protocol) {
3018 SET_EXPECT(Terminate);
3019 if(tymed != TYMED_FILE || (test_protocol != ABOUT_TEST && test_protocol != ITS_TEST))
3021 }else {
3023 SET_EXPECT(QueryService_IInternetBindInfo);
3024 if(!abort_start)
3025 SET_EXPECT(QueryInterface_IHttpNegotiate);
3026 SET_EXPECT(QueryInterface_IWindowForBindingUI);
3027 SET_EXPECT(QueryService_IWindowForBindingUI);
3028 SET_EXPECT(GetWindow_IWindowForBindingUI);
3029 if(!abort_start) {
3030 SET_EXPECT(BeginningTransaction);
3031 SET_EXPECT(QueryInterface_IHttpNegotiate2);
3032 SET_EXPECT(GetRootSecurityId);
3033 if(http_is_first || allow_finding_resource)
3034 SET_EXPECT(OnProgress_FINDINGRESOURCE);
3035 SET_EXPECT(OnProgress_CONNECTING);
3036 }
3038 SET_EXPECT(QueryInterface_IHttpSecurity);
3039 SET_EXPECT(QueryService_IHttpSecurity);
3040 SET_EXPECT(OnSecurityProblem);
3042 SET_EXPECT(GetWindow_IHttpSecurity);
3043 }
3044 }
3045 if(!no_callback) {
3048 SET_EXPECT(OnProgress_SENDINGREQUEST);
3050 SET_EXPECT(QueryInterface_IHttpNegotiate);
3051 SET_EXPECT(OnResponse);
3052 }
3053 if(!abort_start) {
3054 SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
3055 SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
3056 }
3058 SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
3060 SET_EXPECT(OnProgress_DOWNLOADINGDATA);
3061 if(!abort_start)
3062 SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
3063 if((tymed != TYMED_FILE || test_protocol != ABOUT_TEST) && !abort_start)
3064 SET_EXPECT(OnDataAvailable);
3065 SET_EXPECT(OnStopBinding);
3066 }
3067 }
3068
3069 hres = IMoniker_BindToStorage(mon, bctx, NULL, tymed == TYMED_ISTREAM ? &IID_IStream : &IID_IUnknown, (void**)&unk);
3072 {
3073 skip("Network unreachable, skipping tests\n");
3074 return;
3075 }
3076
3078 ok(hres == E_FAIL, "Got %08x\n", hres);
3079 CHECK_CALLED(OnStopBinding);
3080 } else if(abort_start)
3081 ok(hres == abort_hres, "IMoniker_BindToStorage failed: %08x, expected %08x\n", hres, abort_hres);
3082 else if(abort_progress)
3083 ok(hres == MK_S_ASYNCHRONOUS, "IMoniker_BindToStorage failed: %08x\n", hres);
3084 else if(no_callback) {
3086 ok( WaitForSingleObject(complete_event2, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
3087 ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres);
3088 ok(unk != NULL, "unk == NULL\n");
3089 }else if(!(bindf & BINDF_ASYNCHRONOUS) && tymed == TYMED_FILE) {
3090 ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres);
3091 ok(unk == NULL, "unk != NULL\n");
3092 }else if(((bindf & BINDF_ASYNCHRONOUS) && !data_available)
3093 || (tymed == TYMED_FILE && test_protocol == FILE_TEST)) {
3094 ok(hres == MK_S_ASYNCHRONOUS, "IMoniker_BindToStorage failed: %08x\n", hres);
3095 ok(unk == NULL, "istr should be NULL\n");
3096 }else if(tymed == TYMED_FILE && test_protocol == ABOUT_TEST) {
3097 ok(hres == INET_E_DATA_NOT_AVAILABLE,
3098 "IMoniker_BindToStorage failed: %08x, expected INET_E_DATA_NOT_AVAILABLE\n", hres);
3099 ok(unk == NULL, "istr should be NULL\n");
3100 }else if((flags & BINDTEST_INVALID_CN) && binding_hres != S_OK) {
3101 ok(hres == binding_hres, "Got %08x\n", hres);
3102 ok(unk == NULL, "Got %p\n", unk);
3104 ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres);
3105 ok(unk != NULL, "unk == NULL\n");
3106 if(unk == NULL) {
3107 ok(0, "Expected security problem to be ignored.\n");
3109 binding_hres = INET_E_INVALID_CERTIFICATE;
3110 }
3111 }else {
3112 ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres);
3113 ok(unk != NULL, "unk == NULL\n");
3114 }
3115 if(unk && callback_read && !no_callback) {
3116 IUnknown_Release(unk);
3117 unk = NULL;
3118 }
3119
3121 return;
3122
3123 if((bindf & BINDF_ASYNCHRONOUS) && !no_callback) {
3124 while(!stopped_binding && GetMessageA(&msg,NULL,0,0)) {
3127 }
3128 }
3129
3130 if(async_switch) {
3131 CHECK_CALLED(OnProgress_SENDINGREQUEST);
3132 CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
3133 CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
3135 CHECK_CALLED(OnStopBinding);
3136 }
3137 if(!no_callback) {
3138 CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */
3139 CHECK_CALLED(GetBindInfo);
3141 CHECK_CALLED(QueryInterface_IInternetProtocol);
3142 if(!emulate_protocol) {
3144 CHECK_CALLED(QueryService_IInternetProtocol);
3145 }
3146 CHECK_CALLED(OnStartBinding);
3147 }
3148 if(emulate_protocol) {
3150 CLEAR_CALLED(SetPriority); /* Not called by IE11 */
3154 if(tymed == TYMED_FILE)
3156 CHECK_CALLED(Terminate);
3157 }
3158 if(tymed != TYMED_FILE || (test_protocol != ABOUT_TEST && test_protocol != ITS_TEST))
3160 }else {
3162 CLEAR_CALLED(QueryService_IInternetBindInfo);
3163 if(!abort_start)
3164 CHECK_CALLED(QueryInterface_IHttpNegotiate);
3165 CLEAR_CALLED(QueryInterface_IWindowForBindingUI);
3166 CLEAR_CALLED(QueryService_IWindowForBindingUI);
3167 CLEAR_CALLED(GetWindow_IWindowForBindingUI);
3168 if(!abort_start)
3169 CHECK_CALLED(BeginningTransaction);
3171 {
3172 CHECK_CALLED(QueryInterface_IHttpNegotiate2);
3173 CHECK_CALLED(GetRootSecurityId);
3174 }
3175 if(http_is_first) {
3176 if (! proxy_active())
3177 {
3178 CHECK_CALLED(OnProgress_FINDINGRESOURCE);
3179 CHECK_CALLED(OnProgress_CONNECTING);
3180 }
3181 else
3182 {
3183 CLEAR_CALLED(OnProgress_FINDINGRESOURCE);
3184 CLEAR_CALLED(OnProgress_CONNECTING);
3185 }
3186 }else if(!abort_start) {
3187 if(allow_finding_resource)
3188 CLEAR_CALLED(OnProgress_FINDINGRESOURCE);
3189 /* IE7 does call this */
3190 CLEAR_CALLED(OnProgress_CONNECTING);
3191 }
3193 CHECK_CALLED(QueryInterface_IHttpSecurity);
3194 CHECK_CALLED(QueryService_IHttpSecurity);
3195 CHECK_CALLED(OnSecurityProblem);
3196 }else {
3197 CHECK_NOT_CALLED(QueryInterface_IHttpSecurity);
3198 CHECK_NOT_CALLED(QueryService_IHttpSecurity);
3199 CHECK_NOT_CALLED(OnSecurityProblem);
3200 }
3201 }
3202 if(!no_callback) {
3205 CLEAR_CALLED(OnProgress_SENDINGREQUEST);
3206 else if(!abort_start)
3207 CHECK_CALLED(OnProgress_SENDINGREQUEST);
3208 } else if(test_protocol == FTP_TEST)
3209 todo_wine CHECK_CALLED(OnProgress_SENDINGREQUEST);
3211 CLEAR_CALLED(QueryInterface_IHttpNegotiate);
3212 if((!(flags & BINDTEST_INVALID_CN) || (binding_hres == S_OK)) && !abort_start) {
3213 CHECK_CALLED(OnResponse);
3214 }
3215 }
3217 CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
3218 CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
3219 CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
3220 }
3222 CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
3224 CLEAR_CALLED(OnProgress_DOWNLOADINGDATA);
3225 if((flags & BINDTEST_INVALID_CN)) {
3226 if(binding_hres == S_OK)
3227 CHECK_CALLED(OnDataAvailable);
3228 else
3229 CHECK_NOT_CALLED(OnDataAvailable);
3230 }else if((tymed != TYMED_FILE || test_protocol != ABOUT_TEST) && !abort_start)
3231 CHECK_CALLED(OnDataAvailable);
3232 CHECK_CALLED(OnStopBinding);
3233 }
3234 }
3235
3236 ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n");
3237 if(bctx)
3238 ok(IBindCtx_Release(bctx) == 0, "bctx should be destroyed here\n");
3239
3242
3245
3246 if(unk) {
3247 BYTE buf[512];
3248 DWORD readed;
3249 IStream *stream;
3250
3251 hres = IUnknown_QueryInterface(unk, &IID_IStream, (void**)&stream);
3252 ok(hres == S_OK, "Could not get IStream iface: %08x\n", hres);
3253 IUnknown_Release(unk);
3254
3255 do {
3256 readed = 0xdeadbeef;
3257 hres = IStream_Read(stream, buf, sizeof(buf), &readed);
3258 ok(readed != 0xdeadbeef, "readed = 0xdeadbeef\n");
3259 if(emulate_protocol && test_protocol == HTTP_TEST && readed)
3260 ok(buf[0] == (use_cache_file && !(bindf&BINDF_ASYNCHRONOUS) ? 'X' : '?'), "buf[0] = '%c'\n", buf[0]);
3261 }while(hres == S_OK);
3262 ok(hres == S_FALSE, "IStream_Read returned %08x\n", hres);
3263 ok(!readed, "readed = %d\n", readed);
3264
3265 IStream_Release(stream);
3266 }
3267}
3268
3270{
3271 IMoniker *mon;
3272 HRESULT hres;
3273 LPOLESTR display_name;
3274 IBindCtx *bctx;
3275 DWORD regid;
3276 MSG msg;
3277 IUnknown *unk = (IUnknown*)0x00ff00ff;
3278 IBinding *bind;
3279
3281 binding_hres = exhres;
3282
3284 CoRegisterClassObject(&CLSID_HTMLDocument, (IUnknown *)&mime_cf,
3285 CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &regid);
3286
3287 SET_EXPECT(QueryInterface_IServiceProvider);
3289 ok(hres == S_OK, "CreateAsyncBindCtx failed: %08x\n\n", hres);
3290 CHECK_CALLED(QueryInterface_IServiceProvider);
3291 if(FAILED(hres))
3292 return;
3293
3295 ok(hres == S_OK, "failed to create moniker: %08x\n", hres);
3296 if(FAILED(hres)) {
3297 IBindCtx_Release(bctx);
3298 return;
3299 }
3300
3301 hres = IMoniker_QueryInterface(mon, &IID_IBinding, (void**)&bind);
3302 ok(hres == E_NOINTERFACE, "IMoniker should not have IBinding interface\n");
3303 if(SUCCEEDED(hres))
3304 IBinding_Release(bind);
3305
3306 hres = IMoniker_GetDisplayName(mon, bctx, NULL, &display_name);
3307 ok(hres == S_OK, "GetDisplayName failed %08x\n", hres);
3308 ok(!lstrcmpW(display_name, current_url), "GetDisplayName got wrong name\n");
3309 CoTaskMemFree(display_name);
3310
3311 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
3312 SET_EXPECT(Obj_GetBindInfo);
3313 SET_EXPECT(QueryInterface_IInternetProtocol);
3314 if(!emulate_protocol)
3315 SET_EXPECT(QueryService_IInternetProtocol);
3316 SET_EXPECT(Obj_OnStartBinding);
3317 if(emulate_protocol) {
3322 SET_EXPECT(Terminate);
3324 SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
3326 }else {
3328 SET_EXPECT(QueryInterface_IHttpNegotiate);
3329 SET_EXPECT(BeginningTransaction);
3330 SET_EXPECT(QueryInterface_IHttpNegotiate2);
3331 SET_EXPECT(GetRootSecurityId);
3332 if(http_is_first)
3333 SET_EXPECT(Obj_OnProgress_FINDINGRESOURCE);
3334 SET_EXPECT(Obj_OnProgress_CONNECTING);
3335 SET_EXPECT(QueryInterface_IWindowForBindingUI);
3336 SET_EXPECT(QueryService_IWindowForBindingUI);
3337 SET_EXPECT(GetWindow_IWindowForBindingUI);
3338 }
3340 SET_EXPECT(Obj_OnProgress_SENDINGREQUEST);
3342 SET_EXPECT(QueryInterface_IHttpNegotiate);
3343 SET_EXPECT(OnResponse);
3344 }
3345 SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
3346 SET_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
3348 SET_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
3350 SET_EXPECT(OnProgress_DOWNLOADINGDATA);
3351 SET_EXPECT(Obj_OnProgress_ENDDOWNLOADDATA);
3352 if(SUCCEEDED(hres))
3353 SET_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
3354 SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
3355 if(exhres == REGDB_E_CLASSNOTREG) {
3356 SET_EXPECT(QueryInterface_IWindowForBindingUI);
3357 SET_EXPECT(QueryService_IWindowForBindingUI);
3358 SET_EXPECT(GetWindow_ICodeInstall);
3359 }
3360 SET_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
3361 if(SUCCEEDED(hres))
3362 SET_EXPECT(OnObjectAvailable);
3363 SET_EXPECT(Obj_OnStopBinding);
3364 }
3365
3366 hres = IMoniker_BindToObject(mon, bctx, NULL, &IID_IUnknown, (void**)&unk);
3367
3370 {
3371 skip( "Network unreachable, skipping tests\n" );
3372 return;
3373 }
3374
3375 if(FAILED(exhres)) {
3376 ok(hres == exhres, "BindToObject failed: %08x, expected %08x\n", hres, exhres);
3377 ok(!unk, "unk = %p, expected NULL\n", unk);
3378 }else if(bindf & BINDF_ASYNCHRONOUS) {
3379 ok(hres == MK_S_ASYNCHRONOUS, "IMoniker_BindToObject failed: %08x\n", hres);
3380 ok(unk == NULL, "istr should be NULL\n");
3381 }else {
3382 ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres);
3383 ok(unk != NULL, "unk == NULL\n");
3385 ok(unk == (IUnknown*)&PersistMoniker, "unk != PersistMoniker\n");
3386 }
3387 if(unk)
3388 IUnknown_Release(unk);
3389
3390 while((bindf & BINDF_ASYNCHRONOUS) &&
3394 }
3395
3396 CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx);
3397 CHECK_CALLED(Obj_GetBindInfo);
3398 CHECK_CALLED(QueryInterface_IInternetProtocol);
3399 if(!emulate_protocol)
3400 CHECK_CALLED(QueryService_IInternetProtocol);
3401 CHECK_CALLED(Obj_OnStartBinding);
3402 if(emulate_protocol) {
3404 CLEAR_CALLED(SetPriority); /* Not called by IE11 */
3407 CHECK_CALLED(Terminate);
3409 CLEAR_CALLED(OnProgress_MIMETYPEAVAILABLE); /* not called in IE7 */
3411 }else {
3413 CHECK_CALLED(QueryInterface_IHttpNegotiate);
3414 CHECK_CALLED(BeginningTransaction);
3416 {
3417 CHECK_CALLED(QueryInterface_IHttpNegotiate2);
3418 CHECK_CALLED(GetRootSecurityId);
3419 }
3420 if(http_is_first) {
3421 CHECK_CALLED(Obj_OnProgress_FINDINGRESOURCE);
3422 CHECK_CALLED(Obj_OnProgress_CONNECTING);
3423 }else {
3424 /* IE7 does call this */
3425 CLEAR_CALLED(Obj_OnProgress_CONNECTING);
3426 }
3427 CLEAR_CALLED(QueryInterface_IWindowForBindingUI);
3428 CLEAR_CALLED(QueryService_IWindowForBindingUI);
3429 CLEAR_CALLED(GetWindow_IWindowForBindingUI);
3430 }
3432 if(post_test)
3433 CLEAR_CALLED(Obj_OnProgress_SENDINGREQUEST);
3434 else
3435 CHECK_CALLED(Obj_OnProgress_SENDINGREQUEST);
3436 }
3438 CLEAR_CALLED(QueryInterface_IHttpNegotiate);
3439 CHECK_CALLED(OnResponse);
3440 }
3441 CHECK_CALLED(Obj_OnProgress_MIMETYPEAVAILABLE);
3442 CHECK_CALLED(Obj_OnProgress_BEGINDOWNLOADDATA);
3444 CHECK_CALLED(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
3446 CLEAR_CALLED(OnProgress_DOWNLOADINGDATA);
3447 CLEAR_CALLED(Obj_OnProgress_ENDDOWNLOADDATA);
3448 if(SUCCEEDED(hres))
3449 CHECK_CALLED(Obj_OnProgress_CLASSIDAVAILABLE);
3450 CHECK_CALLED(Obj_OnProgress_BEGINSYNCOPERATION);
3451 if(exhres == REGDB_E_CLASSNOTREG) {
3452 todo_wine CHECK_CALLED(QueryInterface_IWindowForBindingUI);
3453 todo_wine CHECK_CALLED(QueryService_IWindowForBindingUI);
3454 todo_wine CHECK_CALLED(GetWindow_ICodeInstall);
3455 }
3456 CHECK_CALLED(Obj_OnProgress_ENDSYNCOPERATION);
3457 if(SUCCEEDED(hres))
3458 CHECK_CALLED(OnObjectAvailable);
3459 CHECK_CALLED(Obj_OnStopBinding);
3460 }
3461
3462 ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n");
3463 IBindCtx_Release(bctx);
3464
3467
3470}
3471
3472static void test_URLDownloadToFile(DWORD prot, BOOL emul)
3473{
3474 BOOL res;
3475 HRESULT hres;
3476
3477 init_bind_test(prot, BINDTEST_FILEDWLAPI | (emul ? BINDTEST_EMULATE : 0), TYMED_FILE);
3478
3479 SET_EXPECT(GetBindInfo);
3480 SET_EXPECT(QueryInterface_IInternetProtocol);
3481 SET_EXPECT(QueryInterface_IServiceProvider);
3482 if(!emulate_protocol)
3483 SET_EXPECT(QueryService_IInternetProtocol);
3484 SET_EXPECT(OnStartBinding);
3485 if(emulate_protocol) {
3490 }else {
3492 SET_EXPECT(QueryInterface_IHttpNegotiate);
3493 SET_EXPECT(BeginningTransaction);
3494 SET_EXPECT(QueryInterface_IHttpNegotiate2);
3495 SET_EXPECT(GetRootSecurityId);
3496 SET_EXPECT(QueryInterface_IWindowForBindingUI);
3497 SET_EXPECT(OnProgress_CONNECTING);
3498 }
3500 SET_EXPECT(OnProgress_SENDINGREQUEST);
3502 SET_EXPECT(QueryInterface_IHttpNegotiate);
3503 SET_EXPECT(OnResponse);
3504 }
3505 SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
3506 SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
3508 SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
3510 SET_EXPECT(OnProgress_DOWNLOADINGDATA);
3511 SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
3512 SET_EXPECT(OnStopBinding);
3513 }
3514
3516 ok(hres == S_OK, "URLDownloadToFile failed: %08x\n", hres);
3517
3518 CHECK_CALLED(GetBindInfo);
3519 CHECK_CALLED(QueryInterface_IInternetProtocol);
3520 if(!emulate_protocol) {
3521 CHECK_CALLED(QueryInterface_IServiceProvider);
3522 CHECK_CALLED(QueryService_IInternetProtocol);
3523 }else {
3524 CLEAR_CALLED(QueryInterface_IServiceProvider);
3525 }
3526 CHECK_CALLED(OnStartBinding);
3527 if(emulate_protocol) {
3529 CLEAR_CALLED(SetPriority); /* Not called by IE11 */
3532 }else {
3534 CHECK_CALLED(QueryInterface_IHttpNegotiate);
3535 CHECK_CALLED(BeginningTransaction);
3537 {
3538 CHECK_CALLED(QueryInterface_IHttpNegotiate2);
3539 CHECK_CALLED(GetRootSecurityId);
3540 }
3541 CLEAR_CALLED(QueryInterface_IWindowForBindingUI);
3542 CLEAR_CALLED(OnProgress_CONNECTING);
3543 }
3545 CHECK_CALLED(OnProgress_SENDINGREQUEST);
3547 CLEAR_CALLED(OnProgress_SENDINGREQUEST); /* not called by IE7 */
3549 CLEAR_CALLED(QueryInterface_IHttpNegotiate);
3550 CHECK_CALLED(OnResponse);
3551 }
3552 CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
3553 CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
3555 CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
3557 CLEAR_CALLED(OnProgress_DOWNLOADINGDATA);
3558 CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
3559 CHECK_CALLED(OnStopBinding);
3560 }
3561
3563 ok(res, "DeleteFile failed: %u\n", GetLastError());
3564
3565 if(prot != FILE_TEST || emul)
3566 return;
3567
3569 ok(hres == S_OK, "URLDownloadToFile failed: %08x\n", hres);
3570
3572 ok(res, "DeleteFile failed: %u\n", GetLastError());
3573}
3574
3576{
3577 HRESULT hres;
3578
3580
3581 SET_EXPECT(GetBindInfo);
3582 SET_EXPECT(QueryInterface_IInternetProtocol);
3583 SET_EXPECT(QueryInterface_IServiceProvider);
3584 SET_EXPECT(QueryService_IInternetProtocol);
3585 SET_EXPECT(OnStartBinding);
3586 SET_EXPECT(QueryInterface_IHttpNegotiate);
3587 SET_EXPECT(QueryInterface_IHttpNegotiate2);
3588 SET_EXPECT(BeginningTransaction);
3589 SET_EXPECT(GetRootSecurityId);
3590 SET_EXPECT(QueryInterface_IWindowForBindingUI);
3591 SET_EXPECT(OnProgress_CONNECTING);
3592 SET_EXPECT(OnProgress_SENDINGREQUEST);
3593 SET_EXPECT(OnStopBinding);
3594
3596 ok(hres == E_ABORT, "URLDownloadToFile failed: %08x, expected E_ABORT\n", hres);
3597
3598 CHECK_CALLED(GetBindInfo);
3599 CHECK_CALLED(QueryInterface_IInternetProtocol);
3600 CHECK_CALLED(QueryInterface_IServiceProvider);
3601 CHECK_CALLED(QueryService_IInternetProtocol);
3602 CHECK_CALLED(OnStartBinding);
3603 CHECK_CALLED(QueryInterface_IHttpNegotiate);
3604 CHECK_CALLED(QueryInterface_IHttpNegotiate2);
3605 CHECK_CALLED(BeginningTransaction);
3606 CHECK_CALLED(GetRootSecurityId);
3607 CLEAR_CALLED(QueryInterface_IWindowForBindingUI);
3608 CHECK_CALLED(OnProgress_SENDINGREQUEST);
3609 CLEAR_CALLED(OnProgress_CONNECTING);
3610 CHECK_CALLED(OnStopBinding);
3611
3613
3614 SET_EXPECT(GetBindInfo);
3615 SET_EXPECT(QueryInterface_IInternetProtocol);
3616 SET_EXPECT(QueryInterface_IServiceProvider);
3617 SET_EXPECT(QueryService_IInternetProtocol);
3618 SET_EXPECT(OnStartBinding);
3619 SET_EXPECT(OnStopBinding);
3620
3623 ok(hres == E_ABORT, "URLDownloadToFile failed: %08x, expected E_ABORT\n", hres);
3624
3625 CHECK_CALLED(GetBindInfo);
3626 todo_wine CHECK_CALLED(QueryInterface_IInternetProtocol);
3627 todo_wine CHECK_CALLED(QueryInterface_IServiceProvider);
3628 todo_wine CHECK_CALLED(QueryService_IInternetProtocol);
3629 CHECK_CALLED(OnStartBinding);
3630 CHECK_CALLED(OnStopBinding);
3631
3633
3634 SET_EXPECT(GetBindInfo);
3635 SET_EXPECT(QueryInterface_IInternetProtocol);
3636 SET_EXPECT(QueryInterface_IServiceProvider);
3637 SET_EXPECT(QueryService_IInternetProtocol);
3638 SET_EXPECT(OnStartBinding);
3639 SET_EXPECT(QueryInterface_IHttpNegotiate);
3640 SET_EXPECT(QueryInterface_IHttpNegotiate2);
3641 SET_EXPECT(BeginningTransaction);
3642 SET_EXPECT(GetRootSecurityId);
3643 SET_EXPECT(QueryInterface_IWindowForBindingUI);
3644 SET_EXPECT(OnResponse);
3645 SET_EXPECT(OnProgress_CONNECTING);
3646 SET_EXPECT(OnProgress_SENDINGREQUEST);
3647 SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
3648 SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
3649 SET_EXPECT(OnProgress_DOWNLOADINGDATA);
3650 SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
3651 SET_EXPECT(OnStopBinding);
3652
3653 /* URLDownloadToFile doesn't abort if E_NOTIMPL is returned from the
3654 * IBindStatusCallback's OnStartBinding function.
3655 */
3658 ok(hres == S_OK, "URLDownloadToFile failed: %08x\n", hres);
3659
3660 CHECK_CALLED(GetBindInfo);
3661 CHECK_CALLED(QueryInterface_IInternetProtocol);
3662 CHECK_CALLED(QueryInterface_IServiceProvider);
3663 CHECK_CALLED(QueryService_IInternetProtocol);
3664 CHECK_CALLED(OnStartBinding);
3665 CHECK_CALLED(QueryInterface_IHttpNegotiate);
3666 CHECK_CALLED(QueryInterface_IHttpNegotiate2);
3667 CHECK_CALLED(BeginningTransaction);
3668 CHECK_CALLED(GetRootSecurityId);
3669 CLEAR_CALLED(QueryInterface_IWindowForBindingUI);
3670 CHECK_CALLED(OnResponse);
3671 CLEAR_CALLED(OnProgress_CONNECTING);
3672 CHECK_CALLED(OnProgress_SENDINGREQUEST);
3673 CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
3674 CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
3675 CHECK_CALLED(OnProgress_DOWNLOADINGDATA);
3676 CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
3677 CHECK_CALLED(OnStopBinding);
3678
3680}
3681
3682static void set_file_url(char *path)
3683{
3684 CHAR file_urlA[INTERNET_MAX_URL_LENGTH];
3685
3686 lstrcpyA(file_urlA, "file://");
3687 lstrcatA(file_urlA, path);
3689}
3690
3691static void create_file(const char *file_name, const char *content)
3692{
3693 HANDLE file;
3694 DWORD size;
3696
3699 ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
3701 return;
3702
3703 if(test_file)
3708
3710 lstrcatA(path, "\\");
3713}
3714
3715static void create_html_file(void)
3716{
3717 create_file(wszIndexHtmlA, "<HTML></HTML>");
3718}
3719
3720static void create_cache_file(void)
3721{
3722 char buf[6500], curdir[MAX_PATH];
3723 HANDLE file;
3724 DWORD size;
3725
3728 ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
3730 return;
3731
3732 memset(buf, 'X', sizeof(buf));
3733 WriteFile(file, buf, sizeof(buf), &size, NULL);
3735
3736 memset(curdir, 0, sizeof(curdir));
3738 lstrcatA(curdir, "\\");
3739 lstrcatA(curdir, test_txtA);
3740
3742}
3743
3744static void test_ReportResult(HRESULT exhres)
3745{
3746 IMoniker *mon = NULL;
3747 IBindCtx *bctx = NULL;
3748 IUnknown *unk = (void*)0xdeadbeef;
3749 HRESULT hres;
3750
3752 binding_hres = exhres;
3753
3755 ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres);
3756
3757 SET_EXPECT(QueryInterface_IServiceProvider);
3759 ok(hres == S_OK, "CreateAsyncBindCtx failed: %08x\n\n", hres);
3760 CHECK_CALLED(QueryInterface_IServiceProvider);
3761
3762 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
3763 SET_EXPECT(GetBindInfo);
3764 SET_EXPECT(QueryInterface_IInternetProtocol);
3765 SET_EXPECT(OnStartBinding);
3769
3770 hres = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, (void**)&unk);
3771 if(SUCCEEDED(exhres))
3772 ok(hres == S_OK || hres == MK_S_ASYNCHRONOUS, "BindToStorage failed: %08x\n", hres);
3773 else
3774 ok(hres == exhres || hres == MK_S_ASYNCHRONOUS,
3775 "BindToStorage failed: %08x, expected %08x or MK_S_ASYNCHRONOUS\n", hres, exhres);
3776
3777 CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */
3778 CHECK_CALLED(GetBindInfo);
3779 CHECK_CALLED(QueryInterface_IInternetProtocol);
3780 CHECK_CALLED(OnStartBinding);
3782 CLEAR_CALLED(SetPriority); /* Not called by IE11 */
3784
3785 ok(unk == NULL, "unk=%p\n", unk);
3786
3787 IBindCtx_Release(bctx);
3788 IMoniker_Release(mon);
3789}
3790
3792{
3793 IMoniker *mon = NULL;
3794 IBindCtx *bctx = NULL;
3795 IUnknown *unk;
3796 HRESULT hres;
3797
3799 ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres);
3800 if(FAILED(hres))
3801 return;
3802
3803 hres = pCreateAsyncBindCtxEx(NULL, 0, NULL, NULL, &bctx, 0);
3804 ok(hres == S_OK, "CreateAsyncBindCtxEx failed: %08x\n", hres);
3805
3806 unk = (void*)0xdeadbeef;
3807 hres = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, (void**)&unk);
3808 ok(hres == MK_E_SYNTAX || hres == INET_E_DATA_NOT_AVAILABLE,
3809 "hres=%08x, expected MK_E_SYNTAX or INET_E_DATA_NOT_AVAILABLE\n", hres);
3810 ok(unk == NULL, "got %p\n", unk);
3811
3812 IBindCtx_Release(bctx);
3813
3814 IMoniker_Release(mon);
3815
3818}
3819
3820static void test_StdURLMoniker(void)
3821{
3822 IMoniker *mon, *async_mon;
3823 LPOLESTR display_name;
3824 IBindCtx *bctx;
3825 IUnknown *unk;
3826 HRESULT hres;
3827
3828 hres = CoCreateInstance(&IID_IInternet, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
3829 &IID_IMoniker, (void**)&mon);
3830 ok(hres == S_OK, "Could not create IInternet instance: %08x\n", hres);
3831 if(FAILED(hres))
3832 return;
3833
3834 hres = IMoniker_QueryInterface(mon, &IID_IAsyncMoniker, (void**)&async_mon);
3835 ok(hres == S_OK, "Could not get IAsyncMoniker iface: %08x\n", hres);
3836 ok(mon == async_mon, "mon != async_mon\n");
3837 IMoniker_Release(async_mon);
3838
3839 hres = IMoniker_GetDisplayName(mon, NULL, NULL, &display_name);
3840 ok(hres == E_OUTOFMEMORY, "GetDisplayName failed: %08x, expected E_OUTOFMEMORY\n", hres);
3841
3842 if(pCreateUri) {
3843 IUriContainer *uri_container;
3844 IUri *uri;
3845
3846 hres = IMoniker_QueryInterface(mon, &IID_IUriContainer, (void**)&uri_container);
3847 ok(hres == S_OK, "Could not get IUriMoniker iface: %08x\n", hres);
3848
3849
3850 uri = (void*)0xdeadbeef;
3851 hres = IUriContainer_GetIUri(uri_container, &uri);
3852 ok(hres == S_FALSE, "GetIUri failed: %08x\n", hres);
3853 ok(!uri, "uri = %p, expected NULL\n", uri);
3854
3855 IUriContainer_Release(uri_container);
3856 }
3857
3858 SET_EXPECT(QueryInterface_IServiceProvider);
3860 ok(hres == S_OK, "CreateAsyncBindCtx failed: %08x\n\n", hres);
3861 CHECK_CALLED(QueryInterface_IServiceProvider);
3862
3863 if(pCreateUri) { /* Skip these tests on old IEs */
3864 unk = (void*)0xdeadbeef;
3865 hres = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, (void**)&unk);
3866 ok(hres == MK_E_SYNTAX, "BindToStorage failed: %08x, expected MK_E_SYNTAX\n", hres);
3867 ok(!unk, "unk = %p\n", unk);
3868
3869 unk = (void*)0xdeadbeef;
3870 hres = IMoniker_BindToObject(mon, bctx, NULL, &IID_IUnknown, (void**)&unk);
3871 ok(hres == MK_E_SYNTAX, "BindToStorage failed: %08x, expected MK_E_SYNTAX\n", hres);
3872 ok(!unk, "unk = %p\n", unk);
3873 }
3874
3875 IMoniker_Release(mon);
3876}
3877
3878static void register_protocols(void)
3879{
3881 HRESULT hres;
3882
3883 static const WCHAR winetestW[] = {'w','i','n','e','t','e','s','t',0};
3884
3886 ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
3887 if(FAILED(hres))
3888 return;
3889
3890 hres = IInternetSession_RegisterNameSpace(session, &protocol_cf, &IID_NULL,
3891 winetestW, 0, NULL, 0);
3892 ok(hres == S_OK, "RegisterNameSpace failed: %08x\n", hres);
3893
3894 IInternetSession_Release(session);
3895}
3896
3897static BOOL can_do_https(void)
3898{
3899 HINTERNET ses, con, req;
3900 BOOL ret;
3901
3902 ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
3903 ok(ses != NULL, "InternetOpen failed\n");
3904
3905 con = InternetConnectA(ses, "test.winehq.org", INTERNET_DEFAULT_HTTPS_PORT,
3907 ok(con != NULL, "InternetConnect failed\n");
3908
3909 req = HttpOpenRequestA(con, "GET", "/tests/hello.html", NULL, NULL, NULL,
3911 ok(req != NULL, "HttpOpenRequest failed\n");
3912
3913 ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
3915 "request failed: %u\n", GetLastError());
3916
3920 return ret;
3921}
3922
3924{
3925 HMODULE hurlmon;
3926
3928 {
3929 win_skip("Skipping urlmon:url due to hang ROSTESTS-358\n");
3930 return;
3931 }
3932
3933 hurlmon = GetModuleHandleA("urlmon.dll");
3934 pCreateAsyncBindCtxEx = (void*) GetProcAddress(hurlmon, "CreateAsyncBindCtxEx");
3935
3936 if(!GetProcAddress(hurlmon, "CompareSecurityIds")) {
3937 win_skip("Too old IE\n");
3938 return;
3939 }
3940
3941 pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
3942 if(!pCreateUri)
3943 win_skip("IUri not supported\n");
3944
3951
3952 test_create();
3953
3954 trace("test CreateAsyncBindCtx...\n");
3956
3957 trace("test CreateAsyncBindCtxEx...\n");
3959
3960 trace("test RegisterBindStatusCallback...\n");
3962 trace("test BindToStorage failures...\n");
3964
3965 trace("synchronous http test (COM not initialised)...\n");
3966 test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
3967
3969
3970 trace("test StdURLMoniker...\n");
3972
3973 trace("synchronous http test...\n");
3974 test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
3975
3976 trace("emulated synchronous http test (to file)...\n");
3978
3979 trace("synchronous http test (to object)...\n");
3981
3982 trace("emulated synchronous http test (with cache)...\n");
3984
3985 trace("emulated synchronous http test (with cache, no read)...\n");
3987
3988 trace("synchronous http test (with cache, no read)...\n");
3990
3991 trace("synchronous file test...\n");
3992 test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM);
3993
3994 trace("emulated synchronous file test (to file)...\n");
3996
3997 trace("synchronous file test (to object)...\n");
3999
4000 trace("bind to an object of not registered MIME type...\n");
4001 create_file("test.winetest", "\x01\x02\x03xxxxxxxxxxxxxxxxxxxxxxxxx");
4004
4005 trace("file test (no callback)...\n");
4007
4008 if(can_do_https()) {
4009 trace("synchronous https test (invalid CN, dialog)\n");
4013
4014 bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
4015
4016 trace("asynchronous https test (invalid CN, fail)\n");
4019
4020 trace("asynchronous https test (invalid CN, accept)\n");
4023
4024 trace("asynchronous https test (invalid CN, dialog 2)\n");
4028
4029 trace("asynchronous https test...\n");
4030 test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM);
4031 }else {
4032 win_skip("Skipping https testt\n");
4033 }
4034
4035 bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
4036
4037 trace("winetest test (async switch)...\n");
4039
4040 trace("about test (no read)...\n");
4042
4043 trace("http test...\n");
4044 test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
4045
4046 trace("http test (to file)...\n");
4047 test_BindToStorage(HTTP_TEST, 0, TYMED_FILE);
4048
4049 trace("http test (to object)...\n");
4051
4052 trace("http test (short response)...\n");
4054
4055 trace("http test (short response, to object)...\n");
4057
4058 trace("http test (abort start binding E_NOTIMPL)...\n");
4061
4062 trace("http test (abort start binding E_ABORT)...\n");
4065
4066 trace("http test (abort progress)...\n");
4068
4069 trace("emulated http test...\n");
4071
4072 trace("emulated http test (to object)...\n");
4074
4075 trace("emulated http test (to object, redirect)...\n");
4077
4078 trace("emulated http test (to file)...\n");
4080
4081 trace("emulated http test (redirect)...\n");
4083
4084 trace("emulated http test (with cache)...\n");
4086
4087 trace("winetest test (no callback)...\n");
4089
4090 trace("emulated https test...\n");
4092
4093 trace("about test...\n");
4094 test_BindToStorage(ABOUT_TEST, 0, TYMED_ISTREAM);
4095
4096 trace("about test (to file)...\n");
4097 test_BindToStorage(ABOUT_TEST, 0, TYMED_FILE);
4098
4099 trace("about test (to object)...\n");
4101
4102 trace("emulated about test...\n");
4104
4105 trace("emulated about test (to file)...\n");
4107
4108 trace("emulated about test (to object)...\n");
4110
4111 trace("emulalated test reporting result in read...\n");
4113
4114 trace("file test...\n");
4115 test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM);
4116
4117 trace("file test (to file)...\n");
4118 test_BindToStorage(FILE_TEST, 0, TYMED_FILE);
4119
4120 trace("file test (to object)...\n");
4122
4123 trace("emulated file test...\n");
4125
4126 trace("emulated file test (to file)...\n");
4128
4129 trace("emulated file test (to object)...\n");
4131
4132 trace("emulated its test...\n");
4134
4135 trace("emulated its test (to file)...\n");
4137
4138 trace("emulated mk test...\n");
4140
4141 trace("test URLDownloadToFile for file protocol...\n");
4143
4144 trace("test URLDownloadToFile for emulated file protocol...\n");
4146
4147 trace("test URLDownloadToFile for http protocol...\n");
4149
4150 trace("test URLDownloadToFile abort...\n");
4152
4153 trace("test emulated http abort...\n");
4155
4156 bindf |= BINDF_NOWRITECACHE;
4157
4158 trace("ftp test...\n");
4159 test_BindToStorage(FTP_TEST, 0, TYMED_ISTREAM);
4160
4161 trace("test failures...\n");
4163
4164 bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE;
4165 only_check_prot_args = TRUE; /* Fail after checking arguments to Protocol_Start */
4166
4167 trace("check emulated http protocol arguments...\n");
4169 }
4170
4176}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define stat
Definition: acwin.h:99
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define msg(x)
Definition: auth_time.c:54
#define ARRAY_SIZE(A)
Definition: main.h:20
#define U(x)
Definition: wordpad.c:45
unsigned long HANDLE_PTR
Definition: basetsd.h:78
const GUID IID_IUnknown
const GUID IID_IClassFactory
static WCHAR cbinding_contextW[]
Definition: binding.c:29
#define RegCloseKey(hKey)
Definition: registry.h:49
cd_progress_ptr progress
Definition: cdjpeg.h:152
const CLSID CLSID_IdentityUnmarshal
static const WCHAR proxy_enable[]
Definition: connections.c:39
static const WCHAR internet_settings[]
Definition: connections.c:35
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
#define E_PENDING
Definition: dinput.h:172
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
content
Definition: atl_ax.c:994
#define CloseHandle
Definition: compat.h:739
#define CP_ACP
Definition: compat.h:109
#define OPEN_EXISTING
Definition: compat.h:775
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define FILE_SHARE_READ
Definition: compat.h:136
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2146
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
Definition: compobj.c:2897
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI DECLSPEC_HOTPATCH CoRevokeClassObject(DWORD dwRegister)
Definition: compobj.c:1086
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI UrlUnescapeW(LPWSTR pszUrl, LPWSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags)
Definition: url.c:1367
HRESULT WINAPI CoInternetGetSession(DWORD dwSessionMode, IInternetSession **ppIInternetSession, DWORD dwReserved)
Definition: session.c:485
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1418
HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, LPCSTR lpszVerb, LPCSTR lpszObjectName, LPCSTR lpszVersion, LPCSTR lpszReferrer, LPCSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext)
Definition: http.c:1410
BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength)
Definition: http.c:5677
HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType, LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags)
Definition: internet.c:1057
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
Definition: internet.c:1414
HINTERNET WINAPI InternetConnectA(HINTERNET hInternet, LPCSTR lpszServerName, INTERNET_PORT nServerPort, LPCSTR lpszUserName, LPCSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:1321
r reserved
Definition: btrfs.c:3006
PVOID LockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Output, KPROCESSOR_MODE *LockMode)
Definition: lock.c:24
VOID UnlockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp)
Definition: lock.c:180
#define regid
Definition: ecma_167.h:64
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
return pTarget Start()
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble t
Definition: gl.h:2047
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLuint GLfloat * val
Definition: glext.h:7180
@ SetPriority
Definition: halhw.h:216
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
static const WCHAR testW[]
Definition: jsregexp.c:44
#define wine_dbgstr_w
Definition: kernel32.h:34
#define GUID_NULL
Definition: ks.h:106
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define CREATE_ALWAYS
Definition: disk.h:72
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static const WCHAR url[]
Definition: encode.c:1432
#define create_file(name, size)
Definition: asmcache.c:813
static IServiceProvider service_provider
Definition: mimeole.c:1313
static void test_BindToObject(void)
Definition: mimeole.c:1115
static IInternetBindInfo bind_info
Definition: mimeole.c:1273
HRESULT hres
Definition: protocol.c:465
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static TfClientId tid
#define todo_wine_if(is_todo)
Definition: custom.c:86
#define todo_wine
Definition: custom.c:89
static LPOLESTR
Definition: stg_prop.c:27
static LPCWSTR
Definition: url.c:47
const char * expect
Definition: url.c:474
static const WCHAR url1[]
Definition: misc.c:300
static const WCHAR url2[]
Definition: misc.c:302
static PROTOCOLDATA protocoldata
Definition: protocol.c:158
static IHttpSecurity http_security
Definition: protocol.c:294
static IHttpNegotiate2 http_negotiate
Definition: protocol.c:395
static LPCWSTR file_name
Definition: protocol.c:147
static IInternetProtocolSink * binding_sink
Definition: protocol.c:154
const char * uri
Definition: sec_mgr.c:1588
static void test_CreateURLMoniker(void)
Definition: uri.c:11237
static const WCHAR about_blankW[]
Definition: url.c:155
static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
Definition: url.c:1403
static BOOL strict_bsc_qi
Definition: url.c:192
#define SET_EXPECT(func)
Definition: url.c:52
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: url.c:2371
static IInternetPriority InternetPriority
Definition: url.c:365
static HRESULT WINAPI PersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID)
Definition: url.c:2223
#define BINDTEST_ABORT_START
Definition: url.c:2863
#define BINDTEST_USE_CACHE
Definition: url.c:2858
static HRESULT WINAPI statusclb_GetBindInfo(IBindStatusCallbackEx *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
Definition: url.c:1943
static HRESULT WINAPI Protocol_Read(IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: url.c:1100
static IBinding * current_binding
Definition: url.c:178
#define BINDTEST_NO_CALLBACK
Definition: url.c:2860
#define CLEAR_CALLED(func)
Definition: url.c:85
#define BINDTEST_HTTPRESPONSE
Definition: url.c:2856
static HRESULT WINAPI statusclb_OnStopBinding(IBindStatusCallbackEx *iface, HRESULT hresult, LPCWSTR szError)
Definition: url.c:1850
static BOOL abort_start
Definition: url.c:189
static const IClassFactoryVtbl ProtocolCFVtbl
Definition: url.c:2423
static HANDLE complete_event2
Definition: url.c:179
CLSID CLSID_AboutProtocol
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
Definition: url.c:2380
static BOOL is_async_prot
Definition: url.c:183
static HRESULT WINAPI Priority_SetPriority(IInternetPriority *iface, LONG nPriority)
Definition: url.c:344
static BOOL can_do_https(void)
Definition: url.c:3897
static IClassFactory mime_cf
Definition: url.c:2394
static IBindStatusCallbackEx bsc
Definition: url.c:2150
static DWORD security_problem
Definition: url.c:174
static ULONG WINAPI ServiceProvider_Release(IServiceProvider *iface)
Definition: url.c:1398
static HRESULT WINAPI Protocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
Definition: url.c:580
#define BINDTEST_NO_CALLBACK_READ
Definition: url.c:2859
static HRESULT WINAPI HttpNegotiate_OnResponse(IHttpNegotiate2 *iface, DWORD dwResponseCode, LPCWSTR szResponseHeaders, LPCWSTR szRequestHeaders, LPWSTR *pszAdditionalRequestHeaders)
Definition: url.c:1262
static void test_ReportResult(HRESULT exhres)
Definition: url.c:3744
static const WCHAR wszWineHQIP[]
Definition: url.c:163
static enum @1731 test_protocol
static HANDLE complete_event
Definition: url.c:179
static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName, LPBC pbc, BOOL fRemember)
Definition: url.c:2311
static HRESULT abort_hres
Definition: url.c:182
static HRESULT WINAPI statusclb_OnObjectAvailable(IBindStatusCallbackEx *iface, REFIID riid, IUnknown *punk)
Definition: url.c:2109
static WCHAR file_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:196
static HRESULT WINAPI HttpSecurity_QueryInterface(IHttpSecurity *iface, REFIID riid, void **ppv)
Definition: url.c:1318
#define BINDTEST_TOOBJECT
Definition: url.c:2854
static HRESULT WINAPI MonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val)
Definition: url.c:2171
static BOOL no_callback
Definition: url.c:184
static BOOL bind_to_object
Definition: url.c:173
static const WCHAR dwl_htmlW[]
Definition: url.c:168
static const WCHAR winetest_data_urlW[]
Definition: url.c:152
static HRESULT WINAPI Protocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
Definition: url.c:367
#define BINDTEST_FILEDWLAPI
Definition: url.c:2855
static void test_URLDownloadToFile_abort(void)
Definition: url.c:3575
static const IID IID_undocumentedIE11
Definition: url.c:46
static HRESULT WINAPI statusclb_OnLowResource(IBindStatusCallbackEx *iface, DWORD reserved)
Definition: url.c:1650
static BOOL post_test
Definition: url.c:173
static const IClassFactoryVtbl ClassFactoryVtbl
Definition: url.c:2386
static HRESULT WINAPI Protocol_Suspend(IInternetProtocol *iface)
Definition: url.c:1088
static ULONG WINAPI MonikerProp_AddRef(IMonikerProp *iface)
Definition: url.c:2161
static HRESULT WINAPI Protocol_Terminate(IInternetProtocol *iface, DWORD dwOptions)
Definition: url.c:1072
static ULONG WINAPI PersistMoniker_Release(IPersistMoniker *iface)
Definition: url.c:2218
static HRESULT WINAPI PersistMoniker_IsDirty(IPersistMoniker *iface)
Definition: url.c:2229
static ULONG WINAPI HttpNegotiate_Release(IHttpNegotiate2 *iface)
Definition: url.c:1238
static const IPersistMonikerVtbl PersistMonikerVtbl
Definition: url.c:2329
static BOOL test_bscholder(IBindStatusCallback *holder)
Definition: url.c:2604
static HRESULT WINAPI HttpSecurity_GetWindow(IHttpSecurity *iface, REFGUID rguidReason, HWND *phwnd)
Definition: url.c:1345
static IBindStatusCallbackEx bsc2
Definition: url.c:2151
static void test_create(void)
Definition: url.c:276
#define BINDTEST_INVALID_CN
Definition: url.c:2862
#define BINDTEST_EMULATE
Definition: url.c:2853
static BOOL stopped_binding
Definition: url.c:172
static IServiceProvider ServiceProvider
Definition: url.c:1456
#define CHECK_EXPECT(func)
Definition: url.c:61
static HRESULT binding_hres
Definition: url.c:180
static void test_GetBindInfoEx(IBindStatusCallback *holder)
Definition: url.c:2558
@ END_DOWNLOAD
Definition: url.c:213
@ BEFORE_DOWNLOAD
Definition: url.c:211
@ DOWNLOADING
Definition: url.c:212
#define BINDTEST_REDIRECT
Definition: url.c:2857
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: url.c:2366
#define DEFINE_EXPECT(func)
Definition: url.c:49
static const CHAR test_txtA[]
Definition: url.c:169
static BOOL emulate_protocol
Definition: url.c:172
static DWORD_PTR
Definition: url.c:41
static BOOL only_check_prot_args
Definition: url.c:187
static void test_CreateAsyncBindCtx(void)
Definition: url.c:2433
#define BINDTEST_ALLOW_FINDINGRESOURCE
Definition: url.c:2866
static HRESULT WINAPI statusclb_OnStartBinding(IBindStatusCallbackEx *iface, DWORD dwReserved, IBinding *pib)
Definition: url.c:1586
static HRESULT WINAPI statusclb_QueryInterface(IBindStatusCallbackEx *iface, REFIID riid, void **ppv)
Definition: url.c:1506
static IHttpNegotiate2Vtbl HttpNegotiateVtbl
Definition: url.c:1307
static IHttpSecurity HttpSecurity
Definition: url.c:1385
static ULONG WINAPI HttpSecurity_Release(IHttpSecurity *iface)
Definition: url.c:1340
static IMonikerProp MonikerProp
Definition: url.c:2195
#define BINDTEST_ASYNC_SWITCH
Definition: url.c:2865
static HRESULT WINAPI ProtocolCF_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: url.c:2412
static BOOL test_abort
Definition: url.c:184
static ULONG WINAPI Priority_AddRef(IInternetPriority *iface)
Definition: url.c:334
static BOOL abort_progress
Definition: url.c:190
static HRESULT WINAPI HttpSecurity_OnSecurityProblem(IHttpSecurity *iface, DWORD dwProblem)
Definition: url.c:1360
static const IMonikerPropVtbl MonikerPropVtbl
Definition: url.c:2188
static const CHAR dwl_htmlA[]
Definition: url.c:167
static void test_BindToStorage_fail(void)
Definition: url.c:3791
static ULONG WINAPI Protocol_AddRef(IInternetProtocol *iface)
Definition: url.c:398
static DWORD WINAPI thread_proc(PVOID arg)
Definition: url.c:430
static BOOL callback_read
Definition: url.c:184
static IHttpNegotiate2 HttpNegotiate
Definition: url.c:1316
static HRESULT WINAPI HttpNegotiate_GetRootSecurityId(IHttpNegotiate2 *iface, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
Definition: url.c:1280
static const WCHAR cache_fileW[]
Definition: url.c:166
static void test_WinInetHttpInfo(IWinInetHttpInfo *http_info, DWORD progress)
Definition: url.c:1460
static HRESULT WINAPI statusclb_GetBindInfoEx(IBindStatusCallbackEx *iface, DWORD *grfBINDF, BINDINFO *pbindinfo, DWORD *grfBINDF2, DWORD *pdwReserved)
Definition: url.c:2122
static DWORD tymed
Definition: url.c:174
static IPersistMoniker PersistMoniker
Definition: url.c:2341
static DWORD read
Definition: url.c:174
static BOOL have_IHttpNegotiate2
Definition: url.c:183
static void register_protocols(void)
Definition: url.c:3878
static HRESULT WINAPI MonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppv)
Definition: url.c:2154
#define CHECK_EXPECT2(func)
Definition: url.c:55
static HRESULT WINAPI HttpNegotiate_BeginningTransaction(IHttpNegotiate2 *iface, LPCWSTR szURL, LPCWSTR szHeaders, DWORD dwReserved, LPWSTR *pszAdditionalHeaders)
Definition: url.c:1243
static HRESULT WINAPI statusclb_OnProgress(IBindStatusCallbackEx *iface, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
Definition: url.c:1656
static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **pimkName)
Definition: url.c:2323
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: url.c:2343
static const IHttpSecurityVtbl HttpSecurityVtbl
Definition: url.c:1377
static HRESULT WINAPI Priority_QueryInterface(IInternetPriority *iface, REFIID riid, void **ppv)
Definition: url.c:328
#define BINDTEST_ABORT
Definition: url.c:2861
static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable, IMoniker *pimkName, LPBC pibc, DWORD grfMode)
Definition: url.c:2235
static HRESULT WINAPI PersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
Definition: url.c:2317
static const WCHAR emptyW[]
Definition: url.c:170
static enum @1732 download_state
static void create_html_file(void)
Definition: url.c:3715
static ULONG WINAPI Protocol_Release(IInternetProtocol *iface)
Definition: url.c:403
static BOOL test_RegisterBindStatusCallback(void)
Definition: url.c:2752
static const CHAR wszIndexHtmlA[]
Definition: url.c:165
static HRESULT WINAPI ProtocolCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: url.c:2396
static HRESULT WINAPI statusclb_GetPriority(IBindStatusCallbackEx *iface, LONG *pnPriority)
Definition: url.c:1644
static DWORD bindtest_flags
Definition: url.c:193
static ULONG WINAPI Priority_Release(IInternetPriority *iface)
Definition: url.c:339
static ULONG WINAPI statusclb_AddRef(IBindStatusCallbackEx *iface)
Definition: url.c:1576
static ULONG WINAPI statusclb_Release(IBindStatusCallbackEx *iface)
Definition: url.c:1581
@ FTP_TEST
Definition: url.c:205
@ WINETEST_SYNC_TEST
Definition: url.c:207
@ FILE_TEST
Definition: url.c:201
@ HTTPS_TEST
Definition: url.c:204
@ HTTP_TEST
Definition: url.c:199
@ WINETEST_TEST
Definition: url.c:206
@ MK_TEST
Definition: url.c:203
@ ABOUT_TEST
Definition: url.c:200
@ ITS_TEST
Definition: url.c:202
static BOOL http_is_first
Definition: url.c:173
#define CHECK_CALLED(func)
Definition: url.c:67
static void set_file_url(char *path)
Definition: url.c:3682
static DWORD bindf
Definition: url.c:174
static HRESULT WINAPI Protocol_Resume(IInternetProtocol *iface)
Definition: url.c:1094
static HRESULT WINAPI Protocol_UnlockRequest(IInternetProtocol *iface)
Definition: url.c:1196
static BOOL filedwl_api
Definition: url.c:173
static BOOL async_switch
Definition: url.c:191
static const WCHAR * reported_url
Definition: url.c:175
static HRESULT WINAPI Protocol_Abort(IInternetProtocol *iface, HRESULT hrReason, DWORD dwOptions)
Definition: url.c:1056
static void test_StdURLMoniker(void)
Definition: url.c:3820
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: url.c:2361
static const char * test_file
Definition: url.c:194
static ULONG WINAPI HttpNegotiate_AddRef(IHttpNegotiate2 *iface)
Definition: url.c:1233
static BOOL stopped_obj_binding
Definition: url.c:172
static IInternetProtocolSink * protocol_sink
Definition: url.c:177
static BOOL invalid_cn_accepted
Definition: url.c:188
static BOOL is_urlmon_protocol(int prot)
Definition: url.c:235
#define BINDTEST_ABORT_PROGRESS
Definition: url.c:2864
static void init_bind_test(int protocol, DWORD flags, DWORD t)
Definition: url.c:2868
static ULONG WINAPI PersistMoniker_AddRef(IPersistMoniker *iface)
Definition: url.c:2213
static const IInternetPriorityVtbl InternetPriorityVtbl
Definition: url.c:357
static void test_CreateAsyncBindCtxEx(void)
Definition: url.c:2473
static WCHAR BSCBHolder[]
Definition: url.c:159
static void test_BindToStorage(int protocol, DWORD flags, DWORD t)
Definition: url.c:2933
static HRESULT WINAPI statusclb_OnDataAvailable(IBindStatusCallbackEx *iface, DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
Definition: url.c:1987
static HRESULT WINAPI HttpNegotiate_QueryInterface(IHttpNegotiate2 *iface, REFIID riid, void **ppv)
Definition: url.c:1220
static HRESULT onsecurityproblem_hres
Definition: url.c:181
static HRESULT WINAPI ServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
Definition: url.c:1387
static HRESULT WINAPI Protocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
Definition: url.c:1188
static ULONG WINAPI MonikerProp_Release(IMonikerProp *iface)
Definition: url.c:2166
static IInternetProtocol Protocol
Definition: url.c:1218
static WCHAR current_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:196
static IClassFactory protocol_cf
Definition: url.c:2431
static const IBindStatusCallbackExVtbl BindStatusCallbackVtbl
Definition: url.c:2135
static IServiceProviderVtbl ServiceProviderVtbl
Definition: url.c:1449
static HRESULT WINAPI Priority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
Definition: url.c:351
static ULONG WINAPI ServiceProvider_AddRef(IServiceProvider *iface)
Definition: url.c:1393
static HRESULT WINAPI Protocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
Definition: url.c:925
#define CHECK_NOT_CALLED(func)
Definition: url.c:73
static IBindStatusCallbackEx objbsc
Definition: url.c:1458
static BOOL use_bscex
Definition: url.c:183
static void test_stream_seek(IStream *stream)
Definition: url.c:1962
static void create_cache_file(void)
Definition: url.c:3720
static BOOL test_redirect
Definition: url.c:184
static HRESULT WINAPI Protocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: url.c:1181
#define CHECK_CALLED_BROKEN(func)
Definition: url.c:79
static WCHAR cache_file_name[MAX_PATH]
Definition: url.c:185
static void test_URLDownloadToFile(DWORD prot, BOOL emul)
Definition: url.c:3472
static HRESULT WINAPI PersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid, void **ppv)
Definition: url.c:2197
static BOOL proxy_active(void)
Definition: url.c:216
static void test_switch_fail(void)
Definition: url.c:408
static DWORD prot_state
Definition: url.c:174
static ULONG WINAPI HttpSecurity_AddRef(IHttpSecurity *iface)
Definition: url.c:1335
static const WCHAR wszWineHQSite[]
Definition: url.c:161
static BOOL data_available
Definition: url.c:173
static const WCHAR wszTextHtml[]
Definition: url.c:157
static BOOL use_cache_file
Definition: url.c:184
static DWORD thread_id
Definition: url.c:174
static CHAR mime_type[512]
Definition: url.c:176
static WCHAR http_cache_file[MAX_PATH]
Definition: url.c:186
REFCLSID clsid
Definition: msctf.c:82
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define DELETE
Definition: nt_native.h:57
#define DWORD
Definition: nt_native.h:44
#define GENERIC_WRITE
Definition: nt_native.h:90
@ REGCLS_MULTIPLEUSE
Definition: objbase.h:393
#define STGM_READWRITE
Definition: objbase.h:919
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923
interface IBindCtx * LPBC
Definition: objfwd.h:18
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
long LONG
Definition: pedump.c:60
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define CLSID_NULL
Definition: guiddef.h:99
#define REFIID
Definition: guiddef.h:118
#define IID_NULL
Definition: guiddef.h:98
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
#define win_skip
Definition: test.h:163
int winetest_interactive
#define memset(x, y, z)
Definition: compat.h:39
static const WCHAR winetestW[]
Definition: shelldispatch.c:47
HRESULT hr
Definition: shlfolder.c:183
#define URL_UNESCAPE_INPLACE
Definition: shlwapi.h:1250
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
Definition: socklife.c:36
DWORD dwOptions
Definition: solitaire.cpp:25
_In_ BOOLEAN Read
Definition: strmini.h:479
Definition: scsiwmi.h:51
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
Definition: fci.c:127
Definition: send.c:48
Definition: stat.h:55
Definition: ps.c:97
Definition: parse.h:23
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint32_t DWORD_PTR
Definition: typedefs.h:65
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
Definition: umon.c:732
HRESULT WINAPI RevokeBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc)
Definition: bindctx.c:676
HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbscPrevious, DWORD dwReserved)
Definition: bindctx.c:615
IID IID_IBindStatusCallbackHolder
HRESULT WINAPI CreateAsyncBindCtx(DWORD reserved, IBindStatusCallback *callback, IEnumFORMATETC *format, IBindCtx **pbind)
Definition: bindctx.c:899
int ret
HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, LPCWSTR szURL, LPCWSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB)
Definition: download.c:427
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
#define WAIT_OBJECT_0
Definition: winbase.h:432
_Reserved_ DWORD * pdwReserved
Definition: wincrypt.h:4254
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define S_FALSE
Definition: winerror.h:2357
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:135
#define E_NOINTERFACE
Definition: winerror.h:2364
#define MK_E_SYNTAX
Definition: winerror.h:2785
#define STG_E_ACCESSDENIED
Definition: winerror.h:2568
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define E_ABORT
Definition: winerror.h:2366
#define HTTP_STATUS_OK
Definition: winhttp.h:240
#define INTERNET_DEFAULT_HTTPS_PORT
Definition: winhttp.h:37
#define INTERNET_HANDLE_TYPE_HTTP_REQUEST
Definition: wininet.h:814
#define ERROR_INTERNET_SEC_CERT_CN_INVALID
Definition: wininet.h:2026
#define HTTP_QUERY_FLAG_NUMBER
Definition: wininet.h:1606
#define INTERNET_FLAG_SECURE
Definition: wininet.h:71
#define HTTP_QUERY_STATUS_CODE
Definition: wininet.h:1542
#define INTERNET_OPEN_TYPE_PRECONFIG
Definition: wininet.h:521
#define ERROR_INTERNET_CANNOT_CONNECT
Definition: wininet.h:2018
#define ERROR_INTERNET_NAME_NOT_RESOLVED
Definition: wininet.h:1996
#define INTERNET_OPTION_HANDLE_TYPE
Definition: wininet.h:710
#define INTERNET_HANDLE_TYPE_FTP_FILE
Definition: wininet.h:808
#define ERROR_INTERNET_SEC_CERT_ERRORS
Definition: wininet.h:2042
#define INTERNET_SERVICE_HTTP
Definition: wininet.h:562
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
int WINAPI GetClipboardFormatNameA(_In_ UINT format, _Out_writes_(cchMaxCount) LPSTR lpszFormatName, _In_ int cchMaxCount)
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175
unsigned char BYTE
Definition: xxhash.c:193