26#define NONAMELESSUNION
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}};
49#define DEFINE_EXPECT(func) \
50 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
52#define SET_EXPECT(func) \
53 do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)
55#define CHECK_EXPECT2(func) \
57 ok(expect_ ##func, "unexpected call " #func "\n"); \
58 called_ ## func = TRUE; \
61#define CHECK_EXPECT(func) \
63 CHECK_EXPECT2(func); \
64 expect_ ## func = FALSE; \
67#define CHECK_CALLED(func) \
69 ok(called_ ## func, "expected " #func "\n"); \
70 expect_ ## func = called_ ## func = FALSE; \
73#define CHECK_NOT_CALLED(func) \
75 ok(!called_ ## func, "unexpected " #func "\n"); \
76 expect_ ## func = called_ ## func = FALSE; \
79#define CHECK_CALLED_BROKEN(func) \
81 ok(called_ ## func || broken(!called_ ## func), "expected " #func "\n"); \
82 expect_ ## func = called_ ## func = FALSE; \
85#define CLEAR_CALLED(func) \
86 expect_ ## func = called_ ## func = FALSE
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};
159static WCHAR BSCBHolder[] = {
'_',
'B',
'S',
'C',
'B',
'_',
'H',
'o',
'l',
'd',
'e',
'r',
'_',0 };
162 {
'w',
'w',
'w',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',0};
164 {
'4',
'.',
'1',
'5',
'.',
'1',
'8',
'4',
'.',
'7',
'7',0};
166static const WCHAR cache_fileW[] = {
'c',
':',
'\\',
'c',
'a',
'c',
'h',
'e',
'.',
'h',
't',
'm',0};
248 "Expected CreateURLMoniker to return E_INVALIDARG, got 0x%08x\n",
hr);
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);
258 "Expected CreateURLMoniker to return E_INVALIDARG, got 0x%08x\n",
hr);
263 "Expected CreateURLMoniker to return S_OK, got 0x%08x\n",
hr);
264 if(mon1) IMoniker_Release(mon1);
267 ok(
hr ==
S_OK,
"failed to create moniker: 0x%08x\n",
hr);
270 ok(
hr ==
S_OK,
"failed to create moniker: 0x%08x\n",
hr);
272 if(mon1) IMoniker_Release(mon1);
273 if(mon2) IMoniker_Release(mon2);
278 static const WCHAR relativeW[] = {
'a',
'/',
'b',
'.',
't',
'x',
't',0};
284 static const WCHAR TEST_PART_URL_1[] = {
'/',
't',
'e',
's',
't',
's',
'/',
'd',
'a',
't',
'a',
'.',
'p',
'h',
'p',0};
288 mon = (
void*)0xdeadbeef;
295 stream = (
void*)0xdeadbeef;
296 hr = IMoniker_BindToStorage(mon, bctx,
NULL, &IID_IStream, (
void**)&
stream);
300 hr = IMoniker_BindToStorage(mon, bctx,
NULL, &IID_IStream,
NULL);
303 stream = (
void*)0xdeadbeef;
304 hr = IMoniker_BindToStorage(mon,
NULL,
NULL, &IID_IStream, (
void**)&
stream);
309 IMoniker_Release(mon);
311 mon = (
void*)0xdaedbeef;
315 stream = (
void*)0xdeadbeef;
316 hr = IMoniker_BindToStorage(mon,
NULL,
NULL, &IID_IStream, (
void**)&
stream);
321 hr = IMoniker_BindToStorage(mon, bctx,
NULL, &IID_IStream,
NULL);
324 IMoniker_Release(mon);
325 IBindCtx_Release(bctx);
330 ok(0,
"unexpected call\n");
347 ok(!nPriority,
"nPriority = %d\n", nPriority);
353 ok(0,
"unexpected call\n");
369 static const IID IID_undocumentedIE10 = {0x7daf9908,0x8415,0x4005,{0x95,0xae,0xbd,0x27,0xf6,0xe3,0xdc,0x00}};
414 static BOOL tested_switch_fail;
416 if(tested_switch_fail)
419 tested_switch_fail =
TRUE;
422 ok(
hres ==
S_OK,
"Could not get IInternetProtocolSink iface: %08x\n",
hres);
476 BINDSTATUS_SENDINGREQUEST,
NULL);
492 ok(
hres ==
S_OK,
"ReportProgress(BINDSTATUS_REFIRECTING) failed: %08x\n",
hres);
585 DWORD bind_info, bscf = BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION;
588 static const STGMEDIUM stgmed_zero = {0};
598 ok(pOIProtSink !=
NULL,
"pOIProtSink == NULL\n");
599 ok(pOIBindInfo !=
NULL,
"pOIBindInfo == NULL\n");
600 ok(grfPI == 0,
"grfPI=%d, expected 0\n", grfPI);
614 memset(&bindinfo, 0,
sizeof(bindinfo));
616 hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &
bind_info, &bindinfo);
619 memset(&bindinfo, 0,
sizeof(bindinfo));
620 bindinfo.cbSize =
sizeof(bindinfo);
621 hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &
bind_info, &bindinfo);
624 ok(
bind_info & BINDF_FROMURLMON,
"BINDF_FROMURLMON is not set\n");
627 !(
bindf&BINDF_ASYNCSTORAGE) || !(
bindf&BINDF_PULLDATA))
628 ok(
bind_info & BINDF_NEEDFILE,
"BINDF_NEEDFILE is not set\n");
630 ok(!(
bind_info & BINDF_NEEDFILE),
"BINDF_NEEDFILE is set\n");
632 bind_info &= ~(BINDF_NEEDFILE|BINDF_FROMURLMON);
636 ok(
bind_info == (
bindf & ~(BINDF_NEEDFILE|BINDF_FROMURLMON)),
"bind_info = %x, expected %x\n",
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");
651 ok(!bindinfo.pUnk,
"bindinfo.pUnk = %p\n", bindinfo.pUnk);
652 ok(!bindinfo.dwReserved,
"bindinfo.dwReserved = %d\n", bindinfo.dwReserved);
659 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
660 BINDSTATUS_DIRECTBIND,
NULL);
662 "ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n",
hres);
670 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
671 BINDSTATUS_SENDINGREQUEST,
emptyW);
673 "ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n",
hres);
679 IInternetProtocolSink_AddRef(pOIProtSink);
696 static const WCHAR wszMimes[] = {
'*',
'/',
'*',0};
699 hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_USER_AGENT,
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);
708 hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
709 accept_mimes, 256, &fetched);
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");
716 hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
717 NULL, 256, &fetched);
719 "GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n",
hres);
721 hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
722 accept_mimes, 256,
NULL);
724 "GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n",
hres);
726 hres = IInternetBindInfo_QueryInterface(pOIBindInfo, &IID_IServiceProvider,
741 NULL, 0, &additional_headers);
748 ok(additional_headers ==
NULL,
"additional_headers=%p\n", additional_headers);
752 &IID_IHttpNegotiate2, (
void**)&http_negotiate2);
761 hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, sec_id, &
size, 0);
766 IHttpNegotiate2_Release(http_negotiate2);
767 ok(
hres ==
E_FAIL,
"GetRootSecurityId failed: %08x, expected E_FAIL\n",
hres);
784 IInternetProtocolSink_AddRef(pOIProtSink);
791 data.grfFlags = PI_FORCE_ASYNC;
793 hres = IInternetProtocolSink_Switch(pOIProtSink, &
data);
805 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
806 BINDSTATUS_CACHEFILENAMEAVAILABLE,
file_url+7);
808 "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n",
hres);
814 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
815 BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
wszTextHtml);
817 "ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE) failed: %08x\n",
hres);
824 hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
wszTextHtml);
826 "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n",
hres);
829 hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE,
wszTextHtml);
831 "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n",
hres);
835 bscf |= BSCF_DATAFULLYAVAILABLE;
837 bscf = BSCF_FIRSTDATANOTIFICATION|BSCF_DATAFULLYAVAILABLE;
845 SET_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
848 SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
861 SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
870 hres = IInternetProtocolSink_ReportData(pOIProtSink, bscf, 13, 13);
905 hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_BEGINDOWNLOADDATA,
NULL);
906 ok(
hres ==
S_OK,
"ReportProgress(BINDSTATUS_BEGINDOWNLOADDATA) failed: %08x\n",
hres);
910 hres = IInternetProtocolSink_ReportData(pOIProtSink, bscf, 13, 13);
917 hres = IInternetProtocolSink_ReportResult(pOIProtSink,
S_OK, 0,
NULL);
926 PROTOCOLDATA *pProtocolData)
938 ok(pProtocolData !=
NULL,
"pProtocolData == NULL\n");
945 BINDSTATUS_SENDINGREQUEST,
NULL);
951 "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n",
hres);
953 bscf |= BSCF_FIRSTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION;
960 hres = IInternetProtocolSink_QueryInterface(
protocol_sink, &IID_IServiceProvider,
962 ok(
hres ==
S_OK,
"Could not get IServiceProvicder\n");
966 ok(
hres ==
S_OK,
"Could not get IHttpNegotiate\n");
982 ok(
hres ==
S_OK,
"ReportProgress(BINDSTATUS_ACCEPTRANGES) failed: %08x\n",
hres);
988 "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n",
hres);
992 ok(
hres ==
S_OK,
"ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n",
hres);
994 bscf |= BSCF_FIRSTDATANOTIFICATION;
999 bscf = BSCF_INTERMEDIATEDATANOTIFICATION;
1020 SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
1021 SET_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
1023 SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
1063 ok(hrReason ==
E_ABORT,
"hrReason = %08x\n", hrReason);
1090 ok(0,
"unexpected call\n");
1096 ok(0,
"unexpected call\n");
1105 static const char data[] =
"<HTML></HTML>";
1109 ok(pv !=
NULL,
"pv == NULL\n");
1110 ok(
cb != 0,
"cb == 0\n");
1111 ok(pcbRead !=
NULL,
"pcbRead == NULL\n");
1150 BSCF_LASTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION, 2000, 2000);
1175 ok(*pcbRead == 0,
"*pcbRead=%d, expected 0\n", *pcbRead);
1184 ok(0,
"unexpected call\n");
1229 ok(0,
"unexpected call\n");
1255 ok(pszAdditionalHeaders !=
NULL,
"pszAdditionalHeaders == NULL\n");
1256 if(pszAdditionalHeaders)
1257 ok(*pszAdditionalHeaders ==
NULL,
"*pszAdditionalHeaders != NULL\n");
1269 ok(dwResponseCode == 200,
"dwResponseCode=%d, expected 200\n", dwResponseCode);
1270 ok(szResponseHeaders !=
NULL,
"szResponseHeaders == NULL\n");
1271 ok(szRequestHeaders ==
NULL,
"szRequestHeaders != NULL\n");
1273 ok(pszAdditionalRequestHeaders !=
NULL,
"pszAdditionalHeaders == NULL\n");
1274 if(pszAdditionalRequestHeaders)
1275 ok(*pszAdditionalRequestHeaders ==
NULL,
"*pszAdditionalHeaders != NULL\n");
1283 static const BYTE sec_id[] = {
'h',
't',
't',
'p',
':',
't',
'e',
's',
't',1,0,0,0};
1290 ok(pbSecurityId !=
NULL,
"pbSecurityId == NULL\n");
1291 ok(pcbSecurityId !=
NULL,
"pcbSecurityId == NULL\n");
1293 if(pbSecurityId == (
void*)0xdeadbeef)
1297 ok(*pcbSecurityId == 512,
"*pcbSecurityId=%d, expected 512\n", *pcbSecurityId);
1298 *pcbSecurityId =
sizeof(sec_id);
1302 memcpy(pbSecurityId, sec_id,
sizeof(sec_id));
1320 ok(0,
"Unexpected call\n");
1330 ok(0,
"Unexpected interface requested.\n");
1349 else if(
IsEqualGUID(rguidReason, &IID_IWindowForBindingUI))
1351 else if(
IsEqualGUID(rguidReason, &IID_ICodeInstall))
1366 "Got problem: %d\n", dwProblem);
1389 ok(0,
"unexpected call\n");
1406 if(
IsEqualGUID(&IID_IAuthenticate, guidService)) {
1411 if(
IsEqualGUID(&IID_IInternetProtocol, guidService)) {
1416 if(
IsEqualGUID(&IID_IInternetBindInfo, guidService)) {
1421 if(
IsEqualGUID(&IID_IWindowForBindingUI, guidService)) {
1427 if(
IsEqualGUID(&IID_IHttpSecurity, guidService)) {
1433 if(
IsEqualGUID(&IID_IGetBindHandle, guidService)) {
1434 trace(
"QueryService(IID_IGetBindHandle)\n");
1440 trace(
"QueryService(IID_undocumentedIE11)\n");
1466 if(
progress == BINDSTATUS_SENDINGREQUEST)
1470 &&
progress!=BINDSTATUS_MIMETYPEAVAILABLE)
1508 static const IID IID_undocumentedIE10 = {0xf286fa56,0xc1fd,0x4270,{0x8e,0x67,0xb3,0xeb,0x79,0x0a,0x81,0xe8}};
1558 trace(
"QI(IID_IGetBindHandle)\n");
1562 trace(
"QI(IID_undocumentedIE10)\n");
1566 trace(
"QI(IID_undocumentedIE11)\n");
1603 ok(pib !=
NULL,
"pib should not be NULL\n");
1606 if(pib == (
void*)0xdeadbeef)
1611 hres = IBinding_QueryInterface(pib, &IID_IMoniker, (
void**)&mon);
1614 IMoniker_Release(mon);
1616 hres = IBinding_QueryInterface(pib, &IID_IWinInetHttpInfo, (
void**)&http_info);
1627 hres = IBinding_GetBindResult(pib, &
clsid, &
res, &res_str, (
void*)0xdeadbeef);
1631 ok(
hres ==
S_OK,
"GetBindResult failed: %08x, expected S_OK\n",
hres);
1633 ok(!
res,
"incorrect res: %x\n",
res);
1646 ok(0,
"unexpected call\n");
1652 ok(0,
"unexpected call\n");
1661 switch(ulStatusCode) {
1662 case BINDSTATUS_FINDINGRESOURCE:
1674 case BINDSTATUS_CONNECTING:
1686 case BINDSTATUS_REDIRECTING:
1697 case BINDSTATUS_SENDINGREQUEST:
1714 case BINDSTATUS_MIMETYPEAVAILABLE:
1724 case BINDSTATUS_BEGINDOWNLOADDATA:
1729 ok(szStatusText !=
NULL,
"szStatusText == NULL\n");
1742 case BINDSTATUS_DOWNLOADINGDATA:
1744 ok(iface != &
objbsc,
"unexpected call\n");
1761 case BINDSTATUS_ENDDOWNLOADDATA:
1766 ok(szStatusText !=
NULL,
"szStatusText == NULL\n");
1778 case BINDSTATUS_CACHEFILENAMEAVAILABLE:
1789 ok(szStatusText !=
NULL,
"szStatusText == NULL\n");
1793 case BINDSTATUS_CLASSIDAVAILABLE:
1798 ok(0,
"unexpected call\n");
1802 ok(
hr ==
S_OK,
"CLSIDFromString failed with error 0x%08x\n",
hr);
1807 case BINDSTATUS_BEGINSYNCOPERATION:
1810 ok(0,
"unexpected call\n");
1811 ok(szStatusText ==
NULL,
"Expected szStatusText to be NULL\n");
1813 case BINDSTATUS_ENDSYNCOPERATION:
1816 ok(0,
"unexpected call\n");
1817 ok(szStatusText ==
NULL,
"Expected szStatusText to be NULL\n");
1819 case BINDSTATUS_PROXYDETECTING:
1820 trace(
"BINDSTATUS_PROXYDETECTING\n");
1822 case BINDSTATUS_COOKIE_SENT:
1823 trace(
"BINDSTATUS_COOKIE_SENT\n");
1825 case BINDSTATUS_DECODING:
1826 trace(
"BINDSTATUS_DECODING\n");
1829 ok(0,
"unexpected code %d\n", ulStatusCode);
1836 hres = IBinding_QueryInterface(
current_binding, &IID_IWinInetHttpInfo, (
void**)&http_info);
1838 ok(
hres ==
S_OK,
"Could not get IWinInetHttpInfo iface: %08x\n",
hres);
1842 "QueryInterface(IID_IWinInetHttpInfo) returned: %08x, expected E_NOINTERFACE\n",
hres);
1844 IWinInetHttpInfo_Release(http_info);
1873 ok(
SUCCEEDED(hresult),
"binding failed: %08x\n", hresult);
1875 todo_wine ok(hresult ==
S_FALSE,
"binding failed: %08x, expected S_FALSE\n", hresult);
1877 ok(hresult ==
E_ABORT,
"binding failed: %08x, expected E_ABORT\n", hresult);
1880 ok(szError ==
NULL,
"szError should be NULL\n");
1889 ok(
hres ==
S_OK,
"GetBindResult failed: %08x, expected S_OK\n",
hres);
1895 "incorrect protocol CLSID: %s, expected CLSID_NULL\n",
1899 "incorrect protocol CLSID: %s, expected CLSID_FtpProtocol\n",
1903 "incorrect protocol CLSID: %s, expected CLSID_FtpProtocol\n",
1907 "incorrect protocol CLSID: %s, expected CLSID_FileProtocol\n",
1911 "incorrect protocol CLSID: %s, expected CLSID_HttpProtocol\n",
1915 "incorrect protocol CLSID: %s, expected CLSID_HttpSProtocol\n",
1919 "incorrect protocol CLSID: %s, expected CLSID_AboutProtocol\n",
1955 cbSize = pbindinfo->cbSize;
1956 memset(pbindinfo, 0, cbSize);
1957 pbindinfo->cbSize = cbSize;
1970 hres = IStream_Seek(
stream,
pos, STREAM_SEEK_SET, &new_pos);
1972 ok(!new_pos.
QuadPart,
"new_pos.QuadPart != 0\n");
1976 hres = IStream_Seek(
stream,
pos, STREAM_SEEK_END, &new_pos);
1978 ok(new_pos.
QuadPart,
"new_pos.QuadPart = 0\n");
1984 ok(new_pos.
QuadPart == 0xdeadbeef,
"unexpected new_pos.QuadPart\n");
1988 DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
1996 ok(0,
"unexpected call\n");
2003 "Download state was %d, expected DOWNLOADING or END_DOWNLOAD\n",
2008 ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION|BSCF_LASTDATANOTIFICATION),
"grfBSCF = %x\n", grfBSCF);
2010 ok(pformatetc !=
NULL,
"pformatetx == NULL\n");
2017 ok(!
strcmp(clipfmt,
mime_type),
"clipformat %x != mime_type, \"%s\" != \"%s\"\n",
2018 pformatetc->cfFormat, clipfmt,
mime_type);
2020 ok(pformatetc->cfFormat == 0,
"clipformat=%x\n", pformatetc->cfFormat);
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);
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");
2032 switch(pstgmed->tymed) {
2033 case TYMED_ISTREAM: {
2038 if(grfBSCF & BSCF_FIRSTDATANOTIFICATION) {
2043 "Write failed: %08x, expected STG_E_ACCESSDENIED\n",
hres);
2057 "stat.pwcsName = %s, cache_file_name = %s\n",
2060 ok(
U(
stat.cbSize).LowPart == (
bindf&BINDF_ASYNCHRONOUS?0:6500),
2061 "stat.cbSize.LowPart = %u\n",
U(
stat.cbSize).LowPart);
2068 ok(
stat.type == STGTY_STREAM,
"stat.type = %x\n",
stat.type);
2069 ok(
U(
stat.cbSize).HighPart == 0,
"stat.cbSize.HighPart != 0\n");
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);
2092 "unexpected file name %s\n",
wine_dbgstr_w(pstgmed->u.lpszFileName));
2095 "unexpected file name %s\n",
wine_dbgstr_w(pstgmed->u.lpszFileName));
2099 ok(pstgmed->u.lpszFileName !=
NULL,
"lpszFileName == NULL\n");
2114 ok(0,
"unexpected call\n");
2117 ok(punk !=
NULL,
"punk == NULL\n");
2127 ok(grfBINDF !=
NULL,
"grfBINDF == NULL\n");
2128 ok(grfBINDF2 !=
NULL,
"grfBINDF2 == NULL\n");
2129 ok(pbindinfo !=
NULL,
"pbindinfo == NULL\n");
2225 ok(0,
"unexpected call\n");
2231 ok(0,
"unexpected call\n");
2242 {
'C',
'B',
'i',
'n',
'd',
'i',
'n',
'g',
' ',
'C',
'o',
'n',
't',
'e',
'x',
't',0};
2248 ok(!fFullyAvailable,
"fFullyAvailable = %x\n", fFullyAvailable);
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);
2256 ok(
hres ==
S_OK,
"GetObjectParam(CBinding Context) failed: %08x\n",
hres);
2260 hres = IUnknown_QueryInterface(unk, &IID_IBinding, (
void**)&binding);
2263 IBinding_Release(binding);
2264 IUnknown_Release(unk);
2269 ok(
hres ==
S_OK,
"RegisterBindStatusCallback failed: %08x\n",
hres);
2272 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2279 SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
2287 hres = IMoniker_BindToStorage(pimkName, pibc,
NULL, &IID_IStream, (
void**)&unk);
2306 IUnknown_Release(unk);
2313 ok(0,
"unexpected call\n");
2319 ok(0,
"unexpected call\n");
2325 ok(0,
"unexpected call\n");
2374 ok(!outer,
"outer = %p\n", outer);
2382 ok(0,
"unexpected call\n");
2417 ok(outer !=
NULL,
"outer == NULL\n");
2443 ok(bctx == (
IBindCtx*)0x0ff00ff0,
"bctx should not be changed\n");
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);
2459 "bindopts.grfMode = %08x, expected: STGM_READWRITE | STGM_SHARE_EXCLUSIVE\n",
2461 ok(bindopts.dwTickCountDeadline == 0,
2462 "bindopts.dwTickCountDeadline = %08x, expected: 0\n", bindopts.dwTickCountDeadline);
2464 hres = IBindCtx_QueryInterface(bctx, &IID_IAsyncBindCtx, (
void**)&unk);
2467 IUnknown_Release(unk);
2469 ref = IBindCtx_Release(bctx);
2470 ok(
ref == 0,
"bctx should be destroyed here\n");
2482 if (!pCreateAsyncBindCtxEx) {
2483 win_skip(
"CreateAsyncBindCtxEx not present\n");
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);
2500 "bindopts.grfMode = %08x, expected: STGM_READWRITE | STGM_SHARE_EXCLUSIVE\n",
2502 ok(bindopts.dwTickCountDeadline == 0,
2503 "bindopts.dwTickCountDeadline = %08x, expected: 0\n", bindopts.dwTickCountDeadline);
2505 IBindCtx_Release(bctx);
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);
2519 "bindopts.grfMode = %08x, expected: STGM_READWRITE | STGM_SHARE_EXCLUSIVE\n",
2521 ok(bindopts.dwTickCountDeadline == 0,
2522 "bindopts.dwTickCountDeadline = %08x, expected: 0\n", bindopts.dwTickCountDeadline);
2524 IBindCtx_Release(bctx);
2527 IBindCtx_Release(bctx_arg);
2534 hres = IBindCtx_QueryInterface(bctx, &IID_IAsyncBindCtx, (
void**)&unk);
2535 ok(
hres ==
S_OK,
"QueryInterface(IID_IAsyncBindCtx) failed: %08x\n",
hres);
2537 IUnknown_Release(unk);
2539 IBindCtx_Release(bctx);
2544 hres = pCreateAsyncBindCtxEx(bctx2, 0,
NULL,
NULL, &bctx, 0);
2550 hres = IBindCtx_GetObjectParam(bctx,
testW, &unk);
2554 IBindCtx_Release(bctx);
2555 IBindCtx_Release(bctx2);
2561 BINDINFO bindinfo = {
sizeof(bindinfo)};
2565 hres = IBindStatusCallback_QueryInterface(holder, &IID_IBindStatusCallbackEx, (
void**)&bscex);
2567 win_skip(
"IBindStatusCallbackEx not supported\n");
2574 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2576 hres = IBindStatusCallback_GetBindInfo(holder, &
bindf, &bindinfo);
2582 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2584 hres = IBindStatusCallbackEx_GetBindInfoEx(bscex, &
bindf, &bindinfo, &bindf2, &
dw);
2591 bindf = bindf2 =
dw = 0xdeadbeef;
2592 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2594 hres = IBindStatusCallbackEx_GetBindInfoEx(bscex, &
bindf, &bindinfo, &bindf2, &
dw);
2598 ok(bindf2 == 0xdeadbeef,
"bindf2 = %x\n", bindf2);
2599 ok(
dw == 0xdeadbeef,
"dw = %x\n",
dw);
2601 IBindStatusCallbackEx_Release(bscex);
2612 BINDINFO bindinfo = {
sizeof(bindinfo)};
2618 hres = IBindStatusCallback_QueryInterface(holder, &IID_IServiceProvider, (
void**)&serv_prov);
2619 ok(
hres ==
S_OK,
"Could not get IServiceProvider interface: %08x\n",
hres);
2622 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2624 hres = IBindStatusCallback_GetBindInfo(holder, &
dw, &bindinfo);
2632 hres = IBindStatusCallback_OnStartBinding(holder, 0, (
void*)0xdeadbeef);
2636 hres = IBindStatusCallback_QueryInterface(holder, &IID_IHttpNegotiate, (
void**)&
http_negotiate);
2637 ok(
hres ==
S_OK,
"Could not get IHttpNegotiate interface: %08x\n",
hres);
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);
2645 ok(
http_negotiate == http_negotiate_serv,
"http_negotiate != http_negotiate_serv\n");
2647 wstr = (
void*)0xdeadbeef;
2654 ok(wstr ==
NULL,
"wstr = %p\n", wstr);
2656 IHttpNegotiate_Release(http_negotiate_serv);
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);
2664 hres = IBindStatusCallback_QueryInterface(holder, &IID_IHttpNegotiate2, (
void**)&http_negotiate2);
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);
2673 ok(http_negotiate2 == http_negotiate2_serv,
"http_negotiate != http_negotiate_serv\n");
2677 hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, (
void*)0xdeadbeef, (
void*)0xdeadbeef, 0);
2682 IHttpNegotiate2_Release(http_negotiate2_serv);
2683 IHttpNegotiate2_Release(http_negotiate2);
2685 skip(
"Could not get IHttpNegotiate2\n");
2690 hres = IBindStatusCallback_OnProgress(holder, 0, 0, BINDSTATUS_FINDINGRESOURCE,
NULL);
2696 wstr = (
void*)0xdeadbeef;
2704 hres = IBindStatusCallback_QueryInterface(holder, &IID_IAuthenticate, (
void**)&authenticate);
2705 ok(
hres ==
S_OK,
"Could not get IAuthenticate interface: %08x\n",
hres);
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);
2714 ok(authenticate == authenticate_serv,
"authenticate != authenticate_serv\n");
2715 IAuthenticate_Release(authenticate_serv);
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");
2722 IAuthenticate_Release(authenticate);
2723 IAuthenticate_Release(authenticate_serv);
2725 hres = IBindStatusCallback_QueryInterface(holder, &IID_IInternetBindInfo, (
void**)&
bind_info);
2729 hres = IInternetBindInfo_GetBindString(
bind_info, BINDSTRING_USER_AGENT, &wstr, 1, &
dw);
2736 hres = IBindStatusCallback_OnStopBinding(holder,
S_OK,
NULL);
2740 SET_EXPECT(QueryInterface_IInternetProtocol);
2742 hres = IServiceProvider_QueryService(serv_prov, &IID_IInternetProtocol, &IID_IInternetProtocol,
2748 IServiceProvider_Release(serv_prov);
2770 SET_EXPECT(QueryInterface_IBindStatusCallback);
2771 SET_EXPECT(QueryInterface_IBindStatusCallbackHolder);
2772 prevbsc = (
void*)0xdeadbeef;
2774 ok(
hres ==
S_OK,
"RegisterBindStatusCallback failed: %08x\n",
hres);
2777 CHECK_CALLED(QueryInterface_IBindStatusCallbackHolder);
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);
2792 IBindStatusCallback_Release(clb);
2795 ok(
hres ==
S_OK,
"RevokeBindStatusCallback failed: %08x\n",
hres);
2797 unk = (
void*)0xdeadbeef;
2800 ok(unk ==
NULL,
"unk != NULL\n");
2803 IUnknown_Release(unk);
2806 ok(
hres ==
S_OK,
"RevokeBindStatusCallback failed: %08x\n",
hres);
2815 prevbsc = (
void*)0xdeadbeef;
2817 ok(
hres ==
S_OK,
"RegisterBindStatusCallback failed: %08x\n",
hres);
2818 ok(!prevbsc,
"prevbsc=%p\n", prevbsc);
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);
2830 prevbsc = (
void*)0xdeadbeef;
2832 ok(
hres ==
S_OK,
"RegisterBindStatusCallback failed: %08x\n",
hres);
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");
2844 IBindStatusCallback_Release(clb);
2845 IBindStatusCallback_Release(prev_clb);
2847 IBindCtx_Release(bindctx);
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
2870 const char *url_a =
NULL;
2889 url_a =
"http://test.winehq.org/tests/post.php";
2894 url_a =
"about:blank";
2900 url_a =
"mk:@MSITStore:test.chm::/blank.html";
2903 url_a =
"its:test.chm::/blank.html";
2906 url_a = (
flags &
BINDTEST_INVALID_CN) ?
"https://4.15.184.77/favicon.ico" :
"https://test.winehq.org/tests/hello.html";
2909 url_a =
"ftp://ftp.winehq.org/welcome%2emsg";
2912 url_a =
"winetest:test";
2942 BOOL allow_finding_resource;
2961 ok(
hres ==
S_OK,
"RegisterBindStatusCallback failed: %08x\n",
hres);
2965 IBindStatusCallback_Release(previousclb);
2980 hres = IMoniker_QueryInterface(mon, &IID_IBinding, (
void**)&
bind);
2983 IBinding_Release(
bind);
2985 hres = IMoniker_GetDisplayName(mon, bctx,
NULL, &display_name);
3005 SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
3007 SET_EXPECT(QueryInterface_IInternetProtocol);
3026 SET_EXPECT(QueryInterface_IWindowForBindingUI);
3027 SET_EXPECT(QueryService_IWindowForBindingUI);
3058 SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
3073 skip(
"Network unreachable, skipping tests\n");
3083 ok(
hres == MK_S_ASYNCHRONOUS,
"IMoniker_BindToStorage failed: %08x\n",
hres);
3088 ok(unk !=
NULL,
"unk == NULL\n");
3089 }
else if(!(
bindf & BINDF_ASYNCHRONOUS) &&
tymed == TYMED_FILE) {
3091 ok(unk ==
NULL,
"unk != NULL\n");
3094 ok(
hres == MK_S_ASYNCHRONOUS,
"IMoniker_BindToStorage failed: %08x\n",
hres);
3095 ok(unk ==
NULL,
"istr should be NULL\n");
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");
3102 ok(unk ==
NULL,
"Got %p\n", unk);
3105 ok(unk !=
NULL,
"unk == NULL\n");
3107 ok(0,
"Expected security problem to be ignored.\n");
3113 ok(unk !=
NULL,
"unk == NULL\n");
3116 IUnknown_Release(unk);
3154 if(
tymed == TYMED_FILE)
3187 if(allow_finding_resource)
3236 ok(IMoniker_Release(mon) == 0,
"mon should be destroyed here\n");
3238 ok(IBindCtx_Release(bctx) == 0,
"bctx should be destroyed here\n");
3251 hres = IUnknown_QueryInterface(unk, &IID_IStream, (
void**)&
stream);
3253 IUnknown_Release(unk);
3256 readed = 0xdeadbeef;
3258 ok(readed != 0xdeadbeef,
"readed = 0xdeadbeef\n");
3263 ok(!readed,
"readed = %d\n", readed);
3297 IBindCtx_Release(bctx);
3301 hres = IMoniker_QueryInterface(mon, &IID_IBinding, (
void**)&
bind);
3304 IBinding_Release(
bind);