310{
315
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};
332
336 return;
337
338 hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (
void**)&
protocol_info);
339 ok(
hres ==
S_OK,
"Could not get IInternetProtocolInfo interface: %08x\n",
hres);
344
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);
351 }
352 }
353
359 expected_size =
size;
360
362 expected_size, &
size, 0);
365 ok(
size == expected_size,
"size = %d\n",
size);
366
371 ok(
size == expected_size,
"size = %d\n",
size);
372
376 "ParseUrl failed: %08x, expected MK_E_SYNTAX\n",
hres);
377
381
385
391 ok(
buf[0] ==
'?',
"buf changed\n");
395
400 ok(
buf[0] ==
'?',
"buf changed\n");
404
405 if (0)
406 {
407
413 ok(
buf[0] ==
'?',
"buf changed\n");
415
420 ok(
buf[0] ==
'?',
"buf changed\n");
421
426 ok(
buf[0] ==
'?',
"buf changed\n");
427 }
428
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");
435
439 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
"CombineUrl failed: %08x\n",
hres);
441
445 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
"CombineUrl failed: %08x\n",
hres);
447
451 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
"CombineUrl failed: %08x\n",
hres);
453
456
459
460 for(
i=0;
i<30;
i++) {
461 if(
i == QUERY_USES_NETWORK ||
i == QUERY_IS_SECURE ||
i == QUERY_IS_SAFE)
462 continue;
463
466 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
467 "QueryInfo(%d) returned: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n",
i,
hres);
468 }
469
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);
477
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);
483
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);
487
492 ok(
hres ==
S_OK,
"QueryInfo(QUERY_USES_NETWORK) failed: %08x\n",
hres);
495
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);
499
502 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
503 "QueryInfo failed: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n",
hres);
504
506 }
507
509 ok(
hres ==
S_OK,
"Could not get IClassFactory interface\n");
515 ok(
hres ==
S_OK,
"Could not get IInternetProtocol: %08x\n",
hres);
516
519
522 "QueryInterface(IInternetPriority) returned %08x, expected E_NOINTEFACE\n",
hres);
523
529
533 ok(
cb == 0xdeadbeef,
"cb=%u expected 0xdeadbeef\n",
cb);
534
538 ok(
cb == 2,
"cb=%u expected 2\n",
cb);
543 ok(
cb == 0,
"cb=%u expected 0\n",
cb);
546
556
572 ok(
cb == 2,
"cb=%u expected 2\n",
cb);
573
584
585 IInternetProtocol_Release(
protocol);
586 }
587
588 IClassFactory_Release(
factory);
589 }
590
591 IUnknown_Release(unk);
592
596
603 }else {
605 }
606}
#define GetProcAddress(x, y)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
static void test_protocol_fail(IInternetProtocol *protocol, LPCWSTR url, HRESULT expected_hres)
static void res_sec_url_cmp(LPCWSTR url, DWORD size, LPCWSTR file)
static void test_res_url(const char *url_suffix)