fb9a7d08f6065895e6ecebded945837f34d43fd1
[reactos.git] / modules / rostests / winetests / urlmon / uri.c
1 /*
2 * UrlMon IUri tests
3 *
4 * Copyright 2010 Thomas Mullaly
5 *
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.
10 *
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.
15 *
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
19 */
20
21 #define WIN32_NO_STATUS
22 #define _INC_WINDOWS
23 #define COM_NO_WINDOWS_H
24
25 #include <wine/test.h>
26 //#include <stdarg.h>
27 //#include <stddef.h>
28
29 #define COBJMACROS
30 #define CONST_VTABLE
31 #define WIN32_LEAN_AND_MEAN
32
33 //#include "windef.h"
34 //#include "winbase.h"
35 #include <winreg.h>
36 #include <winnls.h>
37 #include <ole2.h>
38 //#include "urlmon.h"
39 #include <shlwapi.h>
40 #include <wininet.h>
41 #include <strsafe.h>
42 #include <initguid.h>
43
44 DEFINE_GUID(CLSID_CUri, 0xDF2FCE13, 0x25EC, 0x45BB, 0x9D,0x4C, 0xCE,0xCD,0x47,0xC2,0x43,0x0C);
45
46 #define URI_STR_PROPERTY_COUNT Uri_PROPERTY_STRING_LAST+1
47 #define URI_DWORD_PROPERTY_COUNT (Uri_PROPERTY_DWORD_LAST - Uri_PROPERTY_DWORD_START)+1
48 #define URI_BUILDER_STR_PROPERTY_COUNT 7
49
50 #define DEFINE_EXPECT(func) \
51 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
52
53 #define SET_EXPECT(func) \
54 expect_ ## func = TRUE
55
56 #define CHECK_EXPECT(func) \
57 do { \
58 ok(expect_ ##func, "unexpected call " #func "\n"); \
59 expect_ ## func = FALSE; \
60 called_ ## func = TRUE; \
61 }while(0)
62
63 #define CHECK_EXPECT2(func) \
64 do { \
65 ok(expect_ ##func, "unexpected call " #func "\n"); \
66 called_ ## func = TRUE; \
67 }while(0)
68
69 #define CHECK_CALLED(func) \
70 do { \
71 ok(called_ ## func, "expected " #func "\n"); \
72 expect_ ## func = called_ ## func = FALSE; \
73 }while(0)
74
75 DEFINE_EXPECT(CombineUrl);
76 DEFINE_EXPECT(ParseUrl);
77
78 static HRESULT (WINAPI *pCreateUri)(LPCWSTR, DWORD, DWORD_PTR, IUri**);
79 static HRESULT (WINAPI *pCreateUriWithFragment)(LPCWSTR, LPCWSTR, DWORD, DWORD_PTR, IUri**);
80 static HRESULT (WINAPI *pCreateIUriBuilder)(IUri*, DWORD, DWORD_PTR, IUriBuilder**);
81 static HRESULT (WINAPI *pCoInternetCombineIUri)(IUri*,IUri*,DWORD,IUri**,DWORD_PTR);
82 static HRESULT (WINAPI *pCoInternetGetSession)(DWORD,IInternetSession**,DWORD);
83 static HRESULT (WINAPI *pCoInternetCombineUrlEx)(IUri*,LPCWSTR,DWORD,IUri**,DWORD_PTR);
84 static HRESULT (WINAPI *pCoInternetParseIUri)(IUri*,PARSEACTION,DWORD,LPWSTR,DWORD,DWORD*,DWORD_PTR);
85 static HRESULT (WINAPI *pCreateURLMonikerEx)(IMoniker*,LPCWSTR,IMoniker**,DWORD);
86 static HRESULT (WINAPI *pCreateURLMonikerEx2)(IMoniker*,IUri*,IMoniker**,DWORD);
87
88 static const WCHAR http_urlW[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
89 '.','o','r','g','/',0};
90 static const WCHAR http_url_fragW[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
91 '.','o','r','g','/','#','F','r','a','g',0};
92
93 static const WCHAR combine_baseW[] = {'w','i','n','e','t','e','s','t',':','?','t',
94 'e','s','t','i','n','g',0};
95 static const WCHAR combine_relativeW[] = {'?','t','e','s','t',0};
96 static const WCHAR combine_resultW[] = {'z','i','p',':','t','e','s','t',0};
97
98 static const WCHAR winetestW[] = {'w','i','n','e','t','e','s','t',0};
99
100 static const WCHAR parse_urlW[] = {'w','i','n','e','t','e','s','t',':','t','e','s','t',0};
101 static const WCHAR parse_resultW[] = {'z','i','p',':','t','e','s','t',0};
102
103 static PARSEACTION parse_action;
104 static DWORD parse_flags;
105
106 typedef struct _uri_create_flag_test {
107 DWORD flags;
108 HRESULT expected;
109 } uri_create_flag_test;
110
111 static const uri_create_flag_test invalid_flag_tests[] = {
112 /* Set of invalid flag combinations to test for. */
113 {Uri_CREATE_DECODE_EXTRA_INFO | Uri_CREATE_NO_DECODE_EXTRA_INFO, E_INVALIDARG},
114 {Uri_CREATE_CANONICALIZE | Uri_CREATE_NO_CANONICALIZE, E_INVALIDARG},
115 {Uri_CREATE_CRACK_UNKNOWN_SCHEMES | Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES, E_INVALIDARG},
116 {Uri_CREATE_PRE_PROCESS_HTML_URI | Uri_CREATE_NO_PRE_PROCESS_HTML_URI, E_INVALIDARG},
117 {Uri_CREATE_IE_SETTINGS | Uri_CREATE_NO_IE_SETTINGS, E_INVALIDARG}
118 };
119
120 typedef struct _uri_str_property {
121 const char* value;
122 HRESULT expected;
123 BOOL todo;
124 const char* broken_value;
125 const char* value2;
126 HRESULT expected2;
127 } uri_str_property;
128
129 typedef struct _uri_dword_property {
130 DWORD value;
131 HRESULT expected;
132 BOOL todo;
133 BOOL broken_combine_hres;
134 } uri_dword_property;
135
136 typedef struct _uri_properties {
137 const char* uri;
138 DWORD create_flags;
139 HRESULT create_expected;
140 BOOL create_todo;
141
142 uri_str_property str_props[URI_STR_PROPERTY_COUNT];
143 uri_dword_property dword_props[URI_DWORD_PROPERTY_COUNT];
144 } uri_properties;
145
146 static const uri_properties uri_tests[] = {
147 { "http://www.winehq.org/tests/../tests/../..", 0, S_OK, FALSE,
148 {
149 {"http://www.winehq.org/",S_OK,FALSE}, /* ABSOLUTE_URI */
150 {"www.winehq.org",S_OK,FALSE}, /* AUTHORITY */
151 {"http://www.winehq.org/",S_OK,FALSE}, /* DISPLAY_URI */
152 {"winehq.org",S_OK,FALSE}, /* DOMAIN */
153 {"",S_FALSE,FALSE}, /* EXTENSION */
154 {"",S_FALSE,FALSE}, /* FRAGMENT */
155 {"www.winehq.org",S_OK,FALSE}, /* HOST */
156 {"",S_FALSE,FALSE}, /* PASSWORD */
157 {"/",S_OK,FALSE}, /* PATH */
158 {"/",S_OK,FALSE}, /* PATH_AND_QUERY */
159 {"",S_FALSE,FALSE}, /* QUERY */
160 {"http://www.winehq.org/tests/../tests/../..",S_OK,FALSE}, /* RAW_URI */
161 {"http",S_OK,FALSE}, /* SCHEME_NAME */
162 {"",S_FALSE,FALSE}, /* USER_INFO */
163 {"",S_FALSE,FALSE} /* USER_NAME */
164 },
165 {
166 {Uri_HOST_DNS,S_OK,FALSE}, /* HOST_TYPE */
167 {80,S_OK,FALSE}, /* PORT */
168 {URL_SCHEME_HTTP,S_OK,FALSE}, /* SCHEME */
169 {URLZONE_INVALID,E_NOTIMPL,FALSE} /* ZONE */
170 }
171 },
172 { "http://winehq.org/tests/.././tests", 0, S_OK, FALSE,
173 {
174 {"http://winehq.org/tests",S_OK,FALSE},
175 {"winehq.org",S_OK,FALSE},
176 {"http://winehq.org/tests",S_OK,FALSE},
177 {"winehq.org",S_OK,FALSE},
178 {"",S_FALSE,FALSE},
179 {"",S_FALSE,FALSE},
180 {"winehq.org",S_OK,FALSE},
181 {"",S_FALSE,FALSE},
182 {"/tests",S_OK,FALSE},
183 {"/tests",S_OK,FALSE},
184 {"",S_FALSE,FALSE},
185 {"http://winehq.org/tests/.././tests",S_OK,FALSE},
186 {"http",S_OK,FALSE},
187 {"",S_FALSE,FALSE},
188 {"",S_FALSE,FALSE}
189 },
190 {
191 {Uri_HOST_DNS,S_OK,FALSE},
192 {80,S_OK,FALSE},
193 {URL_SCHEME_HTTP,S_OK,FALSE},
194 {URLZONE_INVALID,E_NOTIMPL,FALSE}
195 }
196 },
197 { "HtTp://www.winehq.org/tests/..?query=x&return=y", 0, S_OK, FALSE,
198 {
199 {"http://www.winehq.org/?query=x&return=y",S_OK,FALSE},
200 {"www.winehq.org",S_OK,FALSE},
201 {"http://www.winehq.org/?query=x&return=y",S_OK,FALSE},
202 {"winehq.org",S_OK,FALSE},
203 {"",S_FALSE,FALSE},
204 {"",S_FALSE,FALSE},
205 {"www.winehq.org",S_OK,FALSE},
206 {"",S_FALSE,FALSE},
207 {"/",S_OK,FALSE},
208 {"/?query=x&return=y",S_OK,FALSE},
209 {"?query=x&return=y",S_OK,FALSE},
210 {"HtTp://www.winehq.org/tests/..?query=x&return=y",S_OK,FALSE},
211 {"http",S_OK,FALSE},
212 {"",S_FALSE,FALSE},
213 {"",S_FALSE,FALSE}
214 },
215 {
216 {Uri_HOST_DNS,S_OK,FALSE},
217 {80,S_OK,FALSE},
218 {URL_SCHEME_HTTP,S_OK,FALSE},
219 {URLZONE_INVALID,E_NOTIMPL,FALSE},
220 }
221 },
222 { "HtTpS://www.winehq.org/tests/..?query=x&return=y", 0, S_OK, FALSE,
223 {
224 {"https://www.winehq.org/?query=x&return=y",S_OK,FALSE},
225 {"www.winehq.org",S_OK,FALSE},
226 {"https://www.winehq.org/?query=x&return=y",S_OK,FALSE},
227 {"winehq.org",S_OK,FALSE},
228 {"",S_FALSE,FALSE},
229 {"",S_FALSE,FALSE},
230 {"www.winehq.org",S_OK,FALSE},
231 {"",S_FALSE,FALSE},
232 {"/",S_OK,FALSE},
233 {"/?query=x&return=y",S_OK,FALSE},
234 {"?query=x&return=y",S_OK,FALSE},
235 {"HtTpS://www.winehq.org/tests/..?query=x&return=y",S_OK,FALSE},
236 {"https",S_OK,FALSE},
237 {"",S_FALSE,FALSE},
238 {"",S_FALSE,FALSE}
239 },
240 {
241 {Uri_HOST_DNS,S_OK,FALSE},
242 {443,S_OK,FALSE},
243 {URL_SCHEME_HTTPS,S_OK,FALSE},
244 {URLZONE_INVALID,E_NOTIMPL,FALSE},
245 }
246 },
247 { "hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters", 0, S_OK, FALSE,
248 {
249 {"http://usEr%3Ainfo@example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
250 {"usEr%3Ainfo@example.com",S_OK,FALSE},
251 {"http://example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
252 {"example.com",S_OK,FALSE},
253 {"",S_FALSE,FALSE},
254 {"",S_FALSE,FALSE},
255 {"example.com",S_OK,FALSE},
256 {"",S_FALSE,FALSE},
257 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
258 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
259 {"",S_FALSE,FALSE},
260 {"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters",S_OK,FALSE},
261 {"http",S_OK,FALSE},
262 {"usEr%3Ainfo",S_OK,FALSE},
263 {"usEr%3Ainfo",S_OK,FALSE}
264 },
265 {
266 {Uri_HOST_DNS,S_OK,FALSE},
267 {80,S_OK,FALSE},
268 {URL_SCHEME_HTTP,S_OK,FALSE},
269 {URLZONE_INVALID,E_NOTIMPL,FALSE},
270 }
271 },
272 { "ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt", 0, S_OK, FALSE,
273 {
274 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,FALSE},
275 {"winepass:wine@ftp.winehq.org:9999",S_OK,FALSE},
276 {"ftp://ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,FALSE},
277 {"winehq.org",S_OK,FALSE},
278 {".txt",S_OK,FALSE},
279 {"",S_FALSE,FALSE},
280 {"ftp.winehq.org",S_OK,FALSE},
281 {"wine",S_OK,FALSE},
282 {"/dir/foo%20bar.txt",S_OK,FALSE},
283 {"/dir/foo%20bar.txt",S_OK,FALSE},
284 {"",S_FALSE,FALSE},
285 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt",S_OK,FALSE},
286 {"ftp",S_OK,FALSE},
287 {"winepass:wine",S_OK,FALSE},
288 {"winepass",S_OK,FALSE}
289 },
290 {
291 {Uri_HOST_DNS,S_OK,FALSE},
292 {9999,S_OK,FALSE},
293 {URL_SCHEME_FTP,S_OK,FALSE},
294 {URLZONE_INVALID,E_NOTIMPL,FALSE}
295 }
296 },
297 { "file://c:\\tests\\../tests/foo%20bar.mp3", 0, S_OK, FALSE,
298 {
299 {"file:///c:/tests/foo%2520bar.mp3",S_OK,FALSE},
300 {"",S_FALSE,FALSE},
301 {"file:///c:/tests/foo%2520bar.mp3",S_OK,FALSE},
302 {"",S_FALSE,FALSE},
303 {".mp3",S_OK,FALSE},
304 {"",S_FALSE,FALSE},
305 {"",S_FALSE,FALSE},
306 {"",S_FALSE,FALSE},
307 {"/c:/tests/foo%2520bar.mp3",S_OK,FALSE},
308 {"/c:/tests/foo%2520bar.mp3",S_OK,FALSE},
309 {"",S_FALSE,FALSE},
310 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK,FALSE},
311 {"file",S_OK,FALSE},
312 {"",S_FALSE,FALSE},
313 {"",S_FALSE,FALSE}
314 },
315 {
316 {Uri_HOST_UNKNOWN,S_OK,FALSE},
317 {0,S_FALSE,FALSE},
318 {URL_SCHEME_FILE,S_OK,FALSE},
319 {URLZONE_INVALID,E_NOTIMPL,FALSE}
320 }
321 },
322 { "file://c:\\tests\\../tests/foo%20bar.mp3", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
323 {
324 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK,FALSE},
325 {"",S_FALSE,FALSE},
326 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK,FALSE},
327 {"",S_FALSE,FALSE},
328 {".mp3",S_OK,FALSE},
329 {"",S_FALSE,FALSE},
330 {"",S_FALSE,FALSE},
331 {"",S_FALSE,FALSE},
332 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK,FALSE},
333 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK,FALSE},
334 {"",S_FALSE,FALSE},
335 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK,FALSE},
336 {"file",S_OK,FALSE},
337 {"",S_FALSE,FALSE},
338 {"",S_FALSE,FALSE}
339 },
340 {
341 {Uri_HOST_UNKNOWN,S_OK,FALSE},
342 {0,S_FALSE,FALSE},
343 {URL_SCHEME_FILE,S_OK,FALSE},
344 {URLZONE_INVALID,E_NOTIMPL,FALSE}
345 }
346 },
347 { "FILE://localhost/test dir\\../tests/test%20file.README.txt", 0, S_OK, FALSE,
348 {
349 {"file:///tests/test%20file.README.txt",S_OK,FALSE},
350 {"",S_FALSE,FALSE},
351 {"file:///tests/test%20file.README.txt",S_OK,FALSE},
352 {"",S_FALSE,FALSE},
353 {".txt",S_OK,FALSE},
354 {"",S_FALSE,FALSE},
355 {"",S_FALSE,FALSE},
356 {"",S_FALSE,FALSE},
357 {"/tests/test%20file.README.txt",S_OK,FALSE},
358 {"/tests/test%20file.README.txt",S_OK,FALSE},
359 {"",S_FALSE,FALSE},
360 {"FILE://localhost/test dir\\../tests/test%20file.README.txt",S_OK,FALSE},
361 {"file",S_OK,FALSE},
362 {"",S_FALSE,FALSE},
363 {"",S_FALSE,FALSE}
364 },
365 {
366 {Uri_HOST_UNKNOWN,S_OK,FALSE},
367 {0,S_FALSE,FALSE},
368 {URL_SCHEME_FILE,S_OK,FALSE},
369 {URLZONE_INVALID,E_NOTIMPL,FALSE}
370 }
371 },
372 { "file:///z:/test dir/README.txt", 0, S_OK, FALSE,
373 {
374 {"file:///z:/test%20dir/README.txt",S_OK},
375 {"",S_FALSE},
376 {"file:///z:/test%20dir/README.txt",S_OK},
377 {"",S_FALSE},
378 {".txt",S_OK},
379 {"",S_FALSE},
380 {"",S_FALSE},
381 {"",S_FALSE},
382 {"/z:/test%20dir/README.txt",S_OK},
383 {"/z:/test%20dir/README.txt",S_OK},
384 {"",S_FALSE},
385 {"file:///z:/test dir/README.txt",S_OK},
386 {"file",S_OK},
387 {"",S_FALSE},
388 {"",S_FALSE}
389 },
390 {
391 {Uri_HOST_UNKNOWN,S_OK,FALSE},
392 {0,S_FALSE,FALSE},
393 {URL_SCHEME_FILE,S_OK,FALSE},
394 {URLZONE_INVALID,E_NOTIMPL,FALSE}
395 }
396 },
397 { "file:///z:/test dir/README.txt#hash part", 0, S_OK, FALSE,
398 {
399 {"file:///z:/test%20dir/README.txt#hash%20part",S_OK},
400 {"",S_FALSE},
401 {"file:///z:/test%20dir/README.txt#hash%20part",S_OK},
402 {"",S_FALSE},
403 {".txt#hash%20part",S_OK},
404 {"",S_FALSE},
405 {"",S_FALSE},
406 {"",S_FALSE},
407 {"/z:/test%20dir/README.txt#hash%20part",S_OK},
408 {"/z:/test%20dir/README.txt#hash%20part",S_OK},
409 {"",S_FALSE},
410 {"file:///z:/test dir/README.txt#hash part",S_OK},
411 {"file",S_OK},
412 {"",S_FALSE},
413 {"",S_FALSE}
414 },
415 {
416 {Uri_HOST_UNKNOWN,S_OK,FALSE},
417 {0,S_FALSE,FALSE},
418 {URL_SCHEME_FILE,S_OK,FALSE},
419 {URLZONE_INVALID,E_NOTIMPL,FALSE}
420 }
421 },
422 { "urn:nothing:should:happen here", 0, S_OK, FALSE,
423 {
424 {"urn:nothing:should:happen here",S_OK,FALSE},
425 {"",S_FALSE,FALSE},
426 {"urn:nothing:should:happen here",S_OK,FALSE},
427 {"",S_FALSE,FALSE},
428 {"",S_FALSE,FALSE},
429 {"",S_FALSE,FALSE},
430 {"",S_FALSE,FALSE},
431 {"",S_FALSE,FALSE},
432 {"nothing:should:happen here",S_OK,FALSE},
433 {"nothing:should:happen here",S_OK,FALSE},
434 {"",S_FALSE,FALSE},
435 {"urn:nothing:should:happen here",S_OK,FALSE},
436 {"urn",S_OK,FALSE},
437 {"",S_FALSE,FALSE},
438 {"",S_FALSE,FALSE}
439 },
440 {
441 {Uri_HOST_UNKNOWN,S_OK,FALSE},
442 {0,S_FALSE,FALSE},
443 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
444 {URLZONE_INVALID,E_NOTIMPL,FALSE}
445 }
446 },
447 { "http://127.0.0.1/tests/../test dir/./test.txt", 0, S_OK, FALSE,
448 {
449 {"http://127.0.0.1/test%20dir/test.txt",S_OK,FALSE},
450 {"127.0.0.1",S_OK,FALSE},
451 {"http://127.0.0.1/test%20dir/test.txt",S_OK,FALSE},
452 {"",S_FALSE,FALSE},
453 {".txt",S_OK,FALSE},
454 {"",S_FALSE,FALSE},
455 {"127.0.0.1",S_OK,FALSE},
456 {"",S_FALSE,FALSE},
457 {"/test%20dir/test.txt",S_OK,FALSE},
458 {"/test%20dir/test.txt",S_OK,FALSE},
459 {"",S_FALSE,FALSE},
460 {"http://127.0.0.1/tests/../test dir/./test.txt",S_OK,FALSE},
461 {"http",S_OK,FALSE},
462 {"",S_FALSE,FALSE},
463 {"",S_FALSE,FALSE}
464 },
465 {
466 {Uri_HOST_IPV4,S_OK,FALSE},
467 {80,S_OK,FALSE},
468 {URL_SCHEME_HTTP,S_OK,FALSE},
469 {URLZONE_INVALID,E_NOTIMPL,FALSE}
470 }
471 },
472 { "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", 0, S_OK, FALSE,
473 {
474 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,FALSE},
475 {"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]",S_OK,FALSE},
476 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,FALSE},
477 {"",S_FALSE,FALSE},
478 {"",S_FALSE,FALSE},
479 {"",S_FALSE,FALSE},
480 {"fedc:ba98:7654:3210:fedc:ba98:7654:3210",S_OK,FALSE},
481 {"",S_FALSE,FALSE},
482 {"/",S_OK,FALSE},
483 {"/",S_OK,FALSE},
484 {"",S_FALSE,FALSE},
485 {"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]",S_OK,FALSE},
486 {"http",S_OK,FALSE},
487 {"",S_FALSE,FALSE},
488 {"",S_FALSE,FALSE}
489 },
490 {
491 {Uri_HOST_IPV6,S_OK,FALSE},
492 {80,S_OK,FALSE},
493 {URL_SCHEME_HTTP,S_OK,FALSE},
494 {URLZONE_INVALID,E_NOTIMPL,FALSE}
495 }
496 },
497 { "ftp://[::13.1.68.3]", 0, S_OK, FALSE,
498 {
499 {"ftp://[::13.1.68.3]/",S_OK,FALSE},
500 {"[::13.1.68.3]",S_OK,FALSE},
501 {"ftp://[::13.1.68.3]/",S_OK,FALSE},
502 {"",S_FALSE,FALSE},
503 {"",S_FALSE,FALSE},
504 {"",S_FALSE,FALSE},
505 {"::13.1.68.3",S_OK,FALSE},
506 {"",S_FALSE,FALSE},
507 {"/",S_OK,FALSE},
508 {"/",S_OK,FALSE},
509 {"",S_FALSE,FALSE},
510 {"ftp://[::13.1.68.3]",S_OK,FALSE},
511 {"ftp",S_OK,FALSE},
512 {"",S_FALSE,FALSE},
513 {"",S_FALSE,FALSE}
514 },
515 {
516 {Uri_HOST_IPV6,S_OK,FALSE},
517 {21,S_OK,FALSE},
518 {URL_SCHEME_FTP,S_OK,FALSE},
519 {URLZONE_INVALID,E_NOTIMPL,FALSE}
520 }
521 },
522 { "http://[FEDC:BA98:0:0:0:0:0:3210]", 0, S_OK, FALSE,
523 {
524 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
525 {"[fedc:ba98::3210]",S_OK,FALSE},
526 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
527 {"",S_FALSE,FALSE},
528 {"",S_FALSE,FALSE},
529 {"",S_FALSE,FALSE},
530 {"fedc:ba98::3210",S_OK,FALSE},
531 {"",S_FALSE,FALSE},
532 {"/",S_OK,FALSE},
533 {"/",S_OK,FALSE},
534 {"",S_FALSE,FALSE},
535 {"http://[FEDC:BA98:0:0:0:0:0:3210]",S_OK,FALSE},
536 {"http",S_OK,FALSE},
537 {"",S_FALSE,FALSE},
538 {"",S_FALSE,FALSE},
539 },
540 {
541 {Uri_HOST_IPV6,S_OK,FALSE},
542 {80,S_OK,FALSE},
543 {URL_SCHEME_HTTP,S_OK,FALSE},
544 {URLZONE_INVALID,E_NOTIMPL,FALSE}
545 }
546 },
547 { "1234://www.winehq.org", 0, S_OK, FALSE,
548 {
549 {"1234://www.winehq.org/",S_OK,FALSE},
550 {"www.winehq.org",S_OK,FALSE},
551 {"1234://www.winehq.org/",S_OK,FALSE},
552 {"winehq.org",S_OK,FALSE},
553 {"",S_FALSE,FALSE},
554 {"",S_FALSE,FALSE},
555 {"www.winehq.org",S_OK,FALSE},
556 {"",S_FALSE,FALSE},
557 {"/",S_OK,FALSE},
558 {"/",S_OK,FALSE},
559 {"",S_FALSE,FALSE},
560 {"1234://www.winehq.org",S_OK,FALSE},
561 {"1234",S_OK,FALSE},
562 {"",S_FALSE,FALSE},
563 {"",S_FALSE,FALSE}
564 },
565 {
566 {Uri_HOST_DNS,S_OK,FALSE},
567 {0,S_FALSE,FALSE},
568 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
569 {URLZONE_INVALID,E_NOTIMPL,FALSE}
570 }
571 },
572 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
573 { "C:/test/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE,
574 {
575 {"file:///C:/test/test.mp3",S_OK,FALSE},
576 {"",S_FALSE,FALSE},
577 {"file:///C:/test/test.mp3",S_OK,FALSE},
578 {"",S_FALSE,FALSE},
579 {".mp3",S_OK,FALSE},
580 {"",S_FALSE,FALSE},
581 {"",S_FALSE,FALSE},
582 {"",S_FALSE,FALSE},
583 {"/C:/test/test.mp3",S_OK,FALSE},
584 {"/C:/test/test.mp3",S_OK,FALSE},
585 {"",S_FALSE,FALSE},
586 {"C:/test/test.mp3",S_OK,FALSE},
587 {"file",S_OK,FALSE},
588 {"",S_FALSE,FALSE},
589 {"",S_FALSE,FALSE}
590 },
591 {
592 {Uri_HOST_UNKNOWN,S_OK,FALSE},
593 {0,S_FALSE,FALSE},
594 {URL_SCHEME_FILE,S_OK,FALSE},
595 {URLZONE_INVALID,E_NOTIMPL,FALSE}
596 }
597 },
598 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
599 { "\\\\Server/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE,
600 {
601 {"file://server/test.mp3",S_OK,FALSE},
602 {"server",S_OK,FALSE},
603 {"file://server/test.mp3",S_OK,FALSE},
604 {"",S_FALSE,FALSE},
605 {".mp3",S_OK,FALSE},
606 {"",S_FALSE,FALSE},
607 {"server",S_OK,FALSE},
608 {"",S_FALSE,FALSE},
609 {"/test.mp3",S_OK,FALSE},
610 {"/test.mp3",S_OK,FALSE},
611 {"",S_FALSE,FALSE},
612 {"\\\\Server/test.mp3",S_OK,FALSE},
613 {"file",S_OK,FALSE},
614 {"",S_FALSE,FALSE},
615 {"",S_FALSE,FALSE}
616 },
617 {
618 {Uri_HOST_DNS,S_OK,FALSE},
619 {0,S_FALSE,FALSE},
620 {URL_SCHEME_FILE,S_OK,FALSE},
621 {URLZONE_INVALID,E_NOTIMPL,FALSE}
622 }
623 },
624 { "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,
625 {
626 {"file://C:\\test\\test.mp3#fragment|part",S_OK,FALSE},
627 {"",S_FALSE,FALSE},
628 {"file://C:\\test\\test.mp3#fragment|part",S_OK,FALSE},
629 {"",S_FALSE,FALSE},
630 {".mp3#fragment|part",S_OK,FALSE},
631 {"",S_FALSE,FALSE},
632 {"",S_FALSE,FALSE},
633 {"",S_FALSE,FALSE},
634 {"C:\\test\\test.mp3#fragment|part",S_OK,FALSE},
635 {"C:\\test\\test.mp3#fragment|part",S_OK,FALSE},
636 {"",S_FALSE,FALSE},
637 {"C:/test/test.mp3#fragment|part",S_OK,FALSE},
638 {"file",S_OK,FALSE},
639 {"",S_FALSE,FALSE},
640 {"",S_FALSE,FALSE}
641 },
642 {
643 {Uri_HOST_UNKNOWN,S_OK,FALSE},
644 {0,S_FALSE,FALSE},
645 {URL_SCHEME_FILE,S_OK,FALSE},
646 {URLZONE_INVALID,E_NOTIMPL,FALSE}
647 }
648 },
649 { "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,
650 {
651 {"file://C:\\test\\test.mp3?query|part",S_OK,FALSE},
652 {"",S_FALSE,FALSE},
653 {"file://C:\\test\\test.mp3?query|part",S_OK,FALSE},
654 {"",S_FALSE,FALSE},
655 {".mp3",S_OK,FALSE},
656 {"",S_FALSE,FALSE},
657 {"",S_FALSE,FALSE},
658 {"",S_FALSE,FALSE},
659 {"C:\\test\\test.mp3",S_OK,FALSE},
660 {"C:\\test\\test.mp3?query|part",S_OK,FALSE},
661 {"?query|part",S_OK,FALSE},
662 {"C:/test/test.mp3?query|part",S_OK,FALSE},
663 {"file",S_OK,FALSE},
664 {"",S_FALSE,FALSE},
665 {"",S_FALSE,FALSE}
666 },
667 {
668 {Uri_HOST_UNKNOWN,S_OK,FALSE},
669 {0,S_FALSE,FALSE},
670 {URL_SCHEME_FILE,S_OK,FALSE},
671 {URLZONE_INVALID,E_NOTIMPL,FALSE}
672 }
673 },
674 { "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,
675 {
676 {"file://C:\\test\\test.mp3?query|part#hash|part",S_OK,FALSE},
677 {"",S_FALSE,FALSE},
678 {"file://C:\\test\\test.mp3?query|part#hash|part",S_OK,FALSE},
679 {"",S_FALSE,FALSE},
680 {".mp3",S_OK,FALSE},
681 {"#hash|part",S_OK,FALSE},
682 {"",S_FALSE,FALSE},
683 {"",S_FALSE,FALSE},
684 {"C:\\test\\test.mp3",S_OK,FALSE},
685 {"C:\\test\\test.mp3?query|part",S_OK,FALSE},
686 {"?query|part",S_OK,FALSE},
687 {"C:/test/test.mp3?query|part#hash|part",S_OK,FALSE},
688 {"file",S_OK,FALSE},
689 {"",S_FALSE,FALSE},
690 {"",S_FALSE,FALSE}
691 },
692 {
693 {Uri_HOST_UNKNOWN,S_OK,FALSE},
694 {0,S_FALSE,FALSE},
695 {URL_SCHEME_FILE,S_OK,FALSE},
696 {URLZONE_INVALID,E_NOTIMPL,FALSE}
697 }
698 },
699 { "www.winehq.org/test", Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME, S_OK, FALSE,
700 {
701 {"*:www.winehq.org/test",S_OK,FALSE},
702 {"www.winehq.org",S_OK,FALSE},
703 {"*:www.winehq.org/test",S_OK,FALSE},
704 {"winehq.org",S_OK,FALSE},
705 {"",S_FALSE,FALSE},
706 {"",S_FALSE,FALSE},
707 {"www.winehq.org",S_OK,FALSE},
708 {"",S_FALSE,FALSE},
709 {"/test",S_OK,FALSE},
710 {"/test",S_OK,FALSE},
711 {"",S_FALSE,FALSE},
712 {"www.winehq.org/test",S_OK,FALSE},
713 {"*",S_OK,FALSE},
714 {"",S_FALSE,FALSE},
715 {"",S_FALSE,FALSE}
716 },
717 {
718 {Uri_HOST_DNS,S_OK,FALSE},
719 {0,S_FALSE,FALSE},
720 {URL_SCHEME_WILDCARD,S_OK,FALSE},
721 {URLZONE_INVALID,E_NOTIMPL,FALSE}
722 }
723 },
724 /* Valid since the '*' is the only character in the scheme name. */
725 { "*:www.winehq.org/test", 0, S_OK, FALSE,
726 {
727 {"*:www.winehq.org/test",S_OK,FALSE},
728 {"www.winehq.org",S_OK,FALSE},
729 {"*:www.winehq.org/test",S_OK,FALSE},
730 {"winehq.org",S_OK,FALSE},
731 {"",S_FALSE,FALSE},
732 {"",S_FALSE,FALSE},
733 {"www.winehq.org",S_OK,FALSE},
734 {"",S_FALSE,FALSE},
735 {"/test",S_OK,FALSE},
736 {"/test",S_OK,FALSE},
737 {"",S_FALSE,FALSE},
738 {"*:www.winehq.org/test",S_OK,FALSE},
739 {"*",S_OK,FALSE},
740 {"",S_FALSE,FALSE},
741 {"",S_FALSE,FALSE}
742 },
743 {
744 {Uri_HOST_DNS,S_OK,FALSE},
745 {0,S_FALSE,FALSE},
746 {URL_SCHEME_WILDCARD,S_OK,FALSE},
747 {URLZONE_INVALID,E_NOTIMPL,FALSE}
748 }
749 },
750 { "/../some dir/test.ext", Uri_CREATE_ALLOW_RELATIVE, S_OK, FALSE,
751 {
752 {"/../some dir/test.ext",S_OK,FALSE},
753 {"",S_FALSE,FALSE},
754 {"/../some dir/test.ext",S_OK,FALSE},
755 {"",S_FALSE,FALSE},
756 {".ext",S_OK,FALSE},
757 {"",S_FALSE,FALSE},
758 {"",S_FALSE,FALSE},
759 {"",S_FALSE,FALSE},
760 {"/../some dir/test.ext",S_OK,FALSE},
761 {"/../some dir/test.ext",S_OK,FALSE},
762 {"",S_FALSE,FALSE},
763 {"/../some dir/test.ext",S_OK,FALSE},
764 {"",S_FALSE,FALSE},
765 {"",S_FALSE,FALSE},
766 {"",S_FALSE,FALSE}
767 },
768 {
769 {Uri_HOST_UNKNOWN,S_OK,FALSE},
770 {0,S_FALSE,FALSE},
771 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
772 {URLZONE_INVALID,E_NOTIMPL,FALSE}
773 }
774 },
775 { "//implicit/wildcard/uri scheme", Uri_CREATE_ALLOW_RELATIVE|Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME, S_OK, FALSE,
776 {
777 {"*://implicit/wildcard/uri%20scheme",S_OK,FALSE},
778 {"",S_OK,FALSE},
779 {"*://implicit/wildcard/uri%20scheme",S_OK,FALSE},
780 {"",S_FALSE,FALSE},
781 {"",S_FALSE,FALSE},
782 {"",S_FALSE,FALSE},
783 {"",S_OK,FALSE},
784 {"",S_FALSE,FALSE},
785 {"//implicit/wildcard/uri%20scheme",S_OK,FALSE},
786 {"//implicit/wildcard/uri%20scheme",S_OK,FALSE},
787 {"",S_FALSE,FALSE},
788 {"//implicit/wildcard/uri scheme",S_OK,FALSE},
789 {"*",S_OK,FALSE},
790 {"",S_FALSE,FALSE},
791 {"",S_FALSE,FALSE},
792 },
793 {
794 {Uri_HOST_UNKNOWN,S_OK,FALSE},
795 {0,S_FALSE,FALSE},
796 {URL_SCHEME_WILDCARD,S_OK,FALSE},
797 {URLZONE_INVALID,E_NOTIMPL,FALSE}
798 }
799 },
800 /* URI is considered opaque since CREATE_NO_CRACK_UNKNOWN_SCHEMES is set and it's an unknown scheme. */
801 { "zip://google.com", Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES, S_OK, FALSE,
802 {
803 {"zip:/.//google.com",S_OK,FALSE},
804 {"",S_FALSE,FALSE},
805 {"zip:/.//google.com",S_OK,FALSE},
806 {"",S_FALSE,FALSE},
807 {".com",S_OK,FALSE},
808 {"",S_FALSE,FALSE},
809 {"",S_FALSE,FALSE},
810 {"",S_FALSE,FALSE},
811 {"/.//google.com",S_OK,FALSE},
812 {"/.//google.com",S_OK,FALSE},
813 {"",S_FALSE,FALSE},
814 {"zip://google.com",S_OK,FALSE},
815 {"zip",S_OK,FALSE},
816 {"",S_FALSE,FALSE},
817 {"",S_FALSE,FALSE}
818 },
819 {
820 {Uri_HOST_UNKNOWN,S_OK,FALSE},
821 {0,S_FALSE,FALSE},
822 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
823 {URLZONE_INVALID,E_NOTIMPL,FALSE}
824 }
825 },
826 /* Windows uses the first occurrence of ':' to delimit the userinfo. */
827 { "ftp://user:pass:word@winehq.org/", 0, S_OK, FALSE,
828 {
829 {"ftp://user:pass:word@winehq.org/",S_OK,FALSE},
830 {"user:pass:word@winehq.org",S_OK,FALSE},
831 {"ftp://winehq.org/",S_OK,FALSE},
832 {"winehq.org",S_OK,FALSE},
833 {"",S_FALSE,FALSE},
834 {"",S_FALSE,FALSE},
835 {"winehq.org",S_OK,FALSE},
836 {"pass:word",S_OK,FALSE},
837 {"/",S_OK,FALSE},
838 {"/",S_OK,FALSE},
839 {"",S_FALSE,FALSE},
840 {"ftp://user:pass:word@winehq.org/",S_OK,FALSE},
841 {"ftp",S_OK,FALSE},
842 {"user:pass:word",S_OK,FALSE},
843 {"user",S_OK,FALSE}
844 },
845 {
846 {Uri_HOST_DNS,S_OK,FALSE},
847 {21,S_OK,FALSE},
848 {URL_SCHEME_FTP,S_OK,FALSE},
849 {URLZONE_INVALID,E_NOTIMPL,FALSE}
850 }
851 },
852 /* Make sure % encoded unreserved characters are decoded. */
853 { "ftp://w%49%4Ee:PA%53%53@ftp.google.com/", 0, S_OK, FALSE,
854 {
855 {"ftp://wINe:PASS@ftp.google.com/",S_OK,FALSE},
856 {"wINe:PASS@ftp.google.com",S_OK,FALSE},
857 {"ftp://ftp.google.com/",S_OK,FALSE},
858 {"google.com",S_OK,FALSE},
859 {"",S_FALSE,FALSE},
860 {"",S_FALSE,FALSE},
861 {"ftp.google.com",S_OK,FALSE},
862 {"PASS",S_OK,FALSE},
863 {"/",S_OK,FALSE},
864 {"/",S_OK,FALSE},
865 {"",S_FALSE,FALSE},
866 {"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK,FALSE},
867 {"ftp",S_OK,FALSE},
868 {"wINe:PASS",S_OK,FALSE},
869 {"wINe",S_OK,FALSE}
870 },
871 {
872 {Uri_HOST_DNS,S_OK,FALSE},
873 {21,S_OK,FALSE},
874 {URL_SCHEME_FTP,S_OK,FALSE},
875 {URLZONE_INVALID,E_NOTIMPL,FALSE}
876 }
877 },
878 /* Make sure % encoded characters which are NOT unreserved are NOT decoded. */
879 { "ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/", 0, S_OK, FALSE,
880 {
881 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,FALSE},
882 {"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK,FALSE},
883 {"ftp://ftp.google.com/",S_OK,FALSE},
884 {"google.com",S_OK,FALSE},
885 {"",S_FALSE,FALSE},
886 {"",S_FALSE,FALSE},
887 {"ftp.google.com",S_OK,FALSE},
888 {"PA%7B%7D",S_OK,FALSE},
889 {"/",S_OK,FALSE},
890 {"/",S_OK,FALSE},
891 {"",S_FALSE,FALSE},
892 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,FALSE},
893 {"ftp",S_OK,FALSE},
894 {"w%5D%5Be:PA%7B%7D",S_OK,FALSE},
895 {"w%5D%5Be",S_OK,FALSE}
896 },
897 {
898 {Uri_HOST_DNS,S_OK,FALSE},
899 {21,S_OK,FALSE},
900 {URL_SCHEME_FTP,S_OK,FALSE},
901 {URLZONE_INVALID,E_NOTIMPL,FALSE}
902 }
903 },
904 /* You're allowed to have an empty password portion in the userinfo section. */
905 { "ftp://empty:@ftp.google.com/", 0, S_OK, FALSE,
906 {
907 {"ftp://empty:@ftp.google.com/",S_OK,FALSE},
908 {"empty:@ftp.google.com",S_OK,FALSE},
909 {"ftp://ftp.google.com/",S_OK,FALSE},
910 {"google.com",S_OK,FALSE},
911 {"",S_FALSE,FALSE},
912 {"",S_FALSE,FALSE},
913 {"ftp.google.com",S_OK,FALSE},
914 {"",S_OK,FALSE},
915 {"/",S_OK,FALSE},
916 {"/",S_OK,FALSE},
917 {"",S_FALSE,FALSE},
918 {"ftp://empty:@ftp.google.com/",S_OK,FALSE},
919 {"ftp",S_OK,FALSE},
920 {"empty:",S_OK,FALSE},
921 {"empty",S_OK,FALSE}
922 },
923 {
924 {Uri_HOST_DNS,S_OK,FALSE},
925 {21,S_OK,FALSE},
926 {URL_SCHEME_FTP,S_OK,FALSE},
927 {URLZONE_INVALID,E_NOTIMPL,FALSE}
928 }
929 },
930 /* Make sure forbidden characters in "userinfo" get encoded. */
931 { "ftp://\" \"weird@ftp.google.com/", 0, S_OK, FALSE,
932 {
933 {"ftp://%22%20%22weird@ftp.google.com/",S_OK,FALSE},
934 {"%22%20%22weird@ftp.google.com",S_OK,FALSE},
935 {"ftp://ftp.google.com/",S_OK,FALSE},
936 {"google.com",S_OK,FALSE},
937 {"",S_FALSE,FALSE},
938 {"",S_FALSE,FALSE},
939 {"ftp.google.com",S_OK,FALSE},
940 {"",S_FALSE,FALSE},
941 {"/",S_OK,FALSE},
942 {"/",S_OK,FALSE},
943 {"",S_FALSE,FALSE},
944 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
945 {"ftp",S_OK,FALSE},
946 {"%22%20%22weird",S_OK,FALSE},
947 {"%22%20%22weird",S_OK,FALSE}
948 },
949 {
950 {Uri_HOST_DNS,S_OK,FALSE},
951 {21,S_OK,FALSE},
952 {URL_SCHEME_FTP,S_OK,FALSE},
953 {URLZONE_INVALID,E_NOTIMPL,FALSE}
954 }
955 },
956 /* Make sure the forbidden characters don't get percent encoded. */
957 { "ftp://\" \"weird@ftp.google.com/", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
958 {
959 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
960 {"\" \"weird@ftp.google.com",S_OK,FALSE},
961 {"ftp://ftp.google.com/",S_OK,FALSE},
962 {"google.com",S_OK,FALSE},
963 {"",S_FALSE,FALSE},
964 {"",S_FALSE,FALSE},
965 {"ftp.google.com",S_OK,FALSE},
966 {"",S_FALSE,FALSE},
967 {"/",S_OK,FALSE},
968 {"/",S_OK,FALSE},
969 {"",S_FALSE,FALSE},
970 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
971 {"ftp",S_OK,FALSE},
972 {"\" \"weird",S_OK,FALSE},
973 {"\" \"weird",S_OK,FALSE}
974 },
975 {
976 {Uri_HOST_DNS,S_OK,FALSE},
977 {21,S_OK,FALSE},
978 {URL_SCHEME_FTP,S_OK,FALSE},
979 {URLZONE_INVALID,E_NOTIMPL,FALSE}
980 }
981 },
982 /* Make sure already percent encoded characters don't get unencoded. */
983 { "ftp://\"%20\"weird@ftp.google.com/\"%20\"weird", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
984 {
985 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK,FALSE},
986 {"\"%20\"weird@ftp.google.com",S_OK,FALSE},
987 {"ftp://ftp.google.com/\"%20\"weird",S_OK,FALSE},
988 {"google.com",S_OK,FALSE},
989 {"",S_FALSE,FALSE},
990 {"",S_FALSE,FALSE},
991 {"ftp.google.com",S_OK,FALSE},
992 {"",S_FALSE,FALSE},
993 {"/\"%20\"weird",S_OK,FALSE},
994 {"/\"%20\"weird",S_OK,FALSE},
995 {"",S_FALSE,FALSE},
996 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK,FALSE},
997 {"ftp",S_OK,FALSE},
998 {"\"%20\"weird",S_OK,FALSE},
999 {"\"%20\"weird",S_OK,FALSE}
1000 },
1001 {
1002 {Uri_HOST_DNS,S_OK,FALSE},
1003 {21,S_OK,FALSE},
1004 {URL_SCHEME_FTP,S_OK,FALSE},
1005 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1006 }
1007 },
1008 /* Allowed to have invalid % encoded because it's an unknown scheme type. */
1009 { "zip://%xy:word@winehq.org/", 0, S_OK, FALSE,
1010 {
1011 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
1012 {"%xy:word@winehq.org",S_OK,FALSE},
1013 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
1014 {"winehq.org",S_OK,FALSE},
1015 {"",S_FALSE,FALSE},
1016 {"",S_FALSE,FALSE},
1017 {"winehq.org",S_OK,FALSE},
1018 {"word",S_OK,FALSE},
1019 {"/",S_OK,FALSE},
1020 {"/",S_OK,FALSE},
1021 {"",S_FALSE,FALSE},
1022 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
1023 {"zip",S_OK,FALSE},
1024 {"%xy:word",S_OK,FALSE},
1025 {"%xy",S_OK,FALSE}
1026 },
1027 {
1028 {Uri_HOST_DNS,S_OK,FALSE},
1029 {0,S_FALSE,FALSE},
1030 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1031 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1032 }
1033 },
1034 /* Unreserved, percent encoded characters aren't decoded in the userinfo because the scheme
1035 * isn't known.
1036 */
1037 { "zip://%2E:%52%53ord@winehq.org/", 0, S_OK, FALSE,
1038 {
1039 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
1040 {"%2E:%52%53ord@winehq.org",S_OK,FALSE},
1041 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
1042 {"winehq.org",S_OK,FALSE},
1043 {"",S_FALSE,FALSE},
1044 {"",S_FALSE,FALSE},
1045 {"winehq.org",S_OK,FALSE},
1046 {"%52%53ord",S_OK,FALSE},
1047 {"/",S_OK,FALSE},
1048 {"/",S_OK,FALSE},
1049 {"",S_FALSE,FALSE},
1050 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
1051 {"zip",S_OK,FALSE},
1052 {"%2E:%52%53ord",S_OK,FALSE},
1053 {"%2E",S_OK,FALSE}
1054 },
1055 {
1056 {Uri_HOST_DNS,S_OK,FALSE},
1057 {0,S_FALSE,FALSE},
1058 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1059 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1060 }
1061 },
1062 { "ftp://[](),'test':word@winehq.org/", 0, S_OK, FALSE,
1063 {
1064 {"ftp://[](),'test':word@winehq.org/",S_OK,FALSE},
1065 {"[](),'test':word@winehq.org",S_OK,FALSE},
1066 {"ftp://winehq.org/",S_OK,FALSE},
1067 {"winehq.org",S_OK,FALSE},
1068 {"",S_FALSE,FALSE},
1069 {"",S_FALSE,FALSE},
1070 {"winehq.org",S_OK,FALSE},
1071 {"word",S_OK,FALSE},
1072 {"/",S_OK,FALSE},
1073 {"/",S_OK,FALSE},
1074 {"",S_FALSE,FALSE},
1075 {"ftp://[](),'test':word@winehq.org/",S_OK,FALSE},
1076 {"ftp",S_OK,FALSE},
1077 {"[](),'test':word",S_OK,FALSE},
1078 {"[](),'test'",S_OK,FALSE}
1079 },
1080 {
1081 {Uri_HOST_DNS,S_OK,FALSE},
1082 {21,S_OK,FALSE},
1083 {URL_SCHEME_FTP,S_OK,FALSE},
1084 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1085 }
1086 },
1087 { "ftp://test?:word@winehq.org/", 0, S_OK, FALSE,
1088 {
1089 {"ftp://test/?:word@winehq.org/",S_OK,FALSE},
1090 {"test",S_OK,FALSE},
1091 {"ftp://test/?:word@winehq.org/",S_OK,FALSE},
1092 {"",S_FALSE,FALSE},
1093 {"",S_FALSE,FALSE},
1094 {"",S_FALSE,FALSE},
1095 {"test",S_OK,FALSE},
1096 {"",S_FALSE,FALSE},
1097 {"/",S_OK,FALSE},
1098 {"/?:word@winehq.org/",S_OK,FALSE},
1099 {"?:word@winehq.org/",S_OK,FALSE},
1100 {"ftp://test?:word@winehq.org/",S_OK,FALSE},
1101 {"ftp",S_OK,FALSE},
1102 {"",S_FALSE,FALSE},
1103 {"",S_FALSE,FALSE}
1104 },
1105 {
1106 {Uri_HOST_DNS,S_OK,FALSE},
1107 {21,S_OK,FALSE},
1108 {URL_SCHEME_FTP,S_OK,FALSE},
1109 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1110 }
1111 },
1112 { "ftp://test#:word@winehq.org/", 0, S_OK, FALSE,
1113 {
1114 {"ftp://test/#:word@winehq.org/",S_OK,FALSE},
1115 {"test",S_OK,FALSE},
1116 {"ftp://test/#:word@winehq.org/",S_OK,FALSE},
1117 {"",S_FALSE,FALSE},
1118 {"",S_FALSE,FALSE},
1119 {"#:word@winehq.org/",S_OK,FALSE},
1120 {"test",S_OK,FALSE},
1121 {"",S_FALSE,FALSE},
1122 {"/",S_OK,FALSE},
1123 {"/",S_OK,FALSE},
1124 {"",S_FALSE,FALSE},
1125 {"ftp://test#:word@winehq.org/",S_OK,FALSE},
1126 {"ftp",S_OK,FALSE},
1127 {"",S_FALSE,FALSE},
1128 {"",S_FALSE,FALSE}
1129 },
1130 {
1131 {Uri_HOST_DNS,S_OK,FALSE},
1132 {21,S_OK,FALSE},
1133 {URL_SCHEME_FTP,S_OK,FALSE},
1134 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1135 }
1136 },
1137 /* Allowed to have a backslash in the userinfo since it's an unknown scheme. */
1138 { "zip://test\\:word@winehq.org/", 0, S_OK, FALSE,
1139 {
1140 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
1141 {"test\\:word@winehq.org",S_OK,FALSE},
1142 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
1143 {"winehq.org",S_OK,FALSE},
1144 {"",S_FALSE,FALSE},
1145 {"",S_FALSE,FALSE},
1146 {"winehq.org",S_OK,FALSE},
1147 {"word",S_OK,FALSE},
1148 {"/",S_OK,FALSE},
1149 {"/",S_OK,FALSE},
1150 {"",S_FALSE,FALSE},
1151 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
1152 {"zip",S_OK,FALSE},
1153 {"test\\:word",S_OK,FALSE},
1154 {"test\\",S_OK,FALSE}
1155 },
1156 {
1157 {Uri_HOST_DNS,S_OK,FALSE},
1158 {0,S_FALSE,FALSE},
1159 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1160 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1161 }
1162 },
1163 /* It normalizes IPv4 addresses correctly. */
1164 { "http://127.000.000.100/", 0, S_OK, FALSE,
1165 {
1166 {"http://127.0.0.100/",S_OK,FALSE},
1167 {"127.0.0.100",S_OK,FALSE},
1168 {"http://127.0.0.100/",S_OK,FALSE},
1169 {"",S_FALSE,FALSE},
1170 {"",S_FALSE,FALSE},
1171 {"",S_FALSE,FALSE},
1172 {"127.0.0.100",S_OK,FALSE},
1173 {"",S_FALSE,FALSE},
1174 {"/",S_OK,FALSE},
1175 {"/",S_OK,FALSE},
1176 {"",S_FALSE,FALSE},
1177 {"http://127.000.000.100/",S_OK,FALSE},
1178 {"http",S_OK,FALSE},
1179 {"",S_FALSE,FALSE},
1180 {"",S_FALSE,FALSE}
1181 },
1182 {
1183 {Uri_HOST_IPV4,S_OK,FALSE},
1184 {80,S_OK,FALSE},
1185 {URL_SCHEME_HTTP,S_OK,FALSE},
1186 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1187 }
1188 },
1189 { "http://127.0.0.1:8000", 0, S_OK, FALSE,
1190 {
1191 {"http://127.0.0.1:8000/",S_OK},
1192 {"127.0.0.1:8000",S_OK},
1193 {"http://127.0.0.1:8000/",S_OK},
1194 {"",S_FALSE},
1195 {"",S_FALSE},
1196 {"",S_FALSE},
1197 {"127.0.0.1",S_OK},
1198 {"",S_FALSE},
1199 {"/",S_OK},
1200 {"/",S_OK},
1201 {"",S_FALSE},
1202 {"http://127.0.0.1:8000",S_OK},
1203 {"http",S_OK},
1204 {"",S_FALSE},
1205 {"",S_FALSE}
1206 },
1207 {
1208 {Uri_HOST_IPV4,S_OK,FALSE},
1209 {8000,S_OK,FALSE},
1210 {URL_SCHEME_HTTP,S_OK,FALSE},
1211 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1212 }
1213 },
1214 /* Make sure it normalizes partial IPv4 addresses correctly. */
1215 { "http://127.0/", 0, S_OK, FALSE,
1216 {
1217 {"http://127.0.0.0/",S_OK,FALSE},
1218 {"127.0.0.0",S_OK,FALSE},
1219 {"http://127.0.0.0/",S_OK,FALSE},
1220 {"",S_FALSE,FALSE},
1221 {"",S_FALSE,FALSE},
1222 {"",S_FALSE,FALSE},
1223 {"127.0.0.0",S_OK,FALSE},
1224 {"",S_FALSE,FALSE},
1225 {"/",S_OK,FALSE},
1226 {"/",S_OK,FALSE},
1227 {"",S_FALSE,FALSE},
1228 {"http://127.0/",S_OK,FALSE},
1229 {"http",S_OK,FALSE},
1230 {"",S_FALSE,FALSE},
1231 {"",S_FALSE,FALSE}
1232 },
1233 {
1234 {Uri_HOST_IPV4,S_OK,FALSE},
1235 {80,S_OK,FALSE},
1236 {URL_SCHEME_HTTP,S_OK,FALSE},
1237 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1238 }
1239 },
1240 /* Make sure it converts implicit IPv4's correctly. */
1241 { "http://123456/", 0, S_OK, FALSE,
1242 {
1243 {"http://0.1.226.64/",S_OK,FALSE},
1244 {"0.1.226.64",S_OK,FALSE},
1245 {"http://0.1.226.64/",S_OK,FALSE},
1246 {"",S_FALSE,FALSE},
1247 {"",S_FALSE,FALSE},
1248 {"",S_FALSE,FALSE},
1249 {"0.1.226.64",S_OK,FALSE},
1250 {"",S_FALSE,FALSE},
1251 {"/",S_OK,FALSE},
1252 {"/",S_OK,FALSE},
1253 {"",S_FALSE,FALSE},
1254 {"http://123456/",S_OK,FALSE},
1255 {"http",S_OK,FALSE},
1256 {"",S_FALSE,FALSE},
1257 {"",S_FALSE,FALSE}
1258 },
1259 {
1260 {Uri_HOST_IPV4,S_OK,FALSE},
1261 {80,S_OK,FALSE},
1262 {URL_SCHEME_HTTP,S_OK,FALSE},
1263 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1264 }
1265 },
1266 /* UINT_MAX */
1267 { "http://4294967295/", 0, S_OK, FALSE,
1268 {
1269 {"http://255.255.255.255/",S_OK,FALSE},
1270 {"255.255.255.255",S_OK,FALSE},
1271 {"http://255.255.255.255/",S_OK,FALSE},
1272 {"",S_FALSE,FALSE},
1273 {"",S_FALSE,FALSE},
1274 {"",S_FALSE,FALSE},
1275 {"255.255.255.255",S_OK,FALSE},
1276 {"",S_FALSE,FALSE},
1277 {"/",S_OK,FALSE},
1278 {"/",S_OK,FALSE},
1279 {"",S_FALSE,FALSE},
1280 {"http://4294967295/",S_OK,FALSE},
1281 {"http",S_OK,FALSE},
1282 {"",S_FALSE,FALSE},
1283 {"",S_FALSE,FALSE}
1284 },
1285 {
1286 {Uri_HOST_IPV4,S_OK,FALSE},
1287 {80,S_OK,FALSE},
1288 {URL_SCHEME_HTTP,S_OK,FALSE},
1289 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1290 }
1291 },
1292 /* UINT_MAX+1 */
1293 { "http://4294967296/", 0, S_OK, FALSE,
1294 {
1295 {"http://4294967296/",S_OK,FALSE},
1296 {"4294967296",S_OK,FALSE},
1297 {"http://4294967296/",S_OK,FALSE},
1298 {"",S_FALSE,FALSE},
1299 {"",S_FALSE,FALSE},
1300 {"",S_FALSE,FALSE},
1301 {"4294967296",S_OK,FALSE},
1302 {"",S_FALSE,FALSE},
1303 {"/",S_OK,FALSE},
1304 {"/",S_OK,FALSE},
1305 {"",S_FALSE,FALSE},
1306 {"http://4294967296/",S_OK,FALSE},
1307 {"http",S_OK,FALSE},
1308 {"",S_FALSE,FALSE},
1309 {"",S_FALSE,FALSE}
1310 },
1311 {
1312 {Uri_HOST_DNS,S_OK,FALSE},
1313 {80,S_OK,FALSE},
1314 {URL_SCHEME_HTTP,S_OK,FALSE},
1315 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1316 }
1317 },
1318 /* Window's doesn't normalize IP address for unknown schemes. */
1319 { "1234://4294967295/", 0, S_OK, FALSE,
1320 {
1321 {"1234://4294967295/",S_OK,FALSE},
1322 {"4294967295",S_OK,FALSE},
1323 {"1234://4294967295/",S_OK,FALSE},
1324 {"",S_FALSE,FALSE},
1325 {"",S_FALSE,FALSE},
1326 {"",S_FALSE,FALSE},
1327 {"4294967295",S_OK,FALSE},
1328 {"",S_FALSE,FALSE},
1329 {"/",S_OK,FALSE},
1330 {"/",S_OK,FALSE},
1331 {"",S_FALSE,FALSE},
1332 {"1234://4294967295/",S_OK,FALSE},
1333 {"1234",S_OK,FALSE},
1334 {"",S_FALSE,FALSE},
1335 {"",S_FALSE,FALSE}
1336 },
1337 {
1338 {Uri_HOST_IPV4,S_OK,FALSE},
1339 {0,S_FALSE,FALSE},
1340 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1341 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1342 }
1343 },
1344 /* Window's doesn't normalize IP address for unknown schemes. */
1345 { "1234://127.001/", 0, S_OK, FALSE,
1346 {
1347 {"1234://127.001/",S_OK,FALSE},
1348 {"127.001",S_OK,FALSE},
1349 {"1234://127.001/",S_OK,FALSE},
1350 {"",S_FALSE,FALSE},
1351 {"",S_FALSE,FALSE},
1352 {"",S_FALSE,FALSE},
1353 {"127.001",S_OK,FALSE},
1354 {"",S_FALSE,FALSE},
1355 {"/",S_OK,FALSE},
1356 {"/",S_OK,FALSE},
1357 {"",S_FALSE,FALSE},
1358 {"1234://127.001/",S_OK,FALSE},
1359 {"1234",S_OK,FALSE},
1360 {"",S_FALSE,FALSE},
1361 {"",S_FALSE,FALSE}
1362 },
1363 {
1364 {Uri_HOST_IPV4,S_OK,FALSE},
1365 {0,S_FALSE,FALSE},
1366 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1367 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1368 }
1369 },
1370 { "http://[FEDC:BA98::3210]", 0, S_OK, FALSE,
1371 {
1372 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
1373 {"[fedc:ba98::3210]",S_OK,FALSE},
1374 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
1375 {"",S_FALSE,FALSE},
1376 {"",S_FALSE,FALSE},
1377 {"",S_FALSE,FALSE},
1378 {"fedc:ba98::3210",S_OK,FALSE},
1379 {"",S_FALSE,FALSE},
1380 {"/",S_OK,FALSE},
1381 {"/",S_OK,FALSE},
1382 {"",S_FALSE,FALSE},
1383 {"http://[FEDC:BA98::3210]",S_OK,FALSE},
1384 {"http",S_OK,FALSE},
1385 {"",S_FALSE,FALSE},
1386 {"",S_FALSE,FALSE},
1387 },
1388 {
1389 {Uri_HOST_IPV6,S_OK,FALSE},
1390 {80,S_OK,FALSE},
1391 {URL_SCHEME_HTTP,S_OK,FALSE},
1392 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1393 }
1394 },
1395 { "http://[::]", 0, S_OK, FALSE,
1396 {
1397 {"http://[::]/",S_OK,FALSE},
1398 {"[::]",S_OK,FALSE},
1399 {"http://[::]/",S_OK,FALSE},
1400 {"",S_FALSE,FALSE},
1401 {"",S_FALSE,FALSE},
1402 {"",S_FALSE,FALSE},
1403 {"::",S_OK,FALSE},
1404 {"",S_FALSE,FALSE},
1405 {"/",S_OK,FALSE},
1406 {"/",S_OK,FALSE},
1407 {"",S_FALSE,FALSE},
1408 {"http://[::]",S_OK,FALSE},
1409 {"http",S_OK,FALSE},
1410 {"",S_FALSE,FALSE},
1411 {"",S_FALSE,FALSE},
1412 },
1413 {
1414 {Uri_HOST_IPV6,S_OK,FALSE},
1415 {80,S_OK,FALSE},
1416 {URL_SCHEME_HTTP,S_OK,FALSE},
1417 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1418 }
1419 },
1420 { "http://[FEDC:BA98::]", 0, S_OK, FALSE,
1421 {
1422 {"http://[fedc:ba98::]/",S_OK,FALSE},
1423 {"[fedc:ba98::]",S_OK,FALSE},
1424 {"http://[fedc:ba98::]/",S_OK,FALSE},
1425 {"",S_FALSE,FALSE},
1426 {"",S_FALSE,FALSE},
1427 {"",S_FALSE,FALSE},
1428 {"fedc:ba98::",S_OK,FALSE},
1429 {"",S_FALSE,FALSE},
1430 {"/",S_OK,FALSE},
1431 {"/",S_OK,FALSE},
1432 {"",S_FALSE,FALSE},
1433 {"http://[FEDC:BA98::]",S_OK,FALSE},
1434 {"http",S_OK,FALSE},
1435 {"",S_FALSE,FALSE},
1436 {"",S_FALSE,FALSE},
1437 },
1438 {
1439 {Uri_HOST_IPV6,S_OK,FALSE},
1440 {80,S_OK,FALSE},
1441 {URL_SCHEME_HTTP,S_OK,FALSE},
1442 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1443 }
1444 },
1445 /* Valid even with 2 byte elision because it doesn't appear the beginning or end. */
1446 { "http://[1::3:4:5:6:7:8]", 0, S_OK, FALSE,
1447 {
1448 {"http://[1:0:3:4:5:6:7:8]/",S_OK,FALSE},
1449 {"[1:0:3:4:5:6:7:8]",S_OK,FALSE},
1450 {"http://[1:0:3:4:5:6:7:8]/",S_OK,FALSE},
1451 {"",S_FALSE,FALSE},
1452 {"",S_FALSE,FALSE},
1453 {"",S_FALSE,FALSE},
1454 {"1:0:3:4:5:6:7:8",S_OK,FALSE},
1455 {"",S_FALSE,FALSE},
1456 {"/",S_OK,FALSE},
1457 {"/",S_OK,FALSE},
1458 {"",S_FALSE,FALSE},
1459 {"http://[1::3:4:5:6:7:8]",S_OK,FALSE},
1460 {"http",S_OK,FALSE},
1461 {"",S_FALSE,FALSE},
1462 {"",S_FALSE,FALSE},
1463 },
1464 {
1465 {Uri_HOST_IPV6,S_OK,FALSE},
1466 {80,S_OK,FALSE},
1467 {URL_SCHEME_HTTP,S_OK,FALSE},
1468 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1469 }
1470 },
1471 { "http://[v2.34]/", 0, S_OK, FALSE,
1472 {
1473 {"http://[v2.34]/",S_OK,FALSE},
1474 {"[v2.34]",S_OK,FALSE},
1475 {"http://[v2.34]/",S_OK,FALSE},
1476 {"",S_FALSE,FALSE},
1477 {"",S_FALSE,FALSE},
1478 {"",S_FALSE,FALSE},
1479 {"[v2.34]",S_OK,FALSE},
1480 {"",S_FALSE,FALSE},
1481 {"/",S_OK,FALSE},
1482 {"/",S_OK,FALSE},
1483 {"",S_FALSE,FALSE},
1484 {"http://[v2.34]/",S_OK,FALSE},
1485 {"http",S_OK,FALSE},
1486 {"",S_FALSE,FALSE},
1487 {"",S_FALSE,FALSE}
1488 },
1489 {
1490 {Uri_HOST_UNKNOWN,S_OK,FALSE},
1491 {80,S_OK,FALSE},
1492 {URL_SCHEME_HTTP,S_OK,FALSE},
1493 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1494 }
1495 },
1496 /* Windows ignores ':' if they appear after a '[' on a non-IPLiteral host. */
1497 { "http://[xyz:12345.com/test", 0, S_OK, FALSE,
1498 {
1499 {"http://[xyz:12345.com/test",S_OK,FALSE},
1500 {"[xyz:12345.com",S_OK,FALSE},
1501 {"http://[xyz:12345.com/test",S_OK,FALSE},
1502 {"[xyz:12345.com",S_OK,FALSE},
1503 {"",S_FALSE,FALSE},
1504 {"",S_FALSE,FALSE},
1505 {"[xyz:12345.com",S_OK,FALSE},
1506 {"",S_FALSE,FALSE},
1507 {"/test",S_OK,FALSE},
1508 {"/test",S_OK,FALSE},
1509 {"",S_FALSE,FALSE},
1510 {"http://[xyz:12345.com/test",S_OK,FALSE},
1511 {"http",S_OK,FALSE},
1512 {"",S_FALSE,FALSE},
1513 {"",S_FALSE,FALSE}
1514 },
1515 {
1516 {Uri_HOST_DNS,S_OK,FALSE},
1517 {80,S_OK,FALSE},
1518 {URL_SCHEME_HTTP,S_OK,FALSE},
1519 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1520 }
1521 },
1522 /* Valid URI since the '[' and ']' don't appear at the beginning and end
1523 * of the host name (respectively).
1524 */
1525 { "ftp://www.[works].com/", 0, S_OK, FALSE,
1526 {
1527 {"ftp://www.[works].com/",S_OK,FALSE},
1528 {"www.[works].com",S_OK,FALSE},
1529 {"ftp://www.[works].com/",S_OK,FALSE},
1530 {"[works].com",S_OK,FALSE},
1531 {"",S_FALSE,FALSE},
1532 {"",S_FALSE,FALSE},
1533 {"www.[works].com",S_OK,FALSE},
1534 {"",S_FALSE,FALSE},
1535 {"/",S_OK,FALSE},
1536 {"/",S_OK,FALSE},
1537 {"",S_FALSE,FALSE},
1538 {"ftp://www.[works].com/",S_OK,FALSE},
1539 {"ftp",S_OK,FALSE},
1540 {"",S_FALSE,FALSE},
1541 {"",S_FALSE,FALSE}
1542 },
1543 {
1544 {Uri_HOST_DNS,S_OK,FALSE},
1545 {21,S_OK,FALSE},
1546 {URL_SCHEME_FTP,S_OK,FALSE},
1547 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1548 }
1549 },
1550 /* Considers ':' a delimiter since it appears after the ']'. */
1551 { "http://www.google.com]:12345/", 0, S_OK, FALSE,
1552 {
1553 {"http://www.google.com]:12345/",S_OK,FALSE},
1554 {"www.google.com]:12345",S_OK,FALSE},
1555 {"http://www.google.com]:12345/",S_OK,FALSE},
1556 {"google.com]",S_OK,FALSE},
1557 {"",S_FALSE,FALSE},
1558 {"",S_FALSE,FALSE},
1559 {"www.google.com]",S_OK,FALSE},
1560 {"",S_FALSE,FALSE},
1561 {"/",S_OK,FALSE},
1562 {"/",S_OK,FALSE},
1563 {"",S_FALSE,FALSE},
1564 {"http://www.google.com]:12345/",S_OK,FALSE},
1565 {"http",S_OK,FALSE},
1566 {"",S_FALSE,FALSE},
1567 {"",S_FALSE,FALSE}
1568 },
1569 {
1570 {Uri_HOST_DNS,S_OK,FALSE},
1571 {12345,S_OK,FALSE},
1572 {URL_SCHEME_HTTP,S_OK,FALSE},
1573 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1574 }
1575 },
1576 /* Unknown scheme types can have invalid % encoded data in the hostname. */
1577 { "zip://w%XXw%GEw.google.com/", 0, S_OK, FALSE,
1578 {
1579 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1580 {"w%XXw%GEw.google.com",S_OK,FALSE},
1581 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1582 {"google.com",S_OK,FALSE},
1583 {"",S_FALSE,FALSE},
1584 {"",S_FALSE,FALSE},
1585 {"w%XXw%GEw.google.com",S_OK,FALSE},
1586 {"",S_FALSE,FALSE},
1587 {"/",S_OK,FALSE},
1588 {"/",S_OK,FALSE},
1589 {"",S_FALSE,FALSE},
1590 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1591 {"zip",S_OK,FALSE},
1592 {"",S_FALSE,FALSE},
1593 {"",S_FALSE,FALSE}
1594 },
1595 {
1596 {Uri_HOST_DNS,S_OK,FALSE},
1597 {0,S_FALSE,FALSE},
1598 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1599 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1600 }
1601 },
1602 /* Unknown scheme types hostname doesn't get lower cased. */
1603 { "zip://GOOGLE.com/", 0, S_OK, FALSE,
1604 {
1605 {"zip://GOOGLE.com/",S_OK,FALSE},
1606 {"GOOGLE.com",S_OK,FALSE},
1607 {"zip://GOOGLE.com/",S_OK,FALSE},
1608 {"GOOGLE.com",S_OK,FALSE},
1609 {"",S_FALSE,FALSE},
1610 {"",S_FALSE,FALSE},
1611 {"GOOGLE.com",S_OK,FALSE},
1612 {"",S_FALSE,FALSE},
1613 {"/",S_OK,FALSE},
1614 {"/",S_OK,FALSE},
1615 {"",S_FALSE,FALSE},
1616 {"zip://GOOGLE.com/",S_OK,FALSE},
1617 {"zip",S_OK,FALSE},
1618 {"",S_FALSE,FALSE},
1619 {"",S_FALSE,FALSE}
1620 },
1621 {
1622 {Uri_HOST_DNS,S_OK,FALSE},
1623 {0,S_FALSE,FALSE},
1624 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1625 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1626 }
1627 },
1628 /* Hostname gets lower-cased for known scheme types. */
1629 { "http://WWW.GOOGLE.com/", 0, S_OK, FALSE,
1630 {
1631 {"http://www.google.com/",S_OK,FALSE},
1632 {"www.google.com",S_OK,FALSE},
1633 {"http://www.google.com/",S_OK,FALSE},
1634 {"google.com",S_OK,FALSE},
1635 {"",S_FALSE,FALSE},
1636 {"",S_FALSE,FALSE},
1637 {"www.google.com",S_OK,FALSE},
1638 {"",S_FALSE,FALSE},
1639 {"/",S_OK,FALSE},
1640 {"/",S_OK,FALSE},
1641 {"",S_FALSE,FALSE},
1642 {"http://WWW.GOOGLE.com/",S_OK,FALSE},
1643 {"http",S_OK,FALSE},
1644 {"",S_FALSE,FALSE},
1645 {"",S_FALSE,FALSE}
1646 },
1647 {
1648 {Uri_HOST_DNS,S_OK,FALSE},
1649 {80,S_OK,FALSE},
1650 {URL_SCHEME_HTTP,S_OK,FALSE},
1651 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1652 }
1653 },
1654 /* Characters that get % encoded in the hostname also have their percent
1655 * encoded forms lower cased.
1656 */
1657 { "http://www.%7Cgoogle|.com/", 0, S_OK, FALSE,
1658 {
1659 {"http://www.%7cgoogle%7c.com/",S_OK,FALSE},
1660 {"www.%7cgoogle%7c.com",S_OK,FALSE},
1661 {"http://www.%7cgoogle%7c.com/",S_OK,FALSE},
1662 {"%7cgoogle%7c.com",S_OK,FALSE},
1663 {"",S_FALSE,FALSE},
1664 {"",S_FALSE,FALSE},
1665 {"www.%7cgoogle%7c.com",S_OK,FALSE},
1666 {"",S_FALSE,FALSE},
1667 {"/",S_OK,FALSE},
1668 {"/",S_OK,FALSE},
1669 {"",S_FALSE,FALSE},
1670 {"http://www.%7Cgoogle|.com/",S_OK,FALSE},
1671 {"http",S_OK,FALSE},
1672 {"",S_FALSE,FALSE},
1673 {"",S_FALSE,FALSE}
1674 },
1675 {
1676 {Uri_HOST_DNS,S_OK,FALSE},
1677 {80,S_OK,FALSE},
1678 {URL_SCHEME_HTTP,S_OK,FALSE},
1679 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1680 }
1681 },
1682 /* IPv4 addresses attached to IPv6 can be included in elisions. */
1683 { "http://[1:2:3:4:5:6:0.0.0.0]", 0, S_OK, FALSE,
1684 {
1685 {"http://[1:2:3:4:5:6::]/",S_OK,FALSE},
1686 {"[1:2:3:4:5:6::]",S_OK,FALSE},
1687 {"http://[1:2:3:4:5:6::]/",S_OK,FALSE},
1688 {"",S_FALSE,FALSE},
1689 {"",S_FALSE,FALSE},
1690 {"",S_FALSE,FALSE},
1691 {"1:2:3:4:5:6::",S_OK,FALSE},
1692 {"",S_FALSE,FALSE},
1693 {"/",S_OK,FALSE},
1694 {"/",S_OK,FALSE},
1695 {"",S_FALSE,FALSE},
1696 {"http://[1:2:3:4:5:6:0.0.0.0]",S_OK,FALSE},
1697 {"http",S_OK,FALSE},
1698 {"",S_FALSE,FALSE},
1699 {"",S_FALSE,FALSE},
1700 },
1701 {
1702 {Uri_HOST_IPV6,S_OK,FALSE},
1703 {80,S_OK,FALSE},
1704 {URL_SCHEME_HTTP,S_OK,FALSE},
1705 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1706 }
1707 },
1708 /* IPv4 addresses get normalized. */
1709 { "http://[::001.002.003.000]", 0, S_OK, FALSE,
1710 {
1711 {"http://[::1.2.3.0]/",S_OK,FALSE},
1712 {"[::1.2.3.0]",S_OK,FALSE},
1713 {"http://[::1.2.3.0]/",S_OK,FALSE},
1714 {"",S_FALSE,FALSE},
1715 {"",S_FALSE,FALSE},
1716 {"",S_FALSE,FALSE},
1717 {"::1.2.3.0",S_OK,FALSE},
1718 {"",S_FALSE,FALSE},
1719 {"/",S_OK,FALSE},
1720 {"/",S_OK,FALSE},
1721 {"",S_FALSE,FALSE},
1722 {"http://[::001.002.003.000]",S_OK,FALSE},
1723 {"http",S_OK,FALSE},
1724 {"",S_FALSE,FALSE},
1725 {"",S_FALSE,FALSE},
1726 },
1727 {
1728 {Uri_HOST_IPV6,S_OK,FALSE},
1729 {80,S_OK,FALSE},
1730 {URL_SCHEME_HTTP,S_OK,FALSE},
1731 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1732 }
1733 },
1734 /* Windows doesn't do anything to IPv6's in unknown schemes. */
1735 { "zip://[0001:0:000:0004:0005:0006:001.002.003.000]", 0, S_OK, FALSE,
1736 {
1737 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,FALSE},
1738 {"[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK,FALSE},
1739 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,FALSE},
1740 {"",S_FALSE,FALSE},
1741 {"",S_FALSE,FALSE},
1742 {"",S_FALSE,FALSE},
1743 {"0001:0:000:0004:0005:0006:001.002.003.000",S_OK,FALSE},
1744 {"",S_FALSE,FALSE},
1745 {"/",S_OK,FALSE},
1746 {"/",S_OK,FALSE},
1747 {"",S_FALSE,FALSE},
1748 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK,FALSE},
1749 {"zip",S_OK,FALSE},
1750 {"",S_FALSE,FALSE},
1751 {"",S_FALSE,FALSE},
1752 },
1753 {
1754 {Uri_HOST_IPV6,S_OK,FALSE},
1755 {0,S_FALSE,FALSE},
1756 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1757 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1758 }
1759 },
1760 /* IPv4 address is converted into 2 h16 components. */
1761 { "http://[ffff::192.222.111.32]", 0, S_OK, FALSE,
1762 {
1763 {"http://[ffff::c0de:6f20]/",S_OK,FALSE},
1764 {"[ffff::c0de:6f20]",S_OK,FALSE},
1765 {"http://[ffff::c0de:6f20]/",S_OK,FALSE},
1766 {"",S_FALSE,FALSE},
1767 {"",S_FALSE,FALSE},
1768 {"",S_FALSE,FALSE},
1769 {"ffff::c0de:6f20",S_OK,FALSE},
1770 {"",S_FALSE,FALSE},
1771 {"/",S_OK,FALSE},
1772 {"/",S_OK,FALSE},
1773 {"",S_FALSE,FALSE},
1774 {"http://[ffff::192.222.111.32]",S_OK,FALSE},
1775 {"http",S_OK,FALSE},
1776 {"",S_FALSE,FALSE},
1777 {"",S_FALSE,FALSE},
1778 },
1779 {
1780 {Uri_HOST_IPV6,S_OK,FALSE},
1781 {80,S_OK,FALSE},
1782 {URL_SCHEME_HTTP,S_OK,FALSE},
1783 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1784 }
1785 },
1786 /* Max value for a port. */
1787 { "http://google.com:65535", 0, S_OK, FALSE,
1788 {
1789 {"http://google.com:65535/",S_OK,FALSE},
1790 {"google.com:65535",S_OK,FALSE},
1791 {"http://google.com:65535/",S_OK,FALSE},
1792 {"google.com",S_OK,FALSE},
1793 {"",S_FALSE,FALSE},
1794 {"",S_FALSE,FALSE},
1795 {"google.com",S_OK,FALSE},
1796 {"",S_FALSE,FALSE},
1797 {"/",S_OK,FALSE},
1798 {"/",S_OK,FALSE},
1799 {"",S_FALSE,FALSE},
1800 {"http://google.com:65535",S_OK,FALSE},
1801 {"http",S_OK,FALSE},
1802 {"",S_FALSE,FALSE},
1803 {"",S_FALSE,FALSE}
1804 },
1805 {
1806 {Uri_HOST_DNS,S_OK,FALSE},
1807 {65535,S_OK,FALSE},
1808 {URL_SCHEME_HTTP,S_OK,FALSE},
1809 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1810 }
1811 },
1812 { "zip://google.com:65536", 0, S_OK, FALSE,
1813 {
1814 {"zip://google.com:65536/",S_OK,FALSE},
1815 {"google.com:65536",S_OK,FALSE},
1816 {"zip://google.com:65536/",S_OK,FALSE},
1817 {"google.com:65536",S_OK,FALSE},
1818 {"",S_FALSE,FALSE},
1819 {"",S_FALSE,FALSE},
1820 {"google.com:65536",S_OK,FALSE},
1821 {"",S_FALSE,FALSE},
1822 {"/",S_OK,FALSE},
1823 {"/",S_OK,FALSE},
1824 {"",S_FALSE,FALSE},
1825 {"zip://google.com:65536",S_OK,FALSE},
1826 {"zip",S_OK,FALSE},
1827 {"",S_FALSE,FALSE},
1828 {"",S_FALSE,FALSE}
1829 },
1830 {
1831 {Uri_HOST_DNS,S_OK,FALSE},
1832 {0,S_FALSE,FALSE},
1833 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1834 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1835 }
1836 },
1837 { "zip://google.com:65536:25", 0, S_OK, FALSE,
1838 {
1839 {"zip://google.com:65536:25/",S_OK,FALSE},
1840 {"google.com:65536:25",S_OK,FALSE},
1841 {"zip://google.com:65536:25/",S_OK,FALSE},
1842 {"google.com:65536:25",S_OK,FALSE},
1843 {"",S_FALSE,FALSE},
1844 {"",S_FALSE,FALSE},
1845 {"google.com:65536:25",S_OK,FALSE},
1846 {"",S_FALSE,FALSE},
1847 {"/",S_OK,FALSE},
1848 {"/",S_OK,FALSE},
1849 {"",S_FALSE,FALSE},
1850 {"zip://google.com:65536:25",S_OK,FALSE},
1851 {"zip",S_OK,FALSE},
1852 {"",S_FALSE,FALSE},
1853 {"",S_FALSE,FALSE}
1854 },
1855 {
1856 {Uri_HOST_DNS,S_OK,FALSE},
1857 {0,S_FALSE,FALSE},
1858 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1859 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1860 }
1861 },
1862 { "zip://[::ffff]:abcd", 0, S_OK, FALSE,
1863 {
1864 {"zip://[::ffff]:abcd/",S_OK,FALSE},
1865 {"[::ffff]:abcd",S_OK,FALSE},
1866 {"zip://[::ffff]:abcd/",S_OK,FALSE},
1867 {"",S_FALSE,FALSE},
1868 {"",S_FALSE,FALSE},
1869 {"",S_FALSE,FALSE},
1870 {"[::ffff]:abcd",S_OK,FALSE},
1871 {"",S_FALSE,FALSE},
1872 {"/",S_OK,FALSE},
1873 {"/",S_OK,FALSE},
1874 {"",S_FALSE,FALSE},
1875 {"zip://[::ffff]:abcd",S_OK,FALSE},
1876 {"zip",S_OK,FALSE},
1877 {"",S_FALSE,FALSE},
1878 {"",S_FALSE,FALSE}
1879 },
1880 {
1881 {Uri_HOST_DNS,S_OK,FALSE},
1882 {0,S_FALSE,FALSE},
1883 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1884 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1885 }
1886 },
1887 { "zip://127.0.0.1:abcd", 0, S_OK, FALSE,
1888 {
1889 {"zip://127.0.0.1:abcd/",S_OK,FALSE},
1890 {"127.0.0.1:abcd",S_OK,FALSE},
1891 {"zip://127.0.0.1:abcd/",S_OK,FALSE},
1892 {"0.1:abcd",S_OK,FALSE},
1893 {"",S_FALSE,FALSE},
1894 {"",S_FALSE,FALSE},
1895 {"127.0.0.1:abcd",S_OK,FALSE},
1896 {"",S_FALSE,FALSE},
1897 {"/",S_OK,FALSE},
1898 {"/",S_OK,FALSE},
1899 {"",S_FALSE,FALSE},
1900 {"zip://127.0.0.1:abcd",S_OK,FALSE},
1901 {"zip",S_OK,FALSE},
1902 {"",S_FALSE,FALSE},
1903 {"",S_FALSE,FALSE}
1904 },
1905 {
1906 {Uri_HOST_DNS,S_OK,FALSE},
1907 {0,S_FALSE,FALSE},
1908 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1909 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1910 }
1911 },
1912 /* Port is just copied over. */
1913 { "http://google.com:00035", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
1914 {
1915 {"http://google.com:00035",S_OK,FALSE},
1916 {"google.com:00035",S_OK,FALSE},
1917 {"http://google.com:00035",S_OK,FALSE,"http://google.com:35"},
1918 {"google.com",S_OK,FALSE},
1919 {"",S_FALSE,FALSE},
1920 {"",S_FALSE,FALSE},
1921 {"google.com",S_OK,FALSE},
1922 {"",S_FALSE,FALSE},
1923 {"",S_FALSE,FALSE},
1924 {"",S_FALSE,FALSE},
1925 {"",S_FALSE,FALSE},
1926 {"http://google.com:00035",S_OK,FALSE},
1927 {"http",S_OK,FALSE},
1928 {"",S_FALSE,FALSE},
1929 {"",S_FALSE,FALSE}
1930 },
1931 {
1932 {Uri_HOST_DNS,S_OK,FALSE},
1933 {35,S_OK,FALSE},
1934 {URL_SCHEME_HTTP,S_OK,FALSE},
1935 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1936 }
1937 },
1938 /* Default port is copied over. */
1939 { "http://google.com:80", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
1940 {
1941 {"http://google.com:80",S_OK,FALSE},
1942 {"google.com:80",S_OK,FALSE},
1943 {"http://google.com:80",S_OK,FALSE},
1944 {"google.com",S_OK,FALSE},
1945 {"",S_FALSE,FALSE},
1946 {"",S_FALSE,FALSE},
1947 {"google.com",S_OK,FALSE},
1948 {"",S_FALSE,FALSE},
1949 {"",S_FALSE,FALSE},
1950 {"",S_FALSE,FALSE},
1951 {"",S_FALSE,FALSE},
1952 {"http://google.com:80",S_OK,FALSE},
1953 {"http",S_OK,FALSE},
1954 {"",S_FALSE,FALSE},
1955 {"",S_FALSE,FALSE}
1956 },
1957 {
1958 {Uri_HOST_DNS,S_OK,FALSE},
1959 {80,S_OK,FALSE},
1960 {URL_SCHEME_HTTP,S_OK,FALSE},
1961 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1962 }
1963 },
1964 { "http://google.com.uk", 0, S_OK, FALSE,
1965 {
1966 {"http://google.com.uk/",S_OK,FALSE},
1967 {"google.com.uk",S_OK,FALSE},
1968 {"http://google.com.uk/",S_OK,FALSE},
1969 {"google.com.uk",S_OK,FALSE,NULL,"com.uk",S_OK}, /* cf. google.co.uk below */
1970 {"",S_FALSE,FALSE},
1971 {"",S_FALSE,FALSE},
1972 {"google.com.uk",S_OK,FALSE},
1973 {"",S_FALSE,FALSE},
1974 {"/",S_OK,FALSE},
1975 {"/",S_OK,FALSE},
1976 {"",S_FALSE,FALSE},
1977 {"http://google.com.uk",S_OK,FALSE},
1978 {"http",S_OK,FALSE},
1979 {"",S_FALSE,FALSE},
1980 {"",S_FALSE,FALSE}
1981 },
1982 {
1983 {Uri_HOST_DNS,S_OK,FALSE},
1984 {80,S_OK,FALSE},
1985 {URL_SCHEME_HTTP,S_OK,FALSE},
1986 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1987 }
1988 },
1989 { "http://google.co.uk", 0, S_OK, FALSE,
1990 {
1991 {"http://google.co.uk/",S_OK,FALSE},
1992 {"google.co.uk",S_OK,FALSE},
1993 {"http://google.co.uk/",S_OK,FALSE},
1994 {"google.co.uk",S_OK,FALSE},
1995 {"",S_FALSE,FALSE},
1996 {"",S_FALSE,FALSE},
1997 {"google.co.uk",S_OK,FALSE},
1998 {"",S_FALSE,FALSE},
1999 {"/",S_OK,FALSE},
2000 {"/",S_OK,FALSE},
2001 {"",S_FALSE,FALSE},
2002 {"http://google.co.uk",S_OK,FALSE},
2003 {"http",S_OK,FALSE},
2004 {"",S_FALSE,FALSE},
2005 {"",S_FALSE,FALSE}
2006 },
2007 {
2008 {Uri_HOST_DNS,S_OK,FALSE},
2009 {80,S_OK,FALSE},
2010 {URL_SCHEME_HTTP,S_OK,FALSE},
2011 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2012 }
2013 },
2014 { "http://google.com.com", 0, S_OK, FALSE,
2015 {
2016 {"http://google.com.com/",S_OK,FALSE},
2017 {"google.com.com",S_OK,FALSE},
2018 {"http://google.com.com/",S_OK,FALSE},
2019 {"com.com",S_OK,FALSE},
2020 {"",S_FALSE,FALSE},
2021 {"",S_FALSE,FALSE},
2022 {"google.com.com",S_OK,FALSE},
2023 {"",S_FALSE,FALSE},
2024 {"/",S_OK,FALSE},
2025 {"/",S_OK,FALSE},
2026 {"",S_FALSE,FALSE},
2027 {"http://google.com.com",S_OK,FALSE},
2028 {"http",S_OK,FALSE},
2029 {"",S_FALSE,FALSE},
2030 {"",S_FALSE,FALSE}
2031 },
2032 {
2033 {Uri_HOST_DNS,S_OK,FALSE},
2034 {80,S_OK,FALSE},
2035 {URL_SCHEME_HTTP,S_OK,FALSE},
2036 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2037 }
2038 },
2039 { "http://google.uk.1", 0, S_OK, FALSE,
2040 {
2041 {"http://google.uk.1/",S_OK,FALSE},
2042 {"google.uk.1",S_OK,FALSE},
2043 {"http://google.uk.1/",S_OK,FALSE},
2044 {"google.uk.1",S_OK,FALSE,NULL,"uk.1",S_OK},
2045 {"",S_FALSE,FALSE},
2046 {"",S_FALSE,FALSE},
2047 {"google.uk.1",S_OK,FALSE},
2048 {"",S_FALSE,FALSE},
2049 {"/",S_OK,FALSE},
2050 {"/",S_OK,FALSE},
2051 {"",S_FALSE,FALSE},
2052 {"http://google.uk.1",S_OK,FALSE},
2053 {"http",S_OK,FALSE},
2054 {"",S_FALSE,FALSE},
2055 {"",S_FALSE,FALSE}
2056 },
2057 {
2058 {Uri_HOST_DNS,S_OK,FALSE},
2059 {80,S_OK,FALSE},
2060 {URL_SCHEME_HTTP,S_OK,FALSE},
2061 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2062 }
2063 },
2064 /* Since foo isn't a recognized 3 character TLD it's considered the domain name. */
2065 { "http://google.foo.uk", 0, S_OK, FALSE,
2066 {
2067 {"http://google.foo.uk/",S_OK,FALSE},
2068 {"google.foo.uk",S_OK,FALSE},
2069 {"http://google.foo.uk/",S_OK,FALSE},
2070 {"foo.uk",S_OK,FALSE},
2071 {"",S_FALSE,FALSE},
2072 {"",S_FALSE,FALSE},
2073 {"google.foo.uk",S_OK,FALSE},
2074 {"",S_FALSE,FALSE},
2075 {"/",S_OK,FALSE},
2076 {"/",S_OK,FALSE},
2077 {"",S_FALSE,FALSE},
2078 {"http://google.foo.uk",S_OK,FALSE},
2079 {"http",S_OK,FALSE},
2080 {"",S_FALSE,FALSE},
2081 {"",S_FALSE,FALSE}
2082 },
2083 {
2084 {Uri_HOST_DNS,S_OK,FALSE},
2085 {80,S_OK,FALSE},
2086 {URL_SCHEME_HTTP,S_OK,FALSE},
2087 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2088 }
2089 },
2090 { "http://.com", 0, S_OK, FALSE,
2091 {
2092 {"http://.com/",S_OK,FALSE},
2093 {".com",S_OK,FALSE},
2094 {"http://.com/",S_OK,FALSE},
2095 {".com",S_OK,FALSE},
2096 {"",S_FALSE,FALSE},
2097 {"",S_FALSE,FALSE},
2098 {".com",S_OK,FALSE},
2099 {"",S_FALSE,FALSE},
2100 {"/",S_OK,FALSE},
2101 {"/",S_OK,FALSE},
2102 {"",S_FALSE,FALSE},
2103 {"http://.com",S_OK,FALSE},
2104 {"http",S_OK,FALSE},
2105 {"",S_FALSE,FALSE},
2106 {"",S_FALSE,FALSE}
2107 },
2108 {
2109 {Uri_HOST_DNS,S_OK,FALSE},
2110 {80,S_OK,FALSE},
2111 {URL_SCHEME_HTTP,S_OK,FALSE},
2112 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2113 }
2114 },
2115 { "http://.uk", 0, S_OK, FALSE,
2116 {
2117 {"http://.uk/",S_OK,FALSE},
2118 {".uk",S_OK,FALSE},
2119 {"http://.uk/",S_OK,FALSE},
2120 {"",S_FALSE,FALSE,NULL,".uk",S_OK},
2121 {"",S_FALSE,FALSE},
2122 {"",S_FALSE,FALSE},
2123 {".uk",S_OK,FALSE},
2124 {"",S_FALSE,FALSE},
2125 {"/",S_OK,FALSE},
2126 {"/",S_OK,FALSE},
2127 {"",S_FALSE,FALSE},
2128 {"http://.uk",S_OK,FALSE},
2129 {"http",S_OK,FALSE},
2130 {"",S_FALSE,FALSE},
2131 {"",S_FALSE,FALSE}
2132 },
2133 {
2134 {Uri_HOST_DNS,S_OK,FALSE},
2135 {80,S_OK,FALSE},
2136 {URL_SCHEME_HTTP,S_OK,FALSE},
2137 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2138 }
2139 },
2140 { "http://www.co.google.com.[]", 0, S_OK, FALSE,
2141 {
2142 {"http://www.co.google.com.[]/",S_OK,FALSE},
2143 {"www.co.google.com.[]",S_OK,FALSE},
2144 {"http://www.co.google.com.[]/",S_OK,FALSE},
2145 {"google.com.[]",S_OK,FALSE,NULL,"com.[]",S_OK},
2146 {"",S_FALSE,FALSE},
2147 {"",S_FALSE,FALSE},
2148 {"www.co.google.com.[]",S_OK,FALSE},
2149 {"",S_FALSE,FALSE},
2150 {"/",S_OK,FALSE},
2151 {"/",S_OK,FALSE},
2152 {"",S_FALSE,FALSE},
2153 {"http://www.co.google.com.[]",S_OK,FALSE},
2154 {"http",S_OK,FALSE},
2155 {"",S_FALSE,FALSE},
2156 {"",S_FALSE,FALSE}
2157 },
2158 {
2159 {Uri_HOST_DNS,S_OK,FALSE},
2160 {80,S_OK,FALSE},
2161 {URL_SCHEME_HTTP,S_OK,FALSE},
2162 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2163 }
2164 },
2165 { "http://co.uk", 0, S_OK, FALSE,
2166 {
2167 {"http://co.uk/",S_OK,FALSE},
2168 {"co.uk",S_OK,FALSE},
2169 {"http://co.uk/",S_OK,FALSE},
2170 {"",S_FALSE,FALSE},
2171 {"",S_FALSE,FALSE},
2172 {"",S_FALSE,FALSE},
2173 {"co.uk",S_OK,FALSE},
2174 {"",S_FALSE,FALSE},
2175 {"/",S_OK,FALSE},
2176 {"/",S_OK,FALSE},
2177 {"",S_FALSE,FALSE},
2178 {"http://co.uk",S_OK,FALSE},
2179 {"http",S_OK,FALSE},
2180 {"",S_FALSE,FALSE},
2181 {"",S_FALSE,FALSE}
2182 },
2183 {
2184 {Uri_HOST_DNS,S_OK,FALSE},
2185 {80,S_OK,FALSE},
2186 {URL_SCHEME_HTTP,S_OK,FALSE},
2187 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2188 }
2189 },
2190 { "http://www.co.google.us.test", 0, S_OK, FALSE,
2191 {
2192 {"http://www.co.google.us.test/",S_OK,FALSE},
2193 {"www.co.google.us.test",S_OK,FALSE},
2194 {"http://www.co.google.us.test/",S_OK,FALSE},
2195 {"us.test",S_OK,FALSE},
2196 {"",S_FALSE,FALSE},
2197 {"",S_FALSE,FALSE},
2198 {"www.co.google.us.test",S_OK,FALSE},
2199 {"",S_FALSE,FALSE},
2200 {"/",S_OK,FALSE},
2201 {"/",S_OK,FALSE},
2202 {"",S_FALSE,FALSE},
2203 {"http://www.co.google.us.test",S_OK,FALSE},
2204 {"http",S_OK,FALSE},
2205 {"",S_FALSE,FALSE},
2206 {"",S_FALSE,FALSE}
2207 },
2208 {
2209 {Uri_HOST_DNS,S_OK,FALSE},
2210 {80,S_OK,FALSE},
2211 {URL_SCHEME_HTTP,S_OK,FALSE},
2212 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2213 }
2214 },
2215 { "http://gov.uk", 0, S_OK, FALSE,
2216 {
2217 {"http://gov.uk/",S_OK,FALSE},
2218 {"gov.uk",S_OK,FALSE},
2219 {"http://gov.uk/",S_OK,FALSE},
2220 {"",S_FALSE,FALSE},
2221 {"",S_FALSE,FALSE},
2222 {"",S_FALSE,FALSE},
2223 {"gov.uk",S_OK,FALSE},
2224 {"",S_FALSE,FALSE},
2225 {"/",S_OK,FALSE},
2226 {"/",S_OK,FALSE},
2227 {"",S_FALSE,FALSE},
2228 {"http://gov.uk",S_OK,FALSE},
2229 {"http",S_OK,FALSE},
2230 {"",S_FALSE,FALSE},
2231 {"",S_FALSE,FALSE}
2232 },
2233 {
2234 {Uri_HOST_DNS,S_OK,FALSE},
2235 {80,S_OK,FALSE},
2236 {URL_SCHEME_HTTP,S_OK,FALSE},
2237 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2238 }
2239 },
2240 { "zip://www.google.com\\test", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
2241 {
2242 {"zip://www.google.com\\test",S_OK,FALSE},
2243 {"www.google.com\\test",S_OK,FALSE},
2244 {"zip://www.google.com\\test",S_OK,FALSE},
2245 {"google.com\\test",S_OK,FALSE},
2246 {"",S_FALSE,FALSE},
2247 {"",S_FALSE,FALSE},
2248 {"www.google.com\\test",S_OK,FALSE},
2249 {"",S_FALSE,FALSE},
2250 {"",S_FALSE,FALSE},
2251 {"",S_FALSE,FALSE},
2252 {"",S_FALSE,FALSE},
2253 {"zip://www.google.com\\test",S_OK,FALSE},
2254 {"zip",S_OK,FALSE},
2255 {"",S_FALSE,FALSE},
2256 {"",S_FALSE,FALSE}
2257 },
2258 {
2259 {Uri_HOST_DNS,S_OK,FALSE},
2260 {0,S_FALSE,FALSE},
2261 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2262 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2263 }
2264 },
2265 { "urn:excepts:bad:%XY:encoded", 0, S_OK, FALSE,
2266 {
2267 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2268 {"",S_FALSE,FALSE},
2269 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2270 {"",S_FALSE,FALSE},
2271 {"",S_FALSE,FALSE},
2272 {"",S_FALSE,FALSE},
2273 {"",S_FALSE,FALSE},
2274 {"",S_FALSE,FALSE},
2275 {"excepts:bad:%XY:encoded",S_OK,FALSE},
2276 {"excepts:bad:%XY:encoded",S_OK,FALSE},
2277 {"",S_FALSE,FALSE},
2278 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2279 {"urn",S_OK,FALSE},
2280 {"",S_FALSE,FALSE},
2281 {"",S_FALSE,FALSE}
2282 },
2283 {
2284 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2285 {0,S_FALSE,FALSE},
2286 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2287 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2288 }
2289 },
2290 /* Since the original URI doesn't contain an extra '/' before the path no % encoded values
2291 * are decoded and all '%' are encoded.
2292 */
2293 { "file://C:/te%3Es%2Et/tes%t.mp3", 0, S_OK, FALSE,
2294 {
2295 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2296 {"",S_FALSE,FALSE},
2297 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2298 {"",S_FALSE,FALSE},
2299 {".mp3",S_OK,FALSE},
2300 {"",S_FALSE,FALSE},
2301 {"",S_FALSE,FALSE},
2302 {"",S_FALSE,FALSE},
2303 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2304 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2305 {"",S_FALSE,FALSE},
2306 {"file://C:/te%3Es%2Et/tes%t.mp3",S_OK,FALSE},
2307 {"file",S_OK,FALSE},
2308 {"",S_FALSE,FALSE},
2309 {"",S_FALSE,FALSE}
2310 },
2311 {
2312 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2313 {0,S_FALSE,FALSE},
2314 {URL_SCHEME_FILE,S_OK,FALSE},
2315 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2316 }
2317 },
2318 /* Since there's a '/' in front of the drive letter, any percent encoded, non-forbidden character
2319 * is decoded and only %'s in front of invalid hex digits are encoded.
2320 */
2321 { "file:///C:/te%3Es%2Et/t%23es%t.mp3", 0, S_OK, FALSE,
2322 {
2323 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2324 {"",S_FALSE,FALSE},
2325 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2326 {"",S_FALSE,FALSE},
2327 {".mp3",S_OK,FALSE},
2328 {"",S_FALSE,FALSE},
2329 {"",S_FALSE,FALSE},
2330 {"",S_FALSE,FALSE},
2331 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2332 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2333 {"",S_FALSE,FALSE},
2334 {"file:///C:/te%3Es%2Et/t%23es%t.mp3",S_OK,FALSE},
2335 {"file",S_OK,FALSE},
2336 {"",S_FALSE,FALSE},
2337 {"",S_FALSE,FALSE}
2338 },
2339 {
2340 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2341 {0,S_FALSE,FALSE},
2342 {URL_SCHEME_FILE,S_OK,FALSE},
2343 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2344 }
2345 },
2346 /* Only unreserved percent encoded characters are decoded for known schemes that aren't file. */
2347 { "http://[::001.002.003.000]/%3F%23%2E%54/test", 0, S_OK, FALSE,
2348 {
2349 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK,FALSE},
2350 {"[::1.2.3.0]",S_OK,FALSE},
2351 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK,FALSE},
2352 {"",S_FALSE,FALSE},
2353 {"",S_FALSE,FALSE},
2354 {"",S_FALSE,FALSE},
2355 {"::1.2.3.0",S_OK,FALSE},
2356 {"",S_FALSE,FALSE},
2357 {"/%3F%23.T/test",S_OK,FALSE},
2358 {"/%3F%23.T/test",S_OK,FALSE},
2359 {"",S_FALSE,FALSE},
2360 {"http://[::001.002.003.000]/%3F%23%2E%54/test",S_OK,FALSE},
2361 {"http",S_OK,FALSE},
2362 {"",S_FALSE,FALSE},
2363 {"",S_FALSE,FALSE},
2364 },
2365 {
2366 {Uri_HOST_IPV6,S_OK,FALSE},
2367 {80,S_OK,FALSE},
2368 {URL_SCHEME_HTTP,S_OK,FALSE},
2369 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2370 }
2371 },
2372 /* Forbidden characters are always encoded for file URIs. */
2373 { "file:///C:/\"test\"/test.mp3", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
2374 {
2375 {"file:///C:/%22test%22/test.mp3",S_OK,FALSE},
2376 {"",S_FALSE,FALSE},
2377 {"file:///C:/%22test%22/test.mp3",S_OK,FALSE},
2378 {"",S_FALSE,FALSE},
2379 {".mp3",S_OK,FALSE},
2380 {"",S_FALSE,FALSE},
2381 {"",S_FALSE,FALSE},
2382 {"",S_FALSE,FALSE},
2383 {"/C:/%22test%22/test.mp3",S_OK,FALSE},
2384 {"/C:/%22test%22/test.mp3",S_OK,FALSE},
2385 {"",S_FALSE,FALSE},
2386 {"file:///C:/\"test\"/test.mp3",S_OK,FALSE},
2387 {"file",S_OK,FALSE},
2388 {"",S_FALSE,FALSE},
2389 {"",S_FALSE,FALSE}
2390 },
2391 {
2392 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2393 {0,S_FALSE,FALSE},
2394 {URL_SCHEME_FILE,S_OK,FALSE},
2395 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2396 }
2397 },
2398 /* Forbidden characters are never encoded for unknown scheme types. */
2399 { "1234://4294967295/<|>\" test<|>", 0, S_OK, FALSE,
2400 {
2401 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2402 {"4294967295",S_OK,FALSE},
2403 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2404 {"",S_FALSE,FALSE},
2405 {"",S_FALSE,FALSE},
2406 {"",S_FALSE,FALSE},
2407 {"4294967295",S_OK,FALSE},
2408 {"",S_FALSE,FALSE},
2409 {"/<|>\" test<|>",S_OK,FALSE},
2410 {"/<|>\" test<|>",S_OK,FALSE},
2411 {"",S_FALSE,FALSE},
2412 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2413 {"1234",S_OK,FALSE},
2414 {"",S_FALSE,FALSE},
2415 {"",S_FALSE,FALSE}
2416 },
2417 {
2418 {Uri_HOST_IPV4,S_OK,FALSE},
2419 {0,S_FALSE,FALSE},
2420 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2421 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2422 }
2423 },
2424 /* Make sure forbidden characters are percent encoded. */
2425 { "http://gov.uk/<|> test<|>", 0, S_OK, FALSE,
2426 {
2427 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2428 {"gov.uk",S_OK,FALSE},
2429 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2430 {"",S_FALSE,FALSE},
2431 {"",S_FALSE,FALSE},
2432 {"",S_FALSE,FALSE},
2433 {"gov.uk",S_OK,FALSE},
2434 {"",S_FALSE,FALSE},
2435 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2436 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2437 {"",S_FALSE,FALSE},
2438 {"http://gov.uk/<|> test<|>",S_OK,FALSE},
2439 {"http",S_OK,FALSE},
2440 {"",S_FALSE,FALSE},
2441 {"",S_FALSE,FALSE}
2442 },
2443 {
2444 {Uri_HOST_DNS,S_OK,FALSE},
2445 {80,S_OK,FALSE},
2446 {URL_SCHEME_HTTP,S_OK,FALSE},
2447 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2448 }
2449 },
2450 { "http://gov.uk/test/../test2/././../test3/.././././", 0, S_OK, FALSE,
2451 {
2452 {"http://gov.uk/",S_OK,FALSE},
2453 {"gov.uk",S_OK,FALSE},
2454 {"http://gov.uk/",S_OK,FALSE},
2455 {"",S_FALSE,FALSE},
2456 {"",S_FALSE,FALSE},
2457 {"",S_FALSE,FALSE},
2458 {"gov.uk",S_OK,FALSE},
2459 {"",S_FALSE,FALSE},
2460 {"/",S_OK,FALSE},
2461 {"/",S_OK,FALSE},
2462 {"",S_FALSE,FALSE},
2463 {"http://gov.uk/test/../test2/././../test3/.././././",S_OK,FALSE},
2464 {"http",S_OK,FALSE},
2465 {"",S_FALSE,FALSE},
2466 {"",S_FALSE,FALSE}
2467 },
2468 {
2469 {Uri_HOST_DNS,S_OK,FALSE},
2470 {80,S_OK,FALSE},
2471 {URL_SCHEME_HTTP,S_OK,FALSE},
2472 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2473 }
2474 },
2475 { "http://gov.uk/test/test2/../../..", 0, S_OK, FALSE,
2476 {
2477 {"http://gov.uk/",S_OK,FALSE},
2478 {"gov.uk",S_OK,FALSE},
2479 {"http://gov.uk/",S_OK,FALSE},
2480 {"",S_FALSE,FALSE},
2481 {"",S_FALSE,FALSE},
2482 {"",S_FALSE,FALSE},
2483 {"gov.uk",S_OK,FALSE},
2484 {"",S_FALSE,FALSE},
2485 {"/",S_OK,FALSE},
2486 {"/",S_OK,FALSE},
2487 {"",S_FALSE,FALSE},
2488 {"http://gov.uk/test/test2/../../..",S_OK,FALSE},
2489 {"http",S_OK,FALSE},
2490 {"",S_FALSE,FALSE},
2491 {"",S_FALSE,FALSE}
2492 },
2493 {
2494 {Uri_HOST_DNS,S_OK,FALSE},
2495 {80,S_OK,FALSE},
2496 {URL_SCHEME_HTTP,S_OK,FALSE},
2497 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2498 }
2499 },
2500 { "http://gov.uk/test/test2/../../.", 0, S_OK, FALSE,
2501 {
2502 {"http://gov.uk/",S_OK,FALSE},
2503 {"gov.uk",S_OK,FALSE},
2504 {"http://gov.uk/",S_OK,FALSE},
2505 {"",S_FALSE,FALSE},
2506 {"",S_FALSE,FALSE},
2507 {"",S_FALSE,FALSE},
2508 {"gov.uk",S_OK,FALSE},
2509 {"",S_FALSE,FALSE},
2510 {"/",S_OK,FALSE},
2511 {"/",S_OK,FALSE},
2512 {"",S_FALSE,FALSE},
2513 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2514 {"http",S_OK,FALSE},
2515 {"",S_FALSE,FALSE},
2516 {"",S_FALSE,FALSE}
2517 },
2518 {
2519 {Uri_HOST_DNS,S_OK,FALSE},
2520 {80,S_OK,FALSE},
2521 {URL_SCHEME_HTTP,S_OK,FALSE},
2522 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2523 }
2524 },
2525 { "file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3", 0, S_OK, FALSE,
2526 {
2527 {"file:///c:/foo%2520bar.mp3",S_OK,FALSE},
2528 {"",S_FALSE,FALSE},
2529 {"file:///c:/foo%2520bar.mp3",S_OK,FALSE},
2530 {"",S_FALSE,FALSE},
2531 {".mp3",S_OK,FALSE},
2532 {"",S_FALSE,FALSE},
2533 {"",S_FALSE,FALSE},
2534 {"",S_FALSE,FALSE},
2535 {"/c:/foo%2520bar.mp3",S_OK,FALSE},
2536 {"/c:/foo%2520bar.mp3",S_OK,FALSE},
2537 {"",S_FALSE,FALSE},
2538 {"file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3",S_OK,FALSE},
2539 {"file",S_OK,FALSE},
2540 {"",S_FALSE,FALSE},
2541 {"",S_FALSE,FALSE}
2542 },
2543 {
2544 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2545 {0,S_FALSE,FALSE},
2546 {URL_SCHEME_FILE,S_OK,FALSE},
2547 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2548 }
2549 },
2550 /* Dot removal happens for unknown scheme types. */
2551 { "zip://gov.uk/test/test2/../../.", 0, S_OK, FALSE,
2552 {
2553 {"zip://gov.uk/",S_OK,FALSE},
2554 {"gov.uk",S_OK,FALSE},
2555 {"zip://gov.uk/",S_OK,FALSE},
2556 {"",S_FALSE,FALSE},
2557 {"",S_FALSE,FALSE},
2558 {"",S_FALSE,FALSE},
2559 {"gov.uk",S_OK,FALSE},
2560 {"",S_FALSE,FALSE},
2561 {"/",S_OK,FALSE},
2562 {"/",S_OK,FALSE},
2563 {"",S_FALSE,FALSE},
2564 {"zip://gov.uk/test/test2/../../.",S_OK,FALSE},
2565 {"zip",S_OK,FALSE},
2566 {"",S_FALSE,FALSE},
2567 {"",S_FALSE,FALSE}
2568 },
2569 {
2570 {Uri_HOST_DNS,S_OK,FALSE},
2571 {0,S_FALSE,FALSE},
2572 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2573 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2574 }
2575 },
2576 /* Dot removal doesn't happen if NO_CANONICALIZE is set. */
2577 { "http://gov.uk/test/test2/../../.", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
2578 {
2579 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2580 {"gov.uk",S_OK,FALSE},
2581 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2582 {"",S_FALSE,FALSE},
2583 {".",S_OK,FALSE},
2584 {"",S_FALSE,FALSE},
2585 {"gov.uk",S_OK,FALSE},
2586 {"",S_FALSE,FALSE},
2587 {"/test/test2/../../.",S_OK,FALSE},
2588 {"/test/test2/../../.",S_OK,FALSE},
2589 {"",S_FALSE,FALSE},
2590 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2591 {"http",S_OK,FALSE},
2592 {"",S_FALSE,FALSE},
2593 {"",S_FALSE,FALSE}
2594 },
2595 {
2596 {Uri_HOST_DNS,S_OK,FALSE},
2597 {80,S_OK,FALSE},
2598 {URL_SCHEME_HTTP,S_OK,FALSE},
2599 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2600 }
2601 },
2602 /* Dot removal doesn't happen for wildcard scheme types. */
2603 { "*:gov.uk/test/test2/../../.", 0, S_OK, FALSE,
2604 {
2605 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2606 {"gov.uk",S_OK,FALSE},
2607 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2608 {"",S_FALSE,FALSE},
2609 {".",S_OK,FALSE},
2610 {"",S_FALSE,FALSE},
2611 {"gov.uk",S_OK,FALSE},
2612 {"",S_FALSE,FALSE},
2613 {"/test/test2/../../.",S_OK,FALSE},
2614 {"/test/test2/../../.",S_OK,FALSE},
2615 {"",S_FALSE,FALSE},
2616 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2617 {"*",S_OK,FALSE},
2618 {"",S_FALSE,FALSE},
2619 {"",S_FALSE,FALSE}
2620 },
2621 {
2622 {Uri_HOST_DNS,S_OK,FALSE},
2623 {0,S_FALSE,FALSE},
2624 {URL_SCHEME_WILDCARD,S_OK,FALSE},
2625 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2626 }
2627 },
2628 /* Forbidden characters are encoded for opaque known scheme types. */
2629 { "mailto:\"acco<|>unt@example.com\"", 0, S_OK, FALSE,
2630 {
2631 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2632 {"",S_FALSE,FALSE},
2633 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2634 {"",S_FALSE,FALSE},
2635 {".com%22",S_OK,FALSE},
2636 {"",S_FALSE,FALSE},
2637 {"",S_FALSE,FALSE},
2638 {"",S_FALSE,FALSE},
2639 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2640 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2641 {"",S_FALSE,FALSE},
2642 {"mailto:\"acco<|>unt@example.com\"",S_OK,FALSE},
2643 {"mailto",S_OK,FALSE},
2644 {"",S_FALSE,FALSE},
2645 {"",S_FALSE,FALSE}
2646 },
2647 {
2648 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2649 {0,S_FALSE,FALSE},
2650 {URL_SCHEME_MAILTO,S_OK,FALSE},
2651 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2652 }
2653 },
2654 { "news:test.tes<|>t.com", 0, S_OK, FALSE,
2655 {
2656 {"news:test.tes%3C%7C%3Et.com",S_OK,FALSE},
2657 {"",S_FALSE,FALSE},
2658 {"news:test.tes%3C%7C%3Et.com",S_OK,FALSE},
2659 {"",S_FALSE,FALSE},
2660 {".com",S_OK,FALSE},
2661 {"",S_FALSE,FALSE},
2662 {"",S_FALSE,FALSE},
2663 {"",S_FALSE,FALSE},
2664 {"test.tes%3C%7C%3Et.com",S_OK,FALSE},
2665 {"test.tes%3C%7C%3Et.com",S_OK,FALSE},
2666 {"",S_FALSE,FALSE},
2667 {"news:test.tes<|>t.com",S_OK,FALSE},
2668 {"news",S_OK,FALSE},
2669 {"",S_FALSE,FALSE},
2670 {"",S_FALSE,FALSE}
2671 },
2672 {
2673 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2674 {0,S_FALSE,FALSE},
2675 {URL_SCHEME_NEWS,S_OK,FALSE},
2676 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2677 }
2678 },
2679 /* Don't encode forbidden characters. */
2680 { "news:test.tes<|>t.com", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
2681 {
2682 {"news:test.tes<|>t.com",S_OK,FALSE},
2683 {"",S_FALSE,FALSE},
2684 {"news:test.tes<|>t.com",S_OK,FALSE},
2685 {"",S_FALSE,FALSE},
2686 {".com",S_OK,FALSE},
2687 {"",S_FALSE,FALSE},
2688 {"",S_FALSE,FALSE},
2689 {"",S_FALSE,FALSE},
2690 {"test.tes<|>t.com",S_OK,FALSE},
2691 {"test.tes<|>t.com",S_OK,FALSE},
2692 {"",S_FALSE,FALSE},
2693 {"news:test.tes<|>t.com",S_OK,FALSE},
2694 {"news",S_OK,FALSE},
2695 {"",S_FALSE,FALSE},
2696 {"",S_FALSE,FALSE}
2697 },
2698 {
2699 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2700 {0,S_FALSE,FALSE},
2701 {URL_SCHEME_NEWS,S_OK,FALSE},
2702 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2703 }
2704 },
2705 /* Forbidden characters aren't encoded for unknown, opaque URIs. */
2706 { "urn:test.tes<|>t.com", 0, S_OK, FALSE,
2707 {
2708 {"urn:test.tes<|>t.com",S_OK,FALSE},
2709 {"",S_FALSE,FALSE},
2710 {"urn:test.tes<|>t.com",S_OK,FALSE},
2711 {"",S_FALSE,FALSE},
2712 {".com",S_OK,FALSE},
2713 {"",S_FALSE,FALSE},
2714 {"",S_FALSE,FALSE},
2715 {"",S_FALSE,FALSE},
2716 {"test.tes<|>t.com",S_OK,FALSE},
2717 {"test.tes<|>t.com",S_OK,FALSE},
2718 {"",S_FALSE,FALSE},
2719 {"urn:test.tes<|>t.com",S_OK,FALSE},
2720 {"urn",S_OK,FALSE},
2721 {"",S_FALSE,FALSE},
2722 {"",S_FALSE,FALSE}
2723 },
2724 {
2725 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2726 {0,S_FALSE,FALSE},
2727 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2728 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2729 }
2730 },
2731 /* Percent encoded unreserved characters are decoded for known opaque URIs. */
2732 { "news:test.%74%65%73%74.com", 0, S_OK, FALSE,
2733 {
2734 {"news:test.test.com",S_OK,FALSE},
2735 {"",S_FALSE,FALSE},
2736 {"news:test.test.com",S_OK,FALSE},
2737 {"",S_FALSE,FALSE},
2738 {".com",S_OK,FALSE},
2739 {"",S_FALSE,FALSE},
2740 {"",S_FALSE,FALSE},
2741 {"",S_FALSE,FALSE},
2742 {"test.test.com",S_OK,FALSE},
2743 {"test.test.com",S_OK,FALSE},
2744 {"",S_FALSE,FALSE},
2745 {"news:test.%74%65%73%74.com",S_OK,FALSE},
2746 {"news",S_OK,FALSE},
2747 {"",S_FALSE,FALSE},
2748 {"",S_FALSE,FALSE}
2749 },
2750 {
2751 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2752 {0,S_FALSE,FALSE},
2753 {URL_SCHEME_NEWS,S_OK,FALSE},
2754 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2755 }
2756 },
2757 /* Percent encoded characters are still decoded for known scheme types. */
2758 { "news:test.%74%65%73%74.com", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
2759 {
2760 {"news:test.test.com",S_OK,FALSE},
2761 {"",S_FALSE,FALSE},
2762 {"news:test.test.com",S_OK,FALSE},
2763 {"",S_FALSE,FALSE},
2764 {".com",S_OK,FALSE},
2765 {"",S_FALSE,FALSE},
2766 {"",S_FALSE,FALSE},
2767 {"",S_FALSE,FALSE},
2768 {"test.test.com",S_OK,FALSE},
2769 {"test.test.com",S_OK,FALSE},
2770 {"",S_FALSE,FALSE},
2771 {"news:test.%74%65%73%74.com",S_OK,FALSE},
2772 {"news",S_OK,FALSE},
2773 {"",S_FALSE,FALSE},
2774 {"",S_FALSE,FALSE}
2775 },
2776 {
2777 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2778 {0,S_FALSE,FALSE},
2779 {URL_SCHEME_NEWS,S_OK,FALSE},
2780 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2781 }
2782 },
2783 /* Percent encoded characters aren't decoded for unknown scheme types. */
2784 { "urn:test.%74%65%73%74.com", 0, S_OK, FALSE,
2785 {
2786 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2787 {"",S_FALSE,FALSE},
2788 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2789 {"",S_FALSE,FALSE},
2790 {".com",S_OK,FALSE},
2791 {"",S_FALSE,FALSE},
2792 {"",S_FALSE,FALSE},
2793 {"",S_FALSE,FALSE},
2794 {"test.%74%65%73%74.com",S_OK,FALSE},
2795 {"test.%74%65%73%74.com",S_OK,FALSE},
2796 {"",S_FALSE,FALSE},
2797 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2798 {"urn",S_OK,FALSE},
2799 {"",S_FALSE,FALSE},
2800 {"",S_FALSE,FALSE}
2801 },
2802 {
2803 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2804 {0,S_FALSE,FALSE},
2805 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2806 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2807 }
2808 },
2809 /* Unknown scheme types can have invalid % encoded data in query string. */
2810 { "zip://www.winehq.org/tests/..?query=%xx&return=y", 0, S_OK, FALSE,
2811 {
2812 {"zip://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2813 {"www.winehq.org",S_OK,FALSE},
2814 {"zip://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2815 {"winehq.org",S_OK,FALSE},
2816 {"",S_FALSE,FALSE},
2817 {"",S_FALSE,FALSE},
2818 {"www.winehq.org",S_OK,FALSE},
2819 {"",S_FALSE,FALSE},
2820 {"/",S_OK,FALSE},
2821 {"/?query=%xx&return=y",S_OK,FALSE},
2822 {"?query=%xx&return=y",S_OK,FALSE},
2823 {"zip://www.winehq.org/tests/..?query=%xx&return=y",S_OK,FALSE},
2824 {"zip",S_OK,FALSE},
2825 {"",S_FALSE,FALSE},
2826 {"",S_FALSE,FALSE}
2827 },
2828 {
2829 {Uri_HOST_DNS,S_OK,FALSE},
2830 {0,S_FALSE,FALSE},
2831 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2832 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2833 }
2834 },
2835 /* Known scheme types can have invalid % encoded data with the right flags. */
2836 { "http://www.winehq.org/tests/..?query=%xx&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
2837 {
2838 {"http://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2839 {"www.winehq.org",S_OK,FALSE},
2840 {"http://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2841 {"winehq.org",S_OK,FALSE},
2842 {"",S_FALSE,FALSE},
2843 {"",S_FALSE,FALSE},
2844 {"www.winehq.org",S_OK,FALSE},
2845 {"",S_FALSE,FALSE},
2846 {"/",S_OK,FALSE},
2847 {"/?query=%xx&return=y",S_OK,FALSE},
2848 {"?query=%xx&return=y",S_OK,FALSE},
2849 {"http://www.winehq.org/tests/..?query=%xx&return=y",S_OK,FALSE},
2850 {"http",S_OK,FALSE},
2851 {"",S_FALSE,FALSE},
2852 {"",S_FALSE,FALSE}
2853 },
2854 {
2855 {Uri_HOST_DNS,S_OK,FALSE},
2856 {80,S_OK,FALSE},
2857 {URL_SCHEME_HTTP,S_OK,FALSE},
2858 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2859 }
2860 },
2861 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2862 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
2863 {
2864 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2865 {"www.winehq.org",S_OK,FALSE},
2866 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2867 {"winehq.org",S_OK,FALSE},
2868 {"",S_FALSE,FALSE},
2869 {"",S_FALSE,FALSE},
2870 {"www.winehq.org",S_OK,FALSE},
2871 {"",S_FALSE,FALSE},
2872 {"/",S_OK,FALSE},
2873 {"/?query=<|>&return=y",S_OK,FALSE},
2874 {"?query=<|>&return=y",S_OK,FALSE},
2875 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2876 {"http",S_OK,FALSE},
2877 {"",S_FALSE,FALSE},
2878 {"",S_FALSE,FALSE}
2879 },
2880 {
2881 {Uri_HOST_DNS,S_OK,FALSE},
2882 {80,S_OK,FALSE},
2883 {URL_SCHEME_HTTP,S_OK,FALSE},
2884 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2885 }
2886 },
2887 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2888 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
2889 {
2890 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2891 {"www.winehq.org",S_OK,FALSE},
2892 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2893 {"winehq.org",S_OK,FALSE},
2894 {"",S_FALSE,FALSE},
2895 {"",S_FALSE,FALSE},
2896 {"www.winehq.org",S_OK,FALSE},
2897 {"",S_FALSE,FALSE},
2898 {"/",S_OK,FALSE},
2899 {"/?query=<|>&return=y",S_OK,FALSE},
2900 {"?query=<|>&return=y",S_OK,FALSE},
2901 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2902 {"http",S_OK,FALSE},
2903 {"",S_FALSE,FALSE},
2904 {"",S_FALSE,FALSE}
2905 },
2906 {
2907 {Uri_HOST_DNS,S_OK,FALSE},
2908 {80,S_OK,FALSE},
2909 {URL_SCHEME_HTTP,S_OK,FALSE},
2910 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2911 }
2912 },
2913 /* Forbidden characters are encoded for known scheme types. */
2914 { "http://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK, FALSE,
2915 {
2916 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2917 {"www.winehq.org",S_OK,FALSE},
2918 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2919 {"winehq.org",S_OK,FALSE},
2920 {"",S_FALSE,FALSE},
2921 {"",S_FALSE,FALSE},
2922 {"www.winehq.org",S_OK,FALSE},
2923 {"",S_FALSE,FALSE},
2924 {"/",S_OK,FALSE},
2925 {"/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2926 {"?query=%3C%7C%3E&return=y",S_OK,FALSE},
2927 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2928 {"http",S_OK,FALSE},
2929 {"",S_FALSE,FALSE},
2930 {"",S_FALSE,FALSE}
2931 },
2932 {
2933 {Uri_HOST_DNS,S_OK,FALSE},
2934 {80,S_OK,FALSE},
2935 {URL_SCHEME_HTTP,S_OK,FALSE},
2936 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2937 }
2938 },
2939 /* Forbidden characters are not encoded for unknown scheme types. */
2940 { "zip://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK, FALSE,
2941 {
2942 {"zip://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2943 {"www.winehq.org",S_OK,FALSE},
2944 {"zip://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2945 {"winehq.org",S_OK,FALSE},
2946 {"",S_FALSE,FALSE},
2947 {"",S_FALSE,FALSE},
2948 {"www.winehq.org",S_OK,FALSE},
2949 {"",S_FALSE,FALSE},
2950 {"/",S_OK,FALSE},
2951 {"/?query=<|>&return=y",S_OK,FALSE},
2952 {"?query=<|>&return=y",S_OK,FALSE},
2953 {"zip://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2954 {"zip",S_OK,FALSE},
2955 {"",S_FALSE,FALSE},
2956 {"",S_FALSE,FALSE}
2957 },
2958 {
2959 {Uri_HOST_DNS,S_OK,FALSE},
2960 {0,S_FALSE,FALSE},
2961 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2962 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2963 }
2964 },
2965 /* Percent encoded, unreserved characters are decoded for known scheme types. */
2966 { "http://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK, FALSE,
2967 {
2968 {"http://www.winehq.org/?query=01&return=y",S_OK,FALSE},
2969 {"www.winehq.org",S_OK,FALSE},
2970 {"http://www.winehq.org/?query=01&return=y",S_OK,FALSE},
2971 {"winehq.org",S_OK,FALSE},
2972 {"",S_FALSE,FALSE},
2973 {"",S_FALSE,FALSE},
2974 {"www.winehq.org",S_OK,FALSE},
2975 {"",S_FALSE,FALSE},
2976 {"/",S_OK,FALSE},
2977 {"/?query=01&return=y",S_OK,FALSE},
2978 {"?query=01&return=y",S_OK,FALSE},
2979 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
2980 {"http",S_OK,FALSE},
2981 {"",S_FALSE,FALSE},
2982 {"",S_FALSE,FALSE}
2983 },
2984 {
2985 {Uri_HOST_DNS,S_OK,FALSE},
2986 {80,S_OK,FALSE},
2987 {URL_SCHEME_HTTP,S_OK,FALSE},
2988 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2989 }
2990 },
2991 /* Percent encoded, unreserved characters aren't decoded for unknown scheme types. */
2992 { "zip://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK, FALSE,
2993 {
2994 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
2995 {"www.winehq.org",S_OK,FALSE},
2996 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
2997 {"winehq.org",S_OK,FALSE},
2998 {"",S_FALSE,FALSE},
2999 {"",S_FALSE,FALSE},
3000 {"www.winehq.org",S_OK,FALSE},
3001 {"",S_FALSE,FALSE},
3002 {"/",S_OK,FALSE},
3003 {"/?query=%30%31&return=y",S_OK,FALSE},
3004 {"?query=%30%31&return=y",S_OK,FALSE},
3005 {"zip://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
3006 {"zip",S_OK,FALSE},
3007 {"",S_FALSE,FALSE},
3008 {"",S_FALSE,FALSE}
3009 },
3010 {
3011 {Uri_HOST_DNS,S_OK,FALSE},
3012 {0,S_FALSE,FALSE},
3013 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3014 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3015 }
3016 },
3017 /* Percent encoded characters aren't decoded when NO_DECODE_EXTRA_INFO is set. */
3018 { "http://www.winehq.org/tests/..?query=%30%31&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
3019 {
3020 {"http://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
3021 {"www.winehq.org",S_OK,FALSE},
3022 {"http://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
3023 {"winehq.org",S_OK,FALSE},
3024 {"",S_FALSE,FALSE},
3025 {"",S_FALSE,FALSE},
3026 {"www.winehq.org",S_OK,FALSE},
3027 {"",S_FALSE,FALSE},
3028 {"/",S_OK,FALSE},
3029 {"/?query=%30%31&return=y",S_OK,FALSE},
3030 {"?query=%30%31&return=y",S_OK,FALSE},
3031 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
3032 {"http",S_OK,FALSE},
3033 {"",S_FALSE,FALSE},
3034 {"",S_FALSE,FALSE}
3035 },
3036 {
3037 {Uri_HOST_DNS,S_OK,FALSE},
3038 {80,S_OK,FALSE},
3039 {URL_SCHEME_HTTP,S_OK,FALSE},
3040 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3041 }
3042 },
3043 { "http://www.winehq.org?query=12&return=y", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
3044 {
3045 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
3046 {"www.winehq.org",S_OK,FALSE},
3047 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
3048 {"winehq.org",S_OK,FALSE},
3049 {"",S_FALSE,FALSE},
3050 {"",S_FALSE,FALSE},
3051 {"www.winehq.org",S_OK,FALSE},
3052 {"",S_FALSE,FALSE},
3053 {"",S_FALSE,FALSE},
3054 {"?query=12&return=y",S_OK,FALSE},
3055 {"?query=12&return=y",S_OK,FALSE},
3056 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
3057 {"http",S_OK,FALSE},
3058 {"",S_FALSE,FALSE},
3059 {"",S_FALSE,FALSE}
3060 },
3061 {
3062 {Uri_HOST_DNS,S_OK,FALSE},
3063 {80,S_OK,FALSE},
3064 {URL_SCHEME_HTTP,S_OK,FALSE},
3065 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3066 }
3067 },
3068 /* Unknown scheme types can have invalid % encoded data in fragments. */
3069 { "zip://www.winehq.org/tests/#Te%xx", 0, S_OK, FALSE,
3070 {
3071 {"zip://www.winehq.org/tests/#Te%xx",S_OK,FALSE},
3072 {"www.winehq.org",S_OK,FALSE},
3073 {"zip://www.winehq.org/tests/#Te%xx",S_OK,FALSE},
3074 {"winehq.org",S_OK,FALSE},
3075 {"",S_FALSE,FALSE},
3076 {"#Te%xx",S_OK,FALSE},
3077 {"www.winehq.org",S_OK,FALSE},
3078 {"",S_FALSE,FALSE},
3079 {"/tests/",S_OK,FALSE},
3080 {"/tests/",S_OK,FALSE},
3081 {