25#define DEFINE_EXPECT(func) \
26 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
28#define SET_EXPECT(func) \
29 expect_ ## func = TRUE
31#define CHECK_EXPECT(func) \
33 ok(expect_ ##func, "unexpected call " #func "\n"); \
34 expect_ ## func = FALSE; \
35 called_ ## func = TRUE; \
38#define CHECK_EXPECT2(func) \
40 ok(expect_ ##func, "unexpected call " #func "\n"); \
41 called_ ## func = TRUE; \
44#define CHECK_CALLED(func) \
46 ok(called_ ## func, "expected " #func "\n"); \
47 expect_ ## func = called_ ## func = FALSE; \
50DEFINE_GUID(CLSID_ResProtocol, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
51DEFINE_GUID(
CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
52DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
63static const WCHAR about_blank_url[] = {
'a',
'b',
'o',
'u',
't',
':',
'b',
'l',
'a',
'n',
'k',0};
64static const WCHAR about_test_url[] = {
'a',
'b',
'o',
'u',
't',
':',
't',
'e',
's',
't',0};
66static const WCHAR javascript_test_url[] = {
'j',
'a',
'v',
'a',
's',
'c',
'r',
'i',
'p',
't',
':',
't',
'e',
's',
't',
'(',
')',0};
95 ok(0,
"unexpected call\n");
102 static const WCHAR text_html[] = {
't',
'e',
'x',
't',
'/',
'h',
't',
'm',
'l',0};
106 ok(ulStatusCode == BINDSTATUS_MIMETYPEAVAILABLE
107 || ulStatusCode == BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
108 "ulStatusCode=%d\n", ulStatusCode);
109 ok(!
lstrcmpW(szStatusText, text_html),
"szStatusText != text/html\n");
119 ok(ulProgress == ulProgressMax,
"ulProgress != ulProgressMax\n");
120 ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE),
121 "grcf = %08x\n", grfBSCF);
141 ok(dwError == 0,
"dwError = %d\n", dwError);
142 ok(!szResult,
"szResult != NULL\n");
187 ok(grfBINDF !=
NULL,
"grfBINDF == NULL\n");
188 ok(pbindinfo !=
NULL,
"pbindinfo == NULL\n");
189 ok(pbindinfo->cbSize ==
sizeof(BINDINFO),
"wrong size of pbindinfo: %d\n", pbindinfo->cbSize);
198 ok(0,
"unexpected call\n");
215 BOOL expect_win32err)
227 "expected win32 err or %08x got: %08x\n", expected_hres,
hres);
267 ok(
hres ==
S_OK,
"Could not create ResProtocol instance: %08x\n",
hres);
287 static const WCHAR fileW[] = {
'f',
'i',
'l',
'e',
':',
'/',
'/'};
290 ok(0,
"wrong URL protocol\n");
298 win_skip(
"SearchPathW is not implemented\n");
316 static const WCHAR blank_url[] =
317 {
'r',
'e',
's',
':',
'/',
'/',
'm',
's',
'h',
't',
'm',
'l',
'.',
'd',
'l',
'l',
'/',
'b',
'l',
'a',
'n',
'k',
'.',
'h',
't',
'm',0};
318 static const WCHAR test_part_url[] = {
'r',
'e',
's',
':',
'/',
'/',
'C',
'S',
'S',
'/',
't',
'e',
's',
't',0};
319 static const WCHAR wrong_url1[] =
320 {
'm',
's',
'h',
't',
'm',
'l',
'.',
'd',
'l',
'l',
'/',
'b',
'l',
'a',
'n',
'k',
'.',
'm',
't',
'h',0};
321 static const WCHAR wrong_url2[] =
322 {
'r',
'e',
's',
':',
'/',
'/',
'm',
's',
'h',
't',
'm',
'l',
'.',
'd',
'l',
'l',0};
323 static const WCHAR wrong_url3[] =
324 {
'r',
'e',
's',
':',
'/',
'/',
'm',
's',
'h',
't',
'm',
'l',
'.',
'd',
'l',
'l',
'/',
'x',
'x',
'.',
'h',
't',
'm',0};
325 static const WCHAR wrong_url4[] =
326 {
'r',
'e',
's',
':',
'/',
'/',
'x',
'x',
'.',
'd',
'l',
'l',
'/',
'b',
'l',
'a',
'n',
'k',
'.',
'h',
't',
'm',0};
327 static const WCHAR wrong_url5[] =
328 {
'r',
'e',
's',
':',
'/',
'/',
's',
'h',
't',
'm',
'l',
'.',
'd',
'l',
'l',
'/',
'b',
'l',
'a',
'n',
'k',
'.',
'h',
't',
'm',0};
329 static const WCHAR wrong_url6[] =
330 {
'r',
'e',
's',
':',
'/',
'/',
'c',
':',
'\\',
'd',
'i',
'r',
'\\',
'f',
'i',
'l',
'e',
'.',
'd',
'l',
'l',
'/',
'b',
'l',
'a',
'n',
'k',
'.',
'h',
't',
'm',0};
331 static const WCHAR mshtml_dllW[] = {
'm',
's',
'h',
't',
'm',
'l',
'.',
'd',
'l',
'l',0};
338 hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (
void**)&
protocol_info);
339 ok(
hres ==
S_OK,
"Could not get IInternetProtocolInfo interface: %08x\n",
hres);
345 for(
i = PARSE_CANONICALIZE;
i <= PARSE_UNESCAPE;
i++) {
346 if(
i != PARSE_SECURITY_URL &&
i != PARSE_DOMAIN) {
349 ok(
hres == INET_E_DEFAULT_ACTION,
350 "[%d] failed: %08x, expected INET_E_DEFAULT_ACTION\n",
i,
hres);
359 expected_size =
size;
362 expected_size, &
size, 0);
365 ok(
size == expected_size,
"size = %d\n",
size);
371 ok(
size == expected_size,
"size = %d\n",
size);
376 "ParseUrl failed: %08x, expected MK_E_SYNTAX\n",
hres);
391 ok(
buf[0] ==
'?',
"buf changed\n");
400 ok(
buf[0] ==
'?',
"buf changed\n");
413 ok(
buf[0] ==
'?',
"buf changed\n");
420 ok(
buf[0] ==
'?',
"buf changed\n");
426 ok(
buf[0] ==
'?',
"buf changed\n");
432 ok(
hres == INET_E_DEFAULT_ACTION,
433 "ParseUrl failed: %08x, expected INET_E_DEFAULT_ACTION\n",
hres);
434 ok(
buf[0] ==
'?',
"buf changed\n");
439 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
"CombineUrl failed: %08x\n",
hres);
445 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
"CombineUrl failed: %08x\n",
hres);
451 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
"CombineUrl failed: %08x\n",
hres);
460 for(
i=0;
i<30;
i++) {
461 if(
i == QUERY_USES_NETWORK ||
i == QUERY_IS_SECURE ||
i == QUERY_IS_SAFE)
466 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
467 "QueryInfo(%d) returned: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n",
i,
hres);
472 hres = IInternetProtocolInfo_QueryInfo(
protocol_info, blank_url, QUERY_USES_NETWORK, 0,
474 ok(
hres ==
S_OK,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x\n",
hres);
479 hres = IInternetProtocolInfo_QueryInfo(
protocol_info, blank_url, QUERY_USES_NETWORK, 0,
481 ok(
hres ==
S_OK,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x\n",
hres);
484 hres = IInternetProtocolInfo_QueryInfo(
protocol_info, blank_url, QUERY_USES_NETWORK, 0,
486 ok(
hres ==
E_FAIL,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n",
hres);
492 ok(
hres ==
S_OK,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x\n",
hres);
496 hres = IInternetProtocolInfo_QueryInfo(
protocol_info, blank_url, QUERY_USES_NETWORK, 0,
498 ok(
hres ==
E_FAIL,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n",
hres);
502 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
503 "QueryInfo failed: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n",
hres);
509 ok(
hres ==
S_OK,
"Could not get IClassFactory interface\n");
515 ok(
hres ==
S_OK,
"Could not get IInternetProtocol: %08x\n",
hres);
522 "QueryInterface(IInternetPriority) returned %08x, expected E_NOINTEFACE\n",
hres);
533 ok(
cb == 0xdeadbeef,
"cb=%u expected 0xdeadbeef\n",
cb);
538 ok(
cb == 2,
"cb=%u expected 2\n",
cb);
543 ok(
cb == 0,
"cb=%u expected 0\n",
cb);
572 ok(
cb == 2,
"cb=%u expected 2\n",
cb);
585 IInternetProtocol_Release(
protocol);
588 IClassFactory_Release(
factory);
591 IUnknown_Release(unk);
616 static const WCHAR blank_html[] = {0xfeff,
'<',
'H',
'T',
'M',
'L',
'>',
'<',
'/',
'H',
'T',
'M',
'L',
'>',0};
617 static const WCHAR test_html[] =
618 {0xfeff,
'<',
'H',
'T',
'M',
'L',
'>',
't',
'e',
's',
't',
'<',
'/',
'H',
'T',
'M',
'L',
'>',0};
623 ok(
hres ==
S_OK,
"Could not get IInternetProtocol: %08x\n",
hres);
629 "QueryInterface(IInternetPriority) returned %08x, expected E_NOINTEFACE\n",
hres);
636 ok(
cb ==
sizeof(blank_html),
"cb=%d\n",
cb);
646 ok(
cb ==
sizeof(test_html),
"cb=%d\n",
cb);
656 ok(
cb ==
sizeof(blank_html),
"cb=%d\n",
cb);
661 IInternetProtocol_Release(
protocol);
676 hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (
void**)&
protocol_info);
677 ok(
hres ==
S_OK,
"Could not get IInternetProtocolInfo interface: %08x\n",
hres);
683 for(
i = PARSE_CANONICALIZE;
i <= PARSE_UNESCAPE;
i++) {
684 if(
i != PARSE_SECURITY_URL &&
i != PARSE_DOMAIN) {
687 ok(
hres == INET_E_DEFAULT_ACTION,
688 "[%d] failed: %08x, expected INET_E_DEFAULT_ACTION\n",
i,
hres);
714 ok(
buf[0] ==
'?',
"buf changed\n");
727 ok(
buf[0] ==
'?',
"buf changed\n");
734 ok(
buf[0] ==
'?',
"buf changed\n");
740 ok(
buf[0] ==
'?',
"buf changed\n");
745 ok(
hres == INET_E_DEFAULT_ACTION,
746 "ParseUrl failed: %08x, expected INET_E_DEFAULT_ACTION\n",
hres);
751 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
"CombineUrl failed: %08x\n",
hres);
757 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
"CombineUrl failed: %08x\n",
hres);
763 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
"CombineUrl failed: %08x\n",
hres);
772 for(
i=0;
i<30;
i++) {
774 case QUERY_CAN_NAVIGATE:
775 case QUERY_USES_NETWORK:
776 case QUERY_IS_CACHED:
777 case QUERY_IS_INSTALLEDENTRY:
778 case QUERY_IS_CACHED_OR_MAPPED:
779 case QUERY_IS_SECURE:
781 case QUERY_USES_HISTORYFOLDER:
782 case QUERY_IS_CACHED_AND_USABLE_OFFLINE:
793 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER ||
795 "QueryInfo returned: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER or E_FAIL\n",
hres);
801 ok(
hres ==
S_OK,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x\n",
hres);
808 ok(
hres ==
S_OK,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x\n",
hres);
813 ok(
hres ==
E_FAIL,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n",
hres);
817 ok(
hres ==
E_FAIL,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n",
hres);
827 ok(
hres ==
S_OK,
"Could not get IClassFactory interface\n");
831 BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA | BINDF_FROMURLMON | BINDF_NEEDFILE);
833 IClassFactory_Release(
factory);
836 IUnknown_Release(unk);
851 hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (
void**)&
protocol_info);
852 ok(
hres ==
S_OK,
"Could not get IInternetProtocolInfo interface: %08x\n",
hres);
858 for(
i = PARSE_CANONICALIZE;
i <= PARSE_UNESCAPE;
i++) {
859 if(
i != PARSE_SECURITY_URL &&
i != PARSE_DOMAIN) {
862 ok(
hres == INET_E_DEFAULT_ACTION,
863 "[%d] failed: %08x, expected INET_E_DEFAULT_ACTION\n",
i,
hres);
869 ok(
hres == INET_E_DEFAULT_ACTION,
870 "ParseUrl failed: %08x, expected INET_E_DEFAULT_ACTION\n",
hres);
875 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
"CombineUrl failed: %08x\n",
hres);
881 for(
i=0;
i<30;
i++) {
883 case QUERY_USES_NETWORK:
884 case QUERY_IS_SECURE:
889 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
890 "QueryInfo(%d) returned: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n",
i,
hres);
898 ok(
hres ==
S_OK,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x\n",
hres);
905 ok(
hres ==
S_OK,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x\n",
hres);
910 ok(
hres ==
E_FAIL,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n",
hres);
914 ok(
hres ==
E_FAIL,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n",
hres);
918 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
919 "QueryInfo failed: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n",
hres);
927 ok(
hres ==
S_OK,
"Could not get IClassFactory interface\n");
929 IClassFactory_Release(
factory);
931 IUnknown_Release(unk);
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
const GUID IID_IClassFactory
#define ERROR_CALL_NOT_IMPLEMENTED
#define GetProcAddress(x, y)
#define MultiByteToWideChar
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI DECLSPEC_HOTPATCH CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv)
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
static const WCHAR fileW[]
#define INTERNET_MAX_URL_LENGTH
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
static IInternetProtocolSink protocol_sink
static IInternetBindInfo bind_info
static HRESULT WINAPI ProtocolSink_ReportProgress(IInternetProtocolSink *iface, ULONG ulStatusCode, LPCWSTR szStatusText)
static HRESULT WINAPI ProtocolSink_Switch(IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData)
static ULONG WINAPI BindInfo_Release(IInternetBindInfo *iface)
static IInternetBindInfoVtbl bind_info_vtbl
static IInternetProtocolSinkVtbl protocol_sink_vtbl
#define CHECK_EXPECT(func)
static ULONG WINAPI ProtocolSink_Release(IInternetProtocolSink *iface)
#define DEFINE_EXPECT(func)
static HRESULT WINAPI BindInfo_QueryInterface(IInternetBindInfo *iface, REFIID riid, void **ppv)
static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
static HRESULT WINAPI ProtocolSink_QueryInterface(IInternetProtocolSink *iface, REFIID riid, void **ppv)
#define protocol_start(p, u, e)
static HRESULT expect_hrResult
static void test_protocol_fail(IInternetProtocol *protocol, LPCWSTR url, HRESULT expected_hres)
#define CHECK_CALLED(func)
static HRESULT WINAPI ProtocolSink_ReportResult(IInternetProtocolSink *iface, HRESULT hrResult, DWORD dwError, LPCWSTR szResult)
static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWORD grfBSCF, ULONG ulProgress, ULONG ulProgressMax)
static HRESULT WINAPI BindInfo_GetBindString(IInternetBindInfo *iface, ULONG ulStringType, LPOLESTR *ppwzStr, ULONG cEl, ULONG *pcElFetched)
static ULONG WINAPI BindInfo_AddRef(IInternetBindInfo *iface)
static ULONG WINAPI ProtocolSink_AddRef(IInternetProtocolSink *iface)
static HMODULE MODULEINFO DWORD cb
static WCHAR res_url_base[INTERNET_MAX_URL_LENGTH]
static BOOL expect_hr_win32err
static void test_javascript_protocol(void)
static const WCHAR about_blank_url[]
static void do_test_about_protocol(IClassFactory *factory, DWORD bf)
static const WCHAR about_test_url[]
static void res_sec_url_cmp(LPCWSTR url, DWORD size, LPCWSTR file)
static void test_res_protocol(void)
static const WCHAR javascript_test_url[]
static void test_about_protocol(void)
static const WCHAR about_res_url[]
static unsigned res_url_base_len
static void test_res_url(const char *url_suffix)
static IInternetProtocolInfo protocol_info
CLSID CLSID_AboutProtocol
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
#define URL_FILE_USE_PATHURL
DWORD WINAPI GetLastError(void)
#define ERROR_DLL_NOT_FOUND
#define ERROR_RESOURCE_TYPE_NOT_FOUND
#define HRESULT_FROM_WIN32(x)