2 * Copyright 2005 Jacek Caban
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <wine/test.h>
26 //#include "winbase.h"
34 #define DEFINE_EXPECT(func) \
35 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
37 #define SET_EXPECT(func) \
38 expect_ ## func = TRUE
40 #define CHECK_EXPECT(func) \
42 ok(expect_ ##func, "unexpected call " #func "\n"); \
43 expect_ ## func = FALSE; \
44 called_ ## func = TRUE; \
47 #define CHECK_EXPECT2(func) \
49 ok(expect_ ##func, "unexpected call " #func "\n"); \
50 called_ ## func = TRUE; \
53 #define CHECK_CALLED(func) \
55 ok(called_ ## func, "expected " #func "\n"); \
56 expect_ ## func = called_ ## func = FALSE; \
59 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
60 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
61 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
63 DEFINE_EXPECT(GetBindInfo
);
64 DEFINE_EXPECT(ReportProgress
);
65 DEFINE_EXPECT(ReportData
);
66 DEFINE_EXPECT(ReportResult
);
68 static HRESULT expect_hrResult
;
69 static BOOL expect_hr_win32err
= FALSE
;
72 static const WCHAR about_blank_url
[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
73 static const WCHAR about_test_url
[] = {'a','b','o','u','t',':','t','e','s','t',0};
74 static const WCHAR about_res_url
[] = {'r','e','s',':','b','l','a','n','k',0};
75 static const WCHAR javascript_test_url
[] = {'j','a','v','a','s','c','r','i','p','t',':','t','e','s','t','(',')',0};
77 static WCHAR res_url_base
[INTERNET_MAX_URL_LENGTH
] = {'r','e','s',':','/','/'};
78 static unsigned res_url_base_len
;
80 static HRESULT WINAPI
ProtocolSink_QueryInterface(IInternetProtocolSink
*iface
, REFIID riid
, void **ppv
)
82 if(IsEqualGUID(&IID_IUnknown
, riid
) || IsEqualGUID(&IID_IInternetProtocolSink
, riid
)) {
88 ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid
));
92 static ULONG WINAPI
ProtocolSink_AddRef(IInternetProtocolSink
*iface
)
97 static ULONG WINAPI
ProtocolSink_Release(IInternetProtocolSink
*iface
)
102 static HRESULT WINAPI
ProtocolSink_Switch(IInternetProtocolSink
*iface
, PROTOCOLDATA
*pProtocolData
)
104 ok(0, "unexpected call\n");
108 static HRESULT WINAPI
ProtocolSink_ReportProgress(IInternetProtocolSink
*iface
, ULONG ulStatusCode
,
109 LPCWSTR szStatusText
)
111 static const WCHAR text_html
[] = {'t','e','x','t','/','h','t','m','l',0};
113 CHECK_EXPECT(ReportProgress
);
115 ok(ulStatusCode
== BINDSTATUS_MIMETYPEAVAILABLE
116 || ulStatusCode
== BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE
,
117 "ulStatusCode=%d\n", ulStatusCode
);
118 ok(!lstrcmpW(szStatusText
, text_html
), "szStatusText != text/html\n");
123 static HRESULT WINAPI
ProtocolSink_ReportData(IInternetProtocolSink
*iface
, DWORD grfBSCF
, ULONG ulProgress
,
126 CHECK_EXPECT(ReportData
);
128 ok(ulProgress
== ulProgressMax
, "ulProgress != ulProgressMax\n");
129 ok(grfBSCF
== (BSCF_FIRSTDATANOTIFICATION
| BSCF_LASTDATANOTIFICATION
| BSCF_DATAFULLYAVAILABLE
),
130 "grcf = %08x\n", grfBSCF
);
135 static HRESULT WINAPI
ProtocolSink_ReportResult(IInternetProtocolSink
*iface
, HRESULT hrResult
, DWORD dwError
,
138 CHECK_EXPECT(ReportResult
);
140 if(expect_hr_win32err
) {
141 ok((hrResult
&0xffff0000) == ((FACILITY_WIN32
<< 16)|0x80000000) || expect_hrResult
,
142 "expected win32 err or %08x got: %08x\n", expect_hrResult
, hrResult
);
144 ok(hrResult
== expect_hrResult
|| (expect_hrResult
== E_INVALIDARG
&& hrResult
== MK_E_SYNTAX
)
145 || (expect_hrResult
== HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND
) &&
146 (hrResult
== MK_E_SYNTAX
|| hrResult
== HRESULT_FROM_WIN32(ERROR_DLL_NOT_FOUND
))),
147 "expected: %08x got: %08x\n", expect_hrResult
, hrResult
);
148 expect_hrResult
= hrResult
;
150 ok(dwError
== 0, "dwError = %d\n", dwError
);
151 ok(!szResult
, "szResult != NULL\n");
156 static IInternetProtocolSinkVtbl protocol_sink_vtbl
= {
157 ProtocolSink_QueryInterface
,
159 ProtocolSink_Release
,
161 ProtocolSink_ReportProgress
,
162 ProtocolSink_ReportData
,
163 ProtocolSink_ReportResult
166 static IInternetProtocolSink protocol_sink
= {
170 static HRESULT WINAPI
BindInfo_QueryInterface(IInternetBindInfo
*iface
, REFIID riid
, void **ppv
)
172 if(IsEqualGUID(&IID_IUnknown
, riid
) || IsEqualGUID(&IID_IInternetBindInfo
, riid
)) {
178 ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid
));
179 return E_NOINTERFACE
;
182 static ULONG WINAPI
BindInfo_AddRef(IInternetBindInfo
*iface
)
187 static ULONG WINAPI
BindInfo_Release(IInternetBindInfo
*iface
)
192 static HRESULT WINAPI
BindInfo_GetBindInfo(IInternetBindInfo
*iface
, DWORD
*grfBINDF
, BINDINFO
*pbindinfo
)
194 CHECK_EXPECT(GetBindInfo
);
196 ok(grfBINDF
!= NULL
, "grfBINDF == NULL\n");
197 ok(pbindinfo
!= NULL
, "pbindinfo == NULL\n");
198 ok(pbindinfo
->cbSize
== sizeof(BINDINFO
), "wrong size of pbindinfo: %d\n", pbindinfo
->cbSize
);
204 static HRESULT WINAPI
BindInfo_GetBindString(IInternetBindInfo
*iface
, ULONG ulStringType
, LPOLESTR
*ppwzStr
,
205 ULONG cEl
, ULONG
*pcElFetched
)
207 ok(0, "unexpected call\n");
211 static IInternetBindInfoVtbl bind_info_vtbl
= {
212 BindInfo_QueryInterface
,
215 BindInfo_GetBindInfo
,
216 BindInfo_GetBindString
219 static IInternetBindInfo bind_info
= {
223 static void test_protocol_fail(IInternetProtocol
*protocol
, LPCWSTR url
, HRESULT expected_hres
,
224 BOOL expect_win32err
)
228 SET_EXPECT(GetBindInfo
);
229 SET_EXPECT(ReportResult
);
231 expect_hrResult
= expected_hres
;
232 expect_hr_win32err
= expect_win32err
;
233 hres
= IInternetProtocol_Start(protocol
, url
, &protocol_sink
, &bind_info
, 0, 0);
235 ok((hres
&0xffff0000) == ((FACILITY_WIN32
<< 16)|0x80000000) || hres
== expect_hrResult
,
236 "expected win32 err or %08x got: %08x\n", expected_hres
, hres
);
238 ok(hres
== expect_hrResult
, "expected: %08x got: %08x\n", expect_hrResult
, hres
);
240 CHECK_CALLED(GetBindInfo
);
241 CHECK_CALLED(ReportResult
);
244 static void protocol_start(IInternetProtocol
*protocol
, const WCHAR
*url
)
248 SET_EXPECT(GetBindInfo
);
249 SET_EXPECT(ReportResult
);
250 SET_EXPECT(ReportProgress
);
251 SET_EXPECT(ReportData
);
252 expect_hrResult
= S_OK
;
253 expect_hr_win32err
= FALSE
;
255 hres
= IInternetProtocol_Start(protocol
, url
, &protocol_sink
, &bind_info
, 0, 0);
256 ok(hres
== S_OK
, "Start failed: %08x\n", hres
);
258 CHECK_CALLED(GetBindInfo
);
259 CHECK_CALLED(ReportProgress
);
260 CHECK_CALLED(ReportData
);
261 CHECK_CALLED(ReportResult
);
264 static void test_res_url(const char *url_suffix
)
266 WCHAR url
[INTERNET_MAX_URL_LENGTH
];
267 IInternetProtocol
*protocol
;
272 memcpy(url
, res_url_base
, res_url_base_len
*sizeof(WCHAR
));
273 MultiByteToWideChar(CP_ACP
, 0, url_suffix
, -1, url
+res_url_base_len
, sizeof(url
)/sizeof(WCHAR
)-res_url_base_len
);
275 hres
= CoCreateInstance(&CLSID_ResProtocol
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IInternetProtocol
, (void**)&protocol
);
276 ok(hres
== S_OK
, "Could not create ResProtocol instance: %08x\n", hres
);
278 protocol_start(protocol
, url
);
280 hres
= IInternetProtocol_Read(protocol
, buf
, sizeof(buf
), &size
);
281 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
283 hres
= IInternetProtocol_Terminate(protocol
, 0);
284 ok(hres
== S_OK
, "Terminate failed: %08x\n", hres
);
287 ref
= IInternetProtocol_Release(protocol
);
288 ok(!ref
, "ref=%u\n", ref
);
291 static void res_sec_url_cmp(LPCWSTR url
, DWORD size
, LPCWSTR file
)
296 static const WCHAR fileW
[] = {'f','i','l','e',':','/','/'};
298 if(size
< sizeof(fileW
)/sizeof(WCHAR
) || memcmp(url
, fileW
, sizeof(fileW
))) {
299 ok(0, "wrong URL protocol\n");
303 SetLastError(0xdeadbeef);
304 len
= SearchPathW(NULL
, file
, NULL
, sizeof(buf
)/sizeof(WCHAR
), buf
, NULL
);
306 if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED
)
307 win_skip("SearchPathW is not implemented\n");
309 ok(0, "SearchPath failed: %u\n", GetLastError());
313 len
+= sizeof(fileW
)/sizeof(WCHAR
)+1;
314 ok(len
== size
, "wrong size %u, expected %u\n", size
, len
);
315 ok(!lstrcmpW(url
+ sizeof(fileW
)/sizeof(WCHAR
), buf
), "wrong file part %s\n", wine_dbgstr_w(url
));
318 static void test_res_protocol(void)
320 IInternetProtocolInfo
*protocol_info
;
322 IClassFactory
*factory
;
325 static const WCHAR blank_url
[] =
326 {'r','e','s',':','/','/','m','s','h','t','m','l','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0};
327 static const WCHAR test_part_url
[] = {'r','e','s',':','/','/','C','S','S','/','t','e','s','t',0};
328 static const WCHAR wrong_url1
[] =
329 {'m','s','h','t','m','l','.','d','l','l','/','b','l','a','n','k','.','m','t','h',0};
330 static const WCHAR wrong_url2
[] =
331 {'r','e','s',':','/','/','m','s','h','t','m','l','.','d','l','l',0};
332 static const WCHAR wrong_url3
[] =
333 {'r','e','s',':','/','/','m','s','h','t','m','l','.','d','l','l','/','x','x','.','h','t','m',0};
334 static const WCHAR wrong_url4
[] =
335 {'r','e','s',':','/','/','x','x','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0};
336 static const WCHAR wrong_url5
[] =
337 {'r','e','s',':','/','/','s','h','t','m','l','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0};
338 static const WCHAR wrong_url6
[] =
339 {'r','e','s',':','/','/','c',':','\\','d','i','r','\\','f','i','l','e','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0};
340 static const WCHAR mshtml_dllW
[] = {'m','s','h','t','m','l','.','d','l','l',0};
342 hres
= CoGetClassObject(&CLSID_ResProtocol
, CLSCTX_INPROC_SERVER
, NULL
, &IID_IUnknown
, (void**)&unk
);
343 ok(hres
== S_OK
, "CoGetClassObject failed: %08x\n", hres
);
347 hres
= IUnknown_QueryInterface(unk
, &IID_IInternetProtocolInfo
, (void**)&protocol_info
);
348 ok(hres
== S_OK
, "Could not get IInternetProtocolInfo interface: %08x\n", hres
);
349 if(SUCCEEDED(hres
)) {
351 DWORD size
, expected_size
;
354 for(i
= PARSE_CANONICALIZE
; i
<= PARSE_UNESCAPE
; i
++) {
355 if(i
!= PARSE_SECURITY_URL
&& i
!= PARSE_DOMAIN
) {
356 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, blank_url
, i
, 0, buf
,
357 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
358 ok(hres
== INET_E_DEFAULT_ACTION
,
359 "[%d] failed: %08x, expected INET_E_DEFAULT_ACTION\n", i
, hres
);
363 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, blank_url
, PARSE_SECURITY_URL
, 0, buf
,
364 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
365 ok(hres
== S_OK
, "ParseUrl failed: %08x\n", hres
);
366 res_sec_url_cmp(buf
, size
, mshtml_dllW
);
367 ok(size
== lstrlenW(buf
)+1, "size = %d\n", size
);
368 expected_size
= size
;
370 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, blank_url
, PARSE_SECURITY_URL
, 0, buf
,
371 expected_size
, &size
, 0);
372 ok(hres
== S_OK
, "ParseUrl failed: %08x\n", hres
);
373 res_sec_url_cmp(buf
, size
, mshtml_dllW
);
374 ok(size
== expected_size
, "size = %d\n", size
);
377 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, blank_url
, PARSE_SECURITY_URL
, 0, buf
,
379 ok(hres
== S_FALSE
, "ParseUrl failed: %08x, expected S_FALSE\n", hres
);
380 ok(size
== expected_size
, "size = %d\n", size
);
382 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, wrong_url1
, PARSE_SECURITY_URL
, 0, buf
,
383 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
384 ok(hres
== MK_E_SYNTAX
|| hres
== E_INVALIDARG
,
385 "ParseUrl failed: %08x, expected MK_E_SYNTAX\n", hres
);
387 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, wrong_url5
, PARSE_SECURITY_URL
, 0, buf
,
388 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
389 ok(hres
== MK_E_SYNTAX
, "ParseUrl failed: %08x, expected MK_E_SYNTAX\n", hres
);
391 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, wrong_url6
, PARSE_SECURITY_URL
, 0, buf
,
392 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
393 ok(hres
== MK_E_SYNTAX
, "ParseUrl failed: %08x, expected MK_E_SYNTAX\n", hres
);
397 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, blank_url
, PARSE_DOMAIN
, 0, buf
,
398 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
399 ok(hres
== S_OK
|| hres
== E_FAIL
, "ParseUrl failed: %08x\n", hres
);
400 ok(buf
[0] == '?', "buf changed\n");
401 ok(size
== sizeof(blank_url
)/sizeof(WCHAR
) ||
402 size
== sizeof(buf
)/sizeof(buf
[0]), /* IE8 */
406 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, wrong_url1
, PARSE_DOMAIN
, 0, buf
,
407 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
408 ok(hres
== S_OK
|| hres
== E_FAIL
, "ParseUrl failed: %08x\n", hres
);
409 ok(buf
[0] == '?', "buf changed\n");
410 ok(size
== sizeof(wrong_url1
)/sizeof(WCHAR
) ||
411 size
== sizeof(buf
)/sizeof(buf
[0]), /* IE8 */
416 /* Crashes on windows */
419 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, NULL
, PARSE_DOMAIN
, 0, buf
,
420 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
421 ok(hres
== E_FAIL
, "ParseUrl failed: %08x\n", hres
);
422 ok(buf
[0] == '?', "buf changed\n");
423 ok(size
== 1, "size=%u, expected 1\n", size
);
426 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, blank_url
, PARSE_DOMAIN
, 0, buf
,
427 sizeof(buf
)/sizeof(buf
[0]), NULL
, 0);
428 ok(hres
== E_POINTER
, "ParseUrl failed: %08x\n", hres
);
429 ok(buf
[0] == '?', "buf changed\n");
432 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, NULL
, PARSE_DOMAIN
, 0, buf
,
433 sizeof(buf
)/sizeof(buf
[0]), NULL
, 0);
434 ok(hres
== E_POINTER
, "ParseUrl failed: %08x\n", hres
);
435 ok(buf
[0] == '?', "buf changed\n");
439 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, blank_url
, PARSE_UNESCAPE
+1, 0, buf
,
440 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
441 ok(hres
== INET_E_DEFAULT_ACTION
,
442 "ParseUrl failed: %08x, expected INET_E_DEFAULT_ACTION\n", hres
);
443 ok(buf
[0] == '?', "buf changed\n");
446 hres
= IInternetProtocolInfo_CombineUrl(protocol_info
, blank_url
, test_part_url
,
447 0, buf
, sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
448 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
, "CombineUrl failed: %08x\n", hres
);
449 ok(size
== 0xdeadbeef, "size=%d\n", size
);
452 hres
= IInternetProtocolInfo_CombineUrl(protocol_info
, blank_url
, test_part_url
,
453 URL_FILE_USE_PATHURL
, buf
, sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
454 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
, "CombineUrl failed: %08x\n", hres
);
455 ok(size
== 0xdeadbeef, "size=%d\n", size
);
458 hres
= IInternetProtocolInfo_CombineUrl(protocol_info
, NULL
, NULL
,
459 URL_FILE_USE_PATHURL
, NULL
, 0xdeadbeef, NULL
, 0);
460 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
, "CombineUrl failed: %08x\n", hres
);
461 ok(size
== 0xdeadbeef, "size=%d\n", size
);
463 hres
= IInternetProtocolInfo_CompareUrl(protocol_info
, blank_url
, blank_url
, 0);
464 ok(hres
== E_NOTIMPL
, "CompareUrl failed: %08x\n", hres
);
466 hres
= IInternetProtocolInfo_CompareUrl(protocol_info
, NULL
, NULL
, 0xdeadbeef);
467 ok(hres
== E_NOTIMPL
, "CompareUrl failed: %08x\n", hres
);
469 for(i
=0; i
<30; i
++) {
470 if(i
== QUERY_USES_NETWORK
|| i
== QUERY_IS_SECURE
|| i
== QUERY_IS_SAFE
)
473 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, blank_url
, i
, 0,
474 buf
, sizeof(buf
), &size
, 0);
475 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
,
476 "QueryInfo(%d) returned: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", i
, hres
);
480 memset(buf
, '?', sizeof(buf
));
481 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, blank_url
, QUERY_USES_NETWORK
, 0,
482 buf
, sizeof(buf
), &size
, 0);
483 ok(hres
== S_OK
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x\n", hres
);
484 ok(size
== sizeof(DWORD
), "size=%d\n", size
);
485 ok(!*(DWORD
*)buf
, "buf=%d\n", *(DWORD
*)buf
);
487 memset(buf
, '?', sizeof(buf
));
488 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, blank_url
, QUERY_USES_NETWORK
, 0,
489 buf
, sizeof(buf
), NULL
, 0);
490 ok(hres
== S_OK
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x\n", hres
);
491 ok(!*(DWORD
*)buf
, "buf=%d\n", *(DWORD
*)buf
);
493 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, blank_url
, QUERY_USES_NETWORK
, 0,
495 ok(hres
== E_FAIL
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n", hres
);
498 memset(buf
, '?', sizeof(buf
));
499 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, NULL
, QUERY_USES_NETWORK
, 0,
500 buf
, sizeof(buf
), &size
, 0);
501 ok(hres
== S_OK
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x\n", hres
);
502 ok(size
== sizeof(DWORD
), "size=%d\n", size
);
503 ok(!*(DWORD
*)buf
, "buf=%d\n", *(DWORD
*)buf
);
505 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, blank_url
, QUERY_USES_NETWORK
, 0,
506 NULL
, sizeof(buf
), &size
, 0);
507 ok(hres
== E_FAIL
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n", hres
);
509 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, blank_url
, 60, 0,
510 NULL
, sizeof(buf
), &size
, 0);
511 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
,
512 "QueryInfo failed: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", hres
);
514 IInternetProtocolInfo_Release(protocol_info
);
517 hres
= IUnknown_QueryInterface(unk
, &IID_IClassFactory
, (void**)&factory
);
518 ok(hres
== S_OK
, "Could not get IClassFactory interface\n");
519 if(SUCCEEDED(hres
)) {
520 IInternetProtocol
*protocol
;
523 hres
= IClassFactory_CreateInstance(factory
, NULL
, &IID_IInternetProtocol
, (void**)&protocol
);
524 ok(hres
== S_OK
, "Could not get IInternetProtocol: %08x\n", hres
);
526 if(SUCCEEDED(hres
)) {
527 IInternetPriority
*priority
;
529 hres
= IInternetProtocol_QueryInterface(protocol
, &IID_IInternetPriority
, (void**)&priority
);
530 ok(hres
== E_NOINTERFACE
,
531 "QueryInterface(IInternetPriority) returned %08x, expected E_NOINTEFACE\n", hres
);
533 test_protocol_fail(protocol
, wrong_url1
, E_INVALIDARG
, FALSE
);
534 test_protocol_fail(protocol
, wrong_url2
,
535 HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND
), FALSE
);
536 test_protocol_fail(protocol
, wrong_url3
, E_FAIL
, TRUE
);
537 test_protocol_fail(protocol
, wrong_url4
, E_FAIL
, TRUE
);
540 hres
= IInternetProtocol_Read(protocol
, buf
, sizeof(buf
), &cb
);
541 ok(hres
== E_FAIL
, "Read returned %08x expected E_FAIL\n", hres
);
542 ok(cb
== 0xdeadbeef, "cb=%u expected 0xdeadbeef\n", cb
);
544 protocol_start(protocol
, blank_url
);
545 hres
= IInternetProtocol_Read(protocol
, buf
, 2, &cb
);
546 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
547 ok(cb
== 2, "cb=%u expected 2\n", cb
);
548 hres
= IInternetProtocol_Read(protocol
, buf
, sizeof(buf
), &cb
);
549 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
550 hres
= IInternetProtocol_Read(protocol
, buf
, sizeof(buf
), &cb
);
551 ok(hres
== S_FALSE
, "Read failed: %08x expected S_FALSE\n", hres
);
552 ok(cb
== 0, "cb=%u expected 0\n", cb
);
553 hres
= IInternetProtocol_UnlockRequest(protocol
);
554 ok(hres
== S_OK
, "UnlockRequest failed: %08x\n", hres
);
556 protocol_start(protocol
, blank_url
);
557 hres
= IInternetProtocol_Read(protocol
, buf
, 2, &cb
);
558 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
559 hres
= IInternetProtocol_LockRequest(protocol
, 0);
560 ok(hres
== S_OK
, "LockRequest failed: %08x\n", hres
);
561 hres
= IInternetProtocol_UnlockRequest(protocol
);
562 ok(hres
== S_OK
, "UnlockRequest failed: %08x\n", hres
);
563 hres
= IInternetProtocol_Read(protocol
, buf
, sizeof(buf
), &cb
);
564 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
566 protocol_start(protocol
, blank_url
);
567 hres
= IInternetProtocol_LockRequest(protocol
, 0);
568 ok(hres
== S_OK
, "LockRequest failed: %08x\n", hres
);
569 hres
= IInternetProtocol_Terminate(protocol
, 0);
570 ok(hres
== S_OK
, "Terminate failed: %08x\n", hres
);
571 hres
= IInternetProtocol_Read(protocol
, buf
, 2, &cb
);
572 ok(hres
== S_OK
, "Read failed: %08x\n\n", hres
);
573 hres
= IInternetProtocol_UnlockRequest(protocol
);
574 ok(hres
== S_OK
, "UnlockRequest failed: %08x\n", hres
);
575 hres
= IInternetProtocol_Read(protocol
, buf
, 2, &cb
);
576 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
577 hres
= IInternetProtocol_Terminate(protocol
, 0);
578 ok(hres
== S_OK
, "Terminate failed: %08x\n", hres
);
579 hres
= IInternetProtocol_Read(protocol
, buf
, 2, &cb
);
580 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
581 ok(cb
== 2, "cb=%u expected 2\n", cb
);
583 protocol_start(protocol
, blank_url
);
584 hres
= IInternetProtocol_LockRequest(protocol
, 0);
585 ok(hres
== S_OK
, "LockRequest failed: %08x\n", hres
);
586 hres
= IInternetProtocol_Read(protocol
, buf
, sizeof(buf
), &cb
);
587 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
588 protocol_start(protocol
, blank_url
);
589 hres
= IInternetProtocol_Read(protocol
, buf
, sizeof(buf
), &cb
);
590 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
591 hres
= IInternetProtocol_Terminate(protocol
, 0);
592 ok(hres
== S_OK
, "Terminate failed: %08x\n", hres
);
594 IInternetProtocol_Release(protocol
);
597 IClassFactory_Release(factory
);
600 IUnknown_Release(unk
);
602 test_res_url("/jstest.html");
603 test_res_url("/Test/res.html");
604 test_res_url("/test/dir/dir2/res.html");
606 if(GetProcAddress(LoadLibraryA("urlmon.dll"), "CreateUri")) {
607 test_res_url("/test/dir/dir2/res.html?query_part");
608 test_res_url("/test/dir/dir2/res.html#hash_part");
609 test_res_url("/#123");
610 test_res_url("/#23/#123");
611 test_res_url("/#123#456");
613 win_skip("IUri not supported\n");
617 static void do_test_about_protocol(IClassFactory
*factory
, DWORD bf
)
619 IInternetProtocol
*protocol
;
620 IInternetPriority
*priority
;
625 static const WCHAR blank_html
[] = {0xfeff,'<','H','T','M','L','>','<','/','H','T','M','L','>',0};
626 static const WCHAR test_html
[] =
627 {0xfeff,'<','H','T','M','L','>','t','e','s','t','<','/','H','T','M','L','>',0};
631 hres
= IClassFactory_CreateInstance(factory
, NULL
, &IID_IInternetProtocol
, (void**)&protocol
);
632 ok(hres
== S_OK
, "Could not get IInternetProtocol: %08x\n", hres
);
636 hres
= IInternetProtocol_QueryInterface(protocol
, &IID_IInternetPriority
, (void**)&priority
);
637 ok(hres
== E_NOINTERFACE
,
638 "QueryInterface(IInternetPriority) returned %08x, expected E_NOINTEFACE\n", hres
);
640 protocol_start(protocol
, about_blank_url
);
641 hres
= IInternetProtocol_LockRequest(protocol
, 0);
642 ok(hres
== S_OK
, "LockRequest failed: %08x\n", hres
);
643 hres
= IInternetProtocol_Read(protocol
, buf
, sizeof(buf
), &cb
);
644 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
645 ok(cb
== sizeof(blank_html
), "cb=%d\n", cb
);
646 ok(!memcmp(buf
, blank_html
, cb
), "Readed wrong data\n");
647 hres
= IInternetProtocol_UnlockRequest(protocol
);
648 ok(hres
== S_OK
, "UnlockRequest failed: %08x\n", hres
);
650 protocol_start(protocol
, about_test_url
);
651 hres
= IInternetProtocol_LockRequest(protocol
, 0);
652 ok(hres
== S_OK
, "LockRequest failed: %08x\n", hres
);
653 hres
= IInternetProtocol_Read(protocol
, buf
, sizeof(buf
), &cb
);
654 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
655 ok(cb
== sizeof(test_html
), "cb=%d\n", cb
);
656 ok(!memcmp(buf
, test_html
, cb
), "Readed wrong data\n");
657 hres
= IInternetProtocol_UnlockRequest(protocol
);
658 ok(hres
== S_OK
, "UnlockRequest failed: %08x\n", hres
);
660 protocol_start(protocol
, about_res_url
);
661 hres
= IInternetProtocol_LockRequest(protocol
, 0);
662 ok(hres
== S_OK
, "LockRequest failed: %08x\n", hres
);
663 hres
= IInternetProtocol_Read(protocol
, buf
, sizeof(buf
), &cb
);
664 ok(hres
== S_OK
, "Read failed: %08x\n", hres
);
665 ok(cb
== sizeof(blank_html
), "cb=%d\n", cb
);
666 ok(!memcmp(buf
, blank_html
, cb
), "Readed wrong data\n");
667 hres
= IInternetProtocol_UnlockRequest(protocol
);
668 ok(hres
== S_OK
, "UnlockRequest failed: %08x\n", hres
);
670 IInternetProtocol_Release(protocol
);
673 static void test_about_protocol(void)
675 IInternetProtocolInfo
*protocol_info
;
677 IClassFactory
*factory
;
680 hres
= CoGetClassObject(&CLSID_AboutProtocol
, CLSCTX_INPROC_SERVER
, NULL
, &IID_IUnknown
, (void**)&unk
);
681 ok(hres
== S_OK
, "CoGetClassObject failed: %08x\n", hres
);
685 hres
= IUnknown_QueryInterface(unk
, &IID_IInternetProtocolInfo
, (void**)&protocol_info
);
686 ok(hres
== S_OK
, "Could not get IInternetProtocolInfo interface: %08x\n", hres
);
687 if(SUCCEEDED(hres
)) {
692 for(i
= PARSE_CANONICALIZE
; i
<= PARSE_UNESCAPE
; i
++) {
693 if(i
!= PARSE_SECURITY_URL
&& i
!= PARSE_DOMAIN
) {
694 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, about_blank_url
, i
, 0, buf
,
695 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
696 ok(hres
== INET_E_DEFAULT_ACTION
,
697 "[%d] failed: %08x, expected INET_E_DEFAULT_ACTION\n", i
, hres
);
701 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, about_blank_url
, PARSE_SECURITY_URL
, 0, buf
,
702 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
703 ok(hres
== S_OK
, "ParseUrl failed: %08x\n", hres
);
704 ok(!lstrcmpW(about_blank_url
, buf
), "buf != blank_url\n");
707 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, about_blank_url
, PARSE_SECURITY_URL
, 0, buf
,
709 ok(hres
== S_FALSE
, "ParseUrl failed: %08x, expected S_FALSE\n", hres
);
710 ok(size
== 12, "size = %d\n", size
);
712 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, about_test_url
, PARSE_SECURITY_URL
, 0, buf
,
713 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
714 ok(hres
== S_OK
, "ParseUrl failed: %08x\n", hres
);
715 ok(!lstrcmpW(about_test_url
, buf
), "buf != test_url\n");
716 ok(size
== 11, "size = %d\n", size
);
720 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, about_blank_url
, PARSE_DOMAIN
, 0, buf
,
721 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
722 ok(hres
== S_OK
|| hres
== E_FAIL
, "ParseUrl failed: %08x\n", hres
);
723 ok(buf
[0] == '?', "buf changed\n");
724 ok(size
== sizeof(about_blank_url
)/sizeof(WCHAR
) ||
725 size
== sizeof(buf
)/sizeof(buf
[0]), /* IE8 */
730 /* Crashes on windows */
733 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, NULL
, PARSE_DOMAIN
, 0, buf
,
734 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
735 ok(hres
== E_FAIL
, "ParseUrl failed: %08x\n", hres
);
736 ok(buf
[0] == '?', "buf changed\n");
737 ok(size
== 1, "size=%u, expected 1\n", size
);
740 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, about_blank_url
, PARSE_DOMAIN
, 0, buf
,
741 sizeof(buf
)/sizeof(buf
[0]), NULL
, 0);
742 ok(hres
== E_POINTER
, "ParseUrl failed: %08x\n", hres
);
743 ok(buf
[0] == '?', "buf changed\n");
746 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, NULL
, PARSE_DOMAIN
, 0, buf
,
747 sizeof(buf
)/sizeof(buf
[0]), NULL
, 0);
748 ok(hres
== E_POINTER
, "ParseUrl failed: %08x\n", hres
);
749 ok(buf
[0] == '?', "buf changed\n");
752 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, about_blank_url
, PARSE_UNESCAPE
+1, 0, buf
,
753 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
754 ok(hres
== INET_E_DEFAULT_ACTION
,
755 "ParseUrl failed: %08x, expected INET_E_DEFAULT_ACTION\n", hres
);
758 hres
= IInternetProtocolInfo_CombineUrl(protocol_info
, about_blank_url
, about_test_url
,
759 0, buf
, sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
760 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
, "CombineUrl failed: %08x\n", hres
);
761 ok(size
== 0xdeadbeef, "size=%d\n", size
);
764 hres
= IInternetProtocolInfo_CombineUrl(protocol_info
, about_blank_url
, about_test_url
,
765 URL_FILE_USE_PATHURL
, buf
, sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
766 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
, "CombineUrl failed: %08x\n", hres
);
767 ok(size
== 0xdeadbeef, "size=%d\n", size
);
770 hres
= IInternetProtocolInfo_CombineUrl(protocol_info
, NULL
, NULL
,
771 URL_FILE_USE_PATHURL
, buf
, sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
772 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
, "CombineUrl failed: %08x\n", hres
);
773 ok(size
== 0xdeadbeef, "size=%d\n", size
);
775 hres
= IInternetProtocolInfo_CompareUrl(protocol_info
, about_blank_url
, about_blank_url
, 0);
776 ok(hres
== E_NOTIMPL
, "CompareUrl failed: %08x\n", hres
);
778 hres
= IInternetProtocolInfo_CompareUrl(protocol_info
, NULL
, NULL
, 0xdeadbeef);
779 ok(hres
== E_NOTIMPL
, "CompareUrl failed: %08x\n", hres
);
781 for(i
=0; i
<30; i
++) {
783 case QUERY_CAN_NAVIGATE
:
784 case QUERY_USES_NETWORK
:
785 case QUERY_IS_CACHED
:
786 case QUERY_IS_INSTALLEDENTRY
:
787 case QUERY_IS_CACHED_OR_MAPPED
:
788 case QUERY_IS_SECURE
:
790 case QUERY_USES_HISTORYFOLDER
:
791 case QUERY_IS_CACHED_AND_USABLE_OFFLINE
:
794 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, about_blank_url
, i
, 0,
795 buf
, sizeof(buf
), &size
, 0);
796 ok(hres
== E_FAIL
, "QueryInfo(%d) returned: %08x, expected E_FAIL\n", i
, hres
);
800 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, about_blank_url
, QUERY_CAN_NAVIGATE
, 0,
801 buf
, sizeof(buf
), &size
, 0);
802 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
||
803 hres
== E_FAIL
, /* win2k */
804 "QueryInfo returned: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER or E_FAIL\n", hres
);
807 memset(buf
, '?', sizeof(buf
));
808 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, about_blank_url
, QUERY_USES_NETWORK
, 0,
809 buf
, sizeof(buf
), &size
, 0);
810 ok(hres
== S_OK
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x\n", hres
);
811 ok(size
== sizeof(DWORD
), "size=%d\n", size
);
812 ok(!*(DWORD
*)buf
, "buf=%d\n", *(DWORD
*)buf
);
814 memset(buf
, '?', sizeof(buf
));
815 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, about_blank_url
, QUERY_USES_NETWORK
, 0,
816 buf
, sizeof(buf
), NULL
, 0);
817 ok(hres
== S_OK
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x\n", hres
);
818 ok(!*(DWORD
*)buf
, "buf=%d\n", *(DWORD
*)buf
);
820 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, about_blank_url
, QUERY_USES_NETWORK
, 0,
822 ok(hres
== E_FAIL
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n", hres
);
824 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, about_blank_url
, QUERY_USES_NETWORK
, 0,
825 NULL
, sizeof(buf
), &size
, 0);
826 ok(hres
== E_FAIL
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n", hres
);
828 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, about_blank_url
, 60, 0,
829 NULL
, sizeof(buf
), &size
, 0);
830 ok(hres
== E_FAIL
, "QueryInfo failed: %08x, expected E_FAIL\n", hres
);
832 IInternetProtocolInfo_Release(protocol_info
);
835 hres
= IUnknown_QueryInterface(unk
, &IID_IClassFactory
, (void**)&factory
);
836 ok(hres
== S_OK
, "Could not get IClassFactory interface\n");
837 if(SUCCEEDED(hres
)) {
838 do_test_about_protocol(factory
, 0);
839 do_test_about_protocol(factory
,
840 BINDF_ASYNCHRONOUS
| BINDF_ASYNCSTORAGE
| BINDF_PULLDATA
| BINDF_FROMURLMON
| BINDF_NEEDFILE
);
842 IClassFactory_Release(factory
);
845 IUnknown_Release(unk
);
848 static void test_javascript_protocol(void)
850 IInternetProtocolInfo
*protocol_info
;
852 IClassFactory
*factory
;
855 hres
= CoGetClassObject(&CLSID_JSProtocol
, CLSCTX_INPROC_SERVER
, NULL
, &IID_IUnknown
, (void**)&unk
);
856 ok(hres
== S_OK
, "CoGetClassObject failed: %08x\n", hres
);
860 hres
= IUnknown_QueryInterface(unk
, &IID_IInternetProtocolInfo
, (void**)&protocol_info
);
861 ok(hres
== S_OK
, "Could not get IInternetProtocolInfo interface: %08x\n", hres
);
862 if(SUCCEEDED(hres
)) {
867 for(i
= PARSE_CANONICALIZE
; i
<= PARSE_UNESCAPE
; i
++) {
868 if(i
!= PARSE_SECURITY_URL
&& i
!= PARSE_DOMAIN
) {
869 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, javascript_test_url
, i
, 0, buf
,
870 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
871 ok(hres
== INET_E_DEFAULT_ACTION
,
872 "[%d] failed: %08x, expected INET_E_DEFAULT_ACTION\n", i
, hres
);
876 hres
= IInternetProtocolInfo_ParseUrl(protocol_info
, javascript_test_url
, PARSE_UNESCAPE
+1, 0, buf
,
877 sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
878 ok(hres
== INET_E_DEFAULT_ACTION
,
879 "ParseUrl failed: %08x, expected INET_E_DEFAULT_ACTION\n", hres
);
882 hres
= IInternetProtocolInfo_CombineUrl(protocol_info
, javascript_test_url
, javascript_test_url
,
883 0, buf
, sizeof(buf
)/sizeof(buf
[0]), &size
, 0);
884 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
, "CombineUrl failed: %08x\n", hres
);
885 ok(size
== 0xdeadbeef, "size=%d\n", size
);
887 hres
= IInternetProtocolInfo_CompareUrl(protocol_info
, javascript_test_url
, javascript_test_url
, 0);
888 ok(hres
== E_NOTIMPL
, "CompareUrl failed: %08x\n", hres
);
890 for(i
=0; i
<30; i
++) {
892 case QUERY_USES_NETWORK
:
893 case QUERY_IS_SECURE
:
896 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, javascript_test_url
, i
, 0,
897 buf
, sizeof(buf
), &size
, 0);
898 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
,
899 "QueryInfo(%d) returned: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", i
, hres
);
904 memset(buf
, '?', sizeof(buf
));
905 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, javascript_test_url
, QUERY_USES_NETWORK
, 0,
906 buf
, sizeof(buf
), &size
, 0);
907 ok(hres
== S_OK
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x\n", hres
);
908 ok(size
== sizeof(DWORD
), "size=%d\n", size
);
909 ok(!*(DWORD
*)buf
, "buf=%d\n", *(DWORD
*)buf
);
911 memset(buf
, '?', sizeof(buf
));
912 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, javascript_test_url
, QUERY_USES_NETWORK
, 0,
913 buf
, sizeof(buf
), NULL
, 0);
914 ok(hres
== S_OK
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x\n", hres
);
915 ok(!*(DWORD
*)buf
, "buf=%d\n", *(DWORD
*)buf
);
917 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, javascript_test_url
, QUERY_USES_NETWORK
, 0,
919 ok(hres
== E_FAIL
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n", hres
);
921 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, javascript_test_url
, QUERY_USES_NETWORK
, 0,
922 NULL
, sizeof(buf
), &size
, 0);
923 ok(hres
== E_FAIL
, "QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n", hres
);
925 hres
= IInternetProtocolInfo_QueryInfo(protocol_info
, javascript_test_url
, 60, 0,
926 NULL
, sizeof(buf
), &size
, 0);
927 ok(hres
== INET_E_USE_DEFAULT_PROTOCOLHANDLER
,
928 "QueryInfo failed: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", hres
);
930 /* FIXME: test QUERY_IS_SECURE */
932 IInternetProtocolInfo_Release(protocol_info
);
935 hres
= IUnknown_QueryInterface(unk
, &IID_IClassFactory
, (void**)&factory
);
936 ok(hres
== S_OK
, "Could not get IClassFactory interface\n");
938 IClassFactory_Release(factory
);
940 IUnknown_Release(unk
);
945 res_url_base_len
= 6 + GetModuleFileNameW(NULL
, res_url_base
+ 6 /* strlen("res://") */, sizeof(res_url_base
)/sizeof(WCHAR
)-6);
950 test_about_protocol();
951 test_javascript_protocol();