4 * Copyright 2010 Thomas Mullaly
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <wine/test.h>
27 #define WIN32_LEAN_AND_MEAN
37 DEFINE_GUID(CLSID_CUri
, 0xDF2FCE13, 0x25EC, 0x45BB, 0x9D,0x4C, 0xCE,0xCD,0x47,0xC2,0x43,0x0C);
39 #define URI_STR_PROPERTY_COUNT Uri_PROPERTY_STRING_LAST+1
40 #define URI_DWORD_PROPERTY_COUNT (Uri_PROPERTY_DWORD_LAST - Uri_PROPERTY_DWORD_START)+1
41 #define URI_BUILDER_STR_PROPERTY_COUNT 7
43 #define DEFINE_EXPECT(func) \
44 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
46 #define SET_EXPECT(func) \
47 expect_ ## func = TRUE
49 #define CHECK_EXPECT(func) \
51 ok(expect_ ##func, "unexpected call " #func "\n"); \
52 expect_ ## func = FALSE; \
53 called_ ## func = TRUE; \
56 #define CHECK_EXPECT2(func) \
58 ok(expect_ ##func, "unexpected call " #func "\n"); \
59 called_ ## func = TRUE; \
62 #define CHECK_CALLED(func) \
64 ok(called_ ## func, "expected " #func "\n"); \
65 expect_ ## func = called_ ## func = FALSE; \
68 DEFINE_EXPECT(CombineUrl
);
69 DEFINE_EXPECT(ParseUrl
);
71 static HRESULT (WINAPI
*pCreateUri
)(LPCWSTR
, DWORD
, DWORD_PTR
, IUri
**);
72 static HRESULT (WINAPI
*pCreateUriWithFragment
)(LPCWSTR
, LPCWSTR
, DWORD
, DWORD_PTR
, IUri
**);
73 static HRESULT (WINAPI
*pCreateIUriBuilder
)(IUri
*, DWORD
, DWORD_PTR
, IUriBuilder
**);
74 static HRESULT (WINAPI
*pCoInternetCombineIUri
)(IUri
*,IUri
*,DWORD
,IUri
**,DWORD_PTR
);
75 static HRESULT (WINAPI
*pCoInternetGetSession
)(DWORD
,IInternetSession
**,DWORD
);
76 static HRESULT (WINAPI
*pCoInternetCombineUrlEx
)(IUri
*,LPCWSTR
,DWORD
,IUri
**,DWORD_PTR
);
77 static HRESULT (WINAPI
*pCoInternetParseIUri
)(IUri
*,PARSEACTION
,DWORD
,LPWSTR
,DWORD
,DWORD
*,DWORD_PTR
);
78 static HRESULT (WINAPI
*pCreateURLMonikerEx
)(IMoniker
*,LPCWSTR
,IMoniker
**,DWORD
);
79 static HRESULT (WINAPI
*pCreateURLMonikerEx2
)(IMoniker
*,IUri
*,IMoniker
**,DWORD
);
81 static const WCHAR http_urlW
[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
82 '.','o','r','g','/',0};
83 static const WCHAR http_url_fragW
[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
84 '.','o','r','g','/','#','F','r','a','g',0};
86 static const WCHAR combine_baseW
[] = {'w','i','n','e','t','e','s','t',':','?','t',
87 'e','s','t','i','n','g',0};
88 static const WCHAR combine_relativeW
[] = {'?','t','e','s','t',0};
89 static const WCHAR combine_resultW
[] = {'z','i','p',':','t','e','s','t',0};
91 static const WCHAR winetestW
[] = {'w','i','n','e','t','e','s','t',0};
93 static const WCHAR parse_urlW
[] = {'w','i','n','e','t','e','s','t',':','t','e','s','t',0};
94 static const WCHAR parse_resultW
[] = {'z','i','p',':','t','e','s','t',0};
96 static PARSEACTION parse_action
;
97 static DWORD parse_flags
;
99 typedef struct _uri_create_flag_test
{
102 } uri_create_flag_test
;
104 static const uri_create_flag_test invalid_flag_tests
[] = {
105 /* Set of invalid flag combinations to test for. */
106 {Uri_CREATE_DECODE_EXTRA_INFO
| Uri_CREATE_NO_DECODE_EXTRA_INFO
, E_INVALIDARG
},
107 {Uri_CREATE_CANONICALIZE
| Uri_CREATE_NO_CANONICALIZE
, E_INVALIDARG
},
108 {Uri_CREATE_CRACK_UNKNOWN_SCHEMES
| Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
, E_INVALIDARG
},
109 {Uri_CREATE_PRE_PROCESS_HTML_URI
| Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, E_INVALIDARG
},
110 {Uri_CREATE_IE_SETTINGS
| Uri_CREATE_NO_IE_SETTINGS
, E_INVALIDARG
}
113 typedef struct _uri_str_property
{
117 const char* broken_value
;
122 typedef struct _uri_dword_property
{
126 BOOL broken_combine_hres
;
127 } uri_dword_property
;
129 typedef struct _uri_properties
{
132 HRESULT create_expected
;
135 uri_str_property str_props
[URI_STR_PROPERTY_COUNT
];
136 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
139 static const uri_properties uri_tests
[] = {
140 { "http://www.winehq.org/tests/../tests/../..", 0, S_OK
, FALSE
,
142 {"http://www.winehq.org/",S_OK
,FALSE
}, /* ABSOLUTE_URI */
143 {"www.winehq.org",S_OK
,FALSE
}, /* AUTHORITY */
144 {"http://www.winehq.org/",S_OK
,FALSE
}, /* DISPLAY_URI */
145 {"winehq.org",S_OK
,FALSE
}, /* DOMAIN */
146 {"",S_FALSE
,FALSE
}, /* EXTENSION */
147 {"",S_FALSE
,FALSE
}, /* FRAGMENT */
148 {"www.winehq.org",S_OK
,FALSE
}, /* HOST */
149 {"",S_FALSE
,FALSE
}, /* PASSWORD */
150 {"/",S_OK
,FALSE
}, /* PATH */
151 {"/",S_OK
,FALSE
}, /* PATH_AND_QUERY */
152 {"",S_FALSE
,FALSE
}, /* QUERY */
153 {"http://www.winehq.org/tests/../tests/../..",S_OK
,FALSE
}, /* RAW_URI */
154 {"http",S_OK
,FALSE
}, /* SCHEME_NAME */
155 {"",S_FALSE
,FALSE
}, /* USER_INFO */
156 {"",S_FALSE
,FALSE
} /* USER_NAME */
159 {Uri_HOST_DNS
,S_OK
,FALSE
}, /* HOST_TYPE */
160 {80,S_OK
,FALSE
}, /* PORT */
161 {URL_SCHEME_HTTP
,S_OK
,FALSE
}, /* SCHEME */
162 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
} /* ZONE */
165 { "http://winehq.org/tests/.././tests", 0, S_OK
, FALSE
,
167 {"http://winehq.org/tests",S_OK
,FALSE
},
168 {"winehq.org",S_OK
,FALSE
},
169 {"http://winehq.org/tests",S_OK
,FALSE
},
170 {"winehq.org",S_OK
,FALSE
},
173 {"winehq.org",S_OK
,FALSE
},
175 {"/tests",S_OK
,FALSE
},
176 {"/tests",S_OK
,FALSE
},
178 {"http://winehq.org/tests/.././tests",S_OK
,FALSE
},
184 {Uri_HOST_DNS
,S_OK
,FALSE
},
186 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
187 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
190 { "HtTp://www.winehq.org/tests/..?query=x&return=y", 0, S_OK
, FALSE
,
192 {"http://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
193 {"www.winehq.org",S_OK
,FALSE
},
194 {"http://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
195 {"winehq.org",S_OK
,FALSE
},
198 {"www.winehq.org",S_OK
,FALSE
},
201 {"/?query=x&return=y",S_OK
,FALSE
},
202 {"?query=x&return=y",S_OK
,FALSE
},
203 {"HtTp://www.winehq.org/tests/..?query=x&return=y",S_OK
,FALSE
},
209 {Uri_HOST_DNS
,S_OK
,FALSE
},
211 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
212 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
215 { "HtTpS://www.winehq.org/tests/..?query=x&return=y", 0, S_OK
, FALSE
,
217 {"https://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
218 {"www.winehq.org",S_OK
,FALSE
},
219 {"https://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
220 {"winehq.org",S_OK
,FALSE
},
223 {"www.winehq.org",S_OK
,FALSE
},
226 {"/?query=x&return=y",S_OK
,FALSE
},
227 {"?query=x&return=y",S_OK
,FALSE
},
228 {"HtTpS://www.winehq.org/tests/..?query=x&return=y",S_OK
,FALSE
},
229 {"https",S_OK
,FALSE
},
234 {Uri_HOST_DNS
,S_OK
,FALSE
},
236 {URL_SCHEME_HTTPS
,S_OK
,FALSE
},
237 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
240 { "hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters", 0, S_OK
, FALSE
,
242 {"http://usEr%3Ainfo@example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
243 {"usEr%3Ainfo@example.com",S_OK
,FALSE
},
244 {"http://example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
245 {"example.com",S_OK
,FALSE
},
248 {"example.com",S_OK
,FALSE
},
250 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
251 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
253 {"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters",S_OK
,FALSE
},
255 {"usEr%3Ainfo",S_OK
,FALSE
},
256 {"usEr%3Ainfo",S_OK
,FALSE
}
259 {Uri_HOST_DNS
,S_OK
,FALSE
},
261 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
262 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
265 { "ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt", 0, S_OK
, FALSE
,
267 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK
,FALSE
},
268 {"winepass:wine@ftp.winehq.org:9999",S_OK
,FALSE
},
269 {"ftp://ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK
,FALSE
},
270 {"winehq.org",S_OK
,FALSE
},
273 {"ftp.winehq.org",S_OK
,FALSE
},
275 {"/dir/foo%20bar.txt",S_OK
,FALSE
},
276 {"/dir/foo%20bar.txt",S_OK
,FALSE
},
278 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt",S_OK
,FALSE
},
280 {"winepass:wine",S_OK
,FALSE
},
281 {"winepass",S_OK
,FALSE
}
284 {Uri_HOST_DNS
,S_OK
,FALSE
},
286 {URL_SCHEME_FTP
,S_OK
,FALSE
},
287 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
290 { "file://c:\\tests\\../tests/foo%20bar.mp3", 0, S_OK
, FALSE
,
292 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
294 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
300 {"/c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
301 {"/c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
303 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK
,FALSE
},
309 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
311 {URL_SCHEME_FILE
,S_OK
,FALSE
},
312 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
315 { "file://c:\\tests\\../tests/foo%20bar.mp3", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
317 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
319 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
325 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
326 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
328 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK
,FALSE
},
334 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
336 {URL_SCHEME_FILE
,S_OK
,FALSE
},
337 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
340 { "FILE://localhost/test dir\\../tests/test%20file.README.txt", 0, S_OK
, FALSE
,
342 {"file:///tests/test%20file.README.txt",S_OK
,FALSE
},
344 {"file:///tests/test%20file.README.txt",S_OK
,FALSE
},
350 {"/tests/test%20file.README.txt",S_OK
,FALSE
},
351 {"/tests/test%20file.README.txt",S_OK
,FALSE
},
353 {"FILE://localhost/test dir\\../tests/test%20file.README.txt",S_OK
,FALSE
},
359 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
361 {URL_SCHEME_FILE
,S_OK
,FALSE
},
362 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
365 { "file:///z:/test dir/README.txt", 0, S_OK
, FALSE
,
367 {"file:///z:/test%20dir/README.txt",S_OK
},
369 {"file:///z:/test%20dir/README.txt",S_OK
},
375 {"/z:/test%20dir/README.txt",S_OK
},
376 {"/z:/test%20dir/README.txt",S_OK
},
378 {"file:///z:/test dir/README.txt",S_OK
},
384 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
386 {URL_SCHEME_FILE
,S_OK
,FALSE
},
387 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
390 { "file:///z:/test dir/README.txt#hash part", 0, S_OK
, FALSE
,
392 {"file:///z:/test%20dir/README.txt#hash%20part",S_OK
},
394 {"file:///z:/test%20dir/README.txt#hash%20part",S_OK
},
396 {".txt#hash%20part",S_OK
},
400 {"/z:/test%20dir/README.txt#hash%20part",S_OK
},
401 {"/z:/test%20dir/README.txt#hash%20part",S_OK
},
403 {"file:///z:/test dir/README.txt#hash part",S_OK
},
409 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
411 {URL_SCHEME_FILE
,S_OK
,FALSE
},
412 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
415 { "urn:nothing:should:happen here", 0, S_OK
, FALSE
,
417 {"urn:nothing:should:happen here",S_OK
,FALSE
},
419 {"urn:nothing:should:happen here",S_OK
,FALSE
},
425 {"nothing:should:happen here",S_OK
,FALSE
},
426 {"nothing:should:happen here",S_OK
,FALSE
},
428 {"urn:nothing:should:happen here",S_OK
,FALSE
},
434 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
436 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
437 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
440 { "http://127.0.0.1/tests/../test dir/./test.txt", 0, S_OK
, FALSE
,
442 {"http://127.0.0.1/test%20dir/test.txt",S_OK
,FALSE
},
443 {"127.0.0.1",S_OK
,FALSE
},
444 {"http://127.0.0.1/test%20dir/test.txt",S_OK
,FALSE
},
448 {"127.0.0.1",S_OK
,FALSE
},
450 {"/test%20dir/test.txt",S_OK
,FALSE
},
451 {"/test%20dir/test.txt",S_OK
,FALSE
},
453 {"http://127.0.0.1/tests/../test dir/./test.txt",S_OK
,FALSE
},
459 {Uri_HOST_IPV4
,S_OK
,FALSE
},
461 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
462 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
465 { "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", 0, S_OK
, FALSE
,
467 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK
,FALSE
},
468 {"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]",S_OK
,FALSE
},
469 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK
,FALSE
},
473 {"fedc:ba98:7654:3210:fedc:ba98:7654:3210",S_OK
,FALSE
},
478 {"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]",S_OK
,FALSE
},
484 {Uri_HOST_IPV6
,S_OK
,FALSE
},
486 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
487 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
490 { "ftp://[::13.1.68.3]", 0, S_OK
, FALSE
,
492 {"ftp://[::13.1.68.3]/",S_OK
,FALSE
},
493 {"[::13.1.68.3]",S_OK
,FALSE
},
494 {"ftp://[::13.1.68.3]/",S_OK
,FALSE
},
498 {"::13.1.68.3",S_OK
,FALSE
},
503 {"ftp://[::13.1.68.3]",S_OK
,FALSE
},
509 {Uri_HOST_IPV6
,S_OK
,FALSE
},
511 {URL_SCHEME_FTP
,S_OK
,FALSE
},
512 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
515 { "http://[FEDC:BA98:0:0:0:0:0:3210]", 0, S_OK
, FALSE
,
517 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
518 {"[fedc:ba98::3210]",S_OK
,FALSE
},
519 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
523 {"fedc:ba98::3210",S_OK
,FALSE
},
528 {"http://[FEDC:BA98:0:0:0:0:0:3210]",S_OK
,FALSE
},
534 {Uri_HOST_IPV6
,S_OK
,FALSE
},
536 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
537 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
540 { "1234://www.winehq.org", 0, S_OK
, FALSE
,
542 {"1234://www.winehq.org/",S_OK
,FALSE
},
543 {"www.winehq.org",S_OK
,FALSE
},
544 {"1234://www.winehq.org/",S_OK
,FALSE
},
545 {"winehq.org",S_OK
,FALSE
},
548 {"www.winehq.org",S_OK
,FALSE
},
553 {"1234://www.winehq.org",S_OK
,FALSE
},
559 {Uri_HOST_DNS
,S_OK
,FALSE
},
561 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
562 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
565 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
566 { "C:/test/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
568 {"file:///C:/test/test.mp3",S_OK
,FALSE
},
570 {"file:///C:/test/test.mp3",S_OK
,FALSE
},
576 {"/C:/test/test.mp3",S_OK
,FALSE
},
577 {"/C:/test/test.mp3",S_OK
,FALSE
},
579 {"C:/test/test.mp3",S_OK
,FALSE
},
585 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
587 {URL_SCHEME_FILE
,S_OK
,FALSE
},
588 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
591 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
592 { "\\\\Server/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
594 {"file://server/test.mp3",S_OK
,FALSE
},
595 {"server",S_OK
,FALSE
},
596 {"file://server/test.mp3",S_OK
,FALSE
},
600 {"server",S_OK
,FALSE
},
602 {"/test.mp3",S_OK
,FALSE
},
603 {"/test.mp3",S_OK
,FALSE
},
605 {"\\\\Server/test.mp3",S_OK
,FALSE
},
611 {Uri_HOST_DNS
,S_OK
,FALSE
},
613 {URL_SCHEME_FILE
,S_OK
,FALSE
},
614 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
617 { "C:/test/test.mp3#fragment|part", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
|Uri_CREATE_FILE_USE_DOS_PATH
|Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
619 {"file://C:\\test\\test.mp3#fragment|part",S_OK
,FALSE
},
621 {"file://C:\\test\\test.mp3#fragment|part",S_OK
,FALSE
},
623 {".mp3#fragment|part",S_OK
,FALSE
},
627 {"C:\\test\\test.mp3#fragment|part",S_OK
,FALSE
},
628 {"C:\\test\\test.mp3#fragment|part",S_OK
,FALSE
},
630 {"C:/test/test.mp3#fragment|part",S_OK
,FALSE
},
636 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
638 {URL_SCHEME_FILE
,S_OK
,FALSE
},
639 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
642 { "C:/test/test.mp3?query|part", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
|Uri_CREATE_FILE_USE_DOS_PATH
|Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
644 {"file://C:\\test\\test.mp3?query|part",S_OK
,FALSE
},
646 {"file://C:\\test\\test.mp3?query|part",S_OK
,FALSE
},
652 {"C:\\test\\test.mp3",S_OK
,FALSE
},
653 {"C:\\test\\test.mp3?query|part",S_OK
,FALSE
},
654 {"?query|part",S_OK
,FALSE
},
655 {"C:/test/test.mp3?query|part",S_OK
,FALSE
},
661 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
663 {URL_SCHEME_FILE
,S_OK
,FALSE
},
664 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
667 { "C:/test/test.mp3?query|part#hash|part", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
|Uri_CREATE_FILE_USE_DOS_PATH
|Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
669 {"file://C:\\test\\test.mp3?query|part#hash|part",S_OK
,FALSE
},
671 {"file://C:\\test\\test.mp3?query|part#hash|part",S_OK
,FALSE
},
674 {"#hash|part",S_OK
,FALSE
},
677 {"C:\\test\\test.mp3",S_OK
,FALSE
},
678 {"C:\\test\\test.mp3?query|part",S_OK
,FALSE
},
679 {"?query|part",S_OK
,FALSE
},
680 {"C:/test/test.mp3?query|part#hash|part",S_OK
,FALSE
},
686 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
688 {URL_SCHEME_FILE
,S_OK
,FALSE
},
689 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
692 { "www.winehq.org/test", Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
694 {"*:www.winehq.org/test",S_OK
,FALSE
},
695 {"www.winehq.org",S_OK
,FALSE
},
696 {"*:www.winehq.org/test",S_OK
,FALSE
},
697 {"winehq.org",S_OK
,FALSE
},
700 {"www.winehq.org",S_OK
,FALSE
},
702 {"/test",S_OK
,FALSE
},
703 {"/test",S_OK
,FALSE
},
705 {"www.winehq.org/test",S_OK
,FALSE
},
711 {Uri_HOST_DNS
,S_OK
,FALSE
},
713 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
714 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
717 /* Valid since the '*' is the only character in the scheme name. */
718 { "*:www.winehq.org/test", 0, S_OK
, FALSE
,
720 {"*:www.winehq.org/test",S_OK
,FALSE
},
721 {"www.winehq.org",S_OK
,FALSE
},
722 {"*:www.winehq.org/test",S_OK
,FALSE
},
723 {"winehq.org",S_OK
,FALSE
},
726 {"www.winehq.org",S_OK
,FALSE
},
728 {"/test",S_OK
,FALSE
},
729 {"/test",S_OK
,FALSE
},
731 {"*:www.winehq.org/test",S_OK
,FALSE
},
737 {Uri_HOST_DNS
,S_OK
,FALSE
},
739 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
740 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
743 { "/../some dir/test.ext", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
745 {"/../some dir/test.ext",S_OK
,FALSE
},
747 {"/../some dir/test.ext",S_OK
,FALSE
},
753 {"/../some dir/test.ext",S_OK
,FALSE
},
754 {"/../some dir/test.ext",S_OK
,FALSE
},
756 {"/../some dir/test.ext",S_OK
,FALSE
},
762 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
764 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
765 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
768 { "//implicit/wildcard/uri scheme", Uri_CREATE_ALLOW_RELATIVE
|Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
770 {"*://implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
772 {"*://implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
778 {"//implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
779 {"//implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
781 {"//implicit/wildcard/uri scheme",S_OK
,FALSE
},
787 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
789 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
790 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
793 /* URI is considered opaque since CREATE_NO_CRACK_UNKNOWN_SCHEMES is set and it's an unknown scheme. */
794 { "zip://google.com", Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
, S_OK
, FALSE
,
796 {"zip:/.//google.com",S_OK
,FALSE
},
798 {"zip:/.//google.com",S_OK
,FALSE
},
804 {"/.//google.com",S_OK
,FALSE
},
805 {"/.//google.com",S_OK
,FALSE
},
807 {"zip://google.com",S_OK
,FALSE
},
813 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
815 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
816 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
819 /* Windows uses the first occurrence of ':' to delimit the userinfo. */
820 { "ftp://user:pass:word@winehq.org/", 0, S_OK
, FALSE
,
822 {"ftp://user:pass:word@winehq.org/",S_OK
,FALSE
},
823 {"user:pass:word@winehq.org",S_OK
,FALSE
},
824 {"ftp://winehq.org/",S_OK
,FALSE
},
825 {"winehq.org",S_OK
,FALSE
},
828 {"winehq.org",S_OK
,FALSE
},
829 {"pass:word",S_OK
,FALSE
},
833 {"ftp://user:pass:word@winehq.org/",S_OK
,FALSE
},
835 {"user:pass:word",S_OK
,FALSE
},
839 {Uri_HOST_DNS
,S_OK
,FALSE
},
841 {URL_SCHEME_FTP
,S_OK
,FALSE
},
842 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
845 /* Make sure % encoded unreserved characters are decoded. */
846 { "ftp://w%49%4Ee:PA%53%53@ftp.google.com/", 0, S_OK
, FALSE
,
848 {"ftp://wINe:PASS@ftp.google.com/",S_OK
,FALSE
},
849 {"wINe:PASS@ftp.google.com",S_OK
,FALSE
},
850 {"ftp://ftp.google.com/",S_OK
,FALSE
},
851 {"google.com",S_OK
,FALSE
},
854 {"ftp.google.com",S_OK
,FALSE
},
859 {"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK
,FALSE
},
861 {"wINe:PASS",S_OK
,FALSE
},
865 {Uri_HOST_DNS
,S_OK
,FALSE
},
867 {URL_SCHEME_FTP
,S_OK
,FALSE
},
868 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
871 /* Make sure % encoded characters which are NOT unreserved are NOT decoded. */
872 { "ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/", 0, S_OK
, FALSE
,
874 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK
,FALSE
},
875 {"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK
,FALSE
},
876 {"ftp://ftp.google.com/",S_OK
,FALSE
},
877 {"google.com",S_OK
,FALSE
},
880 {"ftp.google.com",S_OK
,FALSE
},
881 {"PA%7B%7D",S_OK
,FALSE
},
885 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK
,FALSE
},
887 {"w%5D%5Be:PA%7B%7D",S_OK
,FALSE
},
888 {"w%5D%5Be",S_OK
,FALSE
}
891 {Uri_HOST_DNS
,S_OK
,FALSE
},
893 {URL_SCHEME_FTP
,S_OK
,FALSE
},
894 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
897 /* You're allowed to have an empty password portion in the userinfo section. */
898 { "ftp://empty:@ftp.google.com/", 0, S_OK
, FALSE
,
900 {"ftp://empty:@ftp.google.com/",S_OK
,FALSE
},
901 {"empty:@ftp.google.com",S_OK
,FALSE
},
902 {"ftp://ftp.google.com/",S_OK
,FALSE
},
903 {"google.com",S_OK
,FALSE
},
906 {"ftp.google.com",S_OK
,FALSE
},
911 {"ftp://empty:@ftp.google.com/",S_OK
,FALSE
},
913 {"empty:",S_OK
,FALSE
},
917 {Uri_HOST_DNS
,S_OK
,FALSE
},
919 {URL_SCHEME_FTP
,S_OK
,FALSE
},
920 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
923 /* Make sure forbidden characters in "userinfo" get encoded. */
924 { "ftp://\" \"weird@ftp.google.com/", 0, S_OK
, FALSE
,
926 {"ftp://%22%20%22weird@ftp.google.com/",S_OK
,FALSE
},
927 {"%22%20%22weird@ftp.google.com",S_OK
,FALSE
},
928 {"ftp://ftp.google.com/",S_OK
,FALSE
},
929 {"google.com",S_OK
,FALSE
},
932 {"ftp.google.com",S_OK
,FALSE
},
937 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
939 {"%22%20%22weird",S_OK
,FALSE
},
940 {"%22%20%22weird",S_OK
,FALSE
}
943 {Uri_HOST_DNS
,S_OK
,FALSE
},
945 {URL_SCHEME_FTP
,S_OK
,FALSE
},
946 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
949 /* Make sure the forbidden characters don't get percent encoded. */
950 { "ftp://\" \"weird@ftp.google.com/", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
952 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
953 {"\" \"weird@ftp.google.com",S_OK
,FALSE
},
954 {"ftp://ftp.google.com/",S_OK
,FALSE
},
955 {"google.com",S_OK
,FALSE
},
958 {"ftp.google.com",S_OK
,FALSE
},
963 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
965 {"\" \"weird",S_OK
,FALSE
},
966 {"\" \"weird",S_OK
,FALSE
}
969 {Uri_HOST_DNS
,S_OK
,FALSE
},
971 {URL_SCHEME_FTP
,S_OK
,FALSE
},
972 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
975 /* Make sure already percent encoded characters don't get unencoded. */
976 { "ftp://\"%20\"weird@ftp.google.com/\"%20\"weird", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
978 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK
,FALSE
},
979 {"\"%20\"weird@ftp.google.com",S_OK
,FALSE
},
980 {"ftp://ftp.google.com/\"%20\"weird",S_OK
,FALSE
},
981 {"google.com",S_OK
,FALSE
},
984 {"ftp.google.com",S_OK
,FALSE
},
986 {"/\"%20\"weird",S_OK
,FALSE
},
987 {"/\"%20\"weird",S_OK
,FALSE
},
989 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK
,FALSE
},
991 {"\"%20\"weird",S_OK
,FALSE
},
992 {"\"%20\"weird",S_OK
,FALSE
}
995 {Uri_HOST_DNS
,S_OK
,FALSE
},
997 {URL_SCHEME_FTP
,S_OK
,FALSE
},
998 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1001 /* Allowed to have invalid % encoded because it's an unknown scheme type. */
1002 { "zip://%xy:word@winehq.org/", 0, S_OK
, FALSE
,
1004 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
1005 {"%xy:word@winehq.org",S_OK
,FALSE
},
1006 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
1007 {"winehq.org",S_OK
,FALSE
},
1010 {"winehq.org",S_OK
,FALSE
},
1011 {"word",S_OK
,FALSE
},
1015 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
1017 {"%xy:word",S_OK
,FALSE
},
1021 {Uri_HOST_DNS
,S_OK
,FALSE
},
1023 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1024 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1027 /* Unreserved, percent encoded characters aren't decoded in the userinfo because the scheme
1030 { "zip://%2E:%52%53ord@winehq.org/", 0, S_OK
, FALSE
,
1032 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
1033 {"%2E:%52%53ord@winehq.org",S_OK
,FALSE
},
1034 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
1035 {"winehq.org",S_OK
,FALSE
},
1038 {"winehq.org",S_OK
,FALSE
},
1039 {"%52%53ord",S_OK
,FALSE
},
1043 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
1045 {"%2E:%52%53ord",S_OK
,FALSE
},
1049 {Uri_HOST_DNS
,S_OK
,FALSE
},
1051 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1052 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1055 { "ftp://[](),'test':word@winehq.org/", 0, S_OK
, FALSE
,
1057 {"ftp://[](),'test':word@winehq.org/",S_OK
,FALSE
},
1058 {"[](),'test':word@winehq.org",S_OK
,FALSE
},
1059 {"ftp://winehq.org/",S_OK
,FALSE
},
1060 {"winehq.org",S_OK
,FALSE
},
1063 {"winehq.org",S_OK
,FALSE
},
1064 {"word",S_OK
,FALSE
},
1068 {"ftp://[](),'test':word@winehq.org/",S_OK
,FALSE
},
1070 {"[](),'test':word",S_OK
,FALSE
},
1071 {"[](),'test'",S_OK
,FALSE
}
1074 {Uri_HOST_DNS
,S_OK
,FALSE
},
1076 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1077 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1080 { "ftp://test?:word@winehq.org/", 0, S_OK
, FALSE
,
1082 {"ftp://test/?:word@winehq.org/",S_OK
,FALSE
},
1083 {"test",S_OK
,FALSE
},
1084 {"ftp://test/?:word@winehq.org/",S_OK
,FALSE
},
1088 {"test",S_OK
,FALSE
},
1091 {"/?:word@winehq.org/",S_OK
,FALSE
},
1092 {"?:word@winehq.org/",S_OK
,FALSE
},
1093 {"ftp://test?:word@winehq.org/",S_OK
,FALSE
},
1099 {Uri_HOST_DNS
,S_OK
,FALSE
},
1101 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1102 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1105 { "ftp://test#:word@winehq.org/", 0, S_OK
, FALSE
,
1107 {"ftp://test/#:word@winehq.org/",S_OK
,FALSE
},
1108 {"test",S_OK
,FALSE
},
1109 {"ftp://test/#:word@winehq.org/",S_OK
,FALSE
},
1112 {"#:word@winehq.org/",S_OK
,FALSE
},
1113 {"test",S_OK
,FALSE
},
1118 {"ftp://test#:word@winehq.org/",S_OK
,FALSE
},
1124 {Uri_HOST_DNS
,S_OK
,FALSE
},
1126 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1127 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1130 /* Allowed to have a backslash in the userinfo since it's an unknown scheme. */
1131 { "zip://test\\:word@winehq.org/", 0, S_OK
, FALSE
,
1133 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1134 {"test\\:word@winehq.org",S_OK
,FALSE
},
1135 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1136 {"winehq.org",S_OK
,FALSE
},
1139 {"winehq.org",S_OK
,FALSE
},
1140 {"word",S_OK
,FALSE
},
1144 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1146 {"test\\:word",S_OK
,FALSE
},
1147 {"test\\",S_OK
,FALSE
}
1150 {Uri_HOST_DNS
,S_OK
,FALSE
},
1152 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1153 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1156 /* It normalizes IPv4 addresses correctly. */
1157 { "http://127.000.000.100/", 0, S_OK
, FALSE
,
1159 {"http://127.0.0.100/",S_OK
,FALSE
},
1160 {"127.0.0.100",S_OK
,FALSE
},
1161 {"http://127.0.0.100/",S_OK
,FALSE
},
1165 {"127.0.0.100",S_OK
,FALSE
},
1170 {"http://127.000.000.100/",S_OK
,FALSE
},
1171 {"http",S_OK
,FALSE
},
1176 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1178 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1179 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1182 { "http://127.0.0.1:8000", 0, S_OK
, FALSE
,
1184 {"http://127.0.0.1:8000/",S_OK
},
1185 {"127.0.0.1:8000",S_OK
},
1186 {"http://127.0.0.1:8000/",S_OK
},
1195 {"http://127.0.0.1:8000",S_OK
},
1201 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1203 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1204 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1207 /* Make sure it normalizes partial IPv4 addresses correctly. */
1208 { "http://127.0/", 0, S_OK
, FALSE
,
1210 {"http://127.0.0.0/",S_OK
,FALSE
},
1211 {"127.0.0.0",S_OK
,FALSE
},
1212 {"http://127.0.0.0/",S_OK
,FALSE
},
1216 {"127.0.0.0",S_OK
,FALSE
},
1221 {"http://127.0/",S_OK
,FALSE
},
1222 {"http",S_OK
,FALSE
},
1227 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1229 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1230 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1233 /* Make sure it converts implicit IPv4's correctly. */
1234 { "http://123456/", 0, S_OK
, FALSE
,
1236 {"http://0.1.226.64/",S_OK
,FALSE
},
1237 {"0.1.226.64",S_OK
,FALSE
},
1238 {"http://0.1.226.64/",S_OK
,FALSE
},
1242 {"0.1.226.64",S_OK
,FALSE
},
1247 {"http://123456/",S_OK
,FALSE
},
1248 {"http",S_OK
,FALSE
},
1253 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1255 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1256 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1260 { "http://4294967295/", 0, S_OK
, FALSE
,
1262 {"http://255.255.255.255/",S_OK
,FALSE
},
1263 {"255.255.255.255",S_OK
,FALSE
},
1264 {"http://255.255.255.255/",S_OK
,FALSE
},
1268 {"255.255.255.255",S_OK
,FALSE
},
1273 {"http://4294967295/",S_OK
,FALSE
},
1274 {"http",S_OK
,FALSE
},
1279 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1281 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1282 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1286 { "http://4294967296/", 0, S_OK
, FALSE
,
1288 {"http://4294967296/",S_OK
,FALSE
},
1289 {"4294967296",S_OK
,FALSE
},
1290 {"http://4294967296/",S_OK
,FALSE
},
1294 {"4294967296",S_OK
,FALSE
},
1299 {"http://4294967296/",S_OK
,FALSE
},
1300 {"http",S_OK
,FALSE
},
1305 {Uri_HOST_DNS
,S_OK
,FALSE
},
1307 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1308 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1311 /* Window's doesn't normalize IP address for unknown schemes. */
1312 { "1234://4294967295/", 0, S_OK
, FALSE
,
1314 {"1234://4294967295/",S_OK
,FALSE
},
1315 {"4294967295",S_OK
,FALSE
},
1316 {"1234://4294967295/",S_OK
,FALSE
},
1320 {"4294967295",S_OK
,FALSE
},
1325 {"1234://4294967295/",S_OK
,FALSE
},
1326 {"1234",S_OK
,FALSE
},
1331 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1333 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1334 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1337 /* Window's doesn't normalize IP address for unknown schemes. */
1338 { "1234://127.001/", 0, S_OK
, FALSE
,
1340 {"1234://127.001/",S_OK
,FALSE
},
1341 {"127.001",S_OK
,FALSE
},
1342 {"1234://127.001/",S_OK
,FALSE
},
1346 {"127.001",S_OK
,FALSE
},
1351 {"1234://127.001/",S_OK
,FALSE
},
1352 {"1234",S_OK
,FALSE
},
1357 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1359 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1360 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1363 { "http://[FEDC:BA98::3210]", 0, S_OK
, FALSE
,
1365 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
1366 {"[fedc:ba98::3210]",S_OK
,FALSE
},
1367 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
1371 {"fedc:ba98::3210",S_OK
,FALSE
},
1376 {"http://[FEDC:BA98::3210]",S_OK
,FALSE
},
1377 {"http",S_OK
,FALSE
},
1382 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1384 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1385 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1388 { "http://[::]", 0, S_OK
, FALSE
,
1390 {"http://[::]/",S_OK
,FALSE
},
1391 {"[::]",S_OK
,FALSE
},
1392 {"http://[::]/",S_OK
,FALSE
},
1401 {"http://[::]",S_OK
,FALSE
},
1402 {"http",S_OK
,FALSE
},
1407 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1409 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1410 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1413 { "http://[FEDC:BA98::]", 0, S_OK
, FALSE
,
1415 {"http://[fedc:ba98::]/",S_OK
,FALSE
},
1416 {"[fedc:ba98::]",S_OK
,FALSE
},
1417 {"http://[fedc:ba98::]/",S_OK
,FALSE
},
1421 {"fedc:ba98::",S_OK
,FALSE
},
1426 {"http://[FEDC:BA98::]",S_OK
,FALSE
},
1427 {"http",S_OK
,FALSE
},
1432 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1434 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1435 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1438 /* Valid even with 2 byte elision because it doesn't appear the beginning or end. */
1439 { "http://[1::3:4:5:6:7:8]", 0, S_OK
, FALSE
,
1441 {"http://[1:0:3:4:5:6:7:8]/",S_OK
,FALSE
},
1442 {"[1:0:3:4:5:6:7:8]",S_OK
,FALSE
},
1443 {"http://[1:0:3:4:5:6:7:8]/",S_OK
,FALSE
},
1447 {"1:0:3:4:5:6:7:8",S_OK
,FALSE
},
1452 {"http://[1::3:4:5:6:7:8]",S_OK
,FALSE
},
1453 {"http",S_OK
,FALSE
},
1458 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1460 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1461 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1464 { "http://[v2.34]/", 0, S_OK
, FALSE
,
1466 {"http://[v2.34]/",S_OK
,FALSE
},
1467 {"[v2.34]",S_OK
,FALSE
},
1468 {"http://[v2.34]/",S_OK
,FALSE
},
1472 {"[v2.34]",S_OK
,FALSE
},
1477 {"http://[v2.34]/",S_OK
,FALSE
},
1478 {"http",S_OK
,FALSE
},
1483 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
1485 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1486 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1489 /* Windows ignores ':' if they appear after a '[' on a non-IPLiteral host. */
1490 { "http://[xyz:12345.com/test", 0, S_OK
, FALSE
,
1492 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1493 {"[xyz:12345.com",S_OK
,FALSE
},
1494 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1495 {"[xyz:12345.com",S_OK
,FALSE
},
1498 {"[xyz:12345.com",S_OK
,FALSE
},
1500 {"/test",S_OK
,FALSE
},
1501 {"/test",S_OK
,FALSE
},
1503 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1504 {"http",S_OK
,FALSE
},
1509 {Uri_HOST_DNS
,S_OK
,FALSE
},
1511 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1512 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1515 /* Valid URI since the '[' and ']' don't appear at the beginning and end
1516 * of the host name (respectively).
1518 { "ftp://www.[works].com/", 0, S_OK
, FALSE
,
1520 {"ftp://www.[works].com/",S_OK
,FALSE
},
1521 {"www.[works].com",S_OK
,FALSE
},
1522 {"ftp://www.[works].com/",S_OK
,FALSE
},
1523 {"[works].com",S_OK
,FALSE
},
1526 {"www.[works].com",S_OK
,FALSE
},
1531 {"ftp://www.[works].com/",S_OK
,FALSE
},
1537 {Uri_HOST_DNS
,S_OK
,FALSE
},
1539 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1540 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1543 /* Considers ':' a delimiter since it appears after the ']'. */
1544 { "http://www.google.com]:12345/", 0, S_OK
, FALSE
,
1546 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1547 {"www.google.com]:12345",S_OK
,FALSE
},
1548 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1549 {"google.com]",S_OK
,FALSE
},
1552 {"www.google.com]",S_OK
,FALSE
},
1557 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1558 {"http",S_OK
,FALSE
},
1563 {Uri_HOST_DNS
,S_OK
,FALSE
},
1565 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1566 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1569 /* Unknown scheme types can have invalid % encoded data in the hostname. */
1570 { "zip://w%XXw%GEw.google.com/", 0, S_OK
, FALSE
,
1572 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1573 {"w%XXw%GEw.google.com",S_OK
,FALSE
},
1574 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1575 {"google.com",S_OK
,FALSE
},
1578 {"w%XXw%GEw.google.com",S_OK
,FALSE
},
1583 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1589 {Uri_HOST_DNS
,S_OK
,FALSE
},
1591 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1592 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1595 /* Unknown scheme types hostname doesn't get lower cased. */
1596 { "zip://GOOGLE.com/", 0, S_OK
, FALSE
,
1598 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1599 {"GOOGLE.com",S_OK
,FALSE
},
1600 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1601 {"GOOGLE.com",S_OK
,FALSE
},
1604 {"GOOGLE.com",S_OK
,FALSE
},
1609 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1615 {Uri_HOST_DNS
,S_OK
,FALSE
},
1617 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1618 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1621 /* Hostname gets lower-cased for known scheme types. */
1622 { "http://WWW.GOOGLE.com/", 0, S_OK
, FALSE
,
1624 {"http://www.google.com/",S_OK
,FALSE
},
1625 {"www.google.com",S_OK
,FALSE
},
1626 {"http://www.google.com/",S_OK
,FALSE
},
1627 {"google.com",S_OK
,FALSE
},
1630 {"www.google.com",S_OK
,FALSE
},
1635 {"http://WWW.GOOGLE.com/",S_OK
,FALSE
},
1636 {"http",S_OK
,FALSE
},
1641 {Uri_HOST_DNS
,S_OK
,FALSE
},
1643 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1644 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1647 /* Characters that get % encoded in the hostname also have their percent
1648 * encoded forms lower cased.
1650 { "http://www.%7Cgoogle|.com/", 0, S_OK
, FALSE
,
1652 {"http://www.%7cgoogle%7c.com/",S_OK
,FALSE
},
1653 {"www.%7cgoogle%7c.com",S_OK
,FALSE
},
1654 {"http://www.%7cgoogle%7c.com/",S_OK
,FALSE
},
1655 {"%7cgoogle%7c.com",S_OK
,FALSE
},
1658 {"www.%7cgoogle%7c.com",S_OK
,FALSE
},
1663 {"http://www.%7Cgoogle|.com/",S_OK
,FALSE
},
1664 {"http",S_OK
,FALSE
},
1669 {Uri_HOST_DNS
,S_OK
,FALSE
},
1671 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1672 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1675 /* IPv4 addresses attached to IPv6 can be included in elisions. */
1676 { "http://[1:2:3:4:5:6:0.0.0.0]", 0, S_OK
, FALSE
,
1678 {"http://[1:2:3:4:5:6::]/",S_OK
,FALSE
},
1679 {"[1:2:3:4:5:6::]",S_OK
,FALSE
},
1680 {"http://[1:2:3:4:5:6::]/",S_OK
,FALSE
},
1684 {"1:2:3:4:5:6::",S_OK
,FALSE
},
1689 {"http://[1:2:3:4:5:6:0.0.0.0]",S_OK
,FALSE
},
1690 {"http",S_OK
,FALSE
},
1695 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1697 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1698 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1701 /* IPv4 addresses get normalized. */
1702 { "http://[::001.002.003.000]", 0, S_OK
, FALSE
,
1704 {"http://[::1.2.3.0]/",S_OK
,FALSE
},
1705 {"[::1.2.3.0]",S_OK
,FALSE
},
1706 {"http://[::1.2.3.0]/",S_OK
,FALSE
},
1710 {"::1.2.3.0",S_OK
,FALSE
},
1715 {"http://[::001.002.003.000]",S_OK
,FALSE
},
1716 {"http",S_OK
,FALSE
},
1721 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1723 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1724 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1727 { "http://[::5efe:1.2.3.4]", 0, S_OK
, FALSE
,
1729 {"http://[::5efe:1.2.3.4]/",S_OK
,FALSE
},
1730 {"[::5efe:1.2.3.4]",S_OK
,FALSE
},
1731 {"http://[::5efe:1.2.3.4]/",S_OK
,FALSE
},
1735 {"::5efe:1.2.3.4",S_OK
,FALSE
},
1740 {"http://[::5efe:1.2.3.4]",S_OK
,FALSE
},
1741 {"http",S_OK
,FALSE
},
1746 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1748 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1749 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1752 /* Windows doesn't do anything to IPv6's in unknown schemes. */
1753 { "zip://[0001:0:000:0004:0005:0006:001.002.003.000]", 0, S_OK
, FALSE
,
1755 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK
,FALSE
},
1756 {"[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK
,FALSE
},
1757 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK
,FALSE
},
1761 {"0001:0:000:0004:0005:0006:001.002.003.000",S_OK
,FALSE
},
1766 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK
,FALSE
},
1772 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1774 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1775 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1778 /* IPv4 address is converted into 2 h16 components. */
1779 { "http://[ffff::192.222.111.32]", 0, S_OK
, FALSE
,
1781 {"http://[ffff::c0de:6f20]/",S_OK
,FALSE
},
1782 {"[ffff::c0de:6f20]",S_OK
,FALSE
},
1783 {"http://[ffff::c0de:6f20]/",S_OK
,FALSE
},
1787 {"ffff::c0de:6f20",S_OK
,FALSE
},
1792 {"http://[ffff::192.222.111.32]",S_OK
,FALSE
},
1793 {"http",S_OK
,FALSE
},
1798 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1800 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1801 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1804 /* Max value for a port. */
1805 { "http://google.com:65535", 0, S_OK
, FALSE
,
1807 {"http://google.com:65535/",S_OK
,FALSE
},
1808 {"google.com:65535",S_OK
,FALSE
},
1809 {"http://google.com:65535/",S_OK
,FALSE
},
1810 {"google.com",S_OK
,FALSE
},
1813 {"google.com",S_OK
,FALSE
},
1818 {"http://google.com:65535",S_OK
,FALSE
},
1819 {"http",S_OK
,FALSE
},
1824 {Uri_HOST_DNS
,S_OK
,FALSE
},
1826 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1827 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1830 { "zip://google.com:65536", 0, S_OK
, FALSE
,
1832 {"zip://google.com:65536/",S_OK
,FALSE
},
1833 {"google.com:65536",S_OK
,FALSE
},
1834 {"zip://google.com:65536/",S_OK
,FALSE
},
1835 {"google.com:65536",S_OK
,FALSE
},
1838 {"google.com:65536",S_OK
,FALSE
},
1843 {"zip://google.com:65536",S_OK
,FALSE
},
1849 {Uri_HOST_DNS
,S_OK
,FALSE
},
1851 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1852 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1855 { "zip://google.com:65536:25", 0, S_OK
, FALSE
,
1857 {"zip://google.com:65536:25/",S_OK
,FALSE
},
1858 {"google.com:65536:25",S_OK
,FALSE
},
1859 {"zip://google.com:65536:25/",S_OK
,FALSE
},
1860 {"google.com:65536:25",S_OK
,FALSE
},
1863 {"google.com:65536:25",S_OK
,FALSE
},
1868 {"zip://google.com:65536:25",S_OK
,FALSE
},
1874 {Uri_HOST_DNS
,S_OK
,FALSE
},
1876 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1877 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1880 { "zip://[::ffff]:abcd", 0, S_OK
, FALSE
,
1882 {"zip://[::ffff]:abcd/",S_OK
,FALSE
},
1883 {"[::ffff]:abcd",S_OK
,FALSE
},
1884 {"zip://[::ffff]:abcd/",S_OK
,FALSE
},
1888 {"[::ffff]:abcd",S_OK
,FALSE
},
1893 {"zip://[::ffff]:abcd",S_OK
,FALSE
},
1899 {Uri_HOST_DNS
,S_OK
,FALSE
},
1901 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1902 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1905 { "zip://127.0.0.1:abcd", 0, S_OK
, FALSE
,
1907 {"zip://127.0.0.1:abcd/",S_OK
,FALSE
},
1908 {"127.0.0.1:abcd",S_OK
,FALSE
},
1909 {"zip://127.0.0.1:abcd/",S_OK
,FALSE
},
1910 {"0.1:abcd",S_OK
,FALSE
},
1913 {"127.0.0.1:abcd",S_OK
,FALSE
},
1918 {"zip://127.0.0.1:abcd",S_OK
,FALSE
},
1924 {Uri_HOST_DNS
,S_OK
,FALSE
},
1926 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1927 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1930 /* Port is just copied over. */
1931 { "http://google.com:00035", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
1933 {"http://google.com:00035",S_OK
,FALSE
},
1934 {"google.com:00035",S_OK
,FALSE
},
1935 {"http://google.com:00035",S_OK
,FALSE
,"http://google.com:35"},
1936 {"google.com",S_OK
,FALSE
},
1939 {"google.com",S_OK
,FALSE
},
1944 {"http://google.com:00035",S_OK
,FALSE
},
1945 {"http",S_OK
,FALSE
},
1950 {Uri_HOST_DNS
,S_OK
,FALSE
},
1952 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1953 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1956 /* Default port is copied over. */
1957 { "http://google.com:80", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
1959 {"http://google.com:80",S_OK
,FALSE
},
1960 {"google.com:80",S_OK
,FALSE
},
1961 {"http://google.com:80",S_OK
,FALSE
},
1962 {"google.com",S_OK
,FALSE
},
1965 {"google.com",S_OK
,FALSE
},
1970 {"http://google.com:80",S_OK
,FALSE
},
1971 {"http",S_OK
,FALSE
},
1976 {Uri_HOST_DNS
,S_OK
,FALSE
},
1978 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1979 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1982 { "http://google.com.uk", 0, S_OK
, FALSE
,
1984 {"http://google.com.uk/",S_OK
,FALSE
},
1985 {"google.com.uk",S_OK
,FALSE
},
1986 {"http://google.com.uk/",S_OK
,FALSE
},
1987 {"google.com.uk",S_OK
,FALSE
,NULL
,"com.uk",S_OK
}, /* cf. google.co.uk below */
1990 {"google.com.uk",S_OK
,FALSE
},
1995 {"http://google.com.uk",S_OK
,FALSE
},
1996 {"http",S_OK
,FALSE
},
2001 {Uri_HOST_DNS
,S_OK
,FALSE
},
2003 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2004 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2007 { "http://google.co.uk", 0, S_OK
, FALSE
,
2009 {"http://google.co.uk/",S_OK
,FALSE
},
2010 {"google.co.uk",S_OK
,FALSE
},
2011 {"http://google.co.uk/",S_OK
,FALSE
},
2012 {"google.co.uk",S_OK
,FALSE
},
2015 {"google.co.uk",S_OK
,FALSE
},
2020 {"http://google.co.uk",S_OK
,FALSE
},
2021 {"http",S_OK
,FALSE
},
2026 {Uri_HOST_DNS
,S_OK
,FALSE
},
2028 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2029 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2032 { "http://google.com.com", 0, S_OK
, FALSE
,
2034 {"http://google.com.com/",S_OK
,FALSE
},
2035 {"google.com.com",S_OK
,FALSE
},
2036 {"http://google.com.com/",S_OK
,FALSE
},
2037 {"com.com",S_OK
,FALSE
},
2040 {"google.com.com",S_OK
,FALSE
},
2045 {"http://google.com.com",S_OK
,FALSE
},
2046 {"http",S_OK
,FALSE
},
2051 {Uri_HOST_DNS
,S_OK
,FALSE
},
2053 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2054 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2057 { "http://google.uk.1", 0, S_OK
, FALSE
,
2059 {"http://google.uk.1/",S_OK
,FALSE
},
2060 {"google.uk.1",S_OK
,FALSE
},
2061 {"http://google.uk.1/",S_OK
,FALSE
},
2062 {"google.uk.1",S_OK
,FALSE
,NULL
,"uk.1",S_OK
},
2065 {"google.uk.1",S_OK
,FALSE
},
2070 {"http://google.uk.1",S_OK
,FALSE
},
2071 {"http",S_OK
,FALSE
},
2076 {Uri_HOST_DNS
,S_OK
,FALSE
},
2078 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2079 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2082 /* Since foo isn't a recognized 3 character TLD it's considered the domain name. */
2083 { "http://google.foo.uk", 0, S_OK
, FALSE
,
2085 {"http://google.foo.uk/",S_OK
,FALSE
},
2086 {"google.foo.uk",S_OK
,FALSE
},
2087 {"http://google.foo.uk/",S_OK
,FALSE
},
2088 {"foo.uk",S_OK
,FALSE
},
2091 {"google.foo.uk",S_OK
,FALSE
},
2096 {"http://google.foo.uk",S_OK
,FALSE
},
2097 {"http",S_OK
,FALSE
},
2102 {Uri_HOST_DNS
,S_OK
,FALSE
},
2104 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2105 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2108 { "http://.com", 0, S_OK
, FALSE
,
2110 {"http://.com/",S_OK
,FALSE
},
2111 {".com",S_OK
,FALSE
},
2112 {"http://.com/",S_OK
,FALSE
},
2113 {".com",S_OK
,FALSE
},
2116 {".com",S_OK
,FALSE
},
2121 {"http://.com",S_OK
,FALSE
},
2122 {"http",S_OK
,FALSE
},
2127 {Uri_HOST_DNS
,S_OK
,FALSE
},
2129 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2130 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2133 { "http://.uk", 0, S_OK
, FALSE
,
2135 {"http://.uk/",S_OK
,FALSE
},
2137 {"http://.uk/",S_OK
,FALSE
},
2138 {"",S_FALSE
,FALSE
,NULL
,".uk",S_OK
},
2146 {"http://.uk",S_OK
,FALSE
},
2147 {"http",S_OK
,FALSE
},
2152 {Uri_HOST_DNS
,S_OK
,FALSE
},
2154 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2155 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2158 { "http://www.co.google.com.[]", 0, S_OK
, FALSE
,
2160 {"http://www.co.google.com.[]/",S_OK
,FALSE
},
2161 {"www.co.google.com.[]",S_OK
,FALSE
},
2162 {"http://www.co.google.com.[]/",S_OK
,FALSE
},
2163 {"google.com.[]",S_OK
,FALSE
,NULL
,"com.[]",S_OK
},
2166 {"www.co.google.com.[]",S_OK
,FALSE
},
2171 {"http://www.co.google.com.[]",S_OK
,FALSE
},
2172 {"http",S_OK
,FALSE
},
2177 {Uri_HOST_DNS
,S_OK
,FALSE
},
2179 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2180 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2183 { "http://co.uk", 0, S_OK
, FALSE
,
2185 {"http://co.uk/",S_OK
,FALSE
},
2186 {"co.uk",S_OK
,FALSE
},
2187 {"http://co.uk/",S_OK
,FALSE
},
2191 {"co.uk",S_OK
,FALSE
},
2196 {"http://co.uk",S_OK
,FALSE
},
2197 {"http",S_OK
,FALSE
},
2202 {Uri_HOST_DNS
,S_OK
,FALSE
},
2204 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2205 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2208 { "http://www.co.google.us.test", 0, S_OK
, FALSE
,
2210 {"http://www.co.google.us.test/",S_OK
,FALSE
},
2211 {"www.co.google.us.test",S_OK
,FALSE
},
2212 {"http://www.co.google.us.test/",S_OK
,FALSE
},
2213 {"us.test",S_OK
,FALSE
},
2216 {"www.co.google.us.test",S_OK
,FALSE
},
2221 {"http://www.co.google.us.test",S_OK
,FALSE
},
2222 {"http",S_OK
,FALSE
},
2227 {Uri_HOST_DNS
,S_OK
,FALSE
},
2229 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2230 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2233 { "http://gov.uk", 0, S_OK
, FALSE
,
2235 {"http://gov.uk/",S_OK
,FALSE
},
2236 {"gov.uk",S_OK
,FALSE
},
2237 {"http://gov.uk/",S_OK
,FALSE
},
2241 {"gov.uk",S_OK
,FALSE
},
2246 {"http://gov.uk",S_OK
,FALSE
},
2247 {"http",S_OK
,FALSE
},
2252 {Uri_HOST_DNS
,S_OK
,FALSE
},
2254 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2255 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2258 { "zip://www.google.com\\test", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2260 {"zip://www.google.com\\test",S_OK
,FALSE
},
2261 {"www.google.com\\test",S_OK
,FALSE
},
2262 {"zip://www.google.com\\test",S_OK
,FALSE
},
2263 {"google.com\\test",S_OK
,FALSE
},
2266 {"www.google.com\\test",S_OK
,FALSE
},
2271 {"zip://www.google.com\\test",S_OK
,FALSE
},
2277 {Uri_HOST_DNS
,S_OK
,FALSE
},
2279 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2280 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2283 { "urn:excepts:bad:%XY:encoded", 0, S_OK
, FALSE
,
2285 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2287 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2293 {"excepts:bad:%XY:encoded",S_OK
,FALSE
},
2294 {"excepts:bad:%XY:encoded",S_OK
,FALSE
},
2296 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2302 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2304 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2305 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2308 /* Since the original URI doesn't contain an extra '/' before the path no % encoded values
2309 * are decoded and all '%' are encoded.
2311 { "file://C:/te%3Es%2Et/tes%t.mp3", 0, S_OK
, FALSE
,
2313 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2315 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2317 {".mp3",S_OK
,FALSE
},
2321 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2322 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2324 {"file://C:/te%3Es%2Et/tes%t.mp3",S_OK
,FALSE
},
2325 {"file",S_OK
,FALSE
},
2330 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2332 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2333 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2336 /* Since there's a '/' in front of the drive letter, any percent encoded, non-forbidden character
2337 * is decoded and only %'s in front of invalid hex digits are encoded.
2339 { "file:///C:/te%3Es%2Et/t%23es%t.mp3", 0, S_OK
, FALSE
,
2341 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2343 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2345 {".mp3",S_OK
,FALSE
},
2349 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2350 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2352 {"file:///C:/te%3Es%2Et/t%23es%t.mp3",S_OK
,FALSE
},
2353 {"file",S_OK
,FALSE
},
2358 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2360 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2361 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2364 /* Only unreserved percent encoded characters are decoded for known schemes that aren't file. */
2365 { "http://[::001.002.003.000]/%3F%23%2E%54/test", 0, S_OK
, FALSE
,
2367 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK
,FALSE
},
2368 {"[::1.2.3.0]",S_OK
,FALSE
},
2369 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK
,FALSE
},
2373 {"::1.2.3.0",S_OK
,FALSE
},
2375 {"/%3F%23.T/test",S_OK
,FALSE
},
2376 {"/%3F%23.T/test",S_OK
,FALSE
},
2378 {"http://[::001.002.003.000]/%3F%23%2E%54/test",S_OK
,FALSE
},
2379 {"http",S_OK
,FALSE
},
2384 {Uri_HOST_IPV6
,S_OK
,FALSE
},
2386 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2387 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2390 /* Forbidden characters are always encoded for file URIs. */
2391 { "file:///C:/\"test\"/test.mp3", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2393 {"file:///C:/%22test%22/test.mp3",S_OK
,FALSE
},
2395 {"file:///C:/%22test%22/test.mp3",S_OK
,FALSE
},
2397 {".mp3",S_OK
,FALSE
},
2401 {"/C:/%22test%22/test.mp3",S_OK
,FALSE
},
2402 {"/C:/%22test%22/test.mp3",S_OK
,FALSE
},
2404 {"file:///C:/\"test\"/test.mp3",S_OK
,FALSE
},
2405 {"file",S_OK
,FALSE
},
2410 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2412 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2413 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2416 /* Forbidden characters are never encoded for unknown scheme types. */
2417 { "1234://4294967295/<|>\" test<|>", 0, S_OK
, FALSE
,
2419 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2420 {"4294967295",S_OK
,FALSE
},
2421 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2425 {"4294967295",S_OK
,FALSE
},
2427 {"/<|>\" test<|>",S_OK
,FALSE
},
2428 {"/<|>\" test<|>",S_OK
,FALSE
},
2430 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2431 {"1234",S_OK
,FALSE
},
2436 {Uri_HOST_IPV4
,S_OK
,FALSE
},
2438 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2439 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2442 /* Make sure forbidden characters are percent encoded. */
2443 { "http://gov.uk/<|> test<|>", 0, S_OK
, FALSE
,
2445 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2446 {"gov.uk",S_OK
,FALSE
},
2447 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2451 {"gov.uk",S_OK
,FALSE
},
2453 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2454 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2456 {"http://gov.uk/<|> test<|>",S_OK
,FALSE
},
2457 {"http",S_OK
,FALSE
},
2462 {Uri_HOST_DNS
,S_OK
,FALSE
},
2464 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2465 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2468 { "http://gov.uk/test/../test2/././../test3/.././././", 0, S_OK
, FALSE
,
2470 {"http://gov.uk/",S_OK
,FALSE
},
2471 {"gov.uk",S_OK
,FALSE
},
2472 {"http://gov.uk/",S_OK
,FALSE
},
2476 {"gov.uk",S_OK
,FALSE
},
2481 {"http://gov.uk/test/../test2/././../test3/.././././",S_OK
,FALSE
},
2482 {"http",S_OK
,FALSE
},
2487 {Uri_HOST_DNS
,S_OK
,FALSE
},
2489 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2490 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2493 { "http://gov.uk/test/test2/../../..", 0, S_OK
, FALSE
,
2495 {"http://gov.uk/",S_OK
,FALSE
},
2496 {"gov.uk",S_OK
,FALSE
},
2497 {"http://gov.uk/",S_OK
,FALSE
},
2501 {"gov.uk",S_OK
,FALSE
},
2506 {"http://gov.uk/test/test2/../../..",S_OK
,FALSE
},
2507 {"http",S_OK
,FALSE
},
2512 {Uri_HOST_DNS
,S_OK
,FALSE
},
2514 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2515 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2518 { "http://gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2520 {"http://gov.uk/",S_OK
,FALSE
},
2521 {"gov.uk",S_OK
,FALSE
},
2522 {"http://gov.uk/",S_OK
,FALSE
},
2526 {"gov.uk",S_OK
,FALSE
},
2531 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2532 {"http",S_OK
,FALSE
},
2537 {Uri_HOST_DNS
,S_OK
,FALSE
},
2539 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2540 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2543 { "file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3", 0, S_OK
, FALSE
,
2545 {"file:///c:/foo%2520bar.mp3",S_OK
,FALSE
},
2547 {"file:///c:/foo%2520bar.mp3",S_OK
,FALSE
},
2549 {".mp3",S_OK
,FALSE
},
2553 {"/c:/foo%2520bar.mp3",S_OK
,FALSE
},
2554 {"/c:/foo%2520bar.mp3",S_OK
,FALSE
},
2556 {"file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3",S_OK
,FALSE
},
2557 {"file",S_OK
,FALSE
},
2562 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2564 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2565 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2568 /* Dot removal happens for unknown scheme types. */
2569 { "zip://gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2571 {"zip://gov.uk/",S_OK
,FALSE
},
2572 {"gov.uk",S_OK
,FALSE
},
2573 {"zip://gov.uk/",S_OK
,FALSE
},
2577 {"gov.uk",S_OK
,FALSE
},
2582 {"zip://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2588 {Uri_HOST_DNS
,S_OK
,FALSE
},
2590 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2591 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2594 /* Dot removal doesn't happen if NO_CANONICALIZE is set. */
2595 { "http://gov.uk/test/test2/../../.", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2597 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2598 {"gov.uk",S_OK
,FALSE
},
2599 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2603 {"gov.uk",S_OK
,FALSE
},
2605 {"/test/test2/../../.",S_OK
,FALSE
},
2606 {"/test/test2/../../.",S_OK
,FALSE
},
2608 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2609 {"http",S_OK
,FALSE
},
2614 {Uri_HOST_DNS
,S_OK
,FALSE
},
2616 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2617 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2620 /* Dot removal doesn't happen for wildcard scheme types. */
2621 { "*:gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2623 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2624 {"gov.uk",S_OK
,FALSE
},
2625 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2629 {"gov.uk",S_OK
,FALSE
},
2631 {"/test/test2/../../.",S_OK
,FALSE
},
2632 {"/test/test2/../../.",S_OK
,FALSE
},
2634 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2640 {Uri_HOST_DNS
,S_OK
,FALSE
},
2642 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
2643 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2646 /* Forbidden characters are encoded for opaque known scheme types. */
2647 { "mailto:\"acco<|>unt@example.com\"", 0, S_OK
, FALSE
,
2649 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2651 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2653 {".com%22",S_OK
,FALSE
},
2657 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2658 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2660 {"mailto:\"acco<|>unt@example.com\"",S_OK
,FALSE
},
2661 {"mailto",S_OK
,FALSE
},
2666 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2668 {URL_SCHEME_MAILTO
,S_OK
,FALSE
},
2669 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2672 { "news:test.tes<|>t.com", 0, S_OK
, FALSE
,
2674 {"news:test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2676 {"news:test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2678 {".com",S_OK
,FALSE
},
2682 {"test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2683 {"test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2685 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2686 {"news",S_OK
,FALSE
},
2691 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2693 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2694 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2697 /* Don't encode forbidden characters. */
2698 { "news:test.tes<|>t.com", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2700 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2702 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2704 {".com",S_OK
,FALSE
},
2708 {"test.tes<|>t.com",S_OK
,FALSE
},
2709 {"test.tes<|>t.com",S_OK
,FALSE
},
2711 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2712 {"news",S_OK
,FALSE
},
2717 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2719 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2720 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2723 /* Forbidden characters aren't encoded for unknown, opaque URIs. */
2724 { "urn:test.tes<|>t.com", 0, S_OK
, FALSE
,
2726 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2728 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2730 {".com",S_OK
,FALSE
},
2734 {"test.tes<|>t.com",S_OK
,FALSE
},
2735 {"test.tes<|>t.com",S_OK
,FALSE
},
2737 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2743 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2745 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2746 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2749 /* Percent encoded unreserved characters are decoded for known opaque URIs. */
2750 { "news:test.%74%65%73%74.com", 0, S_OK
, FALSE
,
2752 {"news:test.test.com",S_OK
,FALSE
},
2754 {"news:test.test.com",S_OK
,FALSE
},
2756 {".com",S_OK
,FALSE
},
2760 {"test.test.com",S_OK
,FALSE
},
2761 {"test.test.com",S_OK
,FALSE
},
2763 {"news:test.%74%65%73%74.com",S_OK
,FALSE
},
2764 {"news",S_OK
,FALSE
},
2769 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2771 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2772 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2775 /* Percent encoded characters are still decoded for known scheme types. */
2776 { "news:test.%74%65%73%74.com", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2778 {"news:test.test.com",S_OK
,FALSE
},
2780 {"news:test.test.com",S_OK
,FALSE
},
2782 {".com",S_OK
,FALSE
},
2786 {"test.test.com",S_OK
,FALSE
},
2787 {"test.test.com",S_OK
,FALSE
},
2789 {"news:test.%74%65%73%74.com",S_OK
,FALSE
},
2790 {"news",S_OK
,FALSE
},
2795 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2797 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2798 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2801 /* Percent encoded characters aren't decoded for unknown scheme types. */
2802 { "urn:test.%74%65%73%74.com", 0, S_OK
, FALSE
,
2804 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2806 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2808 {".com",S_OK
,FALSE
},
2812 {"test.%74%65%73%74.com",S_OK
,FALSE
},
2813 {"test.%74%65%73%74.com",S_OK
,FALSE
},
2815 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2821 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2823 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2824 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2827 /* Unknown scheme types can have invalid % encoded data in query string. */
2828 { "zip://www.winehq.org/tests/..?query=%xx&return=y", 0, S_OK
, FALSE
,
2830 {"zip://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2831 {"www.winehq.org",S_OK
,FALSE
},
2832 {"zip://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2833 {"winehq.org",S_OK
,FALSE
},
2836 {"www.winehq.org",S_OK
,FALSE
},
2839 {"/?query=%xx&return=y",S_OK
,FALSE
},
2840 {"?query=%xx&return=y",S_OK
,FALSE
},
2841 {"zip://www.winehq.org/tests/..?query=%xx&return=y",S_OK
,FALSE
},
2847 {Uri_HOST_DNS
,S_OK
,FALSE
},
2849 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2850 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2853 /* Known scheme types can have invalid % encoded data with the right flags. */
2854 { "http://www.winehq.org/tests/..?query=%xx&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
2856 {"http://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2857 {"www.winehq.org",S_OK
,FALSE
},
2858 {"http://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2859 {"winehq.org",S_OK
,FALSE
},
2862 {"www.winehq.org",S_OK
,FALSE
},
2865 {"/?query=%xx&return=y",S_OK
,FALSE
},
2866 {"?query=%xx&return=y",S_OK
,FALSE
},
2867 {"http://www.winehq.org/tests/..?query=%xx&return=y",S_OK
,FALSE
},
2868 {"http",S_OK
,FALSE
},
2873 {Uri_HOST_DNS
,S_OK
,FALSE
},
2875 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2876 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2879 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2880 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
2882 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2883 {"www.winehq.org",S_OK
,FALSE
},
2884 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2885 {"winehq.org",S_OK
,FALSE
},
2888 {"www.winehq.org",S_OK
,FALSE
},
2891 {"/?query=<|>&return=y",S_OK
,FALSE
},
2892 {"?query=<|>&return=y",S_OK
,FALSE
},
2893 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2894 {"http",S_OK
,FALSE
},
2899 {Uri_HOST_DNS
,S_OK
,FALSE
},
2901 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2902 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2905 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2906 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2908 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2909 {"www.winehq.org",S_OK
,FALSE
},
2910 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2911 {"winehq.org",S_OK
,FALSE
},
2914 {"www.winehq.org",S_OK
,FALSE
},
2917 {"/?query=<|>&return=y",S_OK
,FALSE
},
2918 {"?query=<|>&return=y",S_OK
,FALSE
},
2919 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2920 {"http",S_OK
,FALSE
},
2925 {Uri_HOST_DNS
,S_OK
,FALSE
},
2927 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2928 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2931 /* Forbidden characters are encoded for known scheme types. */
2932 { "http://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK
, FALSE
,
2934 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2935 {"www.winehq.org",S_OK
,FALSE
},
2936 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2937 {"winehq.org",S_OK
,FALSE
},
2940 {"www.winehq.org",S_OK
,FALSE
},
2943 {"/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2944 {"?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2945 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2946 {"http",S_OK
,FALSE
},
2951 {Uri_HOST_DNS
,S_OK
,FALSE
},
2953 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2954 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2957 /* Forbidden characters are not encoded for unknown scheme types. */
2958 { "zip://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK
, FALSE
,
2960 {"zip://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2961 {"www.winehq.org",S_OK
,FALSE
},
2962 {"zip://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2963 {"winehq.org",S_OK
,FALSE
},
2966 {"www.winehq.org",S_OK
,FALSE
},
2969 {"/?query=<|>&return=y",S_OK
,FALSE
},
2970 {"?query=<|>&return=y",S_OK
,FALSE
},
2971 {"zip://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2977 {Uri_HOST_DNS
,S_OK
,FALSE
},
2979 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2980 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2983 /* Percent encoded, unreserved characters are decoded for known scheme types. */
2984 { "http://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK
, FALSE
,
2986 {"http://www.winehq.org/?query=01&return=y",S_OK
,FALSE
},
2987 {"www.winehq.org",S_OK
,FALSE
},
2988 {"http://www.winehq.org/?query=01&return=y",S_OK
,FALSE
},
2989 {"winehq.org",S_OK
,FALSE
},
2992 {"www.winehq.org",S_OK
,FALSE
},
2995 {"/?query=01&return=y",S_OK
,FALSE
},
2996 {"?query=01&return=y",S_OK
,FALSE
},
2997 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
2998 {"http",S_OK
,FALSE
},
3003 {Uri_HOST_DNS
,S_OK
,FALSE
},
3005 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3006 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3009 /* Percent encoded, unreserved characters aren't decoded for unknown scheme types. */
3010 { "zip://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK
, FALSE
,
3012 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
3013 {"www.winehq.org",S_OK
,FALSE
},
3014 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
3015 {"winehq.org",S_OK
,FALSE
},
3018 {"www.winehq.org",S_OK
,FALSE
},
3021 {"/?query=%30%31&return=y",S_OK
,FALSE
},
3022 {"?query=%30%31&return=y",S_OK
,FALSE
},
3023 {"zip://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
3029 {Uri_HOST_DNS
,S_OK
,FALSE
},
3031 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3032 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3035 /* Percent encoded characters aren't decoded when NO_DECODE_EXTRA_INFO is set. */
3036 { "http://www.winehq.org/tests/..?query=%30%31&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
3038 {"http://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
3039 {"www.winehq.org",S_OK
,FALSE
},
3040 {"http://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
3041 {"winehq.org",S_OK
,FALSE
},
3044 {"www.winehq.org",S_OK
,FALSE
},
3047 {"/?query=%30%31&return=y",S_OK
,FALSE
},
3048 {"?query=%30%31&return=y",S_OK
,FALSE
},
3049 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
3050 {"http",S_OK
,FALSE
},
3055 {Uri_HOST_DNS
,S_OK
,FALSE
},
3057 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3058 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3061 { "http://www.winehq.org?query=12&return=y", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
3063 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
3064 {"www.winehq.org",S_OK
,FALSE
},
3065 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
3066 {"winehq.org",S_OK
,FALSE
},
3069 {"www.winehq.org",S_OK
,FALSE
},
3072 {"?query=12&return=y",S_OK
,FALSE
},
3073 {"?query=12&return=y",S_OK
,FALSE
},
3074 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
3075 {"http",S_OK
,FALSE
},
3080 {Uri_HOST_DNS
,S_OK
,FALSE
},
3082 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3083 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3086 /* Unknown scheme types can have invalid % encoded data in fragments. */
3087 { "zip://www.winehq.org/tests/#Te%xx", 0, S_OK
, FALSE
,
3089 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
3090 {"www.winehq.org",S_OK
,FALSE
},
3091 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
3092 {"winehq.org",S_OK
,FALSE
},
3094 {"#Te%xx",S_OK
,FALSE
},
3095 {"www.winehq.org",S_OK
,FALSE
},
3097 {"/tests/",S_OK
,FALSE
},
3098 {"/tests/",S_OK
,FALSE
},
3100 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
3106 {Uri_HOST_DNS
,S_OK
,FALSE
},
3108 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3109 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3112 /* Forbidden characters in fragment aren't encoded for unknown schemes. */
3113 { "zip://www.winehq.org/tests/#Te<|>", 0, S_OK
, FALSE
,
3115 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3116 {"www.winehq.org",S_OK
,FALSE
},
3117 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3118 {"winehq.org",S_OK
,FALSE
},
3120 {"#Te<|>",S_OK
,FALSE
},
3121 {"www.winehq.org",S_OK
,FALSE
},
3123 {"/tests/",S_OK
,FALSE
},
3124 {"/tests/",S_OK
,FALSE
},
3126 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3132 {Uri_HOST_DNS
,S_OK
,FALSE
},
3134 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3135 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3138 /* Forbidden characters in the fragment are percent encoded for known schemes. */
3139 { "http://www.winehq.org/tests/#Te<|>", 0, S_OK
, FALSE
,
3141 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK
,FALSE
},
3142 {"www.winehq.org",S_OK
,FALSE
},
3143 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK
,FALSE
},
3144 {"winehq.org",S_OK
,FALSE
},
3146 {"#Te%3C%7C%3E",S_OK
,FALSE
},
3147 {"www.winehq.org",S_OK
,FALSE
},
3149 {"/tests/",S_OK
,FALSE
},
3150 {"/tests/",S_OK
,FALSE
},
3152 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3153 {"http",S_OK
,FALSE
},
3158 {Uri_HOST_DNS
,S_OK
,FALSE
},
3160 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3161 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3164 /* Forbidden characters aren't encoded in the fragment with this flag. */
3165 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
3167 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3168 {"www.winehq.org",S_OK
,FALSE
},
3169 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3170 {"winehq.org",S_OK
,FALSE
},
3172 {"#Te<|>",S_OK
,FALSE
},
3173 {"www.winehq.org",S_OK
,FALSE
},
3175 {"/tests/",S_OK
,FALSE
},
3176 {"/tests/",S_OK
,FALSE
},
3178 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3179 {"http",S_OK
,FALSE
},
3184 {Uri_HOST_DNS
,S_OK
,FALSE
},
3186 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3187 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3190 /* Forbidden characters aren't encoded in the fragment with this flag. */
3191 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
3193 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3194 {"www.winehq.org",S_OK
,FALSE
},
3195 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3196 {"winehq.org",S_OK
,FALSE
},
3198 {"#Te<|>",S_OK
,FALSE
},
3199 {"www.winehq.org",S_OK
,FALSE
},
3201 {"/tests/",S_OK
,FALSE
},
3202 {"/tests/",S_OK
,FALSE
},
3204 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3205 {"http",S_OK
,FALSE
},
3210 {Uri_HOST_DNS
,S_OK
,FALSE
},
3212 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3213 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3216 /* Percent encoded, unreserved characters aren't decoded for known scheme types. */
3217 { "zip://www.winehq.org/tests/#Te%30%31%32", 0, S_OK
, FALSE
,
3219 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3220 {"www.winehq.org",S_OK
,FALSE
},
3221 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3222 {"winehq.org",S_OK
,FALSE
},
3224 {"#Te%30%31%32",S_OK
,FALSE
},
3225 {"www.winehq.org",S_OK
,FALSE
},
3227 {"/tests/",S_OK
,FALSE
},
3228 {"/tests/",S_OK
,FALSE
},
3230 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3236 {Uri_HOST_DNS
,S_OK
,FALSE
},
3238 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3239 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3242 /* Percent encoded, unreserved characters are decoded for known schemes. */
3243 { "http://www.winehq.org/tests/#Te%30%31%32", 0, S_OK
, FALSE
,
3245 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3246 {"www.winehq.org",S_OK
,FALSE
},
3247 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3248 {"winehq.org",S_OK
,FALSE
},
3250 {"#Te012",S_OK
,FALSE
},
3251 {"www.winehq.org",S_OK
,FALSE
},
3253 {"/tests/",S_OK
,FALSE
},
3254 {"/tests/",S_OK
,FALSE
},
3256 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3257 {"http",S_OK
,FALSE
},
3262 {Uri_HOST_DNS
,S_OK
,FALSE
},
3264 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3265 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3268 /* Percent encoded, unreserved characters are decoded even if NO_CANONICALIZE is set. */
3269 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
3271 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3272 {"www.winehq.org",S_OK
,FALSE
},
3273 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3274 {"winehq.org",S_OK
,FALSE
},
3276 {"#Te012",S_OK
,FALSE
},
3277 {"www.winehq.org",S_OK
,FALSE
},
3279 {"/tests/",S_OK
,FALSE
},
3280 {"/tests/",S_OK
,FALSE
},
3282 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3283 {"http",S_OK
,FALSE
},
3288 {Uri_HOST_DNS
,S_OK
,FALSE
},
3290 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3291 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3294 /* Percent encoded, unreserved characters aren't decoded when NO_DECODE_EXTRA is set. */
3295 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
3297 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3298 {"www.winehq.org",S_OK
,FALSE
},
3299 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3300 {"winehq.org",S_OK
,FALSE
},
3302 {"#Te%30%31%32",S_OK
,FALSE
},
3303 {"www.winehq.org",S_OK
,FALSE
},
3305 {"/tests/",S_OK
,FALSE
},
3306 {"/tests/",S_OK
,FALSE
},
3308 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3309 {"http",S_OK
,FALSE
},
3314 {Uri_HOST_DNS
,S_OK
,FALSE
},
3316 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3317 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3320 /* Leading/Trailing whitespace is removed. */
3321 { " http://google.com/ ", 0, S_OK
, FALSE
,
3323 {"http://google.com/",S_OK
,FALSE
},
3324 {"google.com",S_OK
,FALSE
},
3325 {"http://google.com/",S_OK
,FALSE
},
3326 {"google.com",S_OK
,FALSE
},
3329 {"google.com",S_OK
,FALSE
},
3334 {"http://google.com/",S_OK
,FALSE
},
3335 {"http",S_OK
,FALSE
},
3340 {Uri_HOST_DNS
,S_OK
,FALSE
},
3342 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3343 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3346 { "\t\t\r\nhttp\n://g\noogle.co\rm/\n\n\n", 0, S_OK
, FALSE
,
3348 {"http://google.com/",S_OK
,FALSE
},
3349 {"google.com",S_OK
,FALSE
},
3350 {"http://google.com/",S_OK
,FALSE
},
3351 {"google.com",S_OK
,FALSE
},
3354 {"google.com",S_OK
,FALSE
},
3359 {"http://google.com/",S_OK
,FALSE
},
3360 {"http",S_OK
,FALSE
},
3365 {Uri_HOST_DNS
,S_OK
,FALSE
},
3367 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3368 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3371 { "http://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
3373 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK
,FALSE
},
3374 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3375 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK
,FALSE
},
3376 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3379 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3381 {"/%0A%0A%0A",S_OK
,FALSE
},
3382 {"/%0A%0A%0A",S_OK
,FALSE
},
3384 {"http://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3385 {"http",S_OK
,FALSE
},
3390 {Uri_HOST_DNS
,S_OK
,FALSE
},
3392 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3393 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3396 { "zip://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
3398 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3399 {"g\noogle.co\rm",S_OK
,FALSE
},
3400 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3401 {"g\noogle.co\rm",S_OK
,FALSE
},
3404 {"g\noogle.co\rm",S_OK
,FALSE
},
3406 {"/\n\n\n",S_OK
,FALSE
},
3407 {"/\n\n\n",S_OK
,FALSE
},
3409 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3415 {Uri_HOST_DNS
,S_OK
,FALSE
},
3417 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3418 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3421 /* Since file URLs are usually hierarchical, it returns an empty string
3422 * for the absolute URI property since it was declared as an opaque URI.
3424 { "file:index.html", 0, S_OK
, FALSE
,
3428 {"file:index.html",S_OK
,FALSE
},
3430 {".html",S_OK
,FALSE
},
3434 {"index.html",S_OK
,FALSE
},
3435 {"index.html",S_OK
,FALSE
},
3437 {"file:index.html",S_OK
,FALSE
},
3438 {"file",S_OK
,FALSE
},
3443 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3445 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3446 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3449 /* Doesn't have an absolute since it's opaque, but gets it port set. */
3450 { "http:test.com/index.html", 0, S_OK
, FALSE
,
3454 {"http:test.com/index.html",S_OK
,FALSE
},
3456 {".html",S_OK
,FALSE
},
3460 {"test.com/index.html",S_OK
,FALSE
},
3461 {"test.com/index.html",S_OK
,FALSE
},
3463 {"http:test.com/index.html",S_OK
,FALSE
},
3464 {"http",S_OK
,FALSE
},
3469 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3471 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3472 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3475 { "ftp:test.com/index.html", 0, S_OK
, FALSE
,
3479 {"ftp:test.com/index.html",S_OK
,FALSE
},
3481 {".html",S_OK
,FALSE
},
3485 {"test.com/index.html",S_OK
,FALSE
},
3486 {"test.com/index.html",S_OK
,FALSE
},
3488 {"ftp:test.com/index.html",S_OK
,FALSE
},
3494 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3496 {URL_SCHEME_FTP
,S_OK
,FALSE
},
3497 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3500 { "file://C|/test.mp3", 0, S_OK
, FALSE
,
3502 {"file:///C:/test.mp3",S_OK
,FALSE
},
3504 {"file:///C:/test.mp3",S_OK
,FALSE
},
3506 {".mp3",S_OK
,FALSE
},
3510 {"/C:/test.mp3",S_OK
,FALSE
},
3511 {"/C:/test.mp3",S_OK
,FALSE
},
3513 {"file://C|/test.mp3",S_OK
,FALSE
},
3514 {"file",S_OK
,FALSE
},
3519 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3521 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3522 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3525 { "file:///C|/test.mp3", 0, S_OK
, FALSE
,
3527 {"file:///C:/test.mp3",S_OK
,FALSE
},
3529 {"file:///C:/test.mp3",S_OK
,FALSE
},
3531 {".mp3",S_OK
,FALSE
},
3535 {"/C:/test.mp3",S_OK
,FALSE
},
3536 {"/C:/test.mp3",S_OK
,FALSE
},
3538 {"file:///C|/test.mp3",S_OK
,FALSE
},
3539 {"file",S_OK
,FALSE
},
3544 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3546 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3547 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3550 /* Extra '/' isn't added before "c:" since USE_DOS_PATH is set and '/' are converted
3553 { "file://c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3555 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3557 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3559 {".html",S_OK
,FALSE
},
3563 {"c:\\dir\\index.html",S_OK
,FALSE
},
3564 {"c:\\dir\\index.html",S_OK
,FALSE
},
3566 {"file://c:/dir/index.html",S_OK
,FALSE
},
3567 {"file",S_OK
,FALSE
},
3572 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3574 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3575 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3578 /* Extra '/' after "file://" is removed. */
3579 { "file:///c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3581 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3583 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3585 {".html",S_OK
,FALSE
},
3589 {"c:\\dir\\index.html",S_OK
,FALSE
},
3590 {"c:\\dir\\index.html",S_OK
,FALSE
},
3592 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3593 {"file",S_OK
,FALSE
},
3598 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3600 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3601 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3604 /* Allow more characters when Uri_CREATE_FILE_USE_DOS_PATH is specified */
3605 { "file:///c:/dir\\%%61%20%5Fname/file%2A.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3607 {"file://c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3609 {"file://c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3611 {".html",S_OK
,FALSE
},
3615 {"c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3616 {"c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3618 {"file:///c:/dir\\%%61%20%5Fname/file%2A.html",S_OK
,FALSE
},
3619 {"file",S_OK
,FALSE
},
3624 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3626 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3627 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3630 { "file://c|/dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3632 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3634 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3636 {".html",S_OK
,FALSE
},
3640 {"c:\\dir\\index.html",S_OK
,FALSE
},
3641 {"c:\\dir\\index.html",S_OK
,FALSE
},
3643 {"file://c|/dir\\index.html",S_OK
,FALSE
},
3644 {"file",S_OK
,FALSE
},
3649 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3651 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3652 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3655 /* The backslashes after the scheme name are converted to forward slashes. */
3656 { "file:\\\\c:\\dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3658 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3660 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3662 {".html",S_OK
,FALSE
},
3666 {"c:\\dir\\index.html",S_OK
,FALSE
},
3667 {"c:\\dir\\index.html",S_OK
,FALSE
},
3669 {"file:\\\\c:\\dir\\index.html",S_OK
,FALSE
},
3670 {"file",S_OK
,FALSE
},
3675 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3677 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3678 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3681 { "file:\\\\c:/dir/index.html", 0, S_OK
, FALSE
,
3683 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3685 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3687 {".html",S_OK
,FALSE
},
3691 {"/c:/dir/index.html",S_OK
,FALSE
},
3692 {"/c:/dir/index.html",S_OK
,FALSE
},
3694 {"file:\\\\c:/dir/index.html",S_OK
,FALSE
},
3695 {"file",S_OK
,FALSE
},
3700 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3702 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3703 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3706 { "http:\\\\google.com", 0, S_OK
, FALSE
,
3708 {"http://google.com/",S_OK
,FALSE
},
3709 {"google.com",S_OK
,FALSE
},
3710 {"http://google.com/",S_OK
,FALSE
},
3711 {"google.com",S_OK
,FALSE
},
3714 {"google.com",S_OK
,FALSE
},
3719 {"http:\\\\google.com",S_OK
,FALSE
},
3720 {"http",S_OK
,FALSE
},
3725 {Uri_HOST_DNS
,S_OK
,FALSE
},
3727 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3728 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3731 /* the "\\\\" aren't converted to "//" for unknown scheme types and it's considered opaque. */
3732 { "zip:\\\\google.com", 0, S_OK
, FALSE
,
3734 {"zip:\\\\google.com",S_OK
,FALSE
},
3736 {"zip:\\\\google.com",S_OK
,FALSE
},
3738 {".com",S_OK
,FALSE
},
3742 {"\\\\google.com",S_OK
,FALSE
},
3743 {"\\\\google.com",S_OK
,FALSE
},
3745 {"zip:\\\\google.com",S_OK
,FALSE
},
3751 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3753 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3754 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3757 /* Dot segments aren't removed. */
3758 { "file://c:\\dir\\../..\\./index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3760 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3762 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3764 {".html",S_OK
,FALSE
},
3768 {"c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3769 {"c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3771 {"file://c:\\dir\\../..\\./index.html",S_OK
,FALSE
},
3772 {"file",S_OK
,FALSE
},
3777 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3779 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3780 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3783 /* Forbidden characters aren't percent encoded. */
3784 { "file://c:\\dir\\i^|ndex.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3786 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3788 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3790 {".html",S_OK
,FALSE
},
3794 {"c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3795 {"c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3797 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3798 {"file",S_OK
,FALSE
},
3803 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3805 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3806 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3809 /* The '\' are still converted to '/' even though it's an opaque file URI. */
3810 { "file:c:\\dir\\../..\\index.html", 0, S_OK
, FALSE
,
3814 {"file:c:/dir/../../index.html",S_OK
,FALSE
},
3816 {".html",S_OK
,FALSE
},
3820 {"c:/dir/../../index.html",S_OK
,FALSE
},
3821 {"c:/dir/../../index.html",S_OK
,FALSE
},
3823 {"file:c:\\dir\\../..\\index.html",S_OK
,FALSE
},
3824 {"file",S_OK
,FALSE
},
3829 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3831 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3832 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3835 /* '/' are still converted to '\' even though it's an opaque URI. */
3836 { "file:c:/dir\\../..\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3840 {"file:c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3842 {".html",S_OK
,FALSE
},
3846 {"c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3847 {"c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3849 {"file:c:/dir\\../..\\index.html",S_OK
,FALSE
},
3850 {"file",S_OK
,FALSE
},
3855 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3857 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3858 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3861 /* Forbidden characters aren't percent encoded. */
3862 { "file:c:\\in^|dex.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3866 {"file:c:\\in^|dex.html",S_OK
,FALSE
},
3868 {".html",S_OK
,FALSE
},
3872 {"c:\\in^|dex.html",S_OK
,FALSE
},
3873 {"c:\\in^|dex.html",S_OK
,FALSE
},
3875 {"file:c:\\in^|dex.html",S_OK
,FALSE
},
3876 {"file",S_OK
,FALSE
},
3881 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3883 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3884 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3887 /* Doesn't have a UserName since the ':' appears at the beginning of the
3890 { "http://:password@gov.uk", 0, S_OK
, FALSE
,
3892 {"http://:password@gov.uk/",S_OK
,FALSE
},
3893 {":password@gov.uk",S_OK
,FALSE
},
3894 {"http://gov.uk/",S_OK
,FALSE
},
3898 {"gov.uk",S_OK
,FALSE
},
3899 {"password",S_OK
,FALSE
},
3903 {"http://:password@gov.uk",S_OK
,FALSE
},
3904 {"http",S_OK
,FALSE
},
3905 {":password",S_OK
,FALSE
},
3909 {Uri_HOST_DNS
,S_OK
,FALSE
},
3911 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3912 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3915 /* Has a UserName since the userinfo section doesn't contain a password. */
3916 { "http://@gov.uk", 0, S_OK
, FALSE
,
3918 {"http://gov.uk/",S_OK
,FALSE
,"http://@gov.uk/"},
3919 {"@gov.uk",S_OK
,FALSE
},
3920 {"http://gov.uk/",S_OK
,FALSE
},
3924 {"gov.uk",S_OK
,FALSE
},
3929 {"http://@gov.uk",S_OK
,FALSE
},
3930 {"http",S_OK
,FALSE
},
3935 {Uri_HOST_DNS
,S_OK
,FALSE
},
3937 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3938 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3941 /* ":@" not included in the absolute URI. */
3942 { "http://:@gov.uk", 0, S_OK
, FALSE
,
3944 {"http://gov.uk/",S_OK
,FALSE
,"http://:@gov.uk/"},
3945 {":@gov.uk",S_OK
,FALSE
},
3946 {"http://gov.uk/",S_OK
,FALSE
},
3950 {"gov.uk",S_OK
,FALSE
},
3955 {"http://:@gov.uk",S_OK
,FALSE
},
3956 {"http",S_OK
,FALSE
},
3961 {Uri_HOST_DNS
,S_OK
,FALSE
},
3963 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3964 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3967 /* '@' is included because it's an unknown scheme type. */
3968 { "zip://@gov.uk", 0, S_OK
, FALSE
,
3970 {"zip://@gov.uk/",S_OK
,FALSE
},
3971 {"@gov.uk",S_OK
,FALSE
},
3972 {"zip://@gov.uk/",S_OK
,FALSE
},
3976 {"gov.uk",S_OK
,FALSE
},
3981 {"zip://@gov.uk",S_OK
,FALSE
},
3987 {Uri_HOST_DNS
,S_OK
,FALSE
},
3989 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3990 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3993 /* ":@" are included because it's an unknown scheme type. */
3994 { "zip://:@gov.uk", 0, S_OK
, FALSE
,
3996 {"zip://:@gov.uk/",S_OK
,FALSE
},
3997 {":@gov.uk",S_OK
,FALSE
},
3998 {"zip://:@gov.uk/",S_OK
,FALSE
},
4002 {"gov.uk",S_OK
,FALSE
},
4007 {"zip://:@gov.uk",S_OK
,FALSE
},
4013 {Uri_HOST_DNS
,S_OK
,FALSE
},
4015 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4016 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4019 { "about:blank", 0, S_OK
, FALSE
,
4021 {"about:blank",S_OK
,FALSE
},
4023 {"about:blank",S_OK
,FALSE
},
4029 {"blank",S_OK
,FALSE
},
4030 {"blank",S_OK
,FALSE
},
4032 {"about:blank",S_OK
,FALSE
},
4033 {"about",S_OK
,FALSE
},
4038 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4040 {URL_SCHEME_ABOUT
,S_OK
,FALSE
},
4041 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4044 { "mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",0,S_OK
,FALSE
,
4046 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
4048 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
4050 {".htm",S_OK
,FALSE
},
4054 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
4055 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
4057 {"mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
4063 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4065 {URL_SCHEME_MK
,S_OK
,FALSE
},
4066 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4069 { "mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",0,S_OK
,FALSE
,
4071 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
4073 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
4075 {".htm",S_OK
,FALSE
},
4079 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
4080 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
4082 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
4088 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4090 {URL_SCHEME_MK
,S_OK
,FALSE
},
4091 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4094 /* Two '\' are added to the URI when USE_DOS_PATH is set, and it's a UNC path. */
4095 { "file://server/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
4097 {"file://\\\\server\\dir\\index.html",S_OK
,FALSE
},
4098 {"server",S_OK
,FALSE
},
4099 {"file://\\\\server\\dir\\index.html",S_OK
,FALSE
},
4101 {".html",S_OK
,FALSE
},
4103 {"server",S_OK
,FALSE
},
4105 {"\\dir\\index.html",S_OK
,FALSE
},
4106 {"\\dir\\index.html",S_OK
,FALSE
},
4108 {"file://server/dir/index.html",S_OK
,FALSE
},
4109 {"file",S_OK
,FALSE
},
4114 {Uri_HOST_DNS
,S_OK
,FALSE
},
4116 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4117 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4120 /* When CreateUri generates an IUri, it still displays the default port in the
4123 { "http://google.com:80/", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4125 {"http://google.com:80/",S_OK
,FALSE
},
4126 {"google.com:80",S_OK
,FALSE
},
4127 {"http://google.com:80/",S_OK
,FALSE
},
4128 {"google.com",S_OK
,FALSE
},
4131 {"google.com",S_OK
,FALSE
},
4136 {"http://google.com:80/",S_OK
,FALSE
},
4137 {"http",S_OK
,FALSE
},
4142 {Uri_HOST_DNS
,S_OK
,FALSE
},
4144 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
4145 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4148 /* For res URIs the host is everything up until the first '/'. */
4149 { "res://C:\\dir\\file.exe/DATA/test.html", 0, S_OK
, FALSE
,
4151 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK
,FALSE
},
4152 {"C:\\dir\\file.exe",S_OK
,FALSE
},
4153 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK
,FALSE
},
4155 {".html",S_OK
,FALSE
},
4157 {"C:\\dir\\file.exe",S_OK
,FALSE
},
4159 {"/DATA/test.html",S_OK
,FALSE
},
4160 {"/DATA/test.html",S_OK
,FALSE
},
4162 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK
,FALSE
},
4168 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4170 {URL_SCHEME_RES
,S_OK
,FALSE
},
4171 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4174 /* Res URI can contain a '|' in the host name. */
4175 { "res://c:\\di|r\\file.exe/test", 0, S_OK
, FALSE
,
4177 {"res://c:\\di|r\\file.exe/test",S_OK
,FALSE
},
4178 {"c:\\di|r\\file.exe",S_OK
,FALSE
},
4179 {"res://c:\\di|r\\file.exe/test",S_OK
,FALSE
},
4183 {"c:\\di|r\\file.exe",S_OK
,FALSE
},
4185 {"/test",S_OK
,FALSE
},
4186 {"/test",S_OK
,FALSE
},
4188 {"res://c:\\di|r\\file.exe/test",S_OK
,FALSE
},
4194 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4196 {URL_SCHEME_RES
,S_OK
,FALSE
},
4197 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
4200 /* Res URIs can have invalid percent encoded values. */
4201 { "res://c:\\dir%xx\\file.exe/test", 0, S_OK
, FALSE
,
4203 {"res://c:\\dir%xx\\file.exe/test",S_OK
,FALSE
},
4204 {"c:\\dir%xx\\file.exe",S_OK
,FALSE
},
4205 {"res://c:\\dir%xx\\file.exe/test",S_OK
,FALSE
},
4209 {"c:\\dir%xx\\file.exe",S_OK
,FALSE
},
4211 {"/test",S_OK
,FALSE
},
4212 {"/test",S_OK
,FALSE
},
4214 {"res://c:\\dir%xx\\file.exe/test",S_OK
,FALSE
},
4220 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4222 {URL_SCHEME_RES
,S_OK
,FALSE
},
4223 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4226 /* Res doesn't get forbidden characters percent encoded in its path. */
4227 { "res://c:\\test/tes<|>t", 0, S_OK
, FALSE
,
4229 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4230 {"c:\\test",S_OK
,FALSE
},
4231 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4235 {"c:\\test",S_OK
,FALSE
},
4237 {"/tes<|>t",S_OK
,FALSE
},
4238 {"/tes<|>t",S_OK
,FALSE
},
4240 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4246 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4248 {URL_SCHEME_RES
,S_OK
,FALSE
},
4249 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4252 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK
, FALSE
,
4254 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4256 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4258 {".jpg",S_OK
,FALSE
},
4262 {"@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4263 {"@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4265 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4271 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4273 {URL_SCHEME_MK
,S_OK
,FALSE
},
4274 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4277 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4279 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4281 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4283 {".jpg",S_OK
,FALSE
},
4287 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4288 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4290 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4296 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4298 {URL_SCHEME_MK
,S_OK
,FALSE
},
4299 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4302 { "xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK
, FALSE
,
4304 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4306 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4308 {".jpg",S_OK
,FALSE
},
4312 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4313 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4315 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4321 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4323 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4324 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4327 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg", 0, S_OK
, FALSE
,
4329 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4331 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4333 {".jpg",S_OK
,FALSE
},
4337 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4338 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4340 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg",S_OK
,FALSE
},
4346 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4348 {URL_SCHEME_MK
,S_OK
,FALSE
},
4349 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4352 { "mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg", 0, S_OK
, FALSE
,
4354 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4356 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4358 {".jpg",S_OK
,FALSE
},
4362 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4363 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4365 {"mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg",S_OK
,FALSE
},
4371 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4373 {URL_SCHEME_MK
,S_OK
,FALSE
},
4374 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4377 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg", 0, S_OK
, FALSE
,
4379 {"mk:images/xxx.jpg",S_OK
,FALSE
},
4381 {"mk:images/xxx.jpg",S_OK
,FALSE
},
4383 {".jpg",S_OK
,FALSE
},
4387 {"images/xxx.jpg",S_OK
,FALSE
},
4388 {"images/xxx.jpg",S_OK
,FALSE
},
4390 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg",S_OK
,FALSE
},
4396 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4398 {URL_SCHEME_MK
,S_OK
,FALSE
},
4399 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4402 { "", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4421 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4423 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4424 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4427 { " \t ", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4446 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4448 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4449 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4452 { "javascript:void", 0, S_OK
, FALSE
,
4454 {"javascript:void",S_OK
},
4456 {"javascript:void",S_OK
},
4465 {"javascript:void",S_OK
},
4466 {"javascript",S_OK
},
4471 {Uri_HOST_UNKNOWN
,S_OK
},
4473 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4474 {URLZONE_INVALID
,E_NOTIMPL
}
4477 { "javascript://undefined", 0, S_OK
, FALSE
,
4479 {"javascript://undefined",S_OK
},
4481 {"javascript://undefined",S_OK
},
4487 {"//undefined",S_OK
},
4488 {"//undefined",S_OK
},
4490 {"javascript://undefined",S_OK
},
4491 {"javascript",S_OK
},
4496 {Uri_HOST_UNKNOWN
,S_OK
},
4498 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4499 {URLZONE_INVALID
,E_NOTIMPL
}
4502 { "JavaSCript:escape('/\\?#?')", 0, S_OK
, FALSE
,
4504 {"javascript:escape('/\\?#?')",S_OK
},
4506 {"javascript:escape('/\\?#?')",S_OK
},
4512 {"escape('/\\?#?')",S_OK
},
4513 {"escape('/\\?#?')",S_OK
},
4515 {"JavaSCript:escape('/\\?#?')",S_OK
},
4516 {"javascript",S_OK
},
4521 {Uri_HOST_UNKNOWN
,S_OK
},
4523 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4524 {URLZONE_INVALID
,E_NOTIMPL
}
4527 { "*://google.com", 0, S_OK
, FALSE
,
4529 {"*:google.com/",S_OK
,FALSE
},
4530 {"google.com",S_OK
},
4531 {"*:google.com/",S_OK
,FALSE
},
4532 {"google.com",S_OK
,FALSE
},
4535 {"google.com",S_OK
,FALSE
},
4540 {"*://google.com",S_OK
,FALSE
},
4546 {Uri_HOST_DNS
,S_OK
,FALSE
},
4548 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
4549 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4552 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",0,S_OK
,FALSE
,
4554 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4556 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4562 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4563 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4565 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4571 {Uri_HOST_UNKNOWN
,S_OK
},
4573 {URL_SCHEME_MK
,S_OK
},
4574 {URLZONE_INVALID
,E_NOTIMPL
}
4577 { "gopher://test.winehq.org:151/file.txt",0,S_OK
,FALSE
,
4579 {"gopher://test.winehq.org:151/file.txt",S_OK
},
4580 {"test.winehq.org:151",S_OK
},
4581 {"gopher://test.winehq.org:151/file.txt",S_OK
},
4582 {"winehq.org",S_OK
},
4585 {"test.winehq.org",S_OK
},
4590 {"gopher://test.winehq.org:151/file.txt",S_OK
},
4596 {Uri_HOST_DNS
,S_OK
},
4598 {URL_SCHEME_GOPHER
,S_OK
},
4599 {URLZONE_INVALID
,E_NOTIMPL
}
4602 { "//host.com/path/file.txt?query", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4604 {"//host.com/path/file.txt?query",S_OK
},
4606 {"//host.com/path/file.txt?query",S_OK
},
4612 {"/path/file.txt",S_OK
},
4613 {"/path/file.txt?query",S_OK
},
4615 {"//host.com/path/file.txt?query",S_OK
},
4621 {Uri_HOST_DNS
,S_OK
},
4623 {URL_SCHEME_UNKNOWN
,S_OK
},
4624 {URLZONE_INVALID
,E_NOTIMPL
}
4627 { "//host/path/file.txt?query", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4629 {"//host/path/file.txt?query",S_OK
},
4631 {"//host/path/file.txt?query",S_OK
},
4637 {"/path/file.txt",S_OK
},
4638 {"/path/file.txt?query",S_OK
},
4640 {"//host/path/file.txt?query",S_OK
},
4646 {Uri_HOST_DNS
,S_OK
},
4648 {URL_SCHEME_UNKNOWN
,S_OK
},
4649 {URLZONE_INVALID
,E_NOTIMPL
}
4652 { "//host", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4671 {Uri_HOST_DNS
,S_OK
},
4673 {URL_SCHEME_UNKNOWN
,S_OK
},
4674 {URLZONE_INVALID
,E_NOTIMPL
}
4677 { "mailto://", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4690 {"mailto://",S_OK
,FALSE
,"mailto:"},
4696 {Uri_HOST_UNKNOWN
,S_OK
},
4698 {URL_SCHEME_MAILTO
,S_OK
},
4699 {URLZONE_INVALID
,E_NOTIMPL
}
4702 { "mailto://a@b.com", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4704 {"mailto:a@b.com",S_OK
},
4706 {"mailto:a@b.com",S_OK
},
4715 {"mailto://a@b.com",S_OK
,FALSE
,"mailto:a@b.com"},
4721 {Uri_HOST_UNKNOWN
,S_OK
},
4723 {URL_SCHEME_MAILTO
,S_OK
},
4724 {URLZONE_INVALID
,E_NOTIMPL
}
4727 { "c:\\test file.html", Uri_CREATE_FILE_USE_DOS_PATH
|Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4729 {"file://c:\\test file.html",S_OK
,FALSE
},
4731 {"file://c:\\test file.html",S_OK
,FALSE
},
4733 {".html",S_OK
,FALSE
},
4737 {"c:\\test file.html",S_OK
,FALSE
},
4738 {"c:\\test file.html",S_OK
,FALSE
},
4740 {"c:\\test file.html",S_OK
,FALSE
},
4741 {"file",S_OK
,FALSE
},
4746 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4748 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4749 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4752 { "c:\\test%20file.html", Uri_CREATE_FILE_USE_DOS_PATH
|Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4754 {"file://c:\\test%20file.html",S_OK
,FALSE
},
4756 {"file://c:\\test%20file.html",S_OK
,FALSE
},
4758 {".html",S_OK
,FALSE
},
4762 {"c:\\test%20file.html",S_OK
,FALSE
},
4763 {"c:\\test%20file.html",S_OK
,FALSE
},
4765 {"c:\\test%20file.html",S_OK
,FALSE
},
4766 {"file",S_OK
,FALSE
},
4771 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4773 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4774 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4777 { "c:\\test file.html", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4779 {"file:///c:/test%20file.html",S_OK
,FALSE
},
4781 {"file:///c:/test%20file.html",S_OK
,FALSE
},
4783 {".html",S_OK
,FALSE
},
4787 {"/c:/test%20file.html",S_OK
,FALSE
},
4788 {"/c:/test%20file.html",S_OK
,FALSE
},
4790 {"c:\\test file.html",S_OK
,FALSE
},
4791 {"file",S_OK
,FALSE
},
4796 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4798 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4799 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4802 { "c:\\test%20file.html", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4804 {"file:///c:/test%2520file.html",S_OK
,FALSE
},
4806 {"file:///c:/test%2520file.html",S_OK
,FALSE
},
4808 {".html",S_OK
,FALSE
},
4812 {"/c:/test%2520file.html",S_OK
,FALSE
},
4813 {"/c:/test%2520file.html",S_OK
,FALSE
},
4815 {"c:\\test%20file.html",S_OK
,FALSE
},
4816 {"file",S_OK
,FALSE
},
4821 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4823 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4824 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4827 /* Path with Unicode characters. Unicode characters should not be encoded */
4828 {/* "http://127.0.0.1/测试/test.txt" with Chinese in UTF-8 encoding */
4829 "http://127.0.0.1/\xE6\xB5\x8B\xE8\xAF\x95/test.txt", 0, S_OK
, FALSE
,
4831 {"http://127.0.0.1/\xE6\xB5\x8B\xE8\xAF\x95/test.txt",S_OK
,FALSE
},
4832 {"127.0.0.1",S_OK
,FALSE
},
4833 {"http://127.0.0.1/\xE6\xB5\x8B\xE8\xAF\x95/test.txt",S_OK
,FALSE
},
4835 {".txt",S_OK
,FALSE
},
4837 {"127.0.0.1",S_OK
,FALSE
},
4839 {"/\xE6\xB5\x8B\xE8\xAF\x95/test.txt",S_OK
,FALSE
},
4840 {"/\xE6\xB5\x8B\xE8\xAF\x95/test.txt",S_OK
,FALSE
},
4842 {"http://127.0.0.1/\xE6\xB5\x8B\xE8\xAF\x95/test.txt",S_OK
,FALSE
},
4843 {"http",S_OK
,FALSE
},
4848 {Uri_HOST_IPV4
,S_OK
,FALSE
},
4850 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
4851 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4854 { "file:\xE6\xB5\x8B\xE8\xAF\x95.html", 0, S_OK
, FALSE
,
4858 {"file:\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK
,FALSE
},
4860 {".html",S_OK
,FALSE
},
4864 {"\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK
,FALSE
},
4865 {"\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK
,FALSE
},
4867 {"file:\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK
,FALSE
},
4868 {"file",S_OK
,FALSE
},
4873 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4875 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4876 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4879 /* Username with Unicode characters. Unicode characters should not be encoded */
4880 { "ftp://\xE6\xB5\x8B\xE8\xAF\x95:wine@ftp.winehq.org:9999/dir/foobar.txt", 0, S_OK
, FALSE
,
4882 {"ftp://\xE6\xB5\x8B\xE8\xAF\x95:wine@ftp.winehq.org:9999/dir/foobar.txt",S_OK
,FALSE
},
4883 {"\xE6\xB5\x8B\xE8\xAF\x95:wine@ftp.winehq.org:9999",S_OK
,FALSE
},
4884 {"ftp://ftp.winehq.org:9999/dir/foobar.txt",S_OK
,FALSE
},
4885 {"winehq.org",S_OK
,FALSE
},
4886 {".txt",S_OK
,FALSE
},
4888 {"ftp.winehq.org",S_OK
,FALSE
},
4889 {"wine",S_OK
,FALSE
},
4890 {"/dir/foobar.txt",S_OK
,FALSE
},
4891 {"/dir/foobar.txt",S_OK
,FALSE
},
4893 {"ftp://\xE6\xB5\x8B\xE8\xAF\x95:wine@ftp.winehq.org:9999/dir/foobar.txt",S_OK
,FALSE
},
4895 {"\xE6\xB5\x8B\xE8\xAF\x95:wine",S_OK
,FALSE
},
4896 {"\xE6\xB5\x8B\xE8\xAF\x95",S_OK
,FALSE
}
4899 {Uri_HOST_DNS
,S_OK
,FALSE
},
4901 {URL_SCHEME_FTP
,S_OK
,FALSE
},
4902 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4905 /* Password with Unicode characters. Unicode characters should not be encoded */
4906 { "ftp://winepass:\xE6\xB5\x8B\xE8\xAF\x95@ftp.winehq.org:9999/dir/foobar.txt", 0, S_OK
, FALSE
,
4908 {"ftp://winepass:\xE6\xB5\x8B\xE8\xAF\x95@ftp.winehq.org:9999/dir/foobar.txt",S_OK
,FALSE
},
4909 {"winepass:\xE6\xB5\x8B\xE8\xAF\x95@ftp.winehq.org:9999",S_OK
,FALSE
},
4910 {"ftp://ftp.winehq.org:9999/dir/foobar.txt",S_OK
,FALSE
},
4911 {"winehq.org",S_OK
,FALSE
},
4912 {".txt",S_OK
,FALSE
},
4914 {"ftp.winehq.org",S_OK
,FALSE
},
4915 {"\xE6\xB5\x8B\xE8\xAF\x95",S_OK
,FALSE
},
4916 {"/dir/foobar.txt",S_OK
,FALSE
},
4917 {"/dir/foobar.txt",S_OK
,FALSE
},
4919 {"ftp://winepass:\xE6\xB5\x8B\xE8\xAF\x95@ftp.winehq.org:9999/dir/foobar.txt",S_OK
,FALSE
},
4921 {"winepass:\xE6\xB5\x8B\xE8\xAF\x95",S_OK
,FALSE
},
4922 {"winepass",S_OK
,FALSE
}
4925 {Uri_HOST_DNS
,S_OK
,FALSE
},
4927 {URL_SCHEME_FTP
,S_OK
,FALSE
},
4928 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4931 /* Query with Unicode characters. Unicode characters should not be encoded */
4932 { "http://www.winehq.org/tests/..?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y", 0, S_OK
, FALSE
,
4934 {"http://www.winehq.org/?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y",S_OK
,FALSE
},
4935 {"www.winehq.org",S_OK
,FALSE
},
4936 {"http://www.winehq.org/?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y",S_OK
,FALSE
},
4937 {"winehq.org",S_OK
,FALSE
},
4940 {"www.winehq.org",S_OK
,FALSE
},
4943 {"/?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y",S_OK
,FALSE
},
4944 {"?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y",S_OK
,FALSE
},
4945 {"http://www.winehq.org/tests/..?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y",S_OK
,FALSE
},
4946 {"http",S_OK
,FALSE
},
4951 {Uri_HOST_DNS
,S_OK
,FALSE
},
4953 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
4954 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
4957 /* Fragment with Unicode characters. Unicode characters should not be encoded */
4958 { "http://www.winehq.org/tests/#\xE6\xB5\x8B\xE8\xAF\x95", 0, S_OK
, FALSE
,
4960 {"http://www.winehq.org/tests/#\xE6\xB5\x8B\xE8\xAF\x95",S_OK
,FALSE
},
4961 {"www.winehq.org",S_OK
,FALSE
},
4962 {"http://www.winehq.org/tests/#\xE6\xB5\x8B\xE8\xAF\x95",S_OK
,FALSE
},
4963 {"winehq.org",S_OK
,FALSE
},
4965 {"#\xE6\xB5\x8B\xE8\xAF\x95",S_OK
,FALSE
},
4966 {"www.winehq.org",S_OK
,FALSE
},
4968 {"/tests/",S_OK
,FALSE
},
4969 {"/tests/",S_OK
,FALSE
},
4971 {"http://www.winehq.org/tests/#\xE6\xB5\x8B\xE8\xAF\x95",S_OK
,FALSE
},
4972 {"http",S_OK
,FALSE
},
4977 {Uri_HOST_DNS
,S_OK
,FALSE
},
4979 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
4980 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
4983 /* ZERO WIDTH JOINER as non-printing Unicode characters should not be encoded if not preprocessed. */
4984 { "file:a\xE2\x80\x8D.html", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
4988 {"file:a\xE2\x80\x8D.html",S_OK
,FALSE
},
4990 {".html",S_OK
,FALSE
},
4994 {"a\xE2\x80\x8D.html",S_OK
,FALSE
},
4995 {"a\xE2\x80\x8D.html",S_OK
,FALSE
},
4997 {"file:a\xE2\x80\x8D.html",S_OK
,FALSE
},
4998 {"file",S_OK
,FALSE
},
5003 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
5005 {URL_SCHEME_FILE
,S_OK
,FALSE
},
5006 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
5009 /* LEFT-TO-RIGHT MARK as non-printing Unicode characters should not be encoded if not preprocessed. */
5010 { "file:ab\xE2\x80\x8E.html", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
5014 {"file:ab\xE2\x80\x8D.html",S_OK
,FALSE
},
5016 {".html",S_OK
,FALSE
},
5020 {"ab\xE2\x80\x8D.html",S_OK
,FALSE
},
5021 {"ab\xE2\x80\x8D.html",S_OK
,FALSE
},
5023 {"file:ab\xE2\x80\x8D.html",S_OK
,FALSE
},
5024 {"file",S_OK
,FALSE
},
5029 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
5031 {URL_SCHEME_FILE
,S_OK
,FALSE
},
5032 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
5035 /* Invalid Unicode characters should not be filtered */
5036 { "file:ab\xc3\x28.html", 0, S_OK
, FALSE
,
5040 {"file:ab\xc3\x28.html",S_OK
,FALSE
},
5042 {".html",S_OK
,FALSE
},
5046 {"ab\xc3\x28.html",S_OK
,FALSE
},
5047 {"ab\xc3\x28.html",S_OK
,FALSE
},
5049 {"file:ab\xc3\x28.html",S_OK
,FALSE
},
5050 {"file",S_OK
,FALSE
},
5055 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
5057 {URL_SCHEME_FILE
,S_OK
,FALSE
},
5058 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
5061 /* Make sure % encoded unicode characters are not decoded. */
5062 { "ftp://%E6%B5%8B%E8%AF%95:%E6%B5%8B%E8%AF%95@ftp.google.com/", 0, S_OK
, FALSE
,
5064 {"ftp://%E6%B5%8B%E8%AF%95:%E6%B5%8B%E8%AF%95@ftp.google.com/",S_OK
,FALSE
},
5065 {"%E6%B5%8B%E8%AF%95:%E6%B5%8B%E8%AF%95@ftp.google.com",S_OK
,FALSE
},
5066 {"ftp://ftp.google.com/",S_OK
,FALSE
},
5067 {"google.com",S_OK
,FALSE
},
5070 {"ftp.google.com",S_OK
,FALSE
},
5071 {"%E6%B5%8B%E8%AF%95",S_OK
,FALSE
},
5075 {"ftp://%E6%B5%8B%E8%AF%95:%E6%B5%8B%E8%AF%95@ftp.google.com/",S_OK
,FALSE
},
5077 {"%E6%B5%8B%E8%AF%95:%E6%B5%8B%E8%AF%95",S_OK
,FALSE
},
5078 {"%E6%B5%8B%E8%AF%95",S_OK
,FALSE
}
5081 {Uri_HOST_DNS
,S_OK
,FALSE
},
5083 {URL_SCHEME_FTP
,S_OK
,FALSE
},
5084 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
5089 typedef struct _invalid_uri
{
5095 static const invalid_uri invalid_uri_tests
[] = {
5096 /* Has to have a scheme name. */
5097 {"://www.winehq.org",0,FALSE
},
5098 /* Windows doesn't like URIs which are implicitly file paths without the
5099 * ALLOW_IMPLICIT_FILE_SCHEME flag set.
5101 {"C:/test/test.mp3",0,FALSE
},
5102 {"\\\\Server/test/test.mp3",0,FALSE
},
5103 {"C:/test/test.mp3",Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
,FALSE
},
5104 {"\\\\Server/test/test.mp3",Uri_CREATE_ALLOW_RELATIVE
,FALSE
},
5105 /* Invalid schemes. */
5106 {"*abcd://not.valid.com",0,FALSE
},
5107 {"*a*b*c*d://not.valid.com",0,FALSE
},
5108 /* Not allowed to have invalid % encoded data. */
5109 {"ftp://google.co%XX/",0,FALSE
},
5110 /* Too many h16 components. */
5111 {"http://[1:2:3:4:5:6:7:8:9]",0,FALSE
},
5112 /* Not enough room for IPv4 address. */
5113 {"http://[1:2:3:4:5:6:7:192.0.1.0]",0,FALSE
},
5114 /* Not enough h16 components. */
5115 {"http://[1:2:3:4]",0,FALSE
},
5116 /* Not enough components including IPv4. */
5117 {"http://[1:192.0.1.0]",0,FALSE
},
5118 /* Not allowed to have partial IPv4 in IPv6. */
5119 {"http://[::192.0]",0,FALSE
},
5120 /* Expects a valid IP Literal. */
5121 {"ftp://[not.valid.uri]/",0,FALSE
},
5122 /* Expects valid port for a known scheme type. */
5123 {"ftp://www.winehq.org:123fgh",0,FALSE
},
5124 /* Port exceeds USHORT_MAX for known scheme type. */
5125 {"ftp://www.winehq.org:65536",0,FALSE
},
5126 /* Invalid port with IPv4 address. */
5127 {"http://www.winehq.org:1abcd",0,FALSE
},
5128 /* Invalid port with IPv6 address. */
5129 {"http://[::ffff]:32xy",0,FALSE
},
5130 /* Not allowed to have backslashes with NO_CANONICALIZE. */
5131 {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE
,FALSE
},
5132 /* Not allowed to have invalid % encoded data in opaque URI path. */
5133 {"news:test%XX",0,FALSE
},
5134 {"mailto:wine@winehq%G8.com",0,FALSE
},
5135 /* Known scheme types can't have invalid % encoded data in query string. */
5136 {"http://google.com/?query=te%xx",0,FALSE
},
5137 /* Invalid % encoded data in fragment of know scheme type. */
5138 {"ftp://google.com/#Test%xx",0,FALSE
},
5139 {" http://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
5140 {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
5141 {"file://c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5142 {"file://c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5143 {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5144 {"file:c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5145 {"file:c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5146 {"file:c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5147 /* res URIs aren't allowed to have forbidden dos path characters in the
5150 {"res://c:\\te<st\\test/test",0,FALSE
},
5151 {"res://c:\\te>st\\test/test",0,FALSE
},
5152 {"res://c:\\te\"st\\test/test",0,FALSE
},
5153 {"res://c:\\test/te%xxst",0,FALSE
}
5156 typedef struct _uri_equality
{
5158 DWORD create_flags_a
;
5160 DWORD create_flags_b
;
5165 static const uri_equality equality_tests
[] = {
5167 "HTTP://www.winehq.org/test dir/./",0,
5168 "http://www.winehq.org/test dir/../test dir/",0,
5172 /* http://www.winehq.org/test%20dir */
5173 "http://%77%77%77%2E%77%69%6E%65%68%71%2E%6F%72%67/%74%65%73%74%20%64%69%72",0,
5174 "http://www.winehq.org/test dir",0,
5178 "c:\\test.mp3",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
5179 "file:///c:/test.mp3",0,
5183 "ftp://ftp.winehq.org/",0,
5184 "ftp://ftp.winehq.org",0,
5188 "ftp://ftp.winehq.org/test/test2/../../testB/",0,
5189 "ftp://ftp.winehq.org/t%45stB/",0,
5193 "http://google.com/TEST",0,
5194 "http://google.com/test",0,
5198 "http://GOOGLE.com/",0,
5199 "http://google.com/",0,
5202 /* Performs case insensitive compare of host names (for known scheme types). */
5204 "ftp://GOOGLE.com/",Uri_CREATE_NO_CANONICALIZE
,
5205 "ftp://google.com/",0,
5209 "zip://GOOGLE.com/",0,
5210 "zip://google.com/",0,
5214 "file:///c:/TEST/TeST/",0,
5215 "file:///c:/test/test/",0,
5219 "file:///server/TEST",0,
5220 "file:///SERVER/TEST",0,
5224 "http://google.com",Uri_CREATE_NO_CANONICALIZE
,
5225 "http://google.com/",0,
5229 "ftp://google.com:21/",0,
5230 "ftp://google.com/",0,
5234 "http://google.com:80/",Uri_CREATE_NO_CANONICALIZE
,
5235 "http://google.com/",0,
5239 "http://google.com:70/",0,
5240 "http://google.com:71/",0,
5244 "file:///c:/dir/file.txt", 0,
5245 "file:///c:/dir/file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
5249 "file:///c:/dir/file.txt", 0,
5250 "file:///c:\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
5254 "file:///c:/dir/file.txt", 0,
5255 "file:///c:\\dir2\\..\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
5259 "file:///c:\\dir2\\..\\ dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
5260 "file:///c:/%20dir/file.txt", 0,
5264 "file:///c:/Dir/file.txt", 0,
5265 "file:///C:/dir/file.TXT", Uri_CREATE_FILE_USE_DOS_PATH
,
5269 "file:///c:/dir/file.txt", 0,
5270 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
5274 "file:///c:/dir/file.txt#a", 0,
5275 "file:///c:\\dir\\file.txt#b", Uri_CREATE_FILE_USE_DOS_PATH
,
5278 /* Tests of an empty hash/fragment part */
5280 "http://google.com/test",0,
5281 "http://google.com/test#",0,
5285 "ftp://ftp.winehq.org/",0,
5286 "ftp://ftp.winehq.org/#",0,
5290 "file:///c:/dir/file.txt#", 0,
5291 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
5296 typedef struct _uri_with_fragment
{
5298 const char* fragment
;
5300 HRESULT create_expected
;
5303 const char* expected_uri
;
5305 } uri_with_fragment
;
5307 static const uri_with_fragment uri_fragment_tests
[] = {
5309 "http://google.com/","#fragment",0,S_OK
,FALSE
,
5310 "http://google.com/#fragment",FALSE
5313 "http://google.com/","fragment",0,S_OK
,FALSE
,
5314 "http://google.com/#fragment",FALSE
5317 "zip://test.com/","?test",0,S_OK
,FALSE
,
5318 "zip://test.com/#?test",FALSE
5320 /* The fragment can be empty. */
5322 "ftp://ftp.google.com/","",0,S_OK
,FALSE
,
5323 "ftp://ftp.google.com/#",FALSE
5327 typedef struct _uri_builder_property
{
5330 const char *expected_value
;
5331 Uri_PROPERTY property
;
5334 } uri_builder_property
;
5336 typedef struct _uri_builder_port
{
5344 typedef struct _uri_builder_str_property
{
5345 const char* expected
;
5348 } uri_builder_str_property
;
5350 typedef struct _uri_builder_dword_property
{
5354 } uri_builder_dword_property
;
5356 typedef struct _uri_builder_test
{
5359 HRESULT create_builder_expected
;
5360 BOOL create_builder_todo
;
5362 uri_builder_property properties
[URI_BUILDER_STR_PROPERTY_COUNT
];
5364 uri_builder_port port_prop
;
5370 DWORD uri_simple_encode_flags
;
5371 HRESULT uri_simple_hres
;
5372 BOOL uri_simple_todo
;
5374 DWORD uri_with_flags
;
5375 DWORD uri_with_builder_flags
;
5376 DWORD uri_with_encode_flags
;
5377 HRESULT uri_with_hres
;
5380 uri_builder_str_property expected_str_props
[URI_STR_PROPERTY_COUNT
];
5381 uri_builder_dword_property expected_dword_props
[URI_DWORD_PROPERTY_COUNT
];
5384 static const uri_builder_test uri_builder_tests
[] = {
5385 { "http://google.com/",0,S_OK
,FALSE
,
5387 {TRUE
,"#fragment",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
5388 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
},
5389 {TRUE
,"?query=x",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
5390 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5397 {"http://username:password@google.com/?query=x#fragment",S_OK
},
5398 {"username:password@google.com",S_OK
},
5399 {"http://google.com/?query=x#fragment",S_OK
},
5400 {"google.com",S_OK
},
5403 {"google.com",S_OK
},
5408 {"http://username:password@google.com/?query=x#fragment",S_OK
},
5410 {"username:password",S_OK
},
5414 {Uri_HOST_DNS
,S_OK
},
5416 {URL_SCHEME_HTTP
,S_OK
},
5417 {URLZONE_INVALID
,E_NOTIMPL
}
5420 { "http://google.com/",0,S_OK
,FALSE
,
5422 {TRUE
,"test",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
5424 {TRUE
,TRUE
,120,S_OK
,FALSE
},
5429 {"test://google.com:120/",S_OK
},
5430 {"google.com:120",S_OK
},
5431 {"test://google.com:120/",S_OK
},
5432 {"google.com",S_OK
},
5435 {"google.com",S_OK
},
5440 {"test://google.com:120/",S_OK
},
5446 {Uri_HOST_DNS
,S_OK
},
5448 {URL_SCHEME_UNKNOWN
,S_OK
},
5449 {URLZONE_INVALID
,E_NOTIMPL
}
5452 { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5454 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
5455 {TRUE
,"::192.2.3.4",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
5456 {TRUE
,NULL
,NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
5463 {"http://[::192.2.3.4]/",S_OK
},
5464 {"[::192.2.3.4]",S_OK
},
5465 {"http://[::192.2.3.4]/",S_OK
},
5469 {"::192.2.3.4",S_OK
},
5474 {"http://[::192.2.3.4]/",S_OK
},
5480 {Uri_HOST_IPV6
,S_OK
},
5482 {URL_SCHEME_HTTP
,S_OK
},
5483 {URLZONE_INVALID
,E_NOTIMPL
}
5486 { "http://google.com/",0,S_OK
,FALSE
,
5488 {TRUE
,"Frag","#Frag",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5495 {"http://google.com/#Frag",S_OK
},
5496 {"google.com",S_OK
},
5497 {"http://google.com/#Frag",S_OK
},
5498 {"google.com",S_OK
},
5501 {"google.com",S_OK
},
5506 {"http://google.com/#Frag",S_OK
},
5512 {Uri_HOST_DNS
,S_OK
},
5514 {URL_SCHEME_HTTP
,S_OK
},
5515 {URLZONE_INVALID
,E_NOTIMPL
}
5518 { "http://google.com/",0,S_OK
,FALSE
,
5520 {TRUE
,"","#",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
5527 {"http://google.com/#",S_OK
},
5528 {"google.com",S_OK
},
5529 {"http://google.com/#",S_OK
},
5530 {"google.com",S_OK
},
5533 {"google.com",S_OK
},
5538 {"http://google.com/#",S_OK
},
5544 {Uri_HOST_DNS
,S_OK
},
5546 {URL_SCHEME_HTTP
,S_OK
},
5547 {URLZONE_INVALID
,E_NOTIMPL
}
5550 { "http://google.com/",0,S_OK
,FALSE
,
5552 {TRUE
,":password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5559 {"http://::password@google.com/",S_OK
},
5560 {"::password@google.com",S_OK
},
5561 {"http://google.com/",S_OK
},
5562 {"google.com",S_OK
},
5565 {"google.com",S_OK
},
5570 {"http://::password@google.com/",S_OK
},
5572 {"::password",S_OK
},
5576 {Uri_HOST_DNS
,S_OK
},
5578 {URL_SCHEME_HTTP
,S_OK
},
5579 {URLZONE_INVALID
,E_NOTIMPL
}
5582 { "test/test",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5584 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5587 Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5589 Uri_CREATE_ALLOW_RELATIVE
,0,0,S_OK
,FALSE
,
5591 {":password@test/test",S_OK
},
5592 {":password@",S_OK
},
5593 {":password@test/test",S_OK
},
5602 {":password@test/test",S_OK
},
5608 {Uri_HOST_UNKNOWN
,S_OK
},
5610 {URL_SCHEME_UNKNOWN
,S_OK
},
5611 {URLZONE_INVALID
,E_NOTIMPL
}
5614 { "http://google.com/",0,S_OK
,FALSE
,
5616 {TRUE
,"test/test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5623 {"http://google.com/test/test",S_OK
},
5624 {"google.com",S_OK
},
5625 {"http://google.com/test/test",S_OK
},
5626 {"google.com",S_OK
},
5629 {"google.com",S_OK
},
5631 {"/test/test",S_OK
},
5632 {"/test/test",S_OK
},
5634 {"http://google.com/test/test",S_OK
},
5640 {Uri_HOST_DNS
,S_OK
},
5642 {URL_SCHEME_HTTP
,S_OK
},
5643 {URLZONE_INVALID
,E_NOTIMPL
}
5646 { "zip:testing/test",0,S_OK
,FALSE
,
5648 {TRUE
,"test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5672 {Uri_HOST_UNKNOWN
,S_OK
},
5674 {URL_SCHEME_UNKNOWN
,S_OK
},
5675 {URLZONE_INVALID
,E_NOTIMPL
}
5678 { "http://google.com/",0,S_OK
,FALSE
,
5682 /* 555 will be returned from GetPort even though FALSE was passed as the hasPort parameter. */
5683 {TRUE
,FALSE
,555,S_OK
,FALSE
},
5688 {"http://google.com/",S_OK
},
5689 {"google.com",S_OK
},
5690 {"http://google.com/",S_OK
},
5691 {"google.com",S_OK
},
5694 {"google.com",S_OK
},
5699 {"http://google.com/",S_OK
},
5705 {Uri_HOST_DNS
,S_OK
},
5706 /* Still returns 80, even though earlier the port was disabled. */
5708 {URL_SCHEME_HTTP
,S_OK
},
5709 {URLZONE_INVALID
,E_NOTIMPL
}
5712 { "http://google.com/",0,S_OK
,FALSE
,
5716 /* Instead of getting "TRUE" back as the "hasPort" parameter in GetPort,
5717 * you'll get 122345 instead.
5719 {TRUE
,122345,222,S_OK
,FALSE
},
5724 {"http://google.com:222/",S_OK
},
5725 {"google.com:222",S_OK
},
5726 {"http://google.com:222/",S_OK
},
5727 {"google.com",S_OK
},
5730 {"google.com",S_OK
},
5735 {"http://google.com:222/",S_OK
},
5741 {Uri_HOST_DNS
,S_OK
},
5743 {URL_SCHEME_HTTP
,S_OK
},
5744 {URLZONE_INVALID
,E_NOTIMPL
}
5747 /* IUri's created with the IUriBuilder can have ports that exceed USHORT_MAX. */
5748 { "http://google.com/",0,S_OK
,FALSE
,
5752 {TRUE
,TRUE
,999999,S_OK
,FALSE
},
5757 {"http://google.com:999999/",S_OK
},
5758 {"google.com:999999",S_OK
},
5759 {"http://google.com:999999/",S_OK
},
5760 {"google.com",S_OK
},
5763 {"google.com",S_OK
},
5768 {"http://google.com:999999/",S_OK
},
5774 {Uri_HOST_DNS
,S_OK
},
5776 {URL_SCHEME_HTTP
,S_OK
},
5777 {URLZONE_INVALID
,E_NOTIMPL
}
5780 { "http://google.com/",0,S_OK
,FALSE
,
5782 {TRUE
,"test","?test",Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
5790 {"http://google.com/?test",S_OK
},
5791 {"google.com",S_OK
},
5792 {"http://google.com/?test",S_OK
},
5793 {"google.com",S_OK
},
5796 {"google.com",S_OK
},
5801 {"http://google.com/?test",S_OK
},
5807 {Uri_HOST_DNS
,S_OK
},
5809 {URL_SCHEME_HTTP
,S_OK
},
5810 {URLZONE_INVALID
,E_NOTIMPL
}
5813 { "http://:password@google.com/",0,S_OK
,FALSE
,
5822 {"http://:password@google.com/",S_OK
},
5823 {":password@google.com",S_OK
},
5824 {"http://google.com/",S_OK
},
5825 {"google.com",S_OK
},
5828 {"google.com",S_OK
},
5833 {"http://:password@google.com/",S_OK
},
5839 {Uri_HOST_DNS
,S_OK
},
5841 {URL_SCHEME_HTTP
,S_OK
},
5842 {URLZONE_INVALID
,E_NOTIMPL
}
5845 /* IUriBuilder doesn't need a base IUri to build a IUri. */
5846 { NULL
,0,S_OK
,FALSE
,
5848 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
5849 {TRUE
,"google.com",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5856 {"http://google.com/",S_OK
},
5857 {"google.com",S_OK
},
5858 {"http://google.com/",S_OK
},
5859 {"google.com",S_OK
},
5862 {"google.com",S_OK
},
5867 {"http://google.com/",S_OK
},
5873 {Uri_HOST_DNS
,S_OK
},
5875 {URL_SCHEME_HTTP
,S_OK
},
5876 {URLZONE_INVALID
,E_NOTIMPL
}
5879 /* Can't set the scheme name to NULL. */
5880 { "zip://google.com/",0,S_OK
,FALSE
,
5882 {TRUE
,NULL
,"zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5889 {"zip://google.com/",S_OK
},
5890 {"google.com",S_OK
},
5891 {"zip://google.com/",S_OK
},
5892 {"google.com",S_OK
},
5895 {"google.com",S_OK
},
5900 {"zip://google.com/",S_OK
},
5906 {Uri_HOST_DNS
,S_OK
},
5908 {URL_SCHEME_UNKNOWN
,S_OK
},
5909 {URLZONE_INVALID
,E_NOTIMPL
}
5912 /* Can't set the scheme name to an empty string. */
5913 { "zip://google.com/",0,S_OK
,FALSE
,
5915 {TRUE
,"","zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5922 {"zip://google.com/",S_OK
},
5923 {"google.com",S_OK
},
5924 {"zip://google.com/",S_OK
},
5925 {"google.com",S_OK
},
5928 {"google.com",S_OK
},
5933 {"zip://google.com/",S_OK
},
5939 {Uri_HOST_DNS
,S_OK
},
5941 {URL_SCHEME_UNKNOWN
,S_OK
},
5942 {URLZONE_INVALID
,E_NOTIMPL
}
5945 /* -1 to CreateUri makes it use the same flags as the base IUri was created with.
5946 * CreateUriSimple always uses the flags the base IUri was created with (if any).
5948 { "http://google.com/../../",Uri_CREATE_NO_CANONICALIZE
,S_OK
,FALSE
,
5953 0,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5955 {"http://google.com/../../",S_OK
},
5956 {"google.com",S_OK
},
5957 {"http://google.com/../../",S_OK
},
5958 {"google.com",S_OK
},
5961 {"google.com",S_OK
},
5966 {"http://google.com/../../",S_OK
},
5972 {Uri_HOST_DNS
,S_OK
},
5974 {URL_SCHEME_HTTP
,S_OK
},
5975 {URLZONE_INVALID
,E_NOTIMPL
}
5978 { "http://google.com/",0,S_OK
,FALSE
,
5980 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5985 Uri_CREATE_NO_DECODE_EXTRA_INFO
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5987 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5988 {"google.com",S_OK
},
5989 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5990 {"google.com",S_OK
},
5992 {"#Fr%3C%7C%3Eg",S_OK
},
5993 {"google.com",S_OK
},
5998 {"http://google.com/#Fr<|>g",S_OK
},
6004 {Uri_HOST_DNS
,S_OK
},
6006 {URL_SCHEME_HTTP
,S_OK
},
6007 {URLZONE_INVALID
,E_NOTIMPL
}
6010 { "http://google.com/",0,S_OK
,FALSE
,
6012 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
6015 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,E_INVALIDARG
,FALSE
,
6017 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
6019 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
6020 {"google.com",S_OK
},
6021 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
6022 {"google.com",S_OK
},
6024 {"#Fr%3C%7C%3Eg",S_OK
},
6025 {"google.com",S_OK
},
6030 {"http://google.com/#Fr<|>g",S_OK
},
6036 {Uri_HOST_DNS
,S_OK
},
6038 {URL_SCHEME_HTTP
,S_OK
},
6039 {URLZONE_INVALID
,E_NOTIMPL
}
6042 { NULL
,0,S_OK
,FALSE
,
6044 {TRUE
,"/test/test/",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
6045 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
6048 0,INET_E_INVALID_URL
,FALSE
,
6049 0,INET_E_INVALID_URL
,FALSE
,
6050 0,0,0,INET_E_INVALID_URL
,FALSE
6052 { "http://google.com/",0,S_OK
,FALSE
,
6054 {TRUE
,"ht%xxtp",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
6057 0,INET_E_INVALID_URL
,FALSE
,
6058 0,INET_E_INVALID_URL
,FALSE
,
6059 0,0,0,INET_E_INVALID_URL
,FALSE
6061 /* File scheme's can't have a username set. */
6062 { "file://google.com/",0,S_OK
,FALSE
,
6064 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6067 0,INET_E_INVALID_URL
,FALSE
,
6068 0,INET_E_INVALID_URL
,FALSE
,
6069 0,0,0,INET_E_INVALID_URL
,FALSE
6071 /* File schemes can't have a password set. */
6072 { "file://google.com/",0,S_OK
,FALSE
,
6074 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
6077 0,INET_E_INVALID_URL
,FALSE
,
6078 0,INET_E_INVALID_URL
,FALSE
,
6079 0,0,0,INET_E_INVALID_URL
,FALSE
6081 /* UserName can't contain any character that is a delimiter for another
6082 * component that appears after it in a normal URI.
6084 { "http://google.com/",0,S_OK
,FALSE
,
6086 {TRUE
,"user:pass",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6089 0,INET_E_INVALID_URL
,FALSE
,
6090 0,INET_E_INVALID_URL
,FALSE
,
6091 0,0,0,INET_E_INVALID_URL
,FALSE
6093 { "http://google.com/",0,S_OK
,FALSE
,
6095 {TRUE
,"user@google.com",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6098 0,INET_E_INVALID_URL
,FALSE
,
6099 0,INET_E_INVALID_URL
,FALSE
,
6100 0,0,0,INET_E_INVALID_URL
,FALSE
6102 { "http://google.com/",0,S_OK
,FALSE
,
6104 {TRUE
,"user/path",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6107 0,INET_E_INVALID_URL
,FALSE
,
6108 0,INET_E_INVALID_URL
,FALSE
,
6109 0,0,0,INET_E_INVALID_URL
,FALSE
6111 { "http://google.com/",0,S_OK
,FALSE
,
6113 {TRUE
,"user?Query",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6116 0,INET_E_INVALID_URL
,FALSE
,
6117 0,INET_E_INVALID_URL
,FALSE
,
6118 0,0,0,INET_E_INVALID_URL
,FALSE
6120 { "http://google.com/",0,S_OK
,FALSE
,
6122 {TRUE
,"user#Frag",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6125 0,INET_E_INVALID_URL
,FALSE
,
6126 0,INET_E_INVALID_URL
,FALSE
,
6127 0,0,0,INET_E_INVALID_URL
,FALSE
6129 { "http://google.com/",0,S_OK
,FALSE
,
6131 {TRUE
,"pass@google.com",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
6134 0,INET_E_INVALID_URL
,FALSE
,
6135 0,INET_E_INVALID_URL
,FALSE
,
6136 0,0,0,INET_E_INVALID_URL
,FALSE
6138 { "http://google.com/",0,S_OK
,FALSE
,
6140 {TRUE
,"pass/path",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
6143 0,INET_E_INVALID_URL
,FALSE
,
6144 0,INET_E_INVALID_URL
,FALSE
,
6145 0,0,0,INET_E_INVALID_URL
,FALSE
6147 { "http://google.com/",0,S_OK
,FALSE
,
6149 {TRUE
,"pass?query",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
6152 0,INET_E_INVALID_URL
,FALSE
,
6153 0,INET_E_INVALID_URL
,FALSE
,
6154 0,0,0,INET_E_INVALID_URL
,FALSE
6156 { "http://google.com/",0,S_OK
,FALSE
,
6158 {TRUE
,"pass#frag",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
6161 0,INET_E_INVALID_URL
,FALSE
,
6162 0,INET_E_INVALID_URL
,FALSE
,
6163 0,0,0,INET_E_INVALID_URL
,FALSE
6165 { "http://google.com/",0,S_OK
,FALSE
,
6167 {TRUE
,"winehq.org/test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
6170 0,INET_E_INVALID_URL
,FALSE
,
6171 0,INET_E_INVALID_URL
,FALSE
,
6172 0,0,0,INET_E_INVALID_URL
,FALSE
6174 { "http://google.com/",0,S_OK
,FALSE
,
6176 {TRUE
,"winehq.org?test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
6179 0,INET_E_INVALID_URL
,FALSE
,
6180 0,INET_E_INVALID_URL
,FALSE
,
6181 0,0,0,INET_E_INVALID_URL
,FALSE
6183 { "http://google.com/",0,S_OK
,FALSE
,
6185 {TRUE
,"winehq.org#test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
6188 0,INET_E_INVALID_URL
,FALSE
,
6189 0,INET_E_INVALID_URL
,FALSE
,
6190 0,0,0,INET_E_INVALID_URL
,FALSE
6192 /* Hostname is allowed to contain a ':' (even for known scheme types). */
6193 { "http://google.com/",0,S_OK
,FALSE
,
6195 {TRUE
,"winehq.org:test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
6202 {"http://winehq.org:test/",S_OK
},
6203 {"winehq.org:test",S_OK
},
6204 {"http://winehq.org:test/",S_OK
},
6205 {"winehq.org:test",S_OK
},
6208 {"winehq.org:test",S_OK
},
6213 {"http://winehq.org:test/",S_OK
},
6219 {Uri_HOST_DNS
,S_OK
},
6221 {URL_SCHEME_HTTP
,S_OK
},
6222 {URLZONE_INVALID
,E_NOTIMPL
}
6225 /* Can't set the host name to NULL. */
6226 { "http://google.com/",0,S_OK
,FALSE
,
6228 {TRUE
,NULL
,"google.com",Uri_PROPERTY_HOST
,E_INVALIDARG
,FALSE
}
6235 {"http://google.com/",S_OK
},
6236 {"google.com",S_OK
},
6237 {"http://google.com/",S_OK
},
6238 {"google.com",S_OK
},
6241 {"google.com",S_OK
},
6246 {"http://google.com/",S_OK
},
6252 {Uri_HOST_DNS
,S_OK
},
6254 {URL_SCHEME_HTTP
,S_OK
},
6255 {URLZONE_INVALID
,E_NOTIMPL
}
6258 /* Can set the host name to an empty string. */
6259 { "http://google.com/",0,S_OK
,FALSE
,
6261 {TRUE
,"",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
6285 {Uri_HOST_UNKNOWN
,S_OK
},
6287 {URL_SCHEME_HTTP
,S_OK
},
6288 {URLZONE_INVALID
,E_NOTIMPL
}
6291 { "http://google.com/",0,S_OK
,FALSE
,
6293 {TRUE
,"/path?query",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
6296 0,INET_E_INVALID_URL
,FALSE
,
6297 0,INET_E_INVALID_URL
,FALSE
,
6298 0,0,0,INET_E_INVALID_URL
,FALSE
6300 { "http://google.com/",0,S_OK
,FALSE
,
6302 {TRUE
,"/path#test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
6305 0,INET_E_INVALID_URL
,FALSE
,
6306 0,INET_E_INVALID_URL
,FALSE
,
6307 0,0,0,INET_E_INVALID_URL
,FALSE
6309 { "http://google.com/",0,S_OK
,FALSE
,
6311 {TRUE
,"?path#test",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
}
6314 0,INET_E_INVALID_URL
,FALSE
,
6315 0,INET_E_INVALID_URL
,FALSE
,
6316 0,0,0,INET_E_INVALID_URL
,FALSE
6318 { "file:///c:/dir/file.html",0,S_OK
,FALSE
,
6320 {TRUE
,NULL
,NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
},
6327 {"file:///c:/dir/file.html",S_OK
},
6329 {"file:///c:/dir/file.html",S_OK
},
6335 {"/c:/dir/file.html",S_OK
},
6336 {"/c:/dir/file.html",S_OK
},
6338 {"file:///c:/dir/file.html",S_OK
},
6344 {Uri_HOST_UNKNOWN
,S_OK
},
6346 {URL_SCHEME_FILE
,S_OK
},
6347 {URLZONE_INVALID
,E_NOTIMPL
}
6350 { "file:///c:/dir/file.html",0,S_OK
,FALSE
,
6352 {TRUE
,"#",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
},
6359 {"file:///c:/dir/file.html#",S_OK
},
6361 {"file:///c:/dir/file.html#",S_OK
},
6367 {"/c:/dir/file.html",S_OK
},
6368 {"/c:/dir/file.html",S_OK
},
6370 {"file:///c:/dir/file.html#",S_OK
},
6376 {Uri_HOST_UNKNOWN
,S_OK
},
6378 {URL_SCHEME_FILE
,S_OK
},
6379 {URLZONE_INVALID
,E_NOTIMPL
}
6384 typedef struct _uri_builder_remove_test
{
6387 HRESULT create_builder_expected
;
6388 BOOL create_builder_todo
;
6390 DWORD remove_properties
;
6391 HRESULT remove_expected
;
6394 const char *expected_uri
;
6395 DWORD expected_flags
;
6396 HRESULT expected_hres
;
6398 } uri_builder_remove_test
;
6400 static const uri_builder_remove_test uri_builder_remove_tests
[] = {
6401 { "http://google.com/test?test=y#Frag",0,S_OK
,FALSE
,
6402 Uri_HAS_FRAGMENT
|Uri_HAS_PATH
|Uri_HAS_QUERY
,S_OK
,FALSE
,
6403 "http://google.com/",0,S_OK
,FALSE
6405 { "http://user:pass@winehq.org/",0,S_OK
,FALSE
,
6406 Uri_HAS_USER_NAME
|Uri_HAS_PASSWORD
,S_OK
,FALSE
,
6407 "http://winehq.org/",0,S_OK
,FALSE
6409 { "zip://google.com?Test=x",0,S_OK
,FALSE
,
6410 Uri_HAS_HOST
,S_OK
,FALSE
,
6411 "zip:/?Test=x",0,S_OK
,FALSE
6413 /* Doesn't remove the whole userinfo component. */
6414 { "http://username:pass@google.com/",0,S_OK
,FALSE
,
6415 Uri_HAS_USER_INFO
,S_OK
,FALSE
,
6416 "http://username:pass@google.com/",0,S_OK
,FALSE
6418 /* Doesn't remove the domain. */
6419 { "http://google.com/",0,S_OK
,FALSE
,
6420 Uri_HAS_DOMAIN
,S_OK
,FALSE
,
6421 "http://google.com/",0,S_OK
,FALSE
6423 { "http://google.com:120/",0,S_OK
,FALSE
,
6424 Uri_HAS_AUTHORITY
,S_OK
,FALSE
,
6425 "http://google.com:120/",0,S_OK
,FALSE
6427 { "http://google.com/test.com/",0,S_OK
,FALSE
,
6428 Uri_HAS_EXTENSION
,S_OK
,FALSE
,
6429 "http://google.com/test.com/",0,S_OK
,FALSE
6431 { "http://google.com/?test=x",0,S_OK
,FALSE
,
6432 Uri_HAS_PATH_AND_QUERY
,S_OK
,FALSE
,
6433 "http://google.com/?test=x",0,S_OK
,FALSE
6435 /* Can't remove the scheme name. */
6436 { "http://google.com/?test=x",0,S_OK
,FALSE
,
6437 Uri_HAS_SCHEME_NAME
|Uri_HAS_QUERY
,E_INVALIDARG
,FALSE
,
6438 "http://google.com/?test=x",0,S_OK
,FALSE
6442 typedef struct _uri_combine_str_property
{
6446 const char *broken_value
;
6447 const char *value_ex
;
6448 } uri_combine_str_property
;
6450 typedef struct _uri_combine_test
{
6451 const char *base_uri
;
6452 DWORD base_create_flags
;
6453 const char *relative_uri
;
6454 DWORD relative_create_flags
;
6455 DWORD combine_flags
;
6459 uri_combine_str_property str_props
[URI_STR_PROPERTY_COUNT
];
6460 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
6463 static const uri_combine_test uri_combine_tests
[] = {
6464 { "http://google.com/fun/stuff",0,
6465 "../not/fun/stuff",Uri_CREATE_ALLOW_RELATIVE
,
6468 {"http://google.com/not/fun/stuff",S_OK
},
6469 {"google.com",S_OK
},
6470 {"http://google.com/not/fun/stuff",S_OK
},
6471 {"google.com",S_OK
},
6474 {"google.com",S_OK
},
6476 {"/not/fun/stuff",S_OK
},
6477 {"/not/fun/stuff",S_OK
},
6479 {"http://google.com/not/fun/stuff",S_OK
},
6485 {Uri_HOST_DNS
,S_OK
},
6487 {URL_SCHEME_HTTP
,S_OK
},
6488 {URLZONE_INVALID
,E_NOTIMPL
}
6491 { "http://google.com/test",0,
6492 "zip://test.com/cool",0,
6495 {"zip://test.com/cool",S_OK
},
6497 {"zip://test.com/cool",S_OK
},
6506 {"zip://test.com/cool",S_OK
},
6512 {Uri_HOST_DNS
,S_OK
},
6514 {URL_SCHEME_UNKNOWN
,S_OK
},
6515 {URLZONE_INVALID
,E_NOTIMPL
}
6518 { "http://google.com/use/base/path",0,
6519 "?relative",Uri_CREATE_ALLOW_RELATIVE
,
6522 {"http://google.com/use/base/path?relative",S_OK
},
6523 {"google.com",S_OK
},
6524 {"http://google.com/use/base/path?relative",S_OK
},
6525 {"google.com",S_OK
},
6528 {"google.com",S_OK
},
6530 {"/use/base/path",S_OK
},
6531 {"/use/base/path?relative",S_OK
},
6533 {"http://google.com/use/base/path?relative",S_OK
},
6539 {Uri_HOST_DNS
,S_OK
},
6541 {URL_SCHEME_HTTP
,S_OK
},
6542 {URLZONE_INVALID
,E_NOTIMPL
}
6545 { "http://google.com/path",0,
6546 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
6549 {"http://google.com/testing",S_OK
},
6550 {"google.com",S_OK
},
6551 {"http://google.com/testing",S_OK
},
6552 {"google.com",S_OK
},
6555 {"google.com",S_OK
},
6560 {"http://google.com/testing",S_OK
},
6566 {Uri_HOST_DNS
,S_OK
},
6568 {URL_SCHEME_HTTP
,S_OK
},
6569 {URLZONE_INVALID
,E_NOTIMPL
}
6572 { "http://google.com/path",0,
6573 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
6574 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6576 {"http://google.com:80/test/../test/.././testing",S_OK
},
6577 {"google.com",S_OK
},
6578 {"http://google.com:80/test/../test/.././testing",S_OK
},
6579 {"google.com",S_OK
},
6582 {"google.com",S_OK
},
6584 {"/test/../test/.././testing",S_OK
},
6585 {"/test/../test/.././testing",S_OK
},
6587 {"http://google.com:80/test/../test/.././testing",S_OK
},
6593 {Uri_HOST_DNS
,S_OK
},
6595 {URL_SCHEME_HTTP
,S_OK
},
6596 {URLZONE_INVALID
,E_NOTIMPL
}
6599 { "http://winehq.org/test/abc",0,
6600 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
6603 {"http://winehq.org/test/testing/test",S_OK
},
6604 {"winehq.org",S_OK
},
6605 {"http://winehq.org/test/testing/test",S_OK
},
6606 {"winehq.org",S_OK
},
6609 {"winehq.org",S_OK
},
6611 {"/test/testing/test",S_OK
},
6612 {"/test/testing/test",S_OK
},
6614 {"http://winehq.org/test/testing/test",S_OK
},
6620 {Uri_HOST_DNS
,S_OK
},
6622 {URL_SCHEME_HTTP
,S_OK
},
6623 {URLZONE_INVALID
,E_NOTIMPL
}
6626 { "http://winehq.org/test/abc",0,
6627 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
6628 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6630 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6631 /* Default port is hidden in the authority. */
6632 {"winehq.org",S_OK
},
6633 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6634 {"winehq.org",S_OK
},
6637 {"winehq.org",S_OK
},
6639 {"/test/testing/abc/../test",S_OK
},
6640 {"/test/testing/abc/../test",S_OK
},
6642 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6648 {Uri_HOST_DNS
,S_OK
},
6650 {URL_SCHEME_HTTP
,S_OK
},
6651 {URLZONE_INVALID
,E_NOTIMPL
}
6654 { "http://winehq.org/test?query",0,
6655 "testing",Uri_CREATE_ALLOW_RELATIVE
,
6658 {"http://winehq.org/testing",S_OK
},
6659 {"winehq.org",S_OK
},
6660 {"http://winehq.org/testing",S_OK
},
6661 {"winehq.org",S_OK
},
6664 {"winehq.org",S_OK
},
6669 {"http://winehq.org/testing",S_OK
},
6675 {Uri_HOST_DNS
,S_OK
},
6677 {URL_SCHEME_HTTP
,S_OK
},
6678 {URLZONE_INVALID
,E_NOTIMPL
}
6681 { "http://winehq.org/test#frag",0,
6682 "testing",Uri_CREATE_ALLOW_RELATIVE
,
6685 {"http://winehq.org/testing",S_OK
},
6686 {"winehq.org",S_OK
},
6687 {"http://winehq.org/testing",S_OK
},
6688 {"winehq.org",S_OK
},
6691 {"winehq.org",S_OK
},
6696 {"http://winehq.org/testing",S_OK
},
6702 {Uri_HOST_DNS
,S_OK
},
6704 {URL_SCHEME_HTTP
,S_OK
},
6705 {URLZONE_INVALID
,E_NOTIMPL
}
6708 { "testing?query#frag",Uri_CREATE_ALLOW_RELATIVE
,
6709 "test",Uri_CREATE_ALLOW_RELATIVE
,
6729 {Uri_HOST_UNKNOWN
,S_OK
},
6731 {URL_SCHEME_UNKNOWN
,S_OK
},
6732 {URLZONE_INVALID
,E_NOTIMPL
}
6735 { "file:///c:/test/test",0,
6736 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6737 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6739 {"file://c:\\testing.mp3",S_OK
},
6741 {"file://c:\\testing.mp3",S_OK
},
6747 {"c:\\testing.mp3",S_OK
},
6748 {"c:\\testing.mp3",S_OK
},
6750 {"file://c:\\testing.mp3",S_OK
},
6756 {Uri_HOST_UNKNOWN
,S_OK
},
6758 {URL_SCHEME_FILE
,S_OK
},
6759 {URLZONE_INVALID
,E_NOTIMPL
}
6762 { "file:///c:/test/test",0,
6763 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6766 {"file:///c:/testing.mp3",S_OK
},
6768 {"file:///c:/testing.mp3",S_OK
},
6774 {"/c:/testing.mp3",S_OK
},
6775 {"/c:/testing.mp3",S_OK
},
6777 {"file:///c:/testing.mp3",S_OK
},
6783 {Uri_HOST_UNKNOWN
,S_OK
},
6785 {URL_SCHEME_FILE
,S_OK
},
6786 {URLZONE_INVALID
,E_NOTIMPL
}
6789 { "file://test.com/test/test",0,
6790 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6791 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6793 {"file://\\\\test.com\\testing.mp3",S_OK
},
6795 {"file://\\\\test.com\\testing.mp3",S_OK
},
6801 {"\\testing.mp3",S_OK
},
6802 {"\\testing.mp3",S_OK
},
6804 {"file://\\\\test.com\\testing.mp3",S_OK
},
6810 {Uri_HOST_DNS
,S_OK
},
6812 {URL_SCHEME_FILE
,S_OK
},
6813 {URLZONE_INVALID
,E_NOTIMPL
}
6816 /* URL_DONT_SIMPLIFY has no effect. */
6817 { "http://google.com/test",0,
6818 "zip://test.com/cool/../cool/test",0,
6819 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6821 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
6823 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
6829 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
6830 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
6832 /* The resulting IUri has the same Raw URI as the relative URI (only IE 8).
6833 * On IE 7 it reduces the path in the Raw URI.
6835 {"zip://test.com/cool/../cool/test",S_OK
,FALSE
,"zip://test.com/cool/test"},
6841 {Uri_HOST_DNS
,S_OK
},
6843 {URL_SCHEME_UNKNOWN
,S_OK
},
6844 {URLZONE_INVALID
,E_NOTIMPL
}
6847 /* FILE_USE_PATHURL has no effect in IE 8, in IE 7 the
6848 * resulting URI is converted into a dos path.
6850 { "http://google.com/test",0,
6851 "file:///c:/test/",0,
6852 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6854 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6856 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6862 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
6863 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
6865 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6871 {Uri_HOST_UNKNOWN
,S_OK
},
6873 {URL_SCHEME_FILE
,S_OK
},
6874 {URLZONE_INVALID
,E_NOTIMPL
}
6877 { "http://google.com/test",0,
6878 "http://test.com/test#%30test",0,
6879 URL_DONT_UNESCAPE_EXTRA_INFO
,S_OK
,FALSE
,
6881 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
6883 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
6886 {"#0test",S_OK
,FALSE
,NULL
,"#%30test"},
6892 /* IE 7 decodes the %30 to a 0 in the Raw URI. */
6893 {"http://test.com/test#%30test",S_OK
,FALSE
,"http://test.com/test#0test"},
6899 {Uri_HOST_DNS
,S_OK
},
6901 {URL_SCHEME_HTTP
,S_OK
},
6902 {URLZONE_INVALID
,E_NOTIMPL
}
6905 /* Windows validates the path component from the relative Uri. */
6906 { "http://google.com/test",0,
6907 "/Te%XXst",Uri_CREATE_ALLOW_RELATIVE
,
6908 0,E_INVALIDARG
,FALSE
6910 /* Windows doesn't validate the query from the relative Uri. */
6911 { "http://google.com/test",0,
6912 "?Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6915 {"http://google.com/test?Tes%XXt",S_OK
},
6916 {"google.com",S_OK
},
6917 {"http://google.com/test?Tes%XXt",S_OK
},
6918 {"google.com",S_OK
},
6921 {"google.com",S_OK
},
6924 {"/test?Tes%XXt",S_OK
},
6926 {"http://google.com/test?Tes%XXt",S_OK
},
6932 {Uri_HOST_DNS
,S_OK
},
6934 {URL_SCHEME_HTTP
,S_OK
},
6935 {URLZONE_INVALID
,E_NOTIMPL
}
6938 /* Windows doesn't validate the fragment from the relative Uri. */
6939 { "http://google.com/test",0,
6940 "#Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6943 {"http://google.com/test#Tes%XXt",S_OK
},
6944 {"google.com",S_OK
},
6945 {"http://google.com/test#Tes%XXt",S_OK
},
6946 {"google.com",S_OK
},
6949 {"google.com",S_OK
},
6954 {"http://google.com/test#Tes%XXt",S_OK
},
6960 {Uri_HOST_DNS
,S_OK
},
6962 {URL_SCHEME_HTTP
,S_OK
},
6963 {URLZONE_INVALID
,E_NOTIMPL
}
6966 /* Creates an IUri which contains an invalid dos path char. */
6967 { "file:///c:/test",0,
6968 "/test<ing",Uri_CREATE_ALLOW_RELATIVE
,
6969 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6971 {"file://c:\\test<ing",S_OK
},
6973 {"file://c:\\test<ing",S_OK
},
6979 {"c:\\test<ing",S_OK
},
6980 {"c:\\test<ing",S_OK
},
6982 {"file://c:\\test<ing",S_OK
},
6988 {Uri_HOST_UNKNOWN
,S_OK
},
6990 {URL_SCHEME_FILE
,S_OK
},
6991 {URLZONE_INVALID
,E_NOTIMPL
}
6994 /* Appends the path after the drive letter (if any). */
6995 { "file:///c:/test",0,
6996 "/c:/testing",Uri_CREATE_ALLOW_RELATIVE
,
6999 {"file:///c:/c:/testing",S_OK
},
7001 {"file:///c:/c:/testing",S_OK
},
7007 {"/c:/c:/testing",S_OK
},
7008 {"/c:/c:/testing",S_OK
},
7010 {"file:///c:/c:/testing",S_OK
},
7016 {Uri_HOST_UNKNOWN
,S_OK
},
7018 {URL_SCHEME_FILE
,S_OK
},
7019 {URLZONE_INVALID
,E_NOTIMPL
}
7022 /* A '/' is added if the base URI doesn't have a path and the
7023 * relative URI doesn't contain a path (since the base URI is
7026 { "http://google.com",Uri_CREATE_NO_CANONICALIZE
,
7027 "?test",Uri_CREATE_ALLOW_RELATIVE
,
7030 {"http://google.com/?test",S_OK
},
7031 {"google.com",S_OK
},
7032 {"http://google.com/?test",S_OK
},
7033 {"google.com",S_OK
},
7036 {"google.com",S_OK
},
7041 {"http://google.com/?test",S_OK
},
7047 {Uri_HOST_DNS
,S_OK
},
7049 {URL_SCHEME_HTTP
,S_OK
},
7050 {URLZONE_INVALID
,E_NOTIMPL
}
7053 { "zip://google.com",Uri_CREATE_NO_CANONICALIZE
,
7054 "?test",Uri_CREATE_ALLOW_RELATIVE
,
7057 {"zip://google.com/?test",S_OK
},
7058 {"google.com",S_OK
},
7059 {"zip://google.com/?test",S_OK
},
7060 {"google.com",S_OK
},
7063 {"google.com",S_OK
},
7068 {"zip://google.com/?test",S_OK
},
7074 {Uri_HOST_DNS
,S_OK
},
7076 {URL_SCHEME_UNKNOWN
,S_OK
},
7077 {URLZONE_INVALID
,E_NOTIMPL
}
7080 /* No path is appended since the base URI is opaque. */
7082 "?test",Uri_CREATE_ALLOW_RELATIVE
,
7102 {Uri_HOST_UNKNOWN
,S_OK
},
7104 {URL_SCHEME_UNKNOWN
,S_OK
},
7105 {URLZONE_INVALID
,E_NOTIMPL
}
7109 "../testing/test",Uri_CREATE_ALLOW_RELATIVE
,
7112 {"file:///c:/testing/test",S_OK
},
7114 {"file:///c:/testing/test",S_OK
},
7120 {"/c:/testing/test",S_OK
},
7121 {"/c:/testing/test",S_OK
},
7123 {"file:///c:/testing/test",S_OK
},
7129 {Uri_HOST_UNKNOWN
,S_OK
},
7131 {URL_SCHEME_FILE
,S_OK
},
7132 {URLZONE_INVALID
,E_NOTIMPL
}
7135 { "http://winehq.org/dir/testfile",0,
7136 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
7139 {"http://winehq.org/dir/test?querystring",S_OK
},
7140 {"winehq.org",S_OK
},
7141 {"http://winehq.org/dir/test?querystring",S_OK
},
7142 {"winehq.org",S_OK
},
7145 {"winehq.org",S_OK
},
7148 {"/dir/test?querystring",S_OK
},
7149 {"?querystring",S_OK
},
7150 {"http://winehq.org/dir/test?querystring",S_OK
},
7156 {Uri_HOST_DNS
,S_OK
},
7158 {URL_SCHEME_HTTP
,S_OK
},
7159 {URLZONE_INVALID
,E_NOTIMPL
}
7162 { "http://winehq.org/dir/test",0,
7163 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
7166 {"http://winehq.org/dir/test?querystring",S_OK
},
7167 {"winehq.org",S_OK
},
7168 {"http://winehq.org/dir/test?querystring",S_OK
},
7169 {"winehq.org",S_OK
},
7172 {"winehq.org",S_OK
},
7175 {"/dir/test?querystring",S_OK
},
7176 {"?querystring",S_OK
},
7177 {"http://winehq.org/dir/test?querystring",S_OK
},
7183 {Uri_HOST_DNS
,S_OK
},
7185 {URL_SCHEME_HTTP
,S_OK
},
7186 {URLZONE_INVALID
,E_NOTIMPL
}
7189 { "http://winehq.org/dir/test?querystring",0,
7190 "#hash",Uri_CREATE_ALLOW_RELATIVE
,
7193 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
7194 {"winehq.org",S_OK
},
7195 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
7196 {"winehq.org",S_OK
},
7199 {"winehq.org",S_OK
},
7202 {"/dir/test?querystring",S_OK
},
7203 {"?querystring",S_OK
},
7204 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
7210 {Uri_HOST_DNS
,S_OK
},
7212 {URL_SCHEME_HTTP
,S_OK
},
7213 {URLZONE_INVALID
,E_NOTIMPL
}
7216 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir\\file.txt",0,
7217 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7220 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7222 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7228 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7229 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7231 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7237 {Uri_HOST_UNKNOWN
,S_OK
},
7239 {URL_SCHEME_MK
,S_OK
},
7240 {URLZONE_INVALID
,E_NOTIMPL
}
7243 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::\\subdir\\file.txt",0,
7244 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7247 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7249 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7255 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7256 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7258 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7264 {Uri_HOST_UNKNOWN
,S_OK
},
7266 {URL_SCHEME_MK
,S_OK
},
7267 {URLZONE_INVALID
,E_NOTIMPL
}
7270 { "mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir\\file.txt",0,
7271 "relative\\path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7274 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
7276 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
7282 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
7283 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
7285 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
7291 {Uri_HOST_UNKNOWN
,S_OK
},
7293 {URL_SCHEME_MK
,S_OK
},
7294 {URLZONE_INVALID
,E_NOTIMPL
}
7297 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
7298 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7301 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7303 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7309 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7310 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7312 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7318 {Uri_HOST_UNKNOWN
,S_OK
},
7320 {URL_SCHEME_MK
,S_OK
},
7321 {URLZONE_INVALID
,E_NOTIMPL
}
7324 { "mk:MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
7325 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7328 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7330 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7336 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7337 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7339 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7345 {Uri_HOST_UNKNOWN
,S_OK
},
7347 {URL_SCHEME_MK
,S_OK
},
7348 {URLZONE_INVALID
,E_NOTIMPL
}
7351 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/../../file.txt",0,
7352 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7355 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
7357 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
7363 {"@MSITSTORE:/relative/path.txt",S_OK
},
7364 {"@MSITSTORE:/relative/path.txt",S_OK
},
7366 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
7372 {Uri_HOST_UNKNOWN
,S_OK
},
7374 {URL_SCHEME_MK
,S_OK
},
7375 {URLZONE_INVALID
,E_NOTIMPL
}
7378 { "mk:@xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
7379 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7382 {"mk:@xxx:/relative/path.txt",S_OK
},
7384 {"mk:@xxx:/relative/path.txt",S_OK
},
7390 {"@xxx:/relative/path.txt",S_OK
},
7391 {"@xxx:/relative/path.txt",S_OK
},
7393 {"mk:@xxx:/relative/path.txt",S_OK
},
7399 {Uri_HOST_UNKNOWN
,S_OK
},
7401 {URL_SCHEME_MK
,S_OK
},
7402 {URLZONE_INVALID
,E_NOTIMPL
}
7405 { "mk:xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
7406 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7409 {"mk:/relative/path.txt",S_OK
},
7411 {"mk:/relative/path.txt",S_OK
},
7417 {"/relative/path.txt",S_OK
},
7418 {"/relative/path.txt",S_OK
},
7420 {"mk:/relative/path.txt",S_OK
},
7426 {Uri_HOST_UNKNOWN
,S_OK
},
7428 {URL_SCHEME_MK
,S_OK
},
7429 {URLZONE_INVALID
,E_NOTIMPL
}
7432 { "ml:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
7433 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7436 {"ml:/relative/path.txt",S_OK
},
7438 {"ml:/relative/path.txt",S_OK
},
7444 {"/relative/path.txt",S_OK
},
7445 {"/relative/path.txt",S_OK
},
7447 {"ml:/relative/path.txt",S_OK
},
7453 {Uri_HOST_UNKNOWN
,S_OK
},
7455 {URL_SCHEME_UNKNOWN
,S_OK
},
7456 {URLZONE_INVALID
,E_NOTIMPL
}
7459 { "http://winehq.org/dir/test?querystring",0,
7460 "//winehq.com/#hash",Uri_CREATE_ALLOW_RELATIVE
,
7463 {"http://winehq.com/#hash",S_OK
},
7464 {"winehq.com",S_OK
},
7465 {"http://winehq.com/#hash",S_OK
},
7466 {"winehq.com",S_OK
},
7469 {"winehq.com",S_OK
},
7474 {"http://winehq.com/#hash",S_OK
},
7480 {Uri_HOST_DNS
,S_OK
},
7481 {80,S_OK
,FALSE
,TRUE
},
7482 {URL_SCHEME_HTTP
,S_OK
},
7483 {URLZONE_INVALID
,E_NOTIMPL
}
7486 { "http://winehq.org/dir/test?querystring",0,
7487 "//winehq.com/dir2/../dir/file.txt?query#hash",Uri_CREATE_ALLOW_RELATIVE
,
7490 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
7491 {"winehq.com",S_OK
},
7492 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
7493 {"winehq.com",S_OK
},
7496 {"winehq.com",S_OK
},
7498 {"/dir/file.txt",S_OK
},
7499 {"/dir/file.txt?query",S_OK
},
7501 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
7507 {Uri_HOST_DNS
,S_OK
},
7508 {80,S_OK
,FALSE
,TRUE
},
7509 {URL_SCHEME_HTTP
,S_OK
},
7510 {URLZONE_INVALID
,E_NOTIMPL
}
7513 { "http://google.com/test",0,
7514 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
7517 {"file:///c:/test/",S_OK
},
7519 {"file:///c:/test/",S_OK
},
7528 {"c:\\test\\",S_OK
,FALSE
,"file:///c:/test/"},
7534 {Uri_HOST_UNKNOWN
,S_OK
},
7536 {URL_SCHEME_FILE
,S_OK
},
7537 {URLZONE_INVALID
,E_NOTIMPL
}
7540 { "http://google.com/test",0,
7541 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
7544 {"file:///c:/test/",S_OK
},
7546 {"file:///c:/test/",S_OK
},
7555 {"c:\\test\\",S_OK
,FALSE
,"file:///c:/test/"},
7561 {Uri_HOST_UNKNOWN
,S_OK
},
7563 {URL_SCHEME_FILE
,S_OK
},
7564 {URLZONE_INVALID
,E_NOTIMPL
}
7567 { "http://winehq.org",0,
7568 "mailto://",Uri_CREATE_NO_CANONICALIZE
,
7582 {"mailto://",S_OK
,FALSE
,"mailto:"},
7588 {Uri_HOST_UNKNOWN
,S_OK
},
7590 {URL_SCHEME_MAILTO
,S_OK
},
7591 {URLZONE_INVALID
,E_NOTIMPL
}
7594 { "http://winehq.org",0,
7595 "mailto://a@b.com",Uri_CREATE_NO_CANONICALIZE
,
7598 {"mailto:a@b.com",S_OK
},
7600 {"mailto:a@b.com",S_OK
},
7609 {"mailto://a@b.com",S_OK
,FALSE
,"mailto:a@b.com"},
7615 {Uri_HOST_UNKNOWN
,S_OK
},
7617 {URL_SCHEME_MAILTO
,S_OK
},
7618 {URLZONE_INVALID
,E_NOTIMPL
}
7622 "/",Uri_CREATE_ALLOW_RELATIVE
,
7625 {"http://[::1]/",S_OK
},
7627 {"http://[::1]/",S_OK
},
7636 {"http://[::1]/",S_OK
},
7642 {Uri_HOST_IPV6
,S_OK
},
7643 {80,S_OK
,FALSE
,TRUE
},
7644 {URL_SCHEME_HTTP
,S_OK
},
7645 {URLZONE_INVALID
,E_NOTIMPL
}
7650 typedef struct _uri_parse_test
{
7655 const char *property
;
7658 const char *property2
;
7661 static const uri_parse_test uri_parse_tests
[] = {
7662 /* PARSE_CANONICALIZE tests. */
7663 {"zip://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"zip://google.com/test<|>",S_OK
,FALSE
},
7664 {"http://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"http://google.com/test%3C%7C%3E",S_OK
,FALSE
},
7665 {"http://google.com/%30%23%3F",0,PARSE_CANONICALIZE
,URL_UNESCAPE
,"http://google.com/0#?",S_OK
,FALSE
},
7666 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_UNSAFE
,"test %3C%7C%3E",S_OK
,FALSE
},
7667 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_SPACES_ONLY
,"test%20<|>",S_OK
,FALSE
},
7668 {"test%20<|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_UNESCAPE
|URL_ESCAPE_UNSAFE
,"test%20%3C%7C%3E",S_OK
,FALSE
},
7669 {"http://google.com/%20",0,PARSE_CANONICALIZE
,URL_ESCAPE_PERCENT
,"http://google.com/%2520",S_OK
,FALSE
},
7670 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"http://google.com/test/../",S_OK
,FALSE
},
7671 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_NO_META
,"http://google.com/test/../",S_OK
,FALSE
},
7672 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"http://google.com/",S_OK
,FALSE
},
7673 {"zip://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"zip://google.com/",S_OK
,FALSE
},
7674 {"file:///c:/test/../test",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"file:///c:/test/../test",S_OK
,FALSE
},
7676 /* PARSE_FRIENDLY tests. */
7677 {"http://test@google.com/test#test",0,PARSE_FRIENDLY
,0,"http://google.com/test#test",S_OK
,FALSE
},
7678 {"zip://test@google.com/test",0,PARSE_FRIENDLY
,0,"zip://test@google.com/test",S_OK
,FALSE
},
7680 /* PARSE_ROOTDOCUMENT tests. */
7681 {"http://google.com:200/test/test",0,PARSE_ROOTDOCUMENT
,0,"http://google.com:200/",S_OK
,FALSE
},
7682 {"http://google.com",Uri_CREATE_NO_CANONICALIZE
,PARSE_ROOTDOCUMENT
,0,"http://google.com/",S_OK
,FALSE
},
7683 {"zip://google.com/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7684 {"file:///c:/testing/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7685 {"file://server/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7686 {"zip:test/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7688 /* PARSE_DOCUMENT tests. */
7689 {"http://test@google.com/test?query#frag",0,PARSE_DOCUMENT
,0,"http://test@google.com/test?query",S_OK
,FALSE
},
7690 {"http:testing#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7691 {"file:///c:/test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7692 {"zip://google.com/#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7693 {"zip:test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7694 {"testing#frag",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7696 /* PARSE_PATH_FROM_URL tests. */
7697 {"file:///c:/test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\test.mp3",S_OK
,FALSE
},
7698 {"file:///c:/t<|>est.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\t<|>est.mp3",S_OK
,FALSE
},
7699 {"file:///c:/te%XX t/",0,PARSE_PATH_FROM_URL
,0,"c:\\te%XX t\\",S_OK
,FALSE
},
7700 {"file://server/test",0,PARSE_PATH_FROM_URL
,0,"\\\\server\\test",S_OK
,FALSE
},
7701 {"http://google.com/",0,PARSE_PATH_FROM_URL
,0,"",E_INVALIDARG
,FALSE
},
7702 {"file:/c:/dir/test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\dir\\test.mp3",S_OK
},
7703 {"file:/c:/test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\test.mp3",S_OK
},
7704 {"file://c:\\test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\test.mp3",S_OK
},
7706 /* PARSE_URL_FROM_PATH tests. */
7707 /* This function almost seems to useless (just returns the absolute uri). */
7708 {"test.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"test.com",S_OK
,FALSE
},
7709 {"/test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"/test/test",S_OK
,FALSE
},
7710 {"file://c:\\test\\test",Uri_CREATE_FILE_USE_DOS_PATH
,PARSE_URL_FROM_PATH
,0,"file://c:\\test\\test",S_OK
,FALSE
},
7711 {"file:c:/test",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
7712 {"http:google.com/",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
7714 /* PARSE_SCHEMA tests. */
7715 {"http://google.com/test",0,PARSE_SCHEMA
,0,"http",S_OK
,FALSE
},
7716 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SCHEMA
,0,"",S_OK
,FALSE
},
7718 /* PARSE_SITE tests. */
7719 {"http://google.uk.com/",0,PARSE_SITE
,0,"google.uk.com",S_OK
,FALSE
},
7720 {"http://google.com.com/",0,PARSE_SITE
,0,"google.com.com",S_OK
,FALSE
},
7721 {"google.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SITE
,0,"",S_OK
,FALSE
},
7722 {"file://server/test",0,PARSE_SITE
,0,"server",S_OK
,FALSE
},
7724 /* PARSE_DOMAIN tests. */
7725 {"http://google.com.uk/",0,PARSE_DOMAIN
,0,"google.com.uk",S_OK
,FALSE
,"com.uk"},
7726 {"http://google.com.com/",0,PARSE_DOMAIN
,0,"com.com",S_OK
,FALSE
},
7727 {"test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
7728 {"file://server/test",0,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
7730 /* PARSE_LOCATION and PARSE_ANCHOR tests. */
7731 {"http://google.com/test#Test",0,PARSE_ANCHOR
,0,"#Test",S_OK
,FALSE
},
7732 {"http://google.com/test#Test",0,PARSE_LOCATION
,0,"#Test",S_OK
,FALSE
},
7733 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_ANCHOR
,0,"",S_OK
,FALSE
},
7734 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_LOCATION
,0,"",S_OK
,FALSE
}
7737 static inline LPWSTR
a2w(LPCSTR str
) {
7741 DWORD len
= MultiByteToWideChar(CP_UTF8
, 0, str
, -1, NULL
, 0);
7742 ret
= malloc(len
* sizeof(WCHAR
));
7743 MultiByteToWideChar(CP_UTF8
, 0, str
, -1, ret
, len
);
7749 static inline DWORD
strcmp_aw(LPCSTR strA
, LPCWSTR strB
) {
7750 LPWSTR strAW
= a2w(strA
);
7751 DWORD ret
= lstrcmpW(strAW
, strB
);
7756 static inline ULONG
get_refcnt(IUri
*uri
) {
7758 return IUri_Release(uri
);
7761 static void change_property(IUriBuilder
*builder
, const uri_builder_property
*prop
,
7766 valueW
= a2w(prop
->value
);
7767 switch(prop
->property
) {
7768 case Uri_PROPERTY_FRAGMENT
:
7769 hr
= IUriBuilder_SetFragment(builder
, valueW
);
7770 todo_wine_if(prop
->todo
) {
7771 ok(hr
== prop
->expected
,
7772 "Error: IUriBuilder_SetFragment returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
7773 hr
, prop
->expected
, test_index
);
7776 case Uri_PROPERTY_HOST
:
7777 hr
= IUriBuilder_SetHost(builder
, valueW
);
7778 todo_wine_if(prop
->todo
) {
7779 ok(hr
== prop
->expected
,
7780 "Error: IUriBuilder_SetHost returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
7781 hr
, prop
->expected
, test_index
);
7784 case Uri_PROPERTY_PASSWORD
:
7785 hr
= IUriBuilder_SetPassword(builder
, valueW
);
7786 todo_wine_if(prop
->todo
) {
7787 ok(hr
== prop
->expected
,
7788 "Error: IUriBuilder_SetPassword returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
7789 hr
, prop
->expected
, test_index
);
7792 case Uri_PROPERTY_PATH
:
7793 hr
= IUriBuilder_SetPath(builder
, valueW
);
7794 todo_wine_if(prop
->todo
) {
7795 ok(hr
== prop
->expected
,
7796 "Error: IUriBuilder_SetPath returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
7797 hr
, prop
->expected
, test_index
);
7800 case Uri_PROPERTY_QUERY
:
7801 hr
= IUriBuilder_SetQuery(builder
, valueW
);
7802 todo_wine_if(prop
->todo
) {
7803 ok(hr
== prop
->expected
,
7804 "Error: IUriBuilder_SetQuery returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
7805 hr
, prop
->expected
, test_index
);
7808 case Uri_PROPERTY_SCHEME_NAME
:
7809 hr
= IUriBuilder_SetSchemeName(builder
, valueW
);
7810 todo_wine_if(prop
->todo
) {
7811 ok(hr
== prop
->expected
,
7812 "Error: IUriBuilder_SetSchemeName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
7813 hr
, prop
->expected
, test_index
);
7816 case Uri_PROPERTY_USER_NAME
:
7817 hr
= IUriBuilder_SetUserName(builder
, valueW
);
7818 todo_wine_if(prop
->todo
) {
7819 ok(hr
== prop
->expected
,
7820 "Error: IUriBuilder_SetUserName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
7821 hr
, prop
->expected
, test_index
);
7825 trace("Unsupported operation for %d on uri_builder_tests[%ld].\n", prop
->property
, test_index
);
7832 * Simple tests to make sure the CreateUri function handles invalid flag combinations
7835 static void test_CreateUri_InvalidFlags(void) {
7838 for(i
= 0; i
< ARRAY_SIZE(invalid_flag_tests
); ++i
) {
7840 IUri
*uri
= (void*) 0xdeadbeef;
7842 hr
= pCreateUri(http_urlW
, invalid_flag_tests
[i
].flags
, 0, &uri
);
7843 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx, flags=0x%08lx\n",
7844 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
7845 ok(uri
== NULL
, "Error: expected the IUri to be NULL, but it was %p instead\n", uri
);
7849 static void test_CreateUri_InvalidArgs(void) {
7851 IUri
*uri
= (void*) 0xdeadbeef;
7853 const WCHAR invalidW
[] = {'i','n','v','a','l','i','d',0};
7854 static const WCHAR emptyW
[] = {0};
7856 hr
= pCreateUri(http_urlW
, 0, 0, NULL
);
7857 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx\n", hr
, E_INVALIDARG
);
7859 hr
= pCreateUri(NULL
, 0, 0, &uri
);
7860 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx\n", hr
, E_INVALIDARG
);
7861 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7863 uri
= (void*) 0xdeadbeef;
7864 hr
= pCreateUri(invalidW
, 0, 0, &uri
);
7865 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
7866 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7868 uri
= (void*) 0xdeadbeef;
7869 hr
= pCreateUri(emptyW
, 0, 0, &uri
);
7870 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
7871 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7874 static void test_CreateUri_InvalidUri(void) {
7877 for(i
= 0; i
< ARRAY_SIZE(invalid_uri_tests
); ++i
) {
7878 invalid_uri test
= invalid_uri_tests
[i
];
7883 uriW
= a2w(test
.uri
);
7884 hr
= pCreateUri(uriW
, test
.flags
, 0, &uri
);
7885 todo_wine_if(test
.todo
)
7886 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on invalid_uri_tests[%ld].\n",
7887 hr
, E_INVALIDARG
, i
);
7888 if(uri
) IUri_Release(uri
);
7894 static void test_IUri_GetPropertyBSTR(void) {
7899 /* Make sure GetPropertyBSTR handles invalid args correctly. */
7900 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7901 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
7903 BSTR received
= NULL
;
7905 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, NULL
, 0);
7906 ok(hr
== E_POINTER
, "Error: GetPropertyBSTR returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
7908 /* Make sure it handles an invalid Uri_PROPERTY correctly. */
7909 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_PORT
, &received
, 0);
7910 ok(hr
== E_INVALIDARG
/* IE10 */ || broken(hr
== S_OK
), "Error: GetPropertyBSTR returned 0x%08lx, expected E_INVALIDARG or S_OK.\n", hr
);
7912 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
7913 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
7914 SysFreeString(received
);
7916 ok(!received
, "received = %s\n", wine_dbgstr_w(received
));
7919 /* Make sure it handles the ZONE property correctly. */
7921 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_ZONE
, &received
, 0);
7922 ok(hr
== S_FALSE
, "Error: GetPropertyBSTR returned 0x%08lx, expected 0x%08lx.\n", hr
, S_FALSE
);
7923 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
7924 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
7925 SysFreeString(received
);
7927 if(uri
) IUri_Release(uri
);
7929 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
7930 uri_properties test
= uri_tests
[i
];
7934 uriW
= a2w(test
.uri
);
7935 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7936 todo_wine_if(test
.create_todo
)
7937 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx. Failed on uri_tests[%ld].\n",
7938 hr
, test
.create_expected
, i
);
7943 /* Checks all the string properties of the uri. */
7944 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
7945 BSTR received
= NULL
;
7946 uri_str_property prop
= test
.str_props
[j
];
7948 hr
= IUri_GetPropertyBSTR(uri
, j
, &received
, 0);
7949 todo_wine_if(prop
.todo
) {
7950 ok(hr
== prop
.expected
||
7951 (prop
.value2
&& hr
== prop
.expected2
),
7952 "GetPropertyBSTR returned 0x%08lx, expected 0x%08lx. On uri_tests[%ld].str_props[%ld].\n",
7953 hr
, prop
.expected
, i
, j
);
7954 ok(!strcmp_aw(prop
.value
, received
) || (prop
.value2
&& !strcmp_aw(prop
.value2
, received
)) ||
7955 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7956 "Expected %s but got %s on uri_tests[%ld].str_props[%ld].\n",
7957 prop
.value
, wine_dbgstr_w(received
), i
, j
);
7960 SysFreeString(received
);
7964 if(uri
) IUri_Release(uri
);
7970 static void test_IUri_GetPropertyDWORD(void) {
7975 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7976 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
7978 DWORD received
= 0xdeadbeef;
7980 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_DWORD_START
, NULL
, 0);
7981 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
7983 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_ABSOLUTE_URI
, &received
, 0);
7984 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
7985 ok(received
== 0, "Error: Expected received=%d but instead received=%ld.\n", 0, received
);
7987 if(uri
) IUri_Release(uri
);
7989 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
7990 uri_properties test
= uri_tests
[i
];
7994 uriW
= a2w(test
.uri
);
7995 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7996 todo_wine_if(test
.create_todo
)
7997 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx. Failed on uri_tests[%ld].\n",
7998 hr
, test
.create_expected
, i
);
8003 /* Checks all the DWORD properties of the uri. */
8004 for(j
= 0; j
< ARRAY_SIZE(test
.dword_props
); ++j
) {
8006 uri_dword_property prop
= test
.dword_props
[j
];
8008 hr
= IUri_GetPropertyDWORD(uri
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
8009 todo_wine_if(prop
.todo
) {
8010 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08lx, expected 0x%08lx. On uri_tests[%ld].dword_props[%ld].\n",
8011 hr
, prop
.expected
, i
, j
);
8012 ok(prop
.value
== received
, "Expected %ld but got %ld on uri_tests[%ld].dword_props[%ld].\n",
8013 prop
.value
, received
, i
, j
);
8018 if(uri
) IUri_Release(uri
);
8024 /* Tests all the 'Get*' property functions which deal with strings. */
8025 static void test_IUri_GetStrProperties(void) {
8030 /* Make sure all the 'Get*' string property functions handle invalid args correctly. */
8031 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8032 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
8034 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
8035 ok(hr
== E_POINTER
, "Error: GetAbsoluteUri returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8037 hr
= IUri_GetAuthority(uri
, NULL
);
8038 ok(hr
== E_POINTER
, "Error: GetAuthority returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8040 hr
= IUri_GetDisplayUri(uri
, NULL
);
8041 ok(hr
== E_POINTER
, "Error: GetDisplayUri returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8043 hr
= IUri_GetDomain(uri
, NULL
);
8044 ok(hr
== E_POINTER
, "Error: GetDomain returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8046 hr
= IUri_GetExtension(uri
, NULL
);
8047 ok(hr
== E_POINTER
, "Error: GetExtension returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8049 hr
= IUri_GetFragment(uri
, NULL
);
8050 ok(hr
== E_POINTER
, "Error: GetFragment returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8052 hr
= IUri_GetHost(uri
, NULL
);
8053 ok(hr
== E_POINTER
, "Error: GetHost returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8055 hr
= IUri_GetPassword(uri
, NULL
);
8056 ok(hr
== E_POINTER
, "Error: GetPassword returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8058 hr
= IUri_GetPath(uri
, NULL
);
8059 ok(hr
== E_POINTER
, "Error: GetPath returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8061 hr
= IUri_GetPathAndQuery(uri
, NULL
);
8062 ok(hr
== E_POINTER
, "Error: GetPathAndQuery returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8064 hr
= IUri_GetQuery(uri
, NULL
);
8065 ok(hr
== E_POINTER
, "Error: GetQuery returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8067 hr
= IUri_GetRawUri(uri
, NULL
);
8068 ok(hr
== E_POINTER
, "Error: GetRawUri returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8070 hr
= IUri_GetSchemeName(uri
, NULL
);
8071 ok(hr
== E_POINTER
, "Error: GetSchemeName returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8073 hr
= IUri_GetUserInfo(uri
, NULL
);
8074 ok(hr
== E_POINTER
, "Error: GetUserInfo returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8076 hr
= IUri_GetUserName(uri
, NULL
);
8077 ok(hr
== E_POINTER
, "Error: GetUserName returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
8079 if(uri
) IUri_Release(uri
);
8081 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
8082 uri_properties test
= uri_tests
[i
];
8086 uriW
= a2w(test
.uri
);
8087 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8088 todo_wine_if(test
.create_todo
)
8089 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8090 hr
, test
.create_expected
, i
);
8093 uri_str_property prop
;
8094 BSTR received
= NULL
;
8096 /* GetAbsoluteUri() tests. */
8097 prop
= test
.str_props
[Uri_PROPERTY_ABSOLUTE_URI
];
8098 hr
= IUri_GetAbsoluteUri(uri
, &received
);
8099 todo_wine_if(prop
.todo
) {
8100 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8101 hr
, prop
.expected
, i
);
8102 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
8103 "Error: Expected %s but got %s on uri_tests[%ld].\n",
8104 prop
.value
, wine_dbgstr_w(received
), i
);
8106 SysFreeString(received
);
8109 /* GetAuthority() tests. */
8110 prop
= test
.str_props
[Uri_PROPERTY_AUTHORITY
];
8111 hr
= IUri_GetAuthority(uri
, &received
);
8112 todo_wine_if(prop
.todo
) {
8113 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8114 hr
, prop
.expected
, i
);
8115 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8116 prop
.value
, wine_dbgstr_w(received
), i
);
8118 SysFreeString(received
);
8121 /* GetDisplayUri() tests. */
8122 prop
= test
.str_props
[Uri_PROPERTY_DISPLAY_URI
];
8123 hr
= IUri_GetDisplayUri(uri
, &received
);
8124 todo_wine_if(prop
.todo
) {
8125 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8126 hr
, prop
.expected
, i
);
8127 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
8128 "Error: Expected %s but got %s on uri_tests[%ld].\n",
8129 prop
.value
, wine_dbgstr_w(received
), i
);
8131 SysFreeString(received
);
8134 /* GetDomain() tests. */
8135 prop
= test
.str_props
[Uri_PROPERTY_DOMAIN
];
8136 hr
= IUri_GetDomain(uri
, &received
);
8137 todo_wine_if(prop
.todo
) {
8138 ok(hr
== prop
.expected
|| (prop
.value2
&& hr
== prop
.expected2
),
8139 "Error: GetDomain returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8140 hr
, prop
.expected
, i
);
8141 ok(!strcmp_aw(prop
.value
, received
) || (prop
.value2
&& !strcmp_aw(prop
.value2
, received
)),
8142 "Error: Expected %s but got %s on uri_tests[%ld].\n",
8143 prop
.value
, wine_dbgstr_w(received
), i
);
8145 SysFreeString(received
);
8148 /* GetExtension() tests. */
8149 prop
= test
.str_props
[Uri_PROPERTY_EXTENSION
];
8150 hr
= IUri_GetExtension(uri
, &received
);
8151 todo_wine_if(prop
.todo
) {
8152 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8153 hr
, prop
.expected
, i
);
8154 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8155 prop
.value
, wine_dbgstr_w(received
), i
);
8157 SysFreeString(received
);
8160 /* GetFragment() tests. */
8161 prop
= test
.str_props
[Uri_PROPERTY_FRAGMENT
];
8162 hr
= IUri_GetFragment(uri
, &received
);
8163 todo_wine_if(prop
.todo
) {
8164 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8165 hr
, prop
.expected
, i
);
8166 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8167 prop
.value
, wine_dbgstr_w(received
), i
);
8169 SysFreeString(received
);
8172 /* GetHost() tests. */
8173 prop
= test
.str_props
[Uri_PROPERTY_HOST
];
8174 hr
= IUri_GetHost(uri
, &received
);
8175 todo_wine_if(prop
.todo
) {
8176 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8177 hr
, prop
.expected
, i
);
8178 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8179 prop
.value
, wine_dbgstr_w(received
), i
);
8181 SysFreeString(received
);
8184 /* GetPassword() tests. */
8185 prop
= test
.str_props
[Uri_PROPERTY_PASSWORD
];
8186 hr
= IUri_GetPassword(uri
, &received
);
8187 todo_wine_if(prop
.todo
) {
8188 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8189 hr
, prop
.expected
, i
);
8190 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8191 prop
.value
, wine_dbgstr_w(received
), i
);
8193 SysFreeString(received
);
8196 /* GetPath() tests. */
8197 prop
= test
.str_props
[Uri_PROPERTY_PATH
];
8198 hr
= IUri_GetPath(uri
, &received
);
8199 todo_wine_if(prop
.todo
) {
8200 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8201 hr
, prop
.expected
, i
);
8202 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8203 prop
.value
, wine_dbgstr_w(received
), i
);
8205 SysFreeString(received
);
8208 /* GetPathAndQuery() tests. */
8209 prop
= test
.str_props
[Uri_PROPERTY_PATH_AND_QUERY
];
8210 hr
= IUri_GetPathAndQuery(uri
, &received
);
8211 todo_wine_if(prop
.todo
) {
8212 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8213 hr
, prop
.expected
, i
);
8214 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8215 prop
.value
, wine_dbgstr_w(received
), i
);
8217 SysFreeString(received
);
8220 /* GetQuery() tests. */
8221 prop
= test
.str_props
[Uri_PROPERTY_QUERY
];
8222 hr
= IUri_GetQuery(uri
, &received
);
8223 todo_wine_if(prop
.todo
) {
8224 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8225 hr
, prop
.expected
, i
);
8226 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8227 prop
.value
, wine_dbgstr_w(received
), i
);
8229 SysFreeString(received
);
8232 /* GetRawUri() tests. */
8233 prop
= test
.str_props
[Uri_PROPERTY_RAW_URI
];
8234 hr
= IUri_GetRawUri(uri
, &received
);
8235 todo_wine_if(prop
.todo
) {
8236 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8237 hr
, prop
.expected
, i
);
8238 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8239 prop
.value
, wine_dbgstr_w(received
), i
);
8241 SysFreeString(received
);
8244 /* GetSchemeName() tests. */
8245 prop
= test
.str_props
[Uri_PROPERTY_SCHEME_NAME
];
8246 hr
= IUri_GetSchemeName(uri
, &received
);
8247 todo_wine_if(prop
.todo
) {
8248 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8249 hr
, prop
.expected
, i
);
8250 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8251 prop
.value
, wine_dbgstr_w(received
), i
);
8253 SysFreeString(received
);
8256 /* GetUserInfo() tests. */
8257 prop
= test
.str_props
[Uri_PROPERTY_USER_INFO
];
8258 hr
= IUri_GetUserInfo(uri
, &received
);
8259 todo_wine_if(prop
.todo
) {
8260 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8261 hr
, prop
.expected
, i
);
8262 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8263 prop
.value
, wine_dbgstr_w(received
), i
);
8265 SysFreeString(received
);
8268 /* GetUserName() tests. */
8269 prop
= test
.str_props
[Uri_PROPERTY_USER_NAME
];
8270 hr
= IUri_GetUserName(uri
, &received
);
8271 todo_wine_if(prop
.todo
) {
8272 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8273 hr
, prop
.expected
, i
);
8274 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8275 prop
.value
, wine_dbgstr_w(received
), i
);
8277 SysFreeString(received
);
8280 if(uri
) IUri_Release(uri
);
8286 static void test_IUri_GetDwordProperties(void) {
8291 /* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
8292 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8293 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
8295 hr
= IUri_GetHostType(uri
, NULL
);
8296 ok(hr
== E_INVALIDARG
, "Error: GetHostType returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
8298 hr
= IUri_GetPort(uri
, NULL
);
8299 ok(hr
== E_INVALIDARG
, "Error: GetPort returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
8301 hr
= IUri_GetScheme(uri
, NULL
);
8302 ok(hr
== E_INVALIDARG
, "Error: GetScheme returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
8304 hr
= IUri_GetZone(uri
, NULL
);
8305 ok(hr
== E_INVALIDARG
, "Error: GetZone returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
8307 if(uri
) IUri_Release(uri
);
8309 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
8310 uri_properties test
= uri_tests
[i
];
8314 uriW
= a2w(test
.uri
);
8315 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8316 todo_wine_if(test
.create_todo
)
8317 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8318 hr
, test
.create_expected
, i
);
8321 uri_dword_property prop
;
8324 /* Assign an insane value so tests don't accidentally pass when
8327 received
= -9999999;
8329 /* GetHostType() tests. */
8330 prop
= test
.dword_props
[Uri_PROPERTY_HOST_TYPE
-Uri_PROPERTY_DWORD_START
];
8331 hr
= IUri_GetHostType(uri
, &received
);
8332 todo_wine_if(prop
.todo
) {
8333 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8334 hr
, prop
.expected
, i
);
8335 ok(received
== prop
.value
, "Error: Expected %ld but got %ld on uri_tests[%ld].\n", prop
.value
, received
, i
);
8337 received
= -9999999;
8339 /* GetPort() tests. */
8340 prop
= test
.dword_props
[Uri_PROPERTY_PORT
-Uri_PROPERTY_DWORD_START
];
8341 hr
= IUri_GetPort(uri
, &received
);
8342 todo_wine_if(prop
.todo
) {
8343 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8344 hr
, prop
.expected
, i
);
8345 ok(received
== prop
.value
, "Error: Expected %ld but got %ld on uri_tests[%ld].\n", prop
.value
, received
, i
);
8347 received
= -9999999;
8349 /* GetScheme() tests. */
8350 prop
= test
.dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
];
8351 hr
= IUri_GetScheme(uri
, &received
);
8352 todo_wine_if(prop
.todo
) {
8353 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8354 hr
, prop
.expected
, i
);
8355 ok(received
== prop
.value
, "Error: Expected %ld but got %ld on uri_tests[%ld].\n", prop
.value
, received
, i
);
8357 received
= -9999999;
8359 /* GetZone() tests. */
8360 prop
= test
.dword_props
[Uri_PROPERTY_ZONE
-Uri_PROPERTY_DWORD_START
];
8361 hr
= IUri_GetZone(uri
, &received
);
8362 todo_wine_if(prop
.todo
) {
8363 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8364 hr
, prop
.expected
, i
);
8365 ok(received
== prop
.value
, "Error: Expected %ld but got %ld on uri_tests[%ld].\n", prop
.value
, received
, i
);
8369 if(uri
) IUri_Release(uri
);
8375 static void test_IUri_GetPropertyLength(void) {
8380 /* Make sure it handles invalid args correctly. */
8381 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8382 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
8384 DWORD received
= 0xdeadbeef;
8386 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_STRING_START
, NULL
, 0);
8387 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
8389 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_DWORD_START
, &received
, 0);
8390 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength return 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
8391 ok(received
== 0xdeadbeef, "Error: Expected 0xdeadbeef but got 0x%08lx.\n", received
);
8393 if(uri
) IUri_Release(uri
);
8395 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
8396 uri_properties test
= uri_tests
[i
];
8400 uriW
= a2w(test
.uri
);
8401 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8402 todo_wine_if(test
.create_todo
)
8403 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on uri_test[%ld].\n",
8404 hr
, test
.create_expected
, i
);
8409 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
8410 DWORD expectedLen
, receivedLen
;
8411 uri_str_property prop
= test
.str_props
[j
];
8412 LPWSTR expectedValueW
;
8414 expectedLen
= lstrlenA(prop
.value
);
8415 /* Value may be unicode encoded */
8416 expectedValueW
= a2w(prop
.value
);
8417 expectedLen
= lstrlenW(expectedValueW
);
8418 free(expectedValueW
);
8420 /* This won't be necessary once GetPropertyLength is implemented. */
8423 hr
= IUri_GetPropertyLength(uri
, j
, &receivedLen
, 0);
8424 todo_wine_if(prop
.todo
) {
8425 ok(hr
== prop
.expected
|| (prop
.value2
&& hr
== prop
.expected2
),
8426 "Error: GetPropertyLength returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].str_props[%ld].\n",
8427 hr
, prop
.expected
, i
, j
);
8428 ok(receivedLen
== expectedLen
|| (prop
.value2
&& receivedLen
== lstrlenA(prop
.value2
)) ||
8429 broken(prop
.broken_value
&& receivedLen
== lstrlenA(prop
.broken_value
)),
8430 "Error: Expected a length of %ld but got %ld on uri_tests[%ld].str_props[%ld].\n",
8431 expectedLen
, receivedLen
, i
, j
);
8436 if(uri
) IUri_Release(uri
);
8442 static DWORD
compute_expected_props(uri_properties
*test
, DWORD
*mask
)
8448 for(i
=Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_STRING_LAST
; i
++) {
8449 if(test
->str_props
[i
-Uri_PROPERTY_STRING_START
].expected
== S_OK
)
8451 if(test
->str_props
[i
-Uri_PROPERTY_STRING_START
].value2
== NULL
||
8452 test
->str_props
[i
-Uri_PROPERTY_STRING_START
].expected
==
8453 test
->str_props
[i
-Uri_PROPERTY_STRING_START
].expected2
)
8457 for(i
=Uri_PROPERTY_DWORD_START
; i
<= Uri_PROPERTY_DWORD_LAST
; i
++) {
8458 if(test
->dword_props
[i
-Uri_PROPERTY_DWORD_START
].expected
== S_OK
)
8466 static void test_IUri_GetProperties(void) {
8471 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8472 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
8474 hr
= IUri_GetProperties(uri
, NULL
);
8475 ok(hr
== E_INVALIDARG
, "Error: GetProperties returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
8477 if(uri
) IUri_Release(uri
);
8479 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
8480 uri_properties test
= uri_tests
[i
];
8484 uriW
= a2w(test
.uri
);
8485 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8486 todo_wine_if(test
.create_todo
)
8487 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, test
.create_expected
);
8490 DWORD received
= 0, expected_props
, mask
;
8493 hr
= IUri_GetProperties(uri
, &received
);
8494 ok(hr
== S_OK
, "Error: GetProperties returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
8496 expected_props
= compute_expected_props(&test
, &mask
);
8498 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
8499 /* (1 << j) converts a Uri_PROPERTY to its corresponding Uri_HAS_* flag mask. */
8500 if(mask
& (1 << j
)) {
8501 if(expected_props
& (1 << j
))
8502 ok(received
& (1 << j
), "Error: Expected flag for property %ld on uri_tests[%ld].\n", j
, i
);
8504 ok(!(received
& (1 << j
)), "Error: Received flag for property %ld when not expected on uri_tests[%ld].\n", j
, i
);
8509 if(uri
) IUri_Release(uri
);
8515 static void test_IUri_HasProperty(void) {
8520 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8521 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
8523 hr
= IUri_HasProperty(uri
, Uri_PROPERTY_RAW_URI
, NULL
);
8524 ok(hr
== E_INVALIDARG
, "Error: HasProperty returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
8526 if(uri
) IUri_Release(uri
);
8528 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
8529 uri_properties test
= uri_tests
[i
];
8533 uriW
= a2w(test
.uri
);
8535 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8536 todo_wine_if(test
.create_todo
)
8537 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, test
.create_expected
);
8540 DWORD expected_props
, j
, mask
;
8542 expected_props
= compute_expected_props(&test
, &mask
);
8544 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
8545 /* Assign -1, then explicitly test for TRUE or FALSE later. */
8548 hr
= IUri_HasProperty(uri
, j
, &received
);
8549 ok(hr
== S_OK
, "Error: HasProperty returned 0x%08lx, expected 0x%08lx for property %ld on uri_tests[%ld].\n",
8552 if(mask
& (1 << j
)) {
8553 if(expected_props
& (1 << j
)) {
8554 ok(received
== TRUE
, "Error: Expected to have property %ld on uri_tests[%ld].\n", j
, i
);
8556 ok(received
== FALSE
, "Error: Wasn't expecting to have property %ld on uri_tests[%ld].\n", j
, i
);
8562 if(uri
) IUri_Release(uri
);
8573 static inline struct custom_uri
* impl_from_IUri(IUri
*iface
)
8575 return CONTAINING_RECORD(iface
, struct custom_uri
, IUri_iface
);
8578 static HRESULT WINAPI
custom_uri_QueryInterface(IUri
*iface
, REFIID iid
, void **out
)
8580 if (IsEqualIID(iid
, &IID_IUri
) || IsEqualIID(iid
, &IID_IUnknown
))
8588 return E_NOINTERFACE
;
8591 static ULONG WINAPI
custom_uri_AddRef(IUri
*iface
)
8593 struct custom_uri
*uri
= impl_from_IUri(iface
);
8594 return IUri_AddRef(uri
->uri
);
8597 static ULONG WINAPI
custom_uri_Release(IUri
*iface
)
8599 struct custom_uri
*uri
= impl_from_IUri(iface
);
8600 return IUri_Release(uri
->uri
);
8603 static HRESULT WINAPI
custom_uri_GetPropertyBSTR(IUri
*iface
, Uri_PROPERTY property
, BSTR
*value
, DWORD flags
)
8605 struct custom_uri
*uri
= impl_from_IUri(iface
);
8606 return IUri_GetPropertyBSTR(uri
->uri
, property
, value
, flags
);
8609 static HRESULT WINAPI
custom_uri_GetPropertyLength(IUri
*iface
, Uri_PROPERTY property
, DWORD
*length
, DWORD flags
)
8611 struct custom_uri
*uri
= impl_from_IUri(iface
);
8612 return IUri_GetPropertyLength(uri
->uri
, property
, length
, flags
);
8615 static HRESULT WINAPI
custom_uri_GetPropertyDWORD(IUri
*iface
, Uri_PROPERTY property
, DWORD
*value
, DWORD flags
)
8617 struct custom_uri
*uri
= impl_from_IUri(iface
);
8618 return IUri_GetPropertyDWORD(uri
->uri
, property
, value
, flags
);
8621 static HRESULT WINAPI
custom_uri_HasProperty(IUri
*iface
, Uri_PROPERTY property
, BOOL
*has_property
)
8623 struct custom_uri
*uri
= impl_from_IUri(iface
);
8624 return IUri_HasProperty(uri
->uri
, property
, has_property
);
8627 static HRESULT WINAPI
custom_uri_GetAbsoluteUri(IUri
*iface
, BSTR
*value
)
8629 struct custom_uri
*uri
= impl_from_IUri(iface
);
8630 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8633 static HRESULT WINAPI
custom_uri_GetAuthority(IUri
*iface
, BSTR
*value
)
8635 struct custom_uri
*uri
= impl_from_IUri(iface
);
8636 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8639 static HRESULT WINAPI
custom_uri_GetDisplayUri(IUri
*iface
, BSTR
*value
)
8641 struct custom_uri
*uri
= impl_from_IUri(iface
);
8642 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8645 static HRESULT WINAPI
custom_uri_GetDomain(IUri
*iface
, BSTR
*value
)
8647 struct custom_uri
*uri
= impl_from_IUri(iface
);
8648 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8651 static HRESULT WINAPI
custom_uri_GetExtension(IUri
*iface
, BSTR
*value
)
8653 struct custom_uri
*uri
= impl_from_IUri(iface
);
8654 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8657 static HRESULT WINAPI
custom_uri_GetFragment(IUri
*iface
, BSTR
*value
)
8659 struct custom_uri
*uri
= impl_from_IUri(iface
);
8660 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8663 static HRESULT WINAPI
custom_uri_GetHost(IUri
*iface
, BSTR
*value
)
8665 struct custom_uri
*uri
= impl_from_IUri(iface
);
8666 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8669 static HRESULT WINAPI
custom_uri_GetPassword(IUri
*iface
, BSTR
*value
)
8671 struct custom_uri
*uri
= impl_from_IUri(iface
);
8672 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8675 static HRESULT WINAPI
custom_uri_GetPath(IUri
*iface
, BSTR
*value
)
8677 struct custom_uri
*uri
= impl_from_IUri(iface
);
8678 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8681 static HRESULT WINAPI
custom_uri_GetPathAndQuery(IUri
*iface
, BSTR
*value
)
8683 struct custom_uri
*uri
= impl_from_IUri(iface
);
8684 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8687 static HRESULT WINAPI
custom_uri_GetQuery(IUri
*iface
, BSTR
*value
)
8689 struct custom_uri
*uri
= impl_from_IUri(iface
);
8690 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8693 static HRESULT WINAPI
custom_uri_GetRawUri(IUri
*iface
, BSTR
*value
)
8695 struct custom_uri
*uri
= impl_from_IUri(iface
);
8696 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8699 static HRESULT WINAPI
custom_uri_GetSchemeName(IUri
*iface
, BSTR
*value
)
8701 struct custom_uri
*uri
= impl_from_IUri(iface
);
8702 return IUri_GetSchemeName(uri
->uri
, value
);
8705 static HRESULT WINAPI
custom_uri_GetUserInfo(IUri
*iface
, BSTR
*value
)
8707 struct custom_uri
*uri
= impl_from_IUri(iface
);
8708 return IUri_GetUserInfo(uri
->uri
, value
);
8711 static HRESULT WINAPI
custom_uri_GetUserName(IUri
*iface
, BSTR
*value
)
8713 struct custom_uri
*uri
= impl_from_IUri(iface
);
8714 return IUri_GetUserName(uri
->uri
, value
);
8717 static HRESULT WINAPI
custom_uri_GetHostType(IUri
*iface
, DWORD
*value
)
8719 struct custom_uri
*uri
= impl_from_IUri(iface
);
8720 return IUri_GetHostType(uri
->uri
, value
);
8723 static HRESULT WINAPI
custom_uri_GetPort(IUri
*iface
, DWORD
*value
)
8725 struct custom_uri
*uri
= impl_from_IUri(iface
);
8726 return IUri_GetPort(uri
->uri
, value
);
8729 static HRESULT WINAPI
custom_uri_GetScheme(IUri
*iface
, DWORD
*value
)
8731 struct custom_uri
*uri
= impl_from_IUri(iface
);
8732 return IUri_GetScheme(uri
->uri
, value
);
8735 static HRESULT WINAPI
custom_uri_GetZone(IUri
*iface
, DWORD
*value
)
8737 struct custom_uri
*uri
= impl_from_IUri(iface
);
8738 return IUri_GetZone(uri
->uri
, value
);
8741 static HRESULT WINAPI
custom_uri_GetProperties(IUri
*iface
, DWORD
*flags
)
8743 struct custom_uri
*uri
= impl_from_IUri(iface
);
8744 return IUri_GetProperties(uri
->uri
, flags
);
8747 static HRESULT WINAPI
custom_uri_IsEqual(IUri
*iface
, IUri
*pUri
, BOOL
*is_equal
)
8749 struct custom_uri
*uri
= impl_from_IUri(iface
);
8750 return IUri_IsEqual(uri
->uri
, pUri
, is_equal
);
8753 static const IUriVtbl custom_uri_vtbl
=
8755 custom_uri_QueryInterface
,
8758 custom_uri_GetPropertyBSTR
,
8759 custom_uri_GetPropertyLength
,
8760 custom_uri_GetPropertyDWORD
,
8761 custom_uri_HasProperty
,
8762 custom_uri_GetAbsoluteUri
,
8763 custom_uri_GetAuthority
,
8764 custom_uri_GetDisplayUri
,
8765 custom_uri_GetDomain
,
8766 custom_uri_GetExtension
,
8767 custom_uri_GetFragment
,
8769 custom_uri_GetPassword
,
8771 custom_uri_GetPathAndQuery
,
8772 custom_uri_GetQuery
,
8773 custom_uri_GetRawUri
,
8774 custom_uri_GetSchemeName
,
8775 custom_uri_GetUserInfo
,
8776 custom_uri_GetUserName
,
8777 custom_uri_GetHostType
,
8779 custom_uri_GetScheme
,
8781 custom_uri_GetProperties
,
8785 static void test_IUri_IsEqual(void) {
8786 struct custom_uri custom_uri
;
8794 /* Make sure IsEqual handles invalid args correctly. */
8795 hres
= pCreateUri(http_urlW
, 0, 0, &uriA
);
8796 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hres
, S_OK
);
8797 hres
= pCreateUri(http_urlW
, 0, 0, &uriB
);
8798 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hres
, S_OK
);
8801 hres
= IUri_IsEqual(uriA
, NULL
, &equal
);
8802 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08lx, expected 0x%08lx.\n", hres
, S_OK
);
8803 ok(!equal
, "Error: Expected equal to be FALSE, but was %d instead.\n", equal
);
8805 hres
= IUri_IsEqual(uriA
, uriB
, NULL
);
8806 ok(hres
== E_POINTER
, "Error: IsEqual returned 0x%08lx, expected 0x%08lx.\n", hres
, E_POINTER
);
8809 hres
= IUri_IsEqual(uriA
, uriA
, &equal
);
8810 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08lx, expected 0x%08lx.\n", hres
, S_OK
);
8811 ok(equal
, "Error: Expected equal URIs.\n");
8814 hres
= IUri_IsEqual(uriA
, uriB
, &equal
);
8815 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08lx, expected 0x%08lx.\n", hres
, S_OK
);
8816 ok(equal
, "Error: Expected equal URIs.\n");
8821 custom_uri
.IUri_iface
.lpVtbl
= &custom_uri_vtbl
;
8823 for(i
= 0; i
< ARRAY_SIZE(equality_tests
); ++i
) {
8824 uri_equality test
= equality_tests
[i
];
8825 LPWSTR uriA_W
, uriB_W
;
8829 uriA_W
= a2w(test
.a
);
8830 uriB_W
= a2w(test
.b
);
8832 hres
= pCreateUri(uriA_W
, test
.create_flags_a
, 0, &uriA
);
8833 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on equality_tests[%ld].a\n", hres
, S_OK
, i
);
8835 hres
= pCreateUri(uriB_W
, test
.create_flags_b
, 0, &uriB
);
8836 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on equality_tests[%ld].b\n", hres
, S_OK
, i
);
8839 hres
= IUri_IsEqual(uriA
, uriB
, &equal
);
8840 todo_wine_if(test
.todo
) {
8841 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08lx, expected 0x%08lx on equality_tests[%ld].\n", hres
, S_OK
, i
);
8842 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%ld].\n", test
.equal
, i
);
8845 custom_uri
.uri
= uriB
;
8848 hres
= IUri_IsEqual(uriA
, &custom_uri
.IUri_iface
, &equal
);
8850 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08lx, expected 0x%08lx on equality_tests[%ld].\n", hres
, S_OK
, i
);
8851 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%ld].\n", test
.equal
, i
);
8854 if(uriA
) IUri_Release(uriA
);
8855 if(uriB
) IUri_Release(uriB
);
8862 static void test_CreateUriWithFragment_InvalidArgs(void) {
8864 IUri
*uri
= (void*) 0xdeadbeef;
8865 const WCHAR fragmentW
[] = {'#','f','r','a','g','m','e','n','t',0};
8867 hr
= pCreateUriWithFragment(NULL
, fragmentW
, 0, 0, &uri
);
8868 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
8869 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8871 hr
= pCreateUriWithFragment(http_urlW
, fragmentW
, 0, 0, NULL
);
8872 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
8874 /* Original URI can't already contain a fragment component. */
8875 uri
= (void*) 0xdeadbeef;
8876 hr
= pCreateUriWithFragment(http_url_fragW
, fragmentW
, 0, 0, &uri
);
8877 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
8878 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8881 /* CreateUriWithFragment has the same invalid flag combinations as CreateUri. */
8882 static void test_CreateUriWithFragment_InvalidFlags(void) {
8885 for(i
= 0; i
< ARRAY_SIZE(invalid_flag_tests
); ++i
) {
8887 IUri
*uri
= (void*) 0xdeadbeef;
8889 hr
= pCreateUriWithFragment(http_urlW
, NULL
, invalid_flag_tests
[i
].flags
, 0, &uri
);
8890 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUriWithFragment returned 0x%08lx, expected 0x%08lx. flags=0x%08lx.\n",
8891 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
8892 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8896 static void test_CreateUriWithFragment(void) {
8899 for(i
= 0; i
< ARRAY_SIZE(uri_fragment_tests
); ++i
) {
8903 uri_with_fragment test
= uri_fragment_tests
[i
];
8905 uriW
= a2w(test
.uri
);
8906 fragW
= a2w(test
.fragment
);
8908 hr
= pCreateUriWithFragment(uriW
, fragW
, test
.create_flags
, 0, &uri
);
8909 todo_wine_if(test
.expected_todo
)
8910 ok(hr
== test
.create_expected
,
8911 "Error: CreateUriWithFragment returned 0x%08lx, expected 0x%08lx on uri_fragment_tests[%ld].\n",
8912 hr
, test
.create_expected
, i
);
8915 BSTR received
= NULL
;
8917 hr
= IUri_GetAbsoluteUri(uri
, &received
);
8918 todo_wine_if(test
.expected_todo
) {
8919 ok(hr
== S_OK
, "Error: GetAbsoluteUri returned 0x%08lx, expected 0x%08lx on uri_fragment_tests[%ld].\n",
8921 ok(!strcmp_aw(test
.expected_uri
, received
), "Error: Expected %s but got %s on uri_fragment_tests[%ld].\n",
8922 test
.expected_uri
, wine_dbgstr_w(received
), i
);
8925 SysFreeString(received
);
8928 if(uri
) IUri_Release(uri
);
8934 static void test_CreateIUriBuilder(void) {
8936 IUriBuilder
*builder
= NULL
;
8939 hr
= pCreateIUriBuilder(NULL
, 0, 0, NULL
);
8940 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx\n",
8943 /* CreateIUriBuilder increases the ref count of the IUri it receives. */
8944 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8945 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
8947 ULONG cur_count
, orig_count
;
8949 orig_count
= get_refcnt(uri
);
8950 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
8951 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
8952 ok(builder
!= NULL
, "Error: Expecting builder not to be NULL\n");
8954 cur_count
= get_refcnt(uri
);
8955 ok(cur_count
== orig_count
+1, "Error: Expected the ref count to be %lu, but was %lu instead.\n", orig_count
+1, cur_count
);
8957 if(builder
) IUriBuilder_Release(builder
);
8958 cur_count
= get_refcnt(uri
);
8959 ok(cur_count
== orig_count
, "Error: Expected the ref count to be %lu, but was %lu instead.\n", orig_count
, cur_count
);
8961 if(uri
) IUri_Release(uri
);
8964 static void test_IUriBuilder_CreateUri(IUriBuilder
*builder
, const uri_builder_test
*test
,
8969 hr
= IUriBuilder_CreateUri(builder
, test
->uri_flags
, 0, 0, &uri
);
8970 todo_wine_if(test
->uri_todo
)
8971 ok(hr
== test
->uri_hres
,
8972 "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
8973 hr
, test
->uri_hres
, test_index
);
8978 for(i
= 0; i
< ARRAY_SIZE(test
->expected_str_props
); ++i
) {
8979 uri_builder_str_property prop
= test
->expected_str_props
[i
];
8980 BSTR received
= NULL
;
8982 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
8983 todo_wine_if(prop
.todo
)
8984 ok(hr
== prop
.result
,
8985 "Error: IUri_GetPropertyBSTR returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_str_props[%ld].\n",
8986 hr
, prop
.result
, test_index
, i
);
8988 todo_wine_if(prop
.todo
)
8989 ok(!strcmp_aw(prop
.expected
, received
),
8990 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].expected_str_props[%ld].\n",
8991 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8993 SysFreeString(received
);
8996 for(i
= 0; i
< ARRAY_SIZE(test
->expected_dword_props
); ++i
) {
8997 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
8998 DWORD received
= -2;
9000 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
9001 todo_wine_if(prop
.todo
)
9002 ok(hr
== prop
.result
,
9003 "Error: IUri_GetPropertyDWORD returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9004 hr
, prop
.result
, test_index
, i
);
9006 todo_wine_if(prop
.todo
)
9007 ok(received
== prop
.expected
,
9008 "Error: Expected %ld but got %ld instead on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9009 prop
.expected
, received
, test_index
, i
);
9013 if(uri
) IUri_Release(uri
);
9016 static void test_IUriBuilder_CreateUriSimple(IUriBuilder
*builder
, const uri_builder_test
*test
,
9021 hr
= IUriBuilder_CreateUriSimple(builder
, test
->uri_simple_encode_flags
, 0, &uri
);
9022 todo_wine_if(test
->uri_simple_todo
)
9023 ok(hr
== test
->uri_simple_hres
,
9024 "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9025 hr
, test
->uri_simple_hres
, test_index
);
9030 for(i
= 0; i
< ARRAY_SIZE(test
->expected_str_props
); ++i
) {
9031 uri_builder_str_property prop
= test
->expected_str_props
[i
];
9032 BSTR received
= NULL
;
9034 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
9035 todo_wine_if(prop
.todo
)
9036 ok(hr
== prop
.result
,
9037 "Error: IUri_GetPropertyBSTR returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_str_props[%ld].\n",
9038 hr
, prop
.result
, test_index
, i
);
9040 todo_wine_if(prop
.todo
)
9041 ok(!strcmp_aw(prop
.expected
, received
),
9042 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].expected_str_props[%ld].\n",
9043 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
9045 SysFreeString(received
);
9048 for(i
= 0; i
< ARRAY_SIZE(test
->expected_dword_props
); ++i
) {
9049 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
9050 DWORD received
= -2;
9052 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
9053 todo_wine_if(prop
.todo
)
9054 ok(hr
== prop
.result
,
9055 "Error: IUri_GetPropertyDWORD returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9056 hr
, prop
.result
, test_index
, i
);
9058 todo_wine_if(prop
.todo
)
9059 ok(received
== prop
.expected
,
9060 "Error: Expected %ld but got %ld instead on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9061 prop
.expected
, received
, test_index
, i
);
9065 if(uri
) IUri_Release(uri
);
9068 static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder
*builder
, const uri_builder_test
*test
,
9073 hr
= IUriBuilder_CreateUriWithFlags(builder
, test
->uri_with_flags
, test
->uri_with_builder_flags
,
9074 test
->uri_with_encode_flags
, 0, &uri
);
9075 todo_wine_if(test
->uri_with_todo
)
9076 ok(hr
== test
->uri_with_hres
,
9077 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9078 hr
, test
->uri_with_hres
, test_index
);
9083 for(i
= 0; i
< ARRAY_SIZE(test
->expected_str_props
); ++i
) {
9084 uri_builder_str_property prop
= test
->expected_str_props
[i
];
9085 BSTR received
= NULL
;
9087 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
9088 todo_wine_if(prop
.todo
)
9089 ok(hr
== prop
.result
,
9090 "Error: IUri_GetPropertyBSTR returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_str_props[%ld].\n",
9091 hr
, prop
.result
, test_index
, i
);
9093 todo_wine_if(prop
.todo
)
9094 ok(!strcmp_aw(prop
.expected
, received
),
9095 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].expected_str_props[%ld].\n",
9096 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
9098 SysFreeString(received
);
9101 for(i
= 0; i
< ARRAY_SIZE(test
->expected_dword_props
); ++i
) {
9102 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
9103 DWORD received
= -2;
9105 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
9106 todo_wine_if(prop
.todo
)
9107 ok(hr
== prop
.result
,
9108 "Error: IUri_GetPropertyDWORD returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9109 hr
, prop
.result
, test_index
, i
);
9111 todo_wine_if(prop
.todo
)
9112 ok(received
== prop
.expected
,
9113 "Error: Expected %ld but got %ld instead on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9114 prop
.expected
, received
, test_index
, i
);
9118 if(uri
) IUri_Release(uri
);
9121 static void test_IUriBuilder_CreateInvalidArgs(void) {
9122 IUriBuilder
*builder
;
9125 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
9126 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
9128 IUri
*test
= NULL
, *uri
= (void*) 0xdeadbeef;
9130 /* Test what happens if the IUriBuilder doesn't have a IUri set. */
9131 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, NULL
);
9132 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, E_POINTER
);
9134 uri
= (void*) 0xdeadbeef;
9135 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
9136 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, E_NOTIMPL
);
9137 ok(uri
== NULL
, "Error: expected uri to be NULL, but was %p instead.\n", uri
);
9139 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, NULL
);
9140 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx.\n",
9143 uri
= (void*) 0xdeadbeef;
9144 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
9145 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx.\n",
9147 ok(!uri
, "Error: Expected uri to NULL, but was %p instead.\n", uri
);
9149 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, NULL
);
9150 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n",
9153 uri
= (void*) 0xdeadbeef;
9154 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
9155 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n",
9157 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
9159 hr
= pCreateUri(http_urlW
, 0, 0, &test
);
9160 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
9162 hr
= IUriBuilder_SetIUri(builder
, test
);
9163 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
9165 /* No longer returns E_NOTIMPL, since a IUri has been set and hasn't been modified. */
9167 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
9168 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
9169 ok(uri
!= NULL
, "Error: The uri was NULL.\n");
9170 if(uri
) IUri_Release(uri
);
9173 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
9174 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx.\n",
9176 ok(uri
!= NULL
, "Error: uri was NULL.\n");
9177 if(uri
) IUri_Release(uri
);
9180 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &uri
);
9181 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n",
9183 ok(uri
!= NULL
, "Error: uri was NULL.\n");
9184 if(uri
) IUri_Release(uri
);
9186 hr
= IUriBuilder_SetFragment(builder
, NULL
);
9187 ok(hr
== S_OK
, "Error: IUriBuilder_SetFragment returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
9189 /* The IUriBuilder is changed, so it returns E_NOTIMPL again. */
9190 uri
= (void*) 0xdeadbeef;
9191 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
9192 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
9193 ok(!uri
, "Error: Expected uri to be NULL but was %p instead.\n", uri
);
9195 uri
= (void*) 0xdeadbeef;
9196 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
9197 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx.\n",
9199 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
9201 uri
= (void*) 0xdeadbeef;
9202 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
9203 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n",
9205 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
9207 if(test
) IUri_Release(test
);
9209 if(builder
) IUriBuilder_Release(builder
);
9212 /* Tests invalid args to the "Get*" functions. */
9213 static void test_IUriBuilder_GetInvalidArgs(void) {
9214 IUriBuilder
*builder
= NULL
;
9217 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
9218 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
9220 LPCWSTR received
= (void*) 0xdeadbeef;
9221 DWORD len
= -1, port
= -1;
9224 hr
= IUriBuilder_GetFragment(builder
, NULL
, NULL
);
9225 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx.\n",
9227 hr
= IUriBuilder_GetFragment(builder
, NULL
, &received
);
9228 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx.\n",
9230 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9231 hr
= IUriBuilder_GetFragment(builder
, &len
, NULL
);
9232 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx.\n",
9234 ok(!len
, "Error: Expected len to be 0, but was %ld instead.\n", len
);
9236 hr
= IUriBuilder_GetHost(builder
, NULL
, NULL
);
9237 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx.\n",
9239 received
= (void*) 0xdeadbeef;
9240 hr
= IUriBuilder_GetHost(builder
, NULL
, &received
);
9241 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx.\n",
9243 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9245 hr
= IUriBuilder_GetHost(builder
, &len
, NULL
);
9246 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx.\n",
9248 ok(!len
, "Error: Expected len to be 0, but was %ld instead.\n", len
);
9250 hr
= IUriBuilder_GetPassword(builder
, NULL
, NULL
);
9251 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx.\n",
9253 received
= (void*) 0xdeadbeef;
9254 hr
= IUriBuilder_GetPassword(builder
, NULL
, &received
);
9255 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx.\n",
9257 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9259 hr
= IUriBuilder_GetPassword(builder
, &len
, NULL
);
9260 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx.\n",
9262 ok(!len
, "Error: Expected len to be 0, but was %ld instead.\n", len
);
9264 hr
= IUriBuilder_GetPath(builder
, NULL
, NULL
);
9265 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx.\n",
9267 received
= (void*) 0xdeadbeef;
9268 hr
= IUriBuilder_GetPath(builder
, NULL
, &received
);
9269 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx.\n",
9271 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9273 hr
= IUriBuilder_GetPath(builder
, &len
, NULL
);
9274 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx.\n",
9276 ok(!len
, "Error: Expected len to be 0, but was %ld instead.\n", len
);
9278 hr
= IUriBuilder_GetPort(builder
, NULL
, NULL
);
9279 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx.\n",
9281 hr
= IUriBuilder_GetPort(builder
, NULL
, &port
);
9282 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx.\n",
9284 ok(!port
, "Error: Expected port to be 0, but was %ld instead.\n", port
);
9285 hr
= IUriBuilder_GetPort(builder
, &set
, NULL
);
9286 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx.\n",
9288 ok(!set
, "Error: Expected set to be FALSE, but was %d instead.\n", set
);
9290 hr
= IUriBuilder_GetQuery(builder
, NULL
, NULL
);
9291 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx.\n",
9293 received
= (void*) 0xdeadbeef;
9294 hr
= IUriBuilder_GetQuery(builder
, NULL
, &received
);
9295 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx.\n",
9297 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9299 hr
= IUriBuilder_GetQuery(builder
, &len
, NULL
);
9300 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx.\n",
9302 ok(!len
, "Error: Expected len to be 0, but was %ld instead.\n", len
);
9304 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, NULL
);
9305 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx.\n",
9307 received
= (void*) 0xdeadbeef;
9308 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, &received
);
9309 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx.\n",
9311 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9313 hr
= IUriBuilder_GetSchemeName(builder
, &len
, NULL
);
9314 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx.\n",
9316 ok(!len
, "Error: Expected len to be 0, but was %ld instead.\n", len
);
9318 hr
= IUriBuilder_GetUserName(builder
, NULL
, NULL
);
9319 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx.\n",
9321 received
= (void*) 0xdeadbeef;
9322 hr
= IUriBuilder_GetUserName(builder
, NULL
, &received
);
9323 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx.\n",
9325 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9327 hr
= IUriBuilder_GetUserName(builder
, &len
, NULL
);
9328 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx.\n",
9330 ok(!len
, "Error: Expected len to be 0, but was %ld instead.\n", len
);
9332 if(builder
) IUriBuilder_Release(builder
);
9335 static void test_IUriBuilder_GetFragment(IUriBuilder
*builder
, const uri_builder_test
*test
,
9339 LPCWSTR received
= NULL
;
9341 const uri_builder_property
*prop
= NULL
;
9343 /* Check if the property was set earlier. */
9344 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9345 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_FRAGMENT
)
9346 prop
= &(test
->properties
[i
]);
9350 /* Use expected_value unless it's NULL, then use value. */
9351 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9352 DWORD expected_len
= expected
? strlen(expected
) : 0;
9353 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9354 todo_wine_if(prop
->todo
) {
9355 ok(hr
== (expected
? S_OK
: S_FALSE
),
9356 "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9357 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9359 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
9360 expected
, wine_dbgstr_w(received
), test_index
);
9361 ok(expected_len
== len
,
9362 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
9363 expected_len
, len
, test_index
);
9367 /* The property wasn't set earlier, so it should return whatever
9368 * the base IUri contains (if anything).
9371 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9373 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9374 hr
, S_OK
, test_index
);
9377 received
= (void*) 0xdeadbeef;
9380 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9382 "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9383 hr
, S_FALSE
, test_index
);
9385 ok(!len
, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9387 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
9388 received
, test_index
);
9391 BOOL has_prop
= FALSE
;
9392 BSTR expected
= NULL
;
9394 hr
= IUri_GetFragment(uri
, &expected
);
9396 "Error: Expected IUri_GetFragment to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
9398 has_prop
= hr
== S_OK
;
9400 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9403 "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9404 hr
, S_OK
, test_index
);
9406 ok(!lstrcmpW(expected
, received
),
9407 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
9408 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9409 ok(lstrlenW(expected
) == len
,
9410 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
9411 lstrlenW(expected
), len
, test_index
);
9415 "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9416 hr
, S_FALSE
, test_index
);
9418 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index
);
9419 ok(!len
, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9423 SysFreeString(expected
);
9426 if(uri
) IUri_Release(uri
);
9430 static void test_IUriBuilder_GetHost(IUriBuilder
*builder
, const uri_builder_test
*test
,
9434 LPCWSTR received
= NULL
;
9436 const uri_builder_property
*prop
= NULL
;
9438 /* Check if the property was set earlier. */
9439 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9440 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_HOST
)
9441 prop
= &(test
->properties
[i
]);
9445 /* Use expected_value unless it's NULL, then use value. */
9446 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9447 DWORD expected_len
= expected
? strlen(expected
) : 0;
9448 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9449 todo_wine_if(prop
->todo
) {
9450 ok(hr
== (expected
? S_OK
: S_FALSE
),
9451 "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9452 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9454 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
9455 expected
, wine_dbgstr_w(received
), test_index
);
9456 ok(expected_len
== len
,
9457 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
9458 expected_len
, len
, test_index
);
9462 /* The property wasn't set earlier, so it should return whatever
9463 * the base IUri contains (if anything).
9466 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9468 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9469 hr
, S_OK
, test_index
);
9472 received
= (void*) 0xdeadbeef;
9475 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9477 "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9478 hr
, S_FALSE
, test_index
);
9480 ok(!len
, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9482 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
9483 received
, test_index
);
9486 BOOL has_prop
= FALSE
;
9487 BSTR expected
= NULL
;
9489 hr
= IUri_GetHost(uri
, &expected
);
9491 "Error: Expected IUri_GetHost to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
9493 has_prop
= hr
== S_OK
;
9495 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9498 "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9499 hr
, S_OK
, test_index
);
9501 ok(!lstrcmpW(expected
, received
),
9502 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
9503 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9504 ok(lstrlenW(expected
) == len
,
9505 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
9506 lstrlenW(expected
), len
, test_index
);
9510 "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9511 hr
, S_FALSE
, test_index
);
9513 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index
);
9514 ok(!len
, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9518 SysFreeString(expected
);
9521 if(uri
) IUri_Release(uri
);
9525 static void test_IUriBuilder_GetPassword(IUriBuilder
*builder
, const uri_builder_test
*test
,
9529 LPCWSTR received
= NULL
;
9531 const uri_builder_property
*prop
= NULL
;
9533 /* Check if the property was set earlier. */
9534 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9535 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PASSWORD
)
9536 prop
= &(test
->properties
[i
]);
9540 /* Use expected_value unless it's NULL, then use value. */
9541 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9542 DWORD expected_len
= expected
? strlen(expected
) : 0;
9543 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9544 todo_wine_if(prop
->todo
) {
9545 ok(hr
== (expected
? S_OK
: S_FALSE
),
9546 "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9547 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9549 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
9550 expected
, wine_dbgstr_w(received
), test_index
);
9551 ok(expected_len
== len
,
9552 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
9553 expected_len
, len
, test_index
);
9557 /* The property wasn't set earlier, so it should return whatever
9558 * the base IUri contains (if anything).
9561 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9563 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9564 hr
, S_OK
, test_index
);
9567 received
= (void*) 0xdeadbeef;
9570 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9572 "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9573 hr
, S_FALSE
, test_index
);
9575 ok(!len
, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9577 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
9578 received
, test_index
);
9581 BOOL has_prop
= FALSE
;
9582 BSTR expected
= NULL
;
9584 hr
= IUri_GetPassword(uri
, &expected
);
9586 "Error: Expected IUri_GetPassword to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
9588 has_prop
= hr
== S_OK
;
9590 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9593 "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9594 hr
, S_OK
, test_index
);
9596 ok(!lstrcmpW(expected
, received
),
9597 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
9598 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9599 ok(lstrlenW(expected
) == len
,
9600 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
9601 lstrlenW(expected
), len
, test_index
);
9605 "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9606 hr
, S_FALSE
, test_index
);
9608 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index
);
9609 ok(!len
, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9613 SysFreeString(expected
);
9616 if(uri
) IUri_Release(uri
);
9620 static void test_IUriBuilder_GetPath(IUriBuilder
*builder
, const uri_builder_test
*test
,
9624 LPCWSTR received
= NULL
;
9626 const uri_builder_property
*prop
= NULL
;
9628 /* Check if the property was set earlier. */
9629 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9630 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PATH
)
9631 prop
= &(test
->properties
[i
]);
9635 /* Use expected_value unless it's NULL, then use value. */
9636 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9637 DWORD expected_len
= expected
? strlen(expected
) : 0;
9638 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9639 todo_wine_if(prop
->todo
) {
9640 ok(hr
== (expected
? S_OK
: S_FALSE
),
9641 "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9642 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9644 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
9645 expected
, wine_dbgstr_w(received
), test_index
);
9646 ok(expected_len
== len
,
9647 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
9648 expected_len
, len
, test_index
);
9652 /* The property wasn't set earlier, so it should return whatever
9653 * the base IUri contains (if anything).
9656 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9658 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9659 hr
, S_OK
, test_index
);
9662 received
= (void*) 0xdeadbeef;
9665 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9667 "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9668 hr
, S_FALSE
, test_index
);
9670 ok(!len
, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9672 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
9673 received
, test_index
);
9676 BOOL has_prop
= FALSE
;
9677 BSTR expected
= NULL
;
9679 hr
= IUri_GetPath(uri
, &expected
);
9681 "Error: Expected IUri_GetPath to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
9683 has_prop
= hr
== S_OK
;
9685 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9688 "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9689 hr
, S_OK
, test_index
);
9691 ok(!lstrcmpW(expected
, received
),
9692 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
9693 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9694 ok(lstrlenW(expected
) == len
,
9695 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
9696 lstrlenW(expected
), len
, test_index
);
9700 "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9701 hr
, S_FALSE
, test_index
);
9703 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index
);
9704 ok(!len
, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9708 SysFreeString(expected
);
9711 if(uri
) IUri_Release(uri
);
9715 static void test_IUriBuilder_GetPort(IUriBuilder
*builder
, const uri_builder_test
*test
,
9718 BOOL has_port
= FALSE
;
9719 DWORD received
= -1;
9721 if(test
->port_prop
.change
) {
9722 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9723 todo_wine_if(test
->port_prop
.todo
) {
9725 "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9726 hr
, S_OK
, test_index
);
9728 ok(has_port
== test
->port_prop
.set
,
9729 "Error: Expected has_port to be %d, but was %d instead on uri_builder_tests[%ld].\n",
9730 test
->port_prop
.set
, has_port
, test_index
);
9731 ok(received
== test
->port_prop
.value
,
9732 "Error: Expected port to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
9733 test
->port_prop
.value
, received
, test_index
);
9739 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9741 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9742 hr
, S_OK
, test_index
);
9745 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9747 "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9748 hr
, S_OK
, test_index
);
9750 ok(has_port
== FALSE
,
9751 "Error: Expected has_port to be FALSE, but was %d instead on uri_builder_tests[%ld].\n",
9752 has_port
, test_index
);
9753 ok(!received
, "Error: Expected received to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9754 received
, test_index
);
9759 hr
= IUri_GetPort(uri
, &expected
);
9761 "Error: Expected IUri_Port to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
9764 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9766 "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9767 hr
, S_OK
, test_index
);
9770 "Error: Expected has_port to be FALSE but was TRUE instead on uri_builder_tests[%ld].\n",
9772 ok(received
== expected
,
9773 "Error: Expected received to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
9774 expected
, received
, test_index
);
9778 if(uri
) IUri_Release(uri
);
9782 static void test_IUriBuilder_GetQuery(IUriBuilder
*builder
, const uri_builder_test
*test
,
9786 LPCWSTR received
= NULL
;
9788 const uri_builder_property
*prop
= NULL
;
9790 /* Check if the property was set earlier. */
9791 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9792 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_QUERY
)
9793 prop
= &(test
->properties
[i
]);
9797 /* Use expected_value unless it's NULL, then use value. */
9798 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9799 DWORD expected_len
= expected
? strlen(expected
) : 0;
9800 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9801 todo_wine_if(prop
->todo
) {
9802 ok(hr
== (expected
? S_OK
: S_FALSE
),
9803 "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9804 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9806 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
9807 expected
, wine_dbgstr_w(received
), test_index
);
9808 ok(expected_len
== len
,
9809 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
9810 expected_len
, len
, test_index
);
9814 /* The property wasn't set earlier, so it should return whatever
9815 * the base IUri contains (if anything).
9818 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9820 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9821 hr
, S_OK
, test_index
);
9824 received
= (void*) 0xdeadbeef;
9827 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9829 "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9830 hr
, S_FALSE
, test_index
);
9832 ok(!len
, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9834 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
9835 received
, test_index
);
9838 BOOL has_prop
= FALSE
;
9839 BSTR expected
= NULL
;
9841 hr
= IUri_GetQuery(uri
, &expected
);
9843 "Error: Expected IUri_GetQuery to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
9845 has_prop
= hr
== S_OK
;
9847 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9850 "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9851 hr
, S_OK
, test_index
);
9853 ok(!lstrcmpW(expected
, received
),
9854 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
9855 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9856 ok(lstrlenW(expected
) == len
,
9857 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
9858 lstrlenW(expected
), len
, test_index
);
9862 "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9863 hr
, S_FALSE
, test_index
);
9865 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index
);
9866 ok(!len
, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9870 SysFreeString(expected
);
9873 if(uri
) IUri_Release(uri
);
9877 static void test_IUriBuilder_GetSchemeName(IUriBuilder
*builder
, const uri_builder_test
*test
,
9881 LPCWSTR received
= NULL
;
9883 const uri_builder_property
*prop
= NULL
;
9885 /* Check if the property was set earlier. */
9886 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9887 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_SCHEME_NAME
)
9888 prop
= &(test
->properties
[i
]);
9892 /* Use expected_value unless it's NULL, then use value. */
9893 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9894 DWORD expected_len
= expected
? strlen(expected
) : 0;
9895 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9896 todo_wine_if(prop
->todo
) {
9897 ok(hr
== (expected
? S_OK
: S_FALSE
),
9898 "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9899 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9901 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
9902 expected
, wine_dbgstr_w(received
), test_index
);
9903 ok(expected_len
== len
,
9904 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
9905 expected_len
, len
, test_index
);
9909 /* The property wasn't set earlier, so it should return whatever
9910 * the base IUri contains (if anything).
9913 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9915 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9916 hr
, S_OK
, test_index
);
9919 received
= (void*) 0xdeadbeef;
9922 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9924 "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9925 hr
, S_FALSE
, test_index
);
9927 ok(!len
, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9929 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
9930 received
, test_index
);
9933 BOOL has_prop
= FALSE
;
9934 BSTR expected
= NULL
;
9936 hr
= IUri_GetSchemeName(uri
, &expected
);
9938 "Error: Expected IUri_GetSchemeName to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
9940 has_prop
= hr
== S_OK
;
9942 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9945 "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9946 hr
, S_OK
, test_index
);
9948 ok(!lstrcmpW(expected
, received
),
9949 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
9950 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9951 ok(lstrlenW(expected
) == len
,
9952 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
9953 lstrlenW(expected
), len
, test_index
);
9957 "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9958 hr
, S_FALSE
, test_index
);
9960 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index
);
9961 ok(!len
, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9965 SysFreeString(expected
);
9968 if(uri
) IUri_Release(uri
);
9972 static void test_IUriBuilder_GetUserName(IUriBuilder
*builder
, const uri_builder_test
*test
,
9976 LPCWSTR received
= NULL
;
9978 const uri_builder_property
*prop
= NULL
;
9980 /* Check if the property was set earlier. */
9981 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9982 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_USER_NAME
)
9983 prop
= &(test
->properties
[i
]);
9986 if(prop
&& prop
->value
&& *prop
->value
) {
9987 /* Use expected_value unless it's NULL, then use value. */
9988 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9989 DWORD expected_len
= expected
? strlen(expected
) : 0;
9990 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
9991 todo_wine_if(prop
->todo
) {
9992 ok(hr
== (expected
? S_OK
: S_FALSE
),
9993 "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9994 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9996 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
9997 expected
, wine_dbgstr_w(received
), test_index
);
9998 ok(expected_len
== len
,
9999 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
10000 expected_len
, len
, test_index
);
10004 /* The property wasn't set earlier, so it should return whatever
10005 * the base IUri contains (if anything).
10008 hr
= IUriBuilder_GetIUri(builder
, &uri
);
10010 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10011 hr
, S_OK
, test_index
);
10012 if(SUCCEEDED(hr
)) {
10014 received
= (void*) 0xdeadbeef;
10017 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
10019 "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10020 hr
, S_FALSE
, test_index
);
10021 if(SUCCEEDED(hr
)) {
10022 ok(!len
, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10024 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
10025 received
, test_index
);
10028 BSTR expected
= NULL
;
10029 BOOL has_prop
= FALSE
;
10031 hr
= IUri_GetUserName(uri
, &expected
);
10033 "Error: Expected IUri_GetUserName to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
10035 has_prop
= hr
== S_OK
;
10037 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
10040 "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10041 hr
, S_OK
, test_index
);
10042 if(SUCCEEDED(hr
)) {
10043 ok(!lstrcmpW(expected
, received
),
10044 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
10045 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
10046 ok(lstrlenW(expected
) == len
,
10047 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
10048 lstrlenW(expected
), len
, test_index
);
10052 "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10053 hr
, S_FALSE
, test_index
);
10054 if(SUCCEEDED(hr
)) {
10055 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index
);
10056 ok(!len
, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10060 SysFreeString(expected
);
10063 if(uri
) IUri_Release(uri
);
10067 /* Tests IUriBuilder functions. */
10068 static void test_IUriBuilder(void) {
10070 IUriBuilder
*builder
;
10073 for(i
= 0; i
< ARRAY_SIZE(uri_builder_tests
); ++i
) {
10075 uri_builder_test test
= uri_builder_tests
[i
];
10076 LPWSTR uriW
= NULL
;
10079 uriW
= a2w(test
.uri
);
10080 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
10081 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10083 if(FAILED(hr
)) continue;
10085 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10086 todo_wine_if(test
.create_builder_todo
)
10087 ok(hr
== test
.create_builder_expected
,
10088 "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10089 hr
, test
.create_builder_expected
, i
);
10090 if(SUCCEEDED(hr
)) {
10092 BOOL modified
= FALSE
, received
= FALSE
;
10094 /* Perform all the string property changes. */
10095 for(j
= 0; j
< URI_BUILDER_STR_PROPERTY_COUNT
; ++j
) {
10096 uri_builder_property prop
= test
.properties
[j
];
10098 change_property(builder
, &prop
, i
);
10099 if(prop
.property
!= Uri_PROPERTY_SCHEME_NAME
&&
10100 prop
.property
!= Uri_PROPERTY_HOST
)
10102 else if(prop
.value
&& *prop
.value
)
10104 else if(prop
.value
&& !*prop
.value
&& prop
.property
== Uri_PROPERTY_HOST
)
10105 /* Host name property can't be NULL, but it can be empty. */
10110 if(test
.port_prop
.change
) {
10111 hr
= IUriBuilder_SetPort(builder
, test
.port_prop
.set
, test
.port_prop
.value
);
10113 todo_wine_if(test
.port_prop
.todo
)
10114 ok(hr
== test
.port_prop
.expected
,
10115 "Error: IUriBuilder_SetPort returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10116 hr
, test
.port_prop
.expected
, i
);
10119 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10121 "Error IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10124 ok(received
== modified
,
10125 "Error: Expected received to be %d but was %d instead on uri_builder_tests[%ld].\n",
10126 modified
, received
, i
);
10128 /* Test the "Get*" functions. */
10129 test_IUriBuilder_GetFragment(builder
, &test
, i
);
10130 test_IUriBuilder_GetHost(builder
, &test
, i
);
10131 test_IUriBuilder_GetPassword(builder
, &test
, i
);
10132 test_IUriBuilder_GetPath(builder
, &test
, i
);
10133 test_IUriBuilder_GetPort(builder
, &test
, i
);
10134 test_IUriBuilder_GetQuery(builder
, &test
, i
);
10135 test_IUriBuilder_GetSchemeName(builder
, &test
, i
);
10136 test_IUriBuilder_GetUserName(builder
, &test
, i
);
10138 test_IUriBuilder_CreateUri(builder
, &test
, i
);
10139 test_IUriBuilder_CreateUriSimple(builder
, &test
, i
);
10140 test_IUriBuilder_CreateUriWithFlags(builder
, &test
, i
);
10142 if(builder
) IUriBuilder_Release(builder
);
10143 if(uri
) IUri_Release(uri
);
10148 static void test_IUriBuilder_HasBeenModified(void) {
10150 IUriBuilder
*builder
= NULL
;
10152 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10153 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10154 if(SUCCEEDED(hr
)) {
10155 static const WCHAR hostW
[] = {'g','o','o','g','l','e','.','c','o','m',0};
10159 hr
= IUriBuilder_HasBeenModified(builder
, NULL
);
10160 ok(hr
== E_POINTER
, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10163 hr
= IUriBuilder_SetHost(builder
, hostW
);
10164 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08lx, expected 0x%08lx.\n",
10167 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10168 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10171 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10173 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10174 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10175 if(SUCCEEDED(hr
)) {
10179 hr
= IUriBuilder_SetIUri(builder
, uri
);
10180 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%08lx.\n",
10183 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10184 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10187 ok(received
== FALSE
, "Error: Expected received to be FALSE.\n");
10189 /* Test what happens with you call SetIUri with the same IUri again. */
10190 hr
= IUriBuilder_SetHost(builder
, hostW
);
10191 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10193 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10194 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10197 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10199 hr
= IUriBuilder_SetIUri(builder
, uri
);
10200 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10202 /* IUriBuilder already had 'uri' as its IUri property and so Windows doesn't
10203 * reset any of the changes that were made to the IUriBuilder.
10205 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10206 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10208 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10210 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
10211 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10212 if(SUCCEEDED(hr
)) {
10213 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
10214 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
10215 ok(len
== lstrlenW(hostW
), "Error: Expected len to be %d, but was %ld instead.\n",
10216 lstrlenW(hostW
), len
);
10219 hr
= IUriBuilder_SetIUri(builder
, NULL
);
10220 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10222 hr
= IUriBuilder_SetHost(builder
, hostW
);
10223 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10224 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10225 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10228 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10230 hr
= IUriBuilder_SetIUri(builder
, NULL
);
10231 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%09lx.\n", hr
, S_OK
);
10233 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10234 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10237 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10239 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
10240 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10241 if(SUCCEEDED(hr
)) {
10242 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
10243 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
10244 ok(len
== lstrlenW(hostW
), "Error: Expected len to %d, but was %ld instead.\n",
10245 lstrlenW(hostW
), len
);
10248 if(uri
) IUri_Release(uri
);
10250 if(builder
) IUriBuilder_Release(builder
);
10253 /* Test IUriBuilder {Get,Set}IUri functions. */
10254 static void test_IUriBuilder_IUriProperty(void) {
10255 IUriBuilder
*builder
= NULL
;
10258 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10259 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10260 if(SUCCEEDED(hr
)) {
10263 hr
= IUriBuilder_GetIUri(builder
, NULL
);
10264 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx.\n",
10267 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10268 if(SUCCEEDED(hr
)) {
10270 ULONG cur_count
, orig_count
;
10272 /* IUriBuilder doesn't clone the IUri, it use the same IUri. */
10273 orig_count
= get_refcnt(uri
);
10274 hr
= IUriBuilder_SetIUri(builder
, uri
);
10275 cur_count
= get_refcnt(uri
);
10277 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10278 orig_count
+1, cur_count
);
10280 hr
= IUriBuilder_SetIUri(builder
, NULL
);
10281 cur_count
= get_refcnt(uri
);
10283 ok(cur_count
== orig_count
, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10284 orig_count
, cur_count
);
10286 /* CreateUri* functions will return back the same IUri if nothing has changed. */
10287 hr
= IUriBuilder_SetIUri(builder
, uri
);
10288 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10289 orig_count
= get_refcnt(uri
);
10291 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, &test
);
10292 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10293 if(SUCCEEDED(hr
)) {
10294 cur_count
= get_refcnt(uri
);
10295 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10296 orig_count
+1, cur_count
);
10297 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n",
10300 if(test
) IUri_Release(test
);
10303 hr
= IUriBuilder_CreateUri(builder
, -1, 0, 0, &test
);
10304 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10305 if(SUCCEEDED(hr
)) {
10306 cur_count
= get_refcnt(uri
);
10307 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10308 orig_count
+1, cur_count
);
10309 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10311 if(test
) IUri_Release(test
);
10313 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10317 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, &test
);
10318 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10320 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
10322 if(test
) IUri_Release(test
);
10324 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10325 * explicitly set (because it's a default flag).
10328 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_CANONICALIZE
, 0, 0, &test
);
10329 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10330 if(SUCCEEDED(hr
)) {
10331 cur_count
= get_refcnt(uri
);
10332 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10333 orig_count
+1, cur_count
);
10334 ok(test
== uri
, "Error: Expected 'test' to be %p, but was %p instead.\n", uri
, test
);
10336 if(test
) IUri_Release(test
);
10339 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, &test
);
10340 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10341 if(SUCCEEDED(hr
)) {
10342 cur_count
= get_refcnt(uri
);
10343 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10344 orig_count
+1, cur_count
);
10345 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10347 if(test
) IUri_Release(test
);
10350 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &test
);
10351 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n",
10353 if(SUCCEEDED(hr
)) {
10354 cur_count
= get_refcnt(uri
);
10355 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10356 orig_count
+1, cur_count
);
10357 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10359 if(test
) IUri_Release(test
);
10361 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10365 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, 0, &test
);
10366 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10368 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
10370 if(test
) IUri_Release(test
);
10372 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10373 * explicitly set (because it's a default flag).
10376 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_CANONICALIZE
, 0, 0, 0, &test
);
10377 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10378 if(SUCCEEDED(hr
)) {
10379 cur_count
= get_refcnt(uri
);
10380 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10381 orig_count
+1, cur_count
);
10382 ok(test
== uri
, "Error: Expected 'test' to be %p, but was %p instead.\n", uri
, test
);
10384 if(test
) IUri_Release(test
);
10386 if(uri
) IUri_Release(uri
);
10388 if(builder
) IUriBuilder_Release(builder
);
10391 static void test_IUriBuilder_RemoveProperties(void) {
10392 IUriBuilder
*builder
= NULL
;
10396 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10397 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10398 if(SUCCEEDED(hr
)) {
10399 /* Properties that can't be removed. */
10400 const DWORD invalid
= Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_RAW_URI
|Uri_HAS_HOST_TYPE
|
10401 Uri_HAS_SCHEME
|Uri_HAS_ZONE
;
10403 for(i
= Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_DWORD_LAST
; ++i
) {
10404 hr
= IUriBuilder_RemoveProperties(builder
, i
<< 1);
10405 if((i
<< 1) & invalid
) {
10406 ok(hr
== E_INVALIDARG
,
10407 "Error: IUriBuilder_RemoveProperties returned 0x%08lx, expected 0x%08lx with prop=%ld.\n",
10408 hr
, E_INVALIDARG
, i
);
10411 "Error: IUriBuilder_RemoveProperties returned 0x%08lx, expected 0x%08lx with prop=%ld.\n",
10416 /* Also doesn't accept anything that's outside the range of the
10419 hr
= IUriBuilder_RemoveProperties(builder
, (Uri_PROPERTY_DWORD_LAST
+1) << 1);
10420 ok(hr
== E_INVALIDARG
, "Error: IUriBuilder_RemoveProperties returned 0x%08lx, expected 0x%08lx.\n",
10423 if(builder
) IUriBuilder_Release(builder
);
10425 for(i
= 0; i
< ARRAY_SIZE(uri_builder_remove_tests
); ++i
) {
10426 uri_builder_remove_test test
= uri_builder_remove_tests
[i
];
10430 uriW
= a2w(test
.uri
);
10431 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
10432 if(SUCCEEDED(hr
)) {
10435 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10436 todo_wine_if(test
.create_builder_todo
)
10437 ok(hr
== test
.create_builder_expected
,
10438 "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx on test %ld.\n",
10439 hr
, test
.create_builder_expected
, i
);
10441 if(SUCCEEDED(hr
)) {
10442 hr
= IUriBuilder_RemoveProperties(builder
, test
.remove_properties
);
10443 todo_wine_if(test
.remove_todo
)
10444 ok(hr
== test
.remove_expected
,
10445 "Error: IUriBuilder returned 0x%08lx, expected 0x%08lx on test %ld.\n",
10446 hr
, test
.remove_expected
, i
);
10447 if(SUCCEEDED(hr
)) {
10448 IUri
*result
= NULL
;
10450 hr
= IUriBuilder_CreateUri(builder
, test
.expected_flags
, 0, 0, &result
);
10451 todo_wine_if(test
.expected_todo
)
10452 ok(hr
== test
.expected_hres
,
10453 "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx on test %ld.\n",
10454 hr
, test
.expected_hres
, i
);
10455 if(SUCCEEDED(hr
)) {
10456 BSTR received
= NULL
;
10458 hr
= IUri_GetAbsoluteUri(result
, &received
);
10459 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08lx instead.\n", hr
);
10460 ok(!strcmp_aw(test
.expected_uri
, received
),
10461 "Error: Expected %s but got %s instead on test %ld.\n",
10462 test
.expected_uri
, wine_dbgstr_w(received
), i
);
10463 SysFreeString(received
);
10465 if(result
) IUri_Release(result
);
10468 if(builder
) IUriBuilder_Release(builder
);
10470 if(uri
) IUri_Release(uri
);
10475 static void test_IUriBuilder_Misc(void) {
10479 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10480 if(SUCCEEDED(hr
)) {
10481 IUriBuilder
*builder
;
10483 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10484 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10485 if(SUCCEEDED(hr
)) {
10489 hr
= IUriBuilder_GetPort(builder
, &has
, &port
);
10490 ok(hr
== S_OK
, "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10491 if(SUCCEEDED(hr
)) {
10492 /* 'has' will be set to FALSE, even though uri had a port. */
10493 ok(has
== FALSE
, "Error: Expected 'has' to be FALSE, was %d instead.\n", has
);
10494 /* Still sets 'port' to 80. */
10495 ok(port
== 80, "Error: Expected the port to be 80, but, was %ld instead.\n", port
);
10498 if(builder
) IUriBuilder_Release(builder
);
10500 if(uri
) IUri_Release(uri
);
10503 static void test_IUriBuilderFactory(void) {
10506 IUriBuilderFactory
*factory
;
10507 IUriBuilder
*builder
;
10509 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10510 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08lx.\n", hr
);
10511 if(SUCCEEDED(hr
)) {
10513 hr
= IUri_QueryInterface(uri
, &IID_IUriBuilderFactory
, (void**)&factory
);
10514 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08lx.\n", hr
);
10515 ok(factory
!= NULL
, "Error: Expected 'factory' to not be NULL.\n");
10517 if(SUCCEEDED(hr
)) {
10518 builder
= (void*) 0xdeadbeef;
10519 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 10, 0, &builder
);
10520 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10522 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10524 builder
= (void*) 0xdeadbeef;
10525 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 10, &builder
);
10526 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10528 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10530 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, NULL
);
10531 ok(hr
== E_POINTER
, "Error: CreateInitializedIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10535 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, &builder
);
10536 ok(hr
== S_OK
, "Error: CreateInitializedIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10538 if(SUCCEEDED(hr
)) {
10539 IUri
*tmp
= (void*) 0xdeadbeef;
10543 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
10544 ok(hr
== S_OK
, "Error: GetIUri returned 0x%08lx, expected 0x%08lx.\n",
10546 ok(!tmp
, "Error: Expected 'tmp' to be NULL, but was %p instead.\n", tmp
);
10548 hr
= IUriBuilder_GetHost(builder
, &result_len
, &result
);
10549 ok(hr
== S_FALSE
, "Error: GetHost returned 0x%08lx, expected 0x%08lx.\n",
10552 if(builder
) IUriBuilder_Release(builder
);
10554 builder
= (void*) 0xdeadbeef;
10555 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 10, 0, &builder
);
10556 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10558 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10560 builder
= (void*) 0xdeadbeef;
10561 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 10, &builder
);
10562 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10564 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10566 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, NULL
);
10567 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10571 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, &builder
);
10572 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10574 if(SUCCEEDED(hr
)) {
10577 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
10578 ok(hr
== S_OK
, "Error: GetIUri return 0x%08lx, expected 0x%08lx.\n",
10580 ok(tmp
== uri
, "Error: Expected tmp to be %p, but was %p.\n", uri
, tmp
);
10581 if(tmp
) IUri_Release(tmp
);
10583 if(builder
) IUriBuilder_Release(builder
);
10585 if(factory
) IUriBuilderFactory_Release(factory
);
10587 if(uri
) IUri_Release(uri
);
10590 static void test_CoInternetCombineIUri(void) {
10592 IUri
*base
, *relative
, *result
;
10596 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
10597 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08lx.\n", hr
);
10598 if(SUCCEEDED(hr
)) {
10599 result
= (void*) 0xdeadbeef;
10600 hr
= pCoInternetCombineIUri(base
, NULL
, 0, &result
, 0);
10601 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
10602 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
10606 hr
= pCreateUri(http_urlW
, 0, 0, &relative
);
10607 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08lx.\n", hr
);
10608 if(SUCCEEDED(hr
)) {
10609 result
= (void*) 0xdeadbeef;
10610 hr
= pCoInternetCombineIUri(NULL
, relative
, 0, &result
, 0);
10611 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
10612 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
10615 hr
= pCoInternetCombineIUri(base
, relative
, 0, NULL
, 0);
10616 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08lx, expected 0x%08lx.\n", hr
, E_INVALIDARG
);
10618 if(base
) IUri_Release(base
);
10619 if(relative
) IUri_Release(relative
);
10621 for(i
= 0; i
< ARRAY_SIZE(uri_combine_tests
); ++i
) {
10622 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
10624 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
10625 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08lx on uri_combine_tests[%ld].\n", hr
, i
);
10626 if(SUCCEEDED(hr
)) {
10627 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
10629 hr
= pCreateUri(relativeW
, uri_combine_tests
[i
].relative_create_flags
, 0, &relative
);
10630 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08lx on uri_combine_tests[%ld].\n", hr
, i
);
10631 if(SUCCEEDED(hr
)) {
10634 hr
= pCoInternetCombineIUri(base
, relative
, uri_combine_tests
[i
].combine_flags
, &result
, 0);
10635 todo_wine_if(uri_combine_tests
[i
].todo
)
10636 ok(hr
== uri_combine_tests
[i
].expected
||
10637 broken(hr
== S_OK
&& uri_combine_tests
[i
].expected
== E_INVALIDARG
) /* win10 1607 to 1709 */,
10638 "Error: CoInternetCombineIUri returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].\n",
10639 hr
, uri_combine_tests
[i
]. expected
, i
);
10640 if(SUCCEEDED(hr
) && SUCCEEDED(uri_combine_tests
[i
].expected
)) {
10643 for(j
= 0; j
< ARRAY_SIZE(uri_combine_tests
[i
].str_props
); ++j
) {
10644 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
10647 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
10648 todo_wine_if(prop
.todo
) {
10649 ok(hr
== prop
.expected
,
10650 "Error: IUri_GetPropertyBSTR returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].str_props[%ld].\n",
10651 hr
, prop
.expected
, i
, j
);
10652 ok(!strcmp_aw(prop
.value
, received
) ||
10653 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10654 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%ld].str_props[%ld].\n",
10655 prop
.value
, wine_dbgstr_w(received
), i
, j
);
10657 SysFreeString(received
);
10660 for(j
= 0; j
< ARRAY_SIZE(uri_combine_tests
[i
].dword_props
); ++j
) {
10661 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
10664 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
10665 todo_wine_if(prop
.todo
) {
10666 ok(hr
== prop
.expected
|| broken(prop
.broken_combine_hres
&& hr
== S_FALSE
),
10667 "Error: IUri_GetPropertyDWORD returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].dword_props[%ld].\n",
10668 hr
, prop
.expected
, i
, j
);
10669 if(!prop
.broken_combine_hres
|| hr
!= S_FALSE
)
10670 ok(prop
.value
== received
, "Error: Expected %ld, but got %ld instead on uri_combine_tests[%ld].dword_props[%ld].\n",
10671 prop
.value
, received
, i
, j
);
10675 if(result
) IUri_Release(result
);
10677 if(relative
) IUri_Release(relative
);
10680 if(base
) IUri_Release(base
);
10685 static HRESULT WINAPI
InternetProtocolInfo_QueryInterface(IInternetProtocolInfo
*iface
,
10686 REFIID riid
, void **ppv
)
10688 ok(0, "unexpected call\n");
10689 return E_NOINTERFACE
;
10692 static ULONG WINAPI
InternetProtocolInfo_AddRef(IInternetProtocolInfo
*iface
)
10697 static ULONG WINAPI
InternetProtocolInfo_Release(IInternetProtocolInfo
*iface
)
10702 static HRESULT WINAPI
InternetProtocolInfo_ParseUrl(IInternetProtocolInfo
*iface
, LPCWSTR pwzUrl
,
10703 PARSEACTION ParseAction
, DWORD dwParseFlags
, LPWSTR pwzResult
, DWORD cchResult
,
10704 DWORD
*pcchResult
, DWORD dwReserved
)
10706 CHECK_EXPECT(ParseUrl
);
10707 ok(!lstrcmpW(pwzUrl
, parse_urlW
), "Error: Expected %s, but got %s instead.\n",
10708 wine_dbgstr_w(parse_urlW
), wine_dbgstr_w(pwzUrl
));
10709 ok(ParseAction
== parse_action
, "Error: Expected %d, but got %d.\n", parse_action
, ParseAction
);
10710 ok(dwParseFlags
== parse_flags
, "Error: Expected 0x%08lx, but got 0x%08lx.\n", parse_flags
, dwParseFlags
);
10711 ok(cchResult
== 200, "Error: Got %ld.\n", cchResult
);
10713 memcpy(pwzResult
, parse_resultW
, sizeof(parse_resultW
));
10714 *pcchResult
= lstrlenW(parse_resultW
);
10719 static HRESULT WINAPI
InternetProtocolInfo_CombineUrl(IInternetProtocolInfo
*iface
,
10720 LPCWSTR pwzBaseUrl
, LPCWSTR pwzRelativeUrl
, DWORD dwCombineFlags
,
10721 LPWSTR pwzResult
, DWORD cchResult
, DWORD
*pcchResult
, DWORD dwReserved
)
10723 CHECK_EXPECT(CombineUrl
);
10724 ok(!lstrcmpW(pwzBaseUrl
, combine_baseW
), "Error: Expected %s, but got %s instead.\n",
10725 wine_dbgstr_w(combine_baseW
), wine_dbgstr_w(pwzBaseUrl
));
10726 ok(!lstrcmpW(pwzRelativeUrl
, combine_relativeW
), "Error: Expected %s, but got %s instead.\n",
10727 wine_dbgstr_w(combine_relativeW
), wine_dbgstr_w(pwzRelativeUrl
));
10728 ok(dwCombineFlags
== (URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
),
10729 "Error: Expected 0, but got 0x%08lx.\n", dwCombineFlags
);
10730 ok(cchResult
== INTERNET_MAX_URL_LENGTH
+1, "Error: Got %ld.\n", cchResult
);
10732 memcpy(pwzResult
, combine_resultW
, sizeof(combine_resultW
));
10733 *pcchResult
= lstrlenW(combine_resultW
);
10738 static HRESULT WINAPI
InternetProtocolInfo_CompareUrl(IInternetProtocolInfo
*iface
,
10739 LPCWSTR pwzUrl1
, LPCWSTR pwzUrl2
, DWORD dwCompareFlags
)
10741 ok(0, "unexpected call\n");
10745 static HRESULT WINAPI
InternetProtocolInfo_QueryInfo(IInternetProtocolInfo
*iface
,
10746 LPCWSTR pwzUrl
, QUERYOPTION OueryOption
, DWORD dwQueryFlags
, LPVOID pBuffer
,
10747 DWORD cbBuffer
, DWORD
*pcbBuf
, DWORD dwReserved
)
10749 ok(0, "unexpected call\n");
10753 static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
= {
10754 InternetProtocolInfo_QueryInterface
,
10755 InternetProtocolInfo_AddRef
,
10756 InternetProtocolInfo_Release
,
10757 InternetProtocolInfo_ParseUrl
,
10758 InternetProtocolInfo_CombineUrl
,
10759 InternetProtocolInfo_CompareUrl
,
10760 InternetProtocolInfo_QueryInfo
10763 static IInternetProtocolInfo protocol_info
= { &InternetProtocolInfoVtbl
};
10765 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFIID riid
, void **ppv
)
10767 if(IsEqualGUID(&IID_IInternetProtocolInfo
, riid
)) {
10768 *ppv
= &protocol_info
;
10772 ok(0, "unexpected call\n");
10773 return E_NOINTERFACE
;
10776 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
10781 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
10786 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
, IUnknown
*pOuter
,
10787 REFIID riid
, void **ppv
)
10789 ok(0, "unexpected call\n");
10793 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL dolock
)
10795 ok(0, "unexpected call\n");
10799 static const IClassFactoryVtbl ClassFactoryVtbl
= {
10800 ClassFactory_QueryInterface
,
10801 ClassFactory_AddRef
,
10802 ClassFactory_Release
,
10803 ClassFactory_CreateInstance
,
10804 ClassFactory_LockServer
10807 static IClassFactory protocol_cf
= { &ClassFactoryVtbl
};
10809 static void register_protocols(void)
10811 IInternetSession
*session
;
10814 hres
= pCoInternetGetSession(0, &session
, 0);
10815 ok(hres
== S_OK
, "CoInternetGetSession failed: %08lx\n", hres
);
10819 hres
= IInternetSession_RegisterNameSpace(session
, &protocol_cf
, &IID_NULL
,
10820 winetestW
, 0, NULL
, 0);
10821 ok(hres
== S_OK
, "RegisterNameSpace failed: %08lx\n", hres
);
10823 IInternetSession_Release(session
);
10826 static void unregister_protocols(void) {
10827 IInternetSession
*session
;
10830 hr
= pCoInternetGetSession(0, &session
, 0);
10831 ok(hr
== S_OK
, "CoInternetGetSession failed: 0x%08lx\n", hr
);
10835 hr
= IInternetSession_UnregisterNameSpace(session
, &protocol_cf
, winetestW
);
10836 ok(hr
== S_OK
, "UnregisterNameSpace failed: 0x%08lx\n", hr
);
10838 IInternetSession_Release(session
);
10841 static void test_CoInternetCombineIUri_Pluggable(void) {
10845 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
10846 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08lx.\n", hr
);
10847 if(SUCCEEDED(hr
)) {
10848 IUri
*relative
= NULL
;
10850 hr
= pCreateUri(combine_relativeW
, Uri_CREATE_ALLOW_RELATIVE
, 0, &relative
);
10851 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08lx.\n", hr
);
10852 if(SUCCEEDED(hr
)) {
10853 IUri
*result
= NULL
;
10855 SET_EXPECT(CombineUrl
);
10857 hr
= pCoInternetCombineIUri(base
, relative
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
10859 ok(hr
== S_OK
, "Error: CoInternetCombineIUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10861 CHECK_CALLED(CombineUrl
);
10863 if(SUCCEEDED(hr
)) {
10864 BSTR received
= NULL
;
10865 hr
= IUri_GetAbsoluteUri(result
, &received
);
10866 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08lx instead.\n", hr
);
10867 if(SUCCEEDED(hr
)) {
10868 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
10869 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
10871 SysFreeString(received
);
10873 if(result
) IUri_Release(result
);
10875 if(relative
) IUri_Release(relative
);
10877 if(base
) IUri_Release(base
);
10880 static void test_CoInternetCombineUrlEx(void) {
10882 IUri
*base
, *result
;
10886 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
10887 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08lx.\n", hr
);
10888 if(SUCCEEDED(hr
)) {
10889 result
= (void*) 0xdeadbeef;
10890 hr
= pCoInternetCombineUrlEx(base
, NULL
, 0, &result
, 0);
10891 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx.\n",
10893 ok(!result
, "Error: Expected 'result' to be NULL was %p instead.\n", result
);
10896 result
= (void*) 0xdeadbeef;
10897 hr
= pCoInternetCombineUrlEx(NULL
, http_urlW
, 0, &result
, 0);
10898 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx.\n",
10900 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
10902 result
= (void*) 0xdeadbeef;
10903 hr
= pCoInternetCombineUrlEx(NULL
, NULL
, 0, &result
, 0);
10904 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx.\n",
10906 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
10908 hr
= pCoInternetCombineUrlEx(base
, http_urlW
, 0, NULL
, 0);
10909 ok(hr
== E_POINTER
, "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx.\n",
10911 if(base
) IUri_Release(base
);
10913 for(i
= 0; i
< ARRAY_SIZE(uri_combine_tests
); ++i
) {
10914 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
10916 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
10917 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08lx on uri_combine_tests[%ld].\n", hr
, i
);
10918 if(SUCCEEDED(hr
)) {
10919 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
10921 hr
= pCoInternetCombineUrlEx(base
, relativeW
, uri_combine_tests
[i
].combine_flags
,
10923 todo_wine_if(uri_combine_tests
[i
].todo
)
10924 ok(hr
== uri_combine_tests
[i
].expected
||
10925 broken(hr
== S_OK
&& uri_combine_tests
[i
].expected
== E_INVALIDARG
) /* win10 1607 to 1709 */,
10926 "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].\n",
10927 hr
, uri_combine_tests
[i
]. expected
, i
);
10928 if(SUCCEEDED(hr
) && SUCCEEDED(uri_combine_tests
[i
].expected
)) {
10931 for(j
= 0; j
< ARRAY_SIZE(uri_combine_tests
[i
].str_props
); ++j
) {
10932 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
10934 LPCSTR value
= (prop
.value_ex
) ? prop
.value_ex
: prop
.value
;
10936 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
10937 todo_wine_if(prop
.todo
) {
10938 ok(hr
== prop
.expected
,
10939 "Error: IUri_GetPropertyBSTR returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].str_props[%ld].\n",
10940 hr
, prop
.expected
, i
, j
);
10941 ok(!strcmp_aw(value
, received
) ||
10942 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10943 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%ld].str_props[%ld].\n",
10944 value
, wine_dbgstr_w(received
), i
, j
);
10946 SysFreeString(received
);
10949 for(j
= 0; j
< ARRAY_SIZE(uri_combine_tests
[i
].dword_props
); ++j
) {
10950 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
10953 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
10954 todo_wine_if(prop
.todo
) {
10955 ok(hr
== prop
.expected
|| broken(prop
.broken_combine_hres
&& hr
== S_FALSE
),
10956 "Error: IUri_GetPropertyDWORD returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].dword_props[%ld].\n",
10957 hr
, prop
.expected
, i
, j
);
10958 if(!prop
.broken_combine_hres
|| hr
!= S_FALSE
)
10959 ok(prop
.value
== received
, "Error: Expected %ld, but got %ld instead on uri_combine_tests[%ld].dword_props[%ld].\n",
10960 prop
.value
, received
, i
, j
);
10964 if(result
) IUri_Release(result
);
10967 if(base
) IUri_Release(base
);
10972 static void test_CoInternetCombineUrlEx_Pluggable(void) {
10976 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
10977 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08lx.\n", hr
);
10978 if(SUCCEEDED(hr
)) {
10979 IUri
*result
= NULL
;
10981 SET_EXPECT(CombineUrl
);
10983 hr
= pCoInternetCombineUrlEx(base
, combine_relativeW
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
10985 ok(hr
== S_OK
, "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
10987 CHECK_CALLED(CombineUrl
);
10989 if(SUCCEEDED(hr
)) {
10990 BSTR received
= NULL
;
10991 hr
= IUri_GetAbsoluteUri(result
, &received
);
10992 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08lx instead.\n", hr
);
10993 if(SUCCEEDED(hr
)) {
10994 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
10995 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
10997 SysFreeString(received
);
10999 if(result
) IUri_Release(result
);
11001 if(base
) IUri_Release(base
);
11004 static void test_CoInternetParseIUri_InvalidArgs(void) {
11008 WCHAR
*longurl
, *copy
;
11012 hr
= pCoInternetParseIUri(NULL
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
11013 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11015 ok(!result
, "Error: Expected 'result' to be 0, but was %ld.\n", result
);
11017 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
11018 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08lx.\n", hr
);
11019 if(SUCCEEDED(hr
)) {
11020 DWORD expected_len
;
11023 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, NULL
, 0, &result
, 0);
11024 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11026 ok(!result
, "Error: Expected 'result' to be 0, but was %ld.\n", result
);
11028 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, NULL
, 0);
11029 ok(hr
== E_POINTER
, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11033 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_URL
, 0, tmp
, 3, &result
, 0);
11034 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08lx expected 0x%08lx.\n",
11036 ok(!result
, "Error: Expected 'result' to be 0, but was %ld.\n", result
);
11039 hr
= pCoInternetParseIUri(uri
, PARSE_MIME
, 0, tmp
, 3, &result
, 0);
11040 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11042 ok(!result
, "Error: Expected 'result' to be 0, but was %ld.\n", result
);
11045 hr
= pCoInternetParseIUri(uri
, PARSE_SERVER
, 0, tmp
, 3, &result
, 0);
11046 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11048 ok(!result
, "Error: Expected 'result' to be 0, but was %ld.\n", result
);
11051 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_DOMAIN
, 0, tmp
, 3, &result
, 0);
11052 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11054 ok(!result
, "Error: Expected 'result' to be 0, but was %ld.\n", result
);
11056 expected_len
= lstrlenW(http_urlW
);
11058 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
11059 ok(hr
== STRSAFE_E_INSUFFICIENT_BUFFER
,
11060 "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11061 hr
, STRSAFE_E_INSUFFICIENT_BUFFER
);
11062 ok(result
== expected_len
, "Error: Expected 'result' to be %ld, but was %ld instead.\n",
11063 expected_len
, result
);
11065 if(uri
) IUri_Release(uri
);
11067 /* a long url that causes a crash on Wine */
11068 len
= INTERNET_MAX_URL_LENGTH
*2;
11069 longurl
= malloc((len
+ 1) * sizeof(WCHAR
));
11070 memcpy(longurl
, http_urlW
, sizeof(http_urlW
));
11071 for(i
= ARRAY_SIZE(http_urlW
)-1; i
< len
; i
++)
11075 copy
= malloc((len
+ 1) * sizeof(WCHAR
));
11076 memcpy(copy
, longurl
, (len
+1)*sizeof(WCHAR
));
11078 hr
= pCreateUri(longurl
, 0, 0, &uri
);
11079 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08lx.\n", hr
);
11080 if(SUCCEEDED(hr
)) {
11082 memset(longurl
, 0xcc, len
*sizeof(WCHAR
));
11083 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, longurl
, len
+1, &result
, 0);
11084 ok(SUCCEEDED(hr
), "Error: CoInternetParseIUri returned 0x%08lx.\n", hr
);
11085 ok(!lstrcmpW(longurl
, copy
), "Error: expected long url '%s' but was '%s'.\n",
11086 wine_dbgstr_w(copy
), wine_dbgstr_w(longurl
));
11087 ok(result
== len
, "Error: Expected 'result' to be %ld, but was %ld instead.\n",
11092 if(uri
) IUri_Release(uri
);
11095 static void test_CoInternetParseIUri(void) {
11098 for(i
= 0; i
< ARRAY_SIZE(uri_parse_tests
); ++i
) {
11102 uri_parse_test test
= uri_parse_tests
[i
];
11104 uriW
= a2w(test
.uri
);
11105 hr
= pCreateUri(uriW
, test
.uri_flags
, 0, &uri
);
11106 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08lx on uri_parse_tests[%ld].\n", hr
, i
);
11107 if(SUCCEEDED(hr
)) {
11108 WCHAR result
[INTERNET_MAX_URL_LENGTH
+1];
11109 DWORD result_len
= -1;
11111 hr
= pCoInternetParseIUri(uri
, test
.action
, test
.flags
, result
, INTERNET_MAX_URL_LENGTH
+1, &result_len
, 0);
11112 todo_wine_if(test
.todo
)
11113 ok(hr
== test
.expected
,
11114 "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx on uri_parse_tests[%ld].\n",
11115 hr
, test
.expected
, i
);
11116 if(SUCCEEDED(hr
)) {
11117 DWORD len
= lstrlenA(test
.property
);
11118 ok(!strcmp_aw(test
.property
, result
) || (test
.property2
&& !strcmp_aw(test
.property2
, result
)),
11119 "Error: Expected %s but got %s instead on uri_parse_tests[%ld] - %s.\n",
11120 test
.property
, wine_dbgstr_w(result
), i
, wine_dbgstr_w(uriW
));
11121 ok(len
== result_len
|| (test
.property2
&& lstrlenA(test
.property2
) == result_len
),
11122 "Error: Expected %ld, but got %ld instead on uri_parse_tests[%ld] - %s.\n",
11123 len
, result_len
, i
, wine_dbgstr_w(uriW
));
11126 "Error: Expected 'result_len' to be 0, but was %ld on uri_parse_tests[%ld].\n",
11130 if(uri
) IUri_Release(uri
);
11135 static void test_CoInternetParseIUri_Pluggable(void) {
11139 hr
= pCreateUri(parse_urlW
, 0, 0, &uri
);
11140 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, but got 0x%08lx.\n", hr
);
11141 if(SUCCEEDED(hr
)) {
11145 SET_EXPECT(ParseUrl
);
11147 parse_action
= PARSE_CANONICALIZE
;
11148 parse_flags
= URL_UNESCAPE
|URL_ESCAPE_UNSAFE
;
11150 hr
= pCoInternetParseIUri(uri
, parse_action
, parse_flags
, result
, 200, &result_len
, 0);
11151 ok(hr
== S_OK
, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n", hr
, S_OK
);
11153 CHECK_CALLED(ParseUrl
);
11155 if(SUCCEEDED(hr
)) {
11156 ok(result_len
== lstrlenW(parse_resultW
), "Error: Expected %d, but got %ld.\n",
11157 lstrlenW(parse_resultW
), result_len
);
11158 ok(!lstrcmpW(result
, parse_resultW
), "Error: Expected %s, but got %s.\n",
11159 wine_dbgstr_w(parse_resultW
), wine_dbgstr_w(result
));
11162 if(uri
) IUri_Release(uri
);
11168 const char *base_url
;
11169 DWORD base_uri_flags
;
11170 const char *legacy_url
;
11171 const char *uniform_url
;
11172 const char *no_canon_url
;
11173 const char *uri_url
;
11174 } create_urlmon_test_t
;
11176 static const create_urlmon_test_t create_urlmon_tests
[] = {
11178 "http://www.winehq.org",Uri_CREATE_NO_CANONICALIZE
,
11180 "http://www.winehq.org/",
11181 "http://www.winehq.org/",
11182 "http://www.winehq.org",
11183 "http://www.winehq.org"
11186 "file://c:\\dir\\file.txt",Uri_CREATE_NO_CANONICALIZE
,
11188 "file://c:\\dir\\file.txt",
11189 "file:///c:/dir/file.txt",
11190 "file:///c:/dir/file.txt",
11191 "file:///c:/dir/file.txt"
11194 "file://c:\\dir\\file.txt",Uri_CREATE_FILE_USE_DOS_PATH
,
11196 "file://c:\\dir\\file.txt",
11197 "file:///c:/dir/file.txt",
11198 "file:///c:/dir/file.txt",
11199 "file://c:\\dir\\file.txt"
11202 "dat%61",Uri_CREATE_ALLOW_RELATIVE
,
11203 "http://www.winehq.org",0,
11204 "http://www.winehq.org/data",
11205 "http://www.winehq.org/data",
11206 "http://www.winehq.org:80/data",
11209 "file.txt",Uri_CREATE_ALLOW_RELATIVE
,
11210 "file://c:\\dir\\x.txt",Uri_CREATE_NO_CANONICALIZE
,
11211 "file://c:\\dir\\file.txt",
11212 "file:///c:/dir/file.txt",
11213 "file:///c:/dir/file.txt",
11216 "",Uri_CREATE_ALLOW_RELATIVE
,
11224 "test",Uri_CREATE_ALLOW_RELATIVE
,
11232 "c:\\dir\\file.txt",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
11234 "file://c:\\dir\\file.txt",
11235 "file:///c:/dir/file.txt",
11236 "file:///c:/dir/file.txt",
11237 "file:///c:/dir/file.txt",
11240 "c:\\dir\\file.txt#frag|part",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
11242 "file://c:\\dir\\file.txt#frag|part",
11243 "file:///c:/dir/file.txt#frag%7Cpart",
11244 "file:///c:/dir/file.txt#frag%7Cpart",
11245 "file:///c:/dir/file.txt#frag%7Cpart",
11249 #define test_urlmon_display_name(a,b) _test_urlmon_display_name(__LINE__,a,b)
11250 static void _test_urlmon_display_name(unsigned line
, IMoniker
*mon
, const char *exurl
)
11252 WCHAR
*display_name
;
11255 hres
= IMoniker_GetDisplayName(mon
, NULL
, NULL
, &display_name
);
11256 ok_(__FILE__
,line
)(hres
== S_OK
, "GetDisplayName failed: %08lx\n", hres
);
11257 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_name
), "unexpected display name: %s, expected %s\n",
11258 wine_dbgstr_w(display_name
), exurl
);
11260 CoTaskMemFree(display_name
);
11263 #define test_display_uri(a,b) _test_display_uri(__LINE__,a,b)
11264 static void _test_display_uri(unsigned line
, IMoniker
*mon
, const char *exurl
)
11266 IUriContainer
*uri_container
;
11271 hres
= IMoniker_QueryInterface(mon
, &IID_IUriContainer
, (void**)&uri_container
);
11272 ok(hres
== S_OK
, "Could not get IUriContainer iface: %08lx\n", hres
);
11275 hres
= IUriContainer_GetIUri(uri_container
, &uri
);
11276 IUriContainer_Release(uri_container
);
11277 ok(hres
== S_OK
, "GetIUri failed: %08lx\n", hres
);
11278 ok(uri
!= NULL
, "uri == NULL\n");
11280 hres
= IUri_GetDisplayUri(uri
, &display_uri
);
11282 ok(hres
== S_OK
, "GetDisplayUri failed: %08lx\n", hres
);
11283 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_uri
), "unexpected display uri: %s, expected %s\n",
11284 wine_dbgstr_w(display_uri
), exurl
);
11285 SysFreeString(display_uri
);
11288 static void test_CreateURLMoniker(void)
11290 const create_urlmon_test_t
*test
;
11291 IMoniker
*mon
, *base_mon
;
11292 WCHAR
*url
, *base_url
;
11293 IUri
*uri
, *base_uri
;
11296 for(test
= create_urlmon_tests
; test
< create_urlmon_tests
+ ARRAY_SIZE(create_urlmon_tests
); test
++) {
11297 url
= a2w(test
->url
);
11298 base_url
= a2w(test
->base_url
);
11301 hres
= pCreateUri(base_url
, test
->base_uri_flags
, 0, &base_uri
);
11302 ok(hres
== S_OK
, "CreateUri failed: %08lx\n", hres
);
11304 hres
= pCreateURLMonikerEx2(NULL
, base_uri
, &base_mon
, URL_MK_NO_CANONICALIZE
);
11305 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08lx\n", hres
);
11311 hres
= CreateURLMoniker(base_mon
, url
, &mon
);
11312 ok(hres
== S_OK
, "CreateURLMoniker failed: %08lx\n", hres
);
11313 test_urlmon_display_name(mon
, test
->legacy_url
);
11314 test_display_uri(mon
, test
->legacy_url
);
11315 IMoniker_Release(mon
);
11317 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_LEGACY
);
11318 ok(hres
== S_OK
, "CreateURLMoniker failed: %08lx\n", hres
);
11319 test_urlmon_display_name(mon
, test
->legacy_url
);
11320 test_display_uri(mon
, test
->legacy_url
);
11321 IMoniker_Release(mon
);
11323 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_UNIFORM
);
11324 ok(hres
== S_OK
, "CreateURLMoniker failed: %08lx\n", hres
);
11325 test_urlmon_display_name(mon
, test
->uniform_url
);
11326 test_display_uri(mon
, test
->uniform_url
);
11327 IMoniker_Release(mon
);
11329 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_NO_CANONICALIZE
);
11330 ok(hres
== S_OK
, "CreateURLMoniker failed: %08lx\n", hres
);
11331 test_urlmon_display_name(mon
, test
->no_canon_url
);
11332 test_display_uri(mon
, test
->no_canon_url
);
11333 IMoniker_Release(mon
);
11335 hres
= pCreateUri(url
, test
->uri_flags
, 0, &uri
);
11336 ok(hres
== S_OK
, "CreateUri failed: %08lx\n", hres
);
11338 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_LEGACY
);
11339 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08lx\n", hres
);
11340 test_urlmon_display_name(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
11341 test_display_uri(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
11342 IMoniker_Release(mon
);
11344 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_UNIFORM
);
11345 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08lx\n", hres
);
11346 test_urlmon_display_name(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
11347 test_display_uri(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
11348 IMoniker_Release(mon
);
11350 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_NO_CANONICALIZE
);
11351 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08lx\n", hres
);
11352 test_urlmon_display_name(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
11353 test_display_uri(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
11354 IMoniker_Release(mon
);
11360 IUri_Release(base_uri
);
11362 IMoniker_Release(base_mon
);
11366 static int add_default_flags(DWORD flags
) {
11367 if(!(flags
& Uri_CREATE_NO_CANONICALIZE
))
11368 flags
|= Uri_CREATE_CANONICALIZE
;
11369 if(!(flags
& Uri_CREATE_NO_DECODE_EXTRA_INFO
))
11370 flags
|= Uri_CREATE_DECODE_EXTRA_INFO
;
11371 if(!(flags
& Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
))
11372 flags
|= Uri_CREATE_CRACK_UNKNOWN_SCHEMES
;
11373 if(!(flags
& Uri_CREATE_NO_PRE_PROCESS_HTML_URI
))
11374 flags
|= Uri_CREATE_PRE_PROCESS_HTML_URI
;
11375 if(!(flags
& Uri_CREATE_IE_SETTINGS
))
11376 flags
|= Uri_CREATE_NO_IE_SETTINGS
;
11381 static void test_IPersistStream(void)
11383 int i
, props_order
[Uri_PROPERTY_DWORD_LAST
+1] = { 0 };
11385 props_order
[Uri_PROPERTY_RAW_URI
] = 1;
11386 props_order
[Uri_PROPERTY_FRAGMENT
] = 2;
11387 props_order
[Uri_PROPERTY_HOST
] = 3;
11388 props_order
[Uri_PROPERTY_PASSWORD
] = 4;
11389 props_order
[Uri_PROPERTY_PATH
] = 5;
11390 props_order
[Uri_PROPERTY_PORT
] = 6;
11391 props_order
[Uri_PROPERTY_QUERY
] = 7;
11392 props_order
[Uri_PROPERTY_SCHEME_NAME
] = 8;
11393 props_order
[Uri_PROPERTY_USER_NAME
] = 9;
11395 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); i
++) {
11396 const uri_properties
*test
= uri_tests
+i
;
11399 IPersistStream
*persist_stream
;
11402 DWORD props
, props_no
, dw_data
[6];
11403 WCHAR str_data
[1024];
11404 ULARGE_INTEGER size
, max_size
;
11405 LARGE_INTEGER no_off
;
11410 if(test
->create_todo
|| test
->create_expected
!=S_OK
)
11413 uriW
= a2w(test
->uri
);
11414 hr
= pCreateUri(uriW
, test
->create_flags
, 0, &uri
);
11415 ok(hr
== S_OK
, "%d) CreateUri failed 0x%08lx, expected S_OK..\n", i
, hr
);
11417 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&persist_stream
);
11418 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08lx, expected S_OK.\n", i
, hr
);
11420 hr
= CreateStreamOnHGlobal(NULL
, TRUE
, &stream
);
11421 ok(hr
== S_OK
, "CreateStreamOnHGlobal failed 0x%08lx.\n", hr
);
11422 hr
= IPersistStream_IsDirty(persist_stream
);
11423 ok(hr
== S_FALSE
, "%d) IsDirty returned 0x%08lx, expected S_FALSE.\n", i
, hr
);
11424 hr
= IPersistStream_Save(persist_stream
, stream
, FALSE
);
11425 ok(hr
== S_OK
, "%d) Save failed 0x%08lx, expected S_OK.\n", i
, hr
);
11426 hr
= IPersistStream_IsDirty(persist_stream
);
11427 ok(hr
== S_FALSE
, "%d) IsDirty returned 0x%08lx, expected S_FALSE.\n", i
, hr
);
11428 no_off
.QuadPart
= 0;
11429 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_CUR
, &size
);
11430 ok(hr
== S_OK
, "%d) Seek failed 0x%08lx, expected S_OK.\n", i
, hr
);
11431 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11432 ok(hr
== S_OK
, "%d) Seek failed 0x%08lx, expected S_OK.\n", i
, hr
);
11433 hr
= IPersistStream_GetSizeMax(persist_stream
, &max_size
);
11434 ok(hr
== S_OK
, "%d) GetSizeMax failed 0x%08lx, expected S_OK.\n", i
, hr
);
11435 ok(size
.LowPart
+2 == max_size
.LowPart
,
11436 "%d) Written data size is %ld, max_size %ld.\n",
11437 i
, size
.LowPart
, max_size
.LowPart
);
11439 hr
= IStream_Read(stream
, (void*)dw_data
, sizeof(DWORD
), NULL
);
11440 ok(hr
== S_OK
, "%d) Read failed 0x%08lx, expected S_OK.\n", i
, hr
);
11441 ok(dw_data
[0]-2 == size
.LowPart
, "%d) Structure size is %ld, expected %ld\n",
11442 i
, dw_data
[0]-2, size
.LowPart
);
11443 hr
= IStream_Read(stream
, (void*)dw_data
, 6*sizeof(DWORD
), NULL
);
11444 ok(hr
== S_OK
, "%d) Read failed 0x%08lx, expected S_OK.\n", i
, hr
);
11445 ok(dw_data
[0] == 0, "%d) Incorrect value %lx, expected 0 (unknown).\n", i
, dw_data
[0]);
11446 ok(dw_data
[1] == 0, "%d) Incorrect value %lx, expected 0 (unknown).\n", i
, dw_data
[1]);
11447 ok(dw_data
[2] == add_default_flags(test
->create_flags
),
11448 "%d) Incorrect value %lx, expected %x (creation flags).\n",
11449 i
, dw_data
[2], add_default_flags(test
->create_flags
));
11450 ok(dw_data
[3] == 0, "%d) Incorrect value %lx, expected 0 (unknown).\n", i
, dw_data
[3]);
11451 ok(dw_data
[4] == 0, "%d) Incorrect value %lx, expected 0 (unknown).\n", i
, dw_data
[4]);
11452 ok(dw_data
[5] == 0, "%d) Incorrect value %lx, expected 0 (unknown).\n", i
, dw_data
[5]);
11455 for(props
=0; props
<=Uri_PROPERTY_DWORD_LAST
; props
++) {
11456 if(!props_order
[props
])
11459 if(props
<= Uri_PROPERTY_STRING_LAST
) {
11460 if(test
->str_props
[props
].expected
== S_OK
)
11463 if(test
->dword_props
[props
-Uri_PROPERTY_DWORD_START
].expected
== S_OK
)
11467 if(test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_HTTP
11468 && test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_FTP
11469 && test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_HTTPS
)
11472 hr
= IStream_Read(stream
, (void*)&props
, sizeof(DWORD
), NULL
);
11473 ok(hr
== S_OK
, "%d) Read failed 0x%08lx, expected S_OK.\n", i
, hr
);
11474 ok(props
== props_no
, "%d) Properties no is %ld, expected %ld.\n", i
, props
, props_no
);
11479 hr
= IStream_Read(stream
, (void*)dw_data
, 2*sizeof(DWORD
), NULL
);
11480 ok(hr
== S_OK
, "%d) Read failed 0x%08lx, expected S_OK.\n", i
, hr
);
11482 ok(dw_data
[2]<props_order
[dw_data
[0]],
11483 "%d) Incorrect properties order (%ld, %ld)\n",
11484 i
, dw_data
[0], dw_data
[3]);
11485 dw_data
[2] = props_order
[dw_data
[0]];
11486 dw_data
[3] = dw_data
[0];
11488 if(dw_data
[0]<=Uri_PROPERTY_STRING_LAST
) {
11489 const uri_str_property
*prop
= test
->str_props
+dw_data
[0];
11490 hr
= IStream_Read(stream
, (void*)str_data
, dw_data
[1], NULL
);
11491 ok(hr
== S_OK
, "%d) Read failed 0x%08lx, expected S_OK.\n", i
, hr
);
11492 ok(!strcmp_aw(prop
->value
, str_data
) || broken(prop
->broken_value
&& !strcmp_aw(prop
->broken_value
, str_data
)),
11493 "%d) Expected %s but got %s (%ld).\n", i
, prop
->value
, wine_dbgstr_w(str_data
), dw_data
[0]);
11494 } else if(dw_data
[0]>=Uri_PROPERTY_DWORD_START
&& dw_data
[0]<=Uri_PROPERTY_DWORD_LAST
) {
11495 const uri_dword_property
*prop
= test
->dword_props
+dw_data
[0]-Uri_PROPERTY_DWORD_START
;
11496 ok(dw_data
[1] == sizeof(DWORD
), "%d) Size of dword property is %ld (%ld)\n", i
, dw_data
[1], dw_data
[0]);
11497 hr
= IStream_Read(stream
, (void*)&dw_data
[1], sizeof(DWORD
), NULL
);
11498 ok(hr
== S_OK
, "%d) Read failed 0x%08lx, expected S_OK.\n", i
, hr
);
11499 ok(prop
->value
== dw_data
[1], "%d) Expected %ld but got %ld (%ld).\n", i
, prop
->value
, dw_data
[1], dw_data
[0]);
11501 ok(FALSE
, "%d) Incorrect property type (%ld)\n", i
, dw_data
[0]);
11505 ok(props
== 0, "%d) Not all properties were processed %ld. Next property type: %ld\n",
11506 i
, props
, dw_data
[0]);
11510 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11511 ok(hr
== S_OK
, "%d) Seek failed 0x%08lx, expected S_OK.\n", i
, hr
);
11512 hr
= IPersistStream_GetClassID(persist_stream
, &curi
);
11513 ok(hr
== S_OK
, "%d) GetClassID failed 0x%08lx, expected S_OK.\n", i
, hr
);
11514 ok(IsEqualCLSID(&curi
, &CLSID_CUri
), "%d) GetClassID returned incorrect CLSID.\n", i
);
11515 IPersistStream_Release(persist_stream
);
11517 hr
= CoCreateInstance(&curi
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11518 &IID_IUri
, (void**)&uri
);
11519 ok(hr
== S_OK
, "%d) Error creating uninitialized Uri: 0x%08lx.\n", i
, hr
);
11520 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&persist_stream
);
11521 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08lx, expected S_OK.\n", i
, hr
);
11522 hr
= IPersistStream_Load(persist_stream
, stream
);
11523 ok(hr
== S_OK
, "%d) Load failed 0x%08lx, expected S_OK.\n", i
, hr
);
11524 hr
= IUri_GetRawUri(uri
, &raw_uri
);
11525 ok(hr
== S_OK
, "%d) GetRawUri failed 0x%08lx, expected S_OK.\n", i
, hr
);
11526 ok(!strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].value
, raw_uri
)
11527 || broken(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
11528 && !strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
, raw_uri
)),
11529 "%d) Expected %s but got %s.\n", i
, test
->str_props
[Uri_PROPERTY_RAW_URI
].value
,
11530 wine_dbgstr_w(raw_uri
));
11531 SysFreeString(raw_uri
);
11532 IPersistStream_Release(persist_stream
);
11534 hr
= IUri_QueryInterface(uri
, &IID_IMarshal
, (void**)&marshal
);
11535 ok(hr
== S_OK
, "%d) QueryInterface(IID_IMarshal) failed 0x%08lx, expected S_OK.\n", i
, hr
);
11536 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11537 ok(hr
== S_OK
, "%d) Seek failed 0x%08lx, expected S_OK.\n", i
, hr
);
11538 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11539 MSHCTX_DIFFERENTMACHINE
, NULL
, MSHLFLAGS_NORMAL
);
11540 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08lx, expected E_INVALIDARG.\n", i
, hr
);
11541 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11542 MSHCTX_CROSSCTX
, NULL
, MSHLFLAGS_NORMAL
);
11543 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08lx, expected E_INVALIDARG.\n", i
, hr
);
11544 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11545 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_TABLESTRONG
);
11546 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08lx, expected E_INVALIDARG.\n", i
, hr
);
11547 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11548 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_TABLEWEAK
);
11549 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08lx, expected E_INVALIDARG.\n", i
, hr
);
11550 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11551 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_NOPING
);
11552 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08lx, expected E_INVALIDARG.\n", i
, hr
);
11553 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11554 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_NORMAL
);
11555 ok(hr
== S_OK
, "%d) MarshalInterface failed 0x%08lx, expected S_OK.\n", i
, hr
);
11556 hr
= IMarshal_GetUnmarshalClass(marshal
, &IID_IUri
, (void*)uri
,
11557 MSHCTX_CROSSCTX
, NULL
, MSHLFLAGS_NORMAL
, &curi
);
11558 ok(hr
== E_INVALIDARG
, "%d) GetUnmarshalClass returned 0x%08lx, expected E_INVALIDARG.\n", i
, hr
);
11559 hr
= IMarshal_GetUnmarshalClass(marshal
, &IID_IUri
, (void*)uri
,
11560 MSHCTX_INPROC
, NULL
, MSHLFLAGS_NORMAL
, &curi
);
11561 ok(hr
== S_OK
, "%d) GetUnmarshalClass failed 0x%08lx, expected S_OK.\n", i
, hr
);
11562 ok(IsEqualCLSID(&curi
, &CLSID_CUri
), "%d) GetUnmarshalClass returned incorrect CLSID.\n", i
);
11564 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_CUR
, &size
);
11565 ok(hr
== S_OK
, "%d) Seek failed 0x%08lx, expected S_OK.\n", i
, hr
);
11566 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11567 ok(hr
== S_OK
, "%d) Seek failed 0x%08lx, expected S_OK.\n", i
, hr
);
11568 hr
= IStream_Read(stream
, (void*)dw_data
, 3*sizeof(DWORD
), NULL
);
11569 ok(hr
== S_OK
, "%d) Read failed 0x%08lx, expected S_OK.\n", i
, hr
);
11570 ok(dw_data
[0]-2 == size
.LowPart
, "%d) Structure size is %ld, expected %ld\n",
11571 i
, dw_data
[0]-2, size
.LowPart
);
11572 ok(dw_data
[1] == MSHCTX_LOCAL
, "%d) Incorrect value %ld, expected MSHCTX_LOCAL.\n",
11574 ok(dw_data
[2] == dw_data
[0]-8, "%d) Incorrect value %ld, expected %ld (PersistStream size).\n",
11575 i
, dw_data
[2], dw_data
[0]-8);
11576 if(!test
->str_props
[Uri_PROPERTY_PATH
].value
[0] &&
11577 (test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_HTTP
11578 || test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_FTP
11579 || test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_HTTPS
))
11580 max_size
.LowPart
+= 3*sizeof(DWORD
);
11581 ok(dw_data
[2] == max_size
.LowPart
, "%d) Incorrect value %ld, expected %ld (PersistStream size).\n",
11582 i
, dw_data
[2], max_size
.LowPart
);
11583 IMarshal_Release(marshal
);
11586 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11587 ok(hr
== S_OK
, "%d) Seek failed 0x%08lx, expected S_OK.\n", i
, hr
);
11588 hr
= CoCreateInstance(&curi
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11589 &IID_IUri
, (void**)&uri
);
11590 ok(hr
== S_OK
, "%d) Error creating uninitialized Uri: 0x%08lx.\n", i
, hr
);
11591 hr
= IUri_QueryInterface(uri
, &IID_IMarshal
, (void**)&marshal
);
11592 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08lx, expected S_OK.\n", i
, hr
);
11594 hr
= IMarshal_UnmarshalInterface(marshal
, stream
, &IID_IUri
, (void**)&uri
);
11595 ok(hr
== S_OK
, "%d) UnmarshalInterface failed 0x%08lx, expected S_OK.\n", i
, hr
);
11596 hr
= IUri_GetRawUri(uri
, &raw_uri
);
11597 ok(hr
== S_OK
, "%d) GetRawUri failed 0x%08lx, expected S_OK.\n", i
, hr
);
11598 ok(!strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].value
, raw_uri
)
11599 || broken(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
11600 && !strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
, raw_uri
)),
11601 "%d) Expected %s but got %s.\n", i
, test
->str_props
[Uri_PROPERTY_RAW_URI
].value
,
11602 wine_dbgstr_w(raw_uri
));
11603 SysFreeString(raw_uri
);
11605 IMarshal_Release(marshal
);
11606 IStream_Release(stream
);
11612 static void test_UninitializedUri(void)
11615 IUriBuilderFactory
*ubf
;
11616 IPersistStream
*ps
;
11624 hr
= CoCreateInstance(&CLSID_CUri
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11625 &IID_IUri
, (void**)&uri
);
11627 win_skip("Skipping uninitialized Uri tests.\n");
11631 hr
= IUri_QueryInterface(uri
, &IID_IUriBuilderFactory
, (void**)&ubf
);
11632 ok(hr
== S_OK
, "QueryInterface(IID_IUriBuillderFactory) failed: %lx.\n", hr
);
11633 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&ps
);
11634 ok(hr
== S_OK
, "QueryInterface(IID_IPersistStream) failed: %lx.\n", hr
);
11636 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
11637 ok(hr
== E_UNEXPECTED
, "GetAbsoluteUri returned %lx, expected E_UNEXPECTED.\n", hr
);
11638 hr
= IUri_GetAbsoluteUri(uri
, &bstr
);
11639 ok(hr
== E_UNEXPECTED
, "GetAbsoluteUri returned %lx, expected E_UNEXPECTED.\n", hr
);
11640 hr
= IUri_GetAuthority(uri
, &bstr
);
11641 ok(hr
== E_UNEXPECTED
, "GetAuthority returned %lx, expected E_UNEXPECTED.\n", hr
);
11642 hr
= IUri_GetDisplayUri(uri
, &bstr
);
11643 ok(hr
== E_UNEXPECTED
, "GetDisplayUri returned %lx, expected E_UNEXPECTED.\n", hr
);
11644 hr
= IUri_GetDomain(uri
, &bstr
);
11645 ok(hr
== E_UNEXPECTED
, "GetDomain returned %lx, expected E_UNEXPECTED.\n", hr
);
11646 hr
= IUri_GetExtension(uri
, &bstr
);
11647 ok(hr
== E_UNEXPECTED
, "GetExtension returned %lx, expected E_UNEXPECTED.\n", hr
);
11648 hr
= IUri_GetFragment(uri
, &bstr
);
11649 ok(hr
== E_UNEXPECTED
, "GetFragment returned %lx, expected E_UNEXPECTED.\n", hr
);
11650 hr
= IUri_GetHost(uri
, &bstr
);
11651 ok(hr
== E_UNEXPECTED
, "GetHost returned %lx, expected E_UNEXPECTED.\n", hr
);
11652 hr
= IUri_GetHostType(uri
, &dword
);
11653 ok(hr
== E_UNEXPECTED
, "GetHostType returned %lx, expected E_UNEXPECTED.\n", hr
);
11654 hr
= IUri_GetPassword(uri
, &bstr
);
11655 ok(hr
== E_UNEXPECTED
, "GetPassword returned %lx, expected E_UNEXPECTED.\n", hr
);
11656 hr
= IUri_GetPassword(uri
, &bstr
);
11657 ok(hr
== E_UNEXPECTED
, "GetPassword returned %lx, expected E_UNEXPECTED.\n", hr
);
11658 hr
= IUri_GetPathAndQuery(uri
, &bstr
);
11659 ok(hr
== E_UNEXPECTED
, "GetPathAndQuery returned %lx, expected E_UNEXPECTED.\n", hr
);
11660 hr
= IUri_GetPort(uri
, &dword
);
11661 ok(hr
== E_UNEXPECTED
, "GetPort returned %lx, expected E_UNEXPECTED.\n", hr
);
11662 hr
= IUri_GetProperties(uri
, &dword
);
11663 ok(hr
== E_UNEXPECTED
, "GetProperties returned %lx, expected E_UNEXPECTED.\n", hr
);
11664 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, &bstr
, 0);
11665 ok(hr
== E_UNEXPECTED
, "GetPropertyBSTR returned %lx, expected E_UNEXPECTED.\n", hr
);
11666 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_PORT
, &dword
, 0);
11667 ok(hr
== E_UNEXPECTED
, "GetPropertyDWORD returned %lx, expected E_UNEXPECTED.\n", hr
);
11668 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_RAW_URI
, &dword
, 0);
11669 ok(hr
== E_UNEXPECTED
, "GetPropertyLength returned %lx, expected E_UNEXPECTED.\n", hr
);
11670 hr
= IUri_GetQuery(uri
, &bstr
);
11671 ok(hr
== E_UNEXPECTED
, "GetQuery returned %lx, expected E_UNEXPECTED.\n", hr
);
11672 hr
= IUri_GetRawUri(uri
, &bstr
);
11673 ok(hr
== E_UNEXPECTED
, "GetRawUri returned %lx, expected E_UNEXPECTED.\n", hr
);
11674 hr
= IUri_GetScheme(uri
, &dword
);
11675 ok(hr
== E_UNEXPECTED
, "GetScheme returned %lx, expected E_UNEXPECTED.\n", hr
);
11676 hr
= IUri_GetSchemeName(uri
, &bstr
);
11677 ok(hr
== E_UNEXPECTED
, "GetSchemeName returned %lx, expected E_UNEXPECTED.\n", hr
);
11678 hr
= IUri_GetUserInfo(uri
, &bstr
);
11679 ok(hr
== E_UNEXPECTED
, "GetUserInfo returned %lx, expected E_UNEXPECTED.\n", hr
);
11680 hr
= IUri_GetUserName(uri
, &bstr
);
11681 ok(hr
== E_UNEXPECTED
, "GetUserName returned %lx, expected E_UNEXPECTED.\n", hr
);
11682 hr
= IUri_GetZone(uri
, &dword
);
11683 ok(hr
== E_UNEXPECTED
, "GetZone returned %lx, expected E_UNEXPECTED.\n", hr
);
11684 hr
= IUri_IsEqual(uri
, uri
, &eq
);
11685 ok(hr
== E_UNEXPECTED
, "IsEqual returned %lx, expected E_UNEXPECTED.\n", hr
);
11687 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(ubf
, 0, 0, &ub
);
11688 ok(hr
== E_UNEXPECTED
, "CreateInitializedIUriBuilder returned %lx, expected E_UNEXPECTED.\n", hr
);
11689 hr
= IUriBuilderFactory_CreateIUriBuilder(ubf
, 0, 0, &ub
);
11690 ok(hr
== S_OK
, "CreateIUriBuilder returned %lx, expected S_OK.\n", hr
);
11691 IUriBuilder_Release(ub
);
11693 hr
= IPersistStream_GetSizeMax(ps
, &ui
);
11694 ok(hr
== S_OK
, "GetSizeMax returned %lx, expected S_OK.\n", hr
);
11695 ok(ui
.u
.LowPart
== 34, "ui.LowPart = %ld, expected 34.\n", ui
.u
.LowPart
);
11696 hr
= IPersistStream_IsDirty(ps
);
11697 ok(hr
== S_FALSE
, "IsDirty returned %lx, expected S_FALSE.\n", hr
);
11699 IPersistStream_Release(ps
);
11700 IUriBuilderFactory_Release(ubf
);
11707 hurlmon
= GetModuleHandleA("urlmon.dll");
11708 pCoInternetGetSession
= (void*) GetProcAddress(hurlmon
, "CoInternetGetSession");
11709 pCreateUri
= (void*) GetProcAddress(hurlmon
, "CreateUri");
11710 pCreateUriWithFragment
= (void*) GetProcAddress(hurlmon
, "CreateUriWithFragment");
11711 pCreateIUriBuilder
= (void*) GetProcAddress(hurlmon
, "CreateIUriBuilder");
11712 pCoInternetCombineIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineIUri");
11713 pCoInternetCombineUrlEx
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineUrlEx");
11714 pCoInternetParseIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetParseIUri");
11715 pCreateURLMonikerEx
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx");
11716 pCreateURLMonikerEx2
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx2");
11719 win_skip("CreateUri is not present, skipping tests.\n");
11723 trace("test CreateUri invalid flags...\n");
11724 test_CreateUri_InvalidFlags();
11726 trace("test CreateUri invalid args...\n");
11727 test_CreateUri_InvalidArgs();
11729 trace("test CreateUri invalid URIs...\n");
11730 test_CreateUri_InvalidUri();
11732 trace("test IUri_GetPropertyBSTR...\n");
11733 test_IUri_GetPropertyBSTR();
11735 trace("test IUri_GetPropertyDWORD...\n");
11736 test_IUri_GetPropertyDWORD();
11738 trace("test IUri_GetStrProperties...\n");
11739 test_IUri_GetStrProperties();
11741 trace("test IUri_GetDwordProperties...\n");
11742 test_IUri_GetDwordProperties();
11744 trace("test IUri_GetPropertyLength...\n");
11745 test_IUri_GetPropertyLength();
11747 trace("test IUri_GetProperties...\n");
11748 test_IUri_GetProperties();
11750 trace("test IUri_HasProperty...\n");
11751 test_IUri_HasProperty();
11753 trace("test IUri_IsEqual...\n");
11754 test_IUri_IsEqual();
11756 trace("test CreateUriWithFragment invalid args...\n");
11757 test_CreateUriWithFragment_InvalidArgs();
11759 trace("test CreateUriWithFragment invalid flags...\n");
11760 test_CreateUriWithFragment_InvalidFlags();
11762 trace("test CreateUriWithFragment...\n");
11763 test_CreateUriWithFragment();
11765 trace("test CreateIUriBuilder...\n");
11766 test_CreateIUriBuilder();
11768 trace("test IUriBuilder_CreateInvalidArgs...\n");
11769 test_IUriBuilder_CreateInvalidArgs();
11771 trace("test IUriBuilder...\n");
11772 test_IUriBuilder();
11774 trace("test IUriBuilder_GetInvalidArgs...\n");
11775 test_IUriBuilder_GetInvalidArgs();
11777 trace("test IUriBuilder_HasBeenModified...\n");
11778 test_IUriBuilder_HasBeenModified();
11780 trace("test IUriBuilder_IUriProperty...\n");
11781 test_IUriBuilder_IUriProperty();
11783 trace("test IUriBuilder_RemoveProperties...\n");
11784 test_IUriBuilder_RemoveProperties();
11786 trace("test IUriBuilder miscellaneous...\n");
11787 test_IUriBuilder_Misc();
11789 trace("test IUriBuilderFactory...\n");
11790 test_IUriBuilderFactory();
11792 trace("test CoInternetCombineIUri...\n");
11793 test_CoInternetCombineIUri();
11795 trace("test CoInternetCombineUrlEx...\n");
11796 test_CoInternetCombineUrlEx();
11798 trace("test CoInternetParseIUri Invalid Args...\n");
11799 test_CoInternetParseIUri_InvalidArgs();
11801 trace("test CoInternetParseIUri...\n");
11802 test_CoInternetParseIUri();
11804 register_protocols();
11806 trace("test CoInternetCombineIUri pluggable...\n");
11807 test_CoInternetCombineIUri_Pluggable();
11809 trace("test CoInternetCombineUrlEx Pluggable...\n");
11810 test_CoInternetCombineUrlEx_Pluggable();
11812 trace("test CoInternetParseIUri pluggable...\n");
11813 test_CoInternetParseIUri_Pluggable();
11815 trace("test CreateURLMoniker...\n");
11816 test_CreateURLMoniker();
11818 CoInitialize(NULL
);
11820 trace("test IPersistStream...\n");
11821 test_IPersistStream();
11823 trace("test uninitialized Uri...\n");
11824 test_UninitializedUri();
11827 unregister_protocols();