583{
584 BINDINFO bindinfo;
585 DWORD bind_info, bscf = BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION;
587
588 static const STGMEDIUM stgmed_zero = {0};
590
592
594
598 ok(pOIProtSink !=
NULL,
"pOIProtSink == NULL\n");
599 ok(pOIBindInfo !=
NULL,
"pOIBindInfo == NULL\n");
600 ok(grfPI == 0,
"grfPI=%d, expected 0\n", grfPI);
602
610
612 }
613
614 memset(&bindinfo, 0,
sizeof(bindinfo));
615 bindinfo.cbSize = 0;
616 hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &
bind_info, &bindinfo);
618
619 memset(&bindinfo, 0,
sizeof(bindinfo));
620 bindinfo.cbSize = sizeof(bindinfo);
621 hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &
bind_info, &bindinfo);
623
624 ok(
bind_info & BINDF_FROMURLMON,
"BINDF_FROMURLMON is not set\n");
625
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");
631
632 bind_info &= ~(BINDF_NEEDFILE|BINDF_FROMURLMON);
635 else
636 ok(
bind_info == (
bindf & ~(BINDF_NEEDFILE|BINDF_FROMURLMON)),
"bind_info = %x, expected %x\n",
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");
651 ok(!bindinfo.pUnk,
"bindinfo.pUnk = %p\n", bindinfo.pUnk);
652 ok(!bindinfo.dwReserved,
"bindinfo.dwReserved = %d\n", bindinfo.dwReserved);
653
656
659 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
660 BINDSTATUS_DIRECTBIND,
NULL);
662 "ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n",
hres);
663
668 else
670 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
671 BINDSTATUS_SENDINGREQUEST,
emptyW);
673 "ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n",
hres);
676 else
679 IInternetProtocolSink_AddRef(pOIProtSink);
681 default:
682 break;
683 }
684
695
696 static const WCHAR wszMimes[] = {
'*',
'/',
'*',0};
697
699 hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_USER_AGENT,
700 &ua, 1, &fetched);
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);
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");
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,
729
735
739 }
741 NULL, 0, &additional_headers);
745 }
748 ok(additional_headers ==
NULL,
"additional_headers=%p\n", additional_headers);
749
752 &IID_IHttpNegotiate2, (void**)&http_negotiate2);
755
760 }
761 hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, sec_id, &
size, 0);
765 }
766 IHttpNegotiate2_Release(http_negotiate2);
767 ok(
hres ==
E_FAIL,
"GetRootSecurityId failed: %08x, expected E_FAIL\n",
hres);
769
773 }
780 }
781
783
784 IInternetProtocolSink_AddRef(pOIProtSink);
786
789
791 data.grfFlags = PI_FORCE_ASYNC;
793 hres = IInternetProtocolSink_Switch(pOIProtSink, &
data);
798 } else {
801 }
802 }
803
805 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
806 BINDSTATUS_CACHEFILENAMEAVAILABLE,
file_url+7);
808 "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n",
hres);
809
812 else
814 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
815 BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
wszTextHtml);
817 "ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE) failed: %08x\n",
hres);
820 else
824 hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
wszTextHtml);
826 "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n",
hres);
828 }else {
829 hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE,
wszTextHtml);
831 "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n",
hres);
832 }
833
835 bscf |= BSCF_DATAFULLYAVAILABLE;
837 bscf = BSCF_FIRSTDATANOTIFICATION|BSCF_DATAFULLYAVAILABLE;
838
845 SET_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
848 SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
856 }else {
861 SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
868 }
869
870 hres = IInternetProtocolSink_ReportData(pOIProtSink, bscf, 13, 13);
872
890 }else {
901 }
902
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);
913 }
914
917 hres = IInternetProtocolSink_ReportResult(pOIProtSink,
S_OK, 0,
NULL);
920 }
921
923}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
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)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
static IInternetBindInfo bind_info
static IHttpSecurity http_security
static HANDLE complete_event2
static BOOL only_check_prot_args
static DWORD WINAPI thread_proc(PVOID arg)
static const WCHAR emptyW[]