ReactOS 0.4.17-dev-470-gf9e3448
uri.c
Go to the documentation of this file.
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#include <wine/test.h>
22#include <stdarg.h>
23#include <stddef.h>
24
25#define COBJMACROS
26#define CONST_VTABLE
27#define WIN32_LEAN_AND_MEAN
28
29#include "windef.h"
30#include "winbase.h"
31#include "urlmon.h"
32#include "shlwapi.h"
33#include "wininet.h"
34#include "strsafe.h"
35#include "initguid.h"
36
37DEFINE_GUID(CLSID_CUri, 0xDF2FCE13, 0x25EC, 0x45BB, 0x9D,0x4C, 0xCE,0xCD,0x47,0xC2,0x43,0x0C);
38
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
42
43#define DEFINE_EXPECT(func) \
44 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
45
46#define SET_EXPECT(func) \
47 expect_ ## func = TRUE
48
49#define CHECK_EXPECT(func) \
50 do { \
51 ok(expect_ ##func, "unexpected call " #func "\n"); \
52 expect_ ## func = FALSE; \
53 called_ ## func = TRUE; \
54 }while(0)
55
56#define CHECK_EXPECT2(func) \
57 do { \
58 ok(expect_ ##func, "unexpected call " #func "\n"); \
59 called_ ## func = TRUE; \
60 }while(0)
61
62#define CHECK_CALLED(func) \
63 do { \
64 ok(called_ ## func, "expected " #func "\n"); \
65 expect_ ## func = called_ ## func = FALSE; \
66 }while(0)
67
68DEFINE_EXPECT(CombineUrl);
69DEFINE_EXPECT(ParseUrl);
70
71static HRESULT (WINAPI *pCreateUri)(LPCWSTR, DWORD, DWORD_PTR, IUri**);
72static HRESULT (WINAPI *pCreateUriWithFragment)(LPCWSTR, LPCWSTR, DWORD, DWORD_PTR, IUri**);
73static HRESULT (WINAPI *pCreateIUriBuilder)(IUri*, DWORD, DWORD_PTR, IUriBuilder**);
74static HRESULT (WINAPI *pCoInternetCombineIUri)(IUri*,IUri*,DWORD,IUri**,DWORD_PTR);
75static HRESULT (WINAPI *pCoInternetGetSession)(DWORD,IInternetSession**,DWORD);
76static HRESULT (WINAPI *pCoInternetCombineUrlEx)(IUri*,LPCWSTR,DWORD,IUri**,DWORD_PTR);
77static HRESULT (WINAPI *pCoInternetParseIUri)(IUri*,PARSEACTION,DWORD,LPWSTR,DWORD,DWORD*,DWORD_PTR);
78static HRESULT (WINAPI *pCreateURLMonikerEx)(IMoniker*,LPCWSTR,IMoniker**,DWORD);
79static HRESULT (WINAPI *pCreateURLMonikerEx2)(IMoniker*,IUri*,IMoniker**,DWORD);
80
81static const WCHAR http_urlW[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
82 '.','o','r','g','/',0};
83static 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};
85
86static const WCHAR combine_baseW[] = {'w','i','n','e','t','e','s','t',':','?','t',
87 'e','s','t','i','n','g',0};
88static const WCHAR combine_relativeW[] = {'?','t','e','s','t',0};
89static const WCHAR combine_resultW[] = {'z','i','p',':','t','e','s','t',0};
90
91static const WCHAR winetestW[] = {'w','i','n','e','t','e','s','t',0};
92
93static const WCHAR parse_urlW[] = {'w','i','n','e','t','e','s','t',':','t','e','s','t',0};
94static const WCHAR parse_resultW[] = {'z','i','p',':','t','e','s','t',0};
95
98
99typedef struct _uri_create_flag_test {
103
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}
111};
112
113typedef struct _uri_str_property {
114 const char* value;
117 const char* broken_value;
118 const char* value2;
121
122typedef struct _uri_dword_property {
128
129typedef struct _uri_properties {
130 const char* uri;
135
139
140static const uri_properties uri_tests[] = {
141 { "http://www.winehq.org/tests/../tests/../..", 0, S_OK, FALSE, 0,
142 {
143 {"http://www.winehq.org/",S_OK,FALSE}, /* ABSOLUTE_URI */
144 {"www.winehq.org",S_OK,FALSE}, /* AUTHORITY */
145 {"http://www.winehq.org/",S_OK,FALSE}, /* DISPLAY_URI */
146 {"winehq.org",S_OK,FALSE}, /* DOMAIN */
147 {"",S_FALSE,FALSE}, /* EXTENSION */
148 {"",S_FALSE,FALSE}, /* FRAGMENT */
149 {"www.winehq.org",S_OK,FALSE}, /* HOST */
150 {"",S_FALSE,FALSE}, /* PASSWORD */
151 {"/",S_OK,FALSE}, /* PATH */
152 {"/",S_OK,FALSE}, /* PATH_AND_QUERY */
153 {"",S_FALSE,FALSE}, /* QUERY */
154 {"http://www.winehq.org/tests/../tests/../..",S_OK,FALSE}, /* RAW_URI */
155 {"http",S_OK,FALSE}, /* SCHEME_NAME */
156 {"",S_FALSE,FALSE}, /* USER_INFO */
157 {"",S_FALSE,FALSE} /* USER_NAME */
158 },
159 {
160 {Uri_HOST_DNS,S_OK,FALSE}, /* HOST_TYPE */
161 {80,S_OK,FALSE}, /* PORT */
162 {URL_SCHEME_HTTP,S_OK,FALSE}, /* SCHEME */
163 {URLZONE_INVALID,E_NOTIMPL,FALSE} /* ZONE */
164 }
165 },
166 { "http://winehq.org/tests/.././tests", 0, S_OK, FALSE, 0,
167 {
168 {"http://winehq.org/tests",S_OK,FALSE},
169 {"winehq.org",S_OK,FALSE},
170 {"http://winehq.org/tests",S_OK,FALSE},
171 {"winehq.org",S_OK,FALSE},
172 {"",S_FALSE,FALSE},
173 {"",S_FALSE,FALSE},
174 {"winehq.org",S_OK,FALSE},
175 {"",S_FALSE,FALSE},
176 {"/tests",S_OK,FALSE},
177 {"/tests",S_OK,FALSE},
178 {"",S_FALSE,FALSE},
179 {"http://winehq.org/tests/.././tests",S_OK,FALSE},
180 {"http",S_OK,FALSE},
181 {"",S_FALSE,FALSE},
182 {"",S_FALSE,FALSE}
183 },
184 {
185 {Uri_HOST_DNS,S_OK,FALSE},
186 {80,S_OK,FALSE},
188 {URLZONE_INVALID,E_NOTIMPL,FALSE}
189 }
190 },
191 { "HtTp://www.winehq.org/tests/..?query=x&return=y", 0, S_OK, FALSE, 0,
192 {
193 {"http://www.winehq.org/?query=x&return=y",S_OK,FALSE},
194 {"www.winehq.org",S_OK,FALSE},
195 {"http://www.winehq.org/?query=x&return=y",S_OK,FALSE},
196 {"winehq.org",S_OK,FALSE},
197 {"",S_FALSE,FALSE},
198 {"",S_FALSE,FALSE},
199 {"www.winehq.org",S_OK,FALSE},
200 {"",S_FALSE,FALSE},
201 {"/",S_OK,FALSE},
202 {"/?query=x&return=y",S_OK,FALSE},
203 {"?query=x&return=y",S_OK,FALSE},
204 {"HtTp://www.winehq.org/tests/..?query=x&return=y",S_OK,FALSE},
205 {"http",S_OK,FALSE},
206 {"",S_FALSE,FALSE},
207 {"",S_FALSE,FALSE}
208 },
209 {
210 {Uri_HOST_DNS,S_OK,FALSE},
211 {80,S_OK,FALSE},
213 {URLZONE_INVALID,E_NOTIMPL,FALSE},
214 }
215 },
216 { "HtTpS://www.winehq.org/tests/..?query=x&return=y", 0, S_OK, FALSE, 0,
217 {
218 {"https://www.winehq.org/?query=x&return=y",S_OK,FALSE},
219 {"www.winehq.org",S_OK,FALSE},
220 {"https://www.winehq.org/?query=x&return=y",S_OK,FALSE},
221 {"winehq.org",S_OK,FALSE},
222 {"",S_FALSE,FALSE},
223 {"",S_FALSE,FALSE},
224 {"www.winehq.org",S_OK,FALSE},
225 {"",S_FALSE,FALSE},
226 {"/",S_OK,FALSE},
227 {"/?query=x&return=y",S_OK,FALSE},
228 {"?query=x&return=y",S_OK,FALSE},
229 {"HtTpS://www.winehq.org/tests/..?query=x&return=y",S_OK,FALSE},
230 {"https",S_OK,FALSE},
231 {"",S_FALSE,FALSE},
232 {"",S_FALSE,FALSE}
233 },
234 {
235 {Uri_HOST_DNS,S_OK,FALSE},
236 {443,S_OK,FALSE},
238 {URLZONE_INVALID,E_NOTIMPL,FALSE},
239 }
240 },
241 { "hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters", 0, S_OK, FALSE, 0,
242 {
243 {"http://usEr%3Ainfo@example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
244 {"usEr%3Ainfo@example.com",S_OK,FALSE},
245 {"http://example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
246 {"example.com",S_OK,FALSE},
247 {"",S_FALSE,FALSE},
248 {"",S_FALSE,FALSE},
249 {"example.com",S_OK,FALSE},
250 {"",S_FALSE,FALSE},
251 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
252 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
253 {"",S_FALSE,FALSE},
254 {"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters",S_OK,FALSE},
255 {"http",S_OK,FALSE},
256 {"usEr%3Ainfo",S_OK,FALSE},
257 {"usEr%3Ainfo",S_OK,FALSE}
258 },
259 {
260 {Uri_HOST_DNS,S_OK,FALSE},
261 {80,S_OK,FALSE},
263 {URLZONE_INVALID,E_NOTIMPL,FALSE},
264 }
265 },
266 { "ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt", 0, S_OK, FALSE, 0,
267 {
268 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,FALSE},
269 {"winepass:wine@ftp.winehq.org:9999",S_OK,FALSE},
270 {"ftp://ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,FALSE},
271 {"winehq.org",S_OK,FALSE},
272 {".txt",S_OK,FALSE},
273 {"",S_FALSE,FALSE},
274 {"ftp.winehq.org",S_OK,FALSE},
275 {"wine",S_OK,FALSE},
276 {"/dir/foo%20bar.txt",S_OK,FALSE},
277 {"/dir/foo%20bar.txt",S_OK,FALSE},
278 {"",S_FALSE,FALSE},
279 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt",S_OK,FALSE},
280 {"ftp",S_OK,FALSE},
281 {"winepass:wine",S_OK,FALSE},
282 {"winepass",S_OK,FALSE}
283 },
284 {
285 {Uri_HOST_DNS,S_OK,FALSE},
286 {9999,S_OK,FALSE},
288 {URLZONE_INVALID,E_NOTIMPL,FALSE}
289 }
290 },
291 { "file://c:\\tests\\../tests/foo%20bar.mp3", 0, S_OK, FALSE, 0,
292 {
293 {"file:///c:/tests/foo%2520bar.mp3",S_OK,FALSE},
294 {"",S_FALSE,FALSE},
295 {"file:///c:/tests/foo%2520bar.mp3",S_OK,FALSE},
296 {"",S_FALSE,FALSE},
297 {".mp3",S_OK,FALSE},
298 {"",S_FALSE,FALSE},
299 {"",S_FALSE,FALSE},
300 {"",S_FALSE,FALSE},
301 {"/c:/tests/foo%2520bar.mp3",S_OK,FALSE},
302 {"/c:/tests/foo%2520bar.mp3",S_OK,FALSE},
303 {"",S_FALSE,FALSE},
304 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK,FALSE},
305 {"file",S_OK,FALSE},
306 {"",S_FALSE,FALSE},
307 {"",S_FALSE,FALSE}
308 },
309 {
310 {Uri_HOST_UNKNOWN,S_OK,FALSE},
311 {0,S_FALSE,FALSE},
313 {URLZONE_INVALID,E_NOTIMPL,FALSE}
314 }
315 },
316 { "file://c:\\tests\\../tests/foo%20bar.mp3", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
317 {
318 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK,FALSE},
319 {"",S_FALSE,FALSE},
320 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK,FALSE},
321 {"",S_FALSE,FALSE},
322 {".mp3",S_OK,FALSE},
323 {"",S_FALSE,FALSE},
324 {"",S_FALSE,FALSE},
325 {"",S_FALSE,FALSE},
326 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK,FALSE},
327 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK,FALSE},
328 {"",S_FALSE,FALSE},
329 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK,FALSE},
330 {"file",S_OK,FALSE},
331 {"",S_FALSE,FALSE},
332 {"",S_FALSE,FALSE}
333 },
334 {
335 {Uri_HOST_UNKNOWN,S_OK,FALSE},
336 {0,S_FALSE,FALSE},
338 {URLZONE_INVALID,E_NOTIMPL,FALSE}
339 }
340 },
341 { "FILE://localhost/test dir\\../tests/test%20file.README.txt", 0, S_OK, FALSE, 0,
342 {
343 {"file:///tests/test%20file.README.txt",S_OK,FALSE},
344 {"",S_FALSE,FALSE},
345 {"file:///tests/test%20file.README.txt",S_OK,FALSE},
346 {"",S_FALSE,FALSE},
347 {".txt",S_OK,FALSE},
348 {"",S_FALSE,FALSE},
349 {"",S_FALSE,FALSE},
350 {"",S_FALSE,FALSE},
351 {"/tests/test%20file.README.txt",S_OK,FALSE},
352 {"/tests/test%20file.README.txt",S_OK,FALSE},
353 {"",S_FALSE,FALSE},
354 {"FILE://localhost/test dir\\../tests/test%20file.README.txt",S_OK,FALSE},
355 {"file",S_OK,FALSE},
356 {"",S_FALSE,FALSE},
357 {"",S_FALSE,FALSE}
358 },
359 {
360 {Uri_HOST_UNKNOWN,S_OK,FALSE},
361 {0,S_FALSE,FALSE},
363 {URLZONE_INVALID,E_NOTIMPL,FALSE}
364 }
365 },
366 { "file:///z:/test dir/README.txt", 0, S_OK, FALSE, 0,
367 {
368 {"file:///z:/test%20dir/README.txt",S_OK},
369 {"",S_FALSE},
370 {"file:///z:/test%20dir/README.txt",S_OK},
371 {"",S_FALSE},
372 {".txt",S_OK},
373 {"",S_FALSE},
374 {"",S_FALSE},
375 {"",S_FALSE},
376 {"/z:/test%20dir/README.txt",S_OK},
377 {"/z:/test%20dir/README.txt",S_OK},
378 {"",S_FALSE},
379 {"file:///z:/test dir/README.txt",S_OK},
380 {"file",S_OK},
381 {"",S_FALSE},
382 {"",S_FALSE}
383 },
384 {
385 {Uri_HOST_UNKNOWN,S_OK,FALSE},
386 {0,S_FALSE,FALSE},
388 {URLZONE_INVALID,E_NOTIMPL,FALSE}
389 }
390 },
391 { "file:///z:/test dir/README.txt#hash part", 0, S_OK, FALSE, 0,
392 {
393 {"file:///z:/test%20dir/README.txt#hash%20part",S_OK},
394 {"",S_FALSE},
395 {"file:///z:/test%20dir/README.txt#hash%20part",S_OK},
396 {"",S_FALSE},
397 {".txt#hash%20part",S_OK},
398 {"",S_FALSE},
399 {"",S_FALSE},
400 {"",S_FALSE},
401 {"/z:/test%20dir/README.txt#hash%20part",S_OK},
402 {"/z:/test%20dir/README.txt#hash%20part",S_OK},
403 {"",S_FALSE},
404 {"file:///z:/test dir/README.txt#hash part",S_OK},
405 {"file",S_OK},
406 {"",S_FALSE},
407 {"",S_FALSE}
408 },
409 {
410 {Uri_HOST_UNKNOWN,S_OK,FALSE},
411 {0,S_FALSE,FALSE},
413 {URLZONE_INVALID,E_NOTIMPL,FALSE}
414 }
415 },
416 { "urn:nothing:should:happen here", 0, S_OK, FALSE, 0,
417 {
418 {"urn:nothing:should:happen here",S_OK,FALSE},
419 {"",S_FALSE,FALSE},
420 {"urn:nothing:should:happen here",S_OK,FALSE},
421 {"",S_FALSE,FALSE},
422 {"",S_FALSE,FALSE},
423 {"",S_FALSE,FALSE},
424 {"",S_FALSE,FALSE},
425 {"",S_FALSE,FALSE},
426 {"nothing:should:happen here",S_OK,FALSE},
427 {"nothing:should:happen here",S_OK,FALSE},
428 {"",S_FALSE,FALSE},
429 {"urn:nothing:should:happen here",S_OK,FALSE},
430 {"urn",S_OK,FALSE},
431 {"",S_FALSE,FALSE},
432 {"",S_FALSE,FALSE}
433 },
434 {
435 {Uri_HOST_UNKNOWN,S_OK,FALSE},
436 {0,S_FALSE,FALSE},
438 {URLZONE_INVALID,E_NOTIMPL,FALSE}
439 }
440 },
441 { "http://127.0.0.1/tests/../test dir/./test.txt", 0, S_OK, FALSE, 0,
442 {
443 {"http://127.0.0.1/test%20dir/test.txt",S_OK,FALSE},
444 {"127.0.0.1",S_OK,FALSE},
445 {"http://127.0.0.1/test%20dir/test.txt",S_OK,FALSE},
446 {"",S_FALSE,FALSE},
447 {".txt",S_OK,FALSE},
448 {"",S_FALSE,FALSE},
449 {"127.0.0.1",S_OK,FALSE},
450 {"",S_FALSE,FALSE},
451 {"/test%20dir/test.txt",S_OK,FALSE},
452 {"/test%20dir/test.txt",S_OK,FALSE},
453 {"",S_FALSE,FALSE},
454 {"http://127.0.0.1/tests/../test dir/./test.txt",S_OK,FALSE},
455 {"http",S_OK,FALSE},
456 {"",S_FALSE,FALSE},
457 {"",S_FALSE,FALSE}
458 },
459 {
460 {Uri_HOST_IPV4,S_OK,FALSE},
461 {80,S_OK,FALSE},
463 {URLZONE_INVALID,E_NOTIMPL,FALSE}
464 }
465 },
466 { "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", 0, S_OK, FALSE, 0,
467 {
468 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,FALSE},
469 {"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]",S_OK,FALSE},
470 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,FALSE},
471 {"",S_FALSE,FALSE},
472 {"",S_FALSE,FALSE},
473 {"",S_FALSE,FALSE},
474 {"fedc:ba98:7654:3210:fedc:ba98:7654:3210",S_OK,FALSE},
475 {"",S_FALSE,FALSE},
476 {"/",S_OK,FALSE},
477 {"/",S_OK,FALSE},
478 {"",S_FALSE,FALSE},
479 {"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]",S_OK,FALSE},
480 {"http",S_OK,FALSE},
481 {"",S_FALSE,FALSE},
482 {"",S_FALSE,FALSE}
483 },
484 {
485 {Uri_HOST_IPV6,S_OK,FALSE},
486 {80,S_OK,FALSE},
488 {URLZONE_INVALID,E_NOTIMPL,FALSE}
489 }
490 },
491 { "ftp://[::13.1.68.3]", 0, S_OK, FALSE, 0,
492 {
493 {"ftp://[::13.1.68.3]/",S_OK,FALSE},
494 {"[::13.1.68.3]",S_OK,FALSE},
495 {"ftp://[::13.1.68.3]/",S_OK,FALSE},
496 {"",S_FALSE,FALSE},
497 {"",S_FALSE,FALSE},
498 {"",S_FALSE,FALSE},
499 {"::13.1.68.3",S_OK,FALSE},
500 {"",S_FALSE,FALSE},
501 {"/",S_OK,FALSE},
502 {"/",S_OK,FALSE},
503 {"",S_FALSE,FALSE},
504 {"ftp://[::13.1.68.3]",S_OK,FALSE},
505 {"ftp",S_OK,FALSE},
506 {"",S_FALSE,FALSE},
507 {"",S_FALSE,FALSE}
508 },
509 {
510 {Uri_HOST_IPV6,S_OK,FALSE},
511 {21,S_OK,FALSE},
513 {URLZONE_INVALID,E_NOTIMPL,FALSE}
514 }
515 },
516 { "http://[FEDC:BA98:0:0:0:0:0:3210]", 0, S_OK, FALSE, 0,
517 {
518 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
519 {"[fedc:ba98::3210]",S_OK,FALSE},
520 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
521 {"",S_FALSE,FALSE},
522 {"",S_FALSE,FALSE},
523 {"",S_FALSE,FALSE},
524 {"fedc:ba98::3210",S_OK,FALSE},
525 {"",S_FALSE,FALSE},
526 {"/",S_OK,FALSE},
527 {"/",S_OK,FALSE},
528 {"",S_FALSE,FALSE},
529 {"http://[FEDC:BA98:0:0:0:0:0:3210]",S_OK,FALSE},
530 {"http",S_OK,FALSE},
531 {"",S_FALSE,FALSE},
532 {"",S_FALSE,FALSE},
533 },
534 {
535 {Uri_HOST_IPV6,S_OK,FALSE},
536 {80,S_OK,FALSE},
538 {URLZONE_INVALID,E_NOTIMPL,FALSE}
539 }
540 },
541 { "1234://www.winehq.org", 0, S_OK, FALSE, 0,
542 {
543 {"1234://www.winehq.org/",S_OK,FALSE},
544 {"www.winehq.org",S_OK,FALSE},
545 {"1234://www.winehq.org/",S_OK,FALSE},
546 {"winehq.org",S_OK,FALSE},
547 {"",S_FALSE,FALSE},
548 {"",S_FALSE,FALSE},
549 {"www.winehq.org",S_OK,FALSE},
550 {"",S_FALSE,FALSE},
551 {"/",S_OK,FALSE},
552 {"/",S_OK,FALSE},
553 {"",S_FALSE,FALSE},
554 {"1234://www.winehq.org",S_OK,FALSE},
555 {"1234",S_OK,FALSE},
556 {"",S_FALSE,FALSE},
557 {"",S_FALSE,FALSE}
558 },
559 {
560 {Uri_HOST_DNS,S_OK,FALSE},
561 {0,S_FALSE,FALSE},
563 {URLZONE_INVALID,E_NOTIMPL,FALSE}
564 }
565 },
566 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
567 { "C:/test/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE, 0,
568 {
569 {"file:///C:/test/test.mp3",S_OK,FALSE},
570 {"",S_FALSE,FALSE},
571 {"file:///C:/test/test.mp3",S_OK,FALSE},
572 {"",S_FALSE,FALSE},
573 {".mp3",S_OK,FALSE},
574 {"",S_FALSE,FALSE},
575 {"",S_FALSE,FALSE},
576 {"",S_FALSE,FALSE},
577 {"/C:/test/test.mp3",S_OK,FALSE},
578 {"/C:/test/test.mp3",S_OK,FALSE},
579 {"",S_FALSE,FALSE},
580 {"C:/test/test.mp3",S_OK,FALSE},
581 {"file",S_OK,FALSE},
582 {"",S_FALSE,FALSE},
583 {"",S_FALSE,FALSE}
584 },
585 {
586 {Uri_HOST_UNKNOWN,S_OK,FALSE},
587 {0,S_FALSE,FALSE},
589 {URLZONE_INVALID,E_NOTIMPL,FALSE}
590 }
591 },
592 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
593 { "\\\\Server/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE, 0,
594 {
595 {"file://server/test.mp3",S_OK,FALSE},
596 {"server",S_OK,FALSE},
597 {"file://server/test.mp3",S_OK,FALSE},
598 {"",S_FALSE,FALSE},
599 {".mp3",S_OK,FALSE},
600 {"",S_FALSE,FALSE},
601 {"server",S_OK,FALSE},
602 {"",S_FALSE,FALSE},
603 {"/test.mp3",S_OK,FALSE},
604 {"/test.mp3",S_OK,FALSE},
605 {"",S_FALSE,FALSE},
606 {"\\\\Server/test.mp3",S_OK,FALSE},
607 {"file",S_OK,FALSE},
608 {"",S_FALSE,FALSE},
609 {"",S_FALSE,FALSE}
610 },
611 {
612 {Uri_HOST_DNS,S_OK,FALSE},
613 {0,S_FALSE,FALSE},
615 {URLZONE_INVALID,E_NOTIMPL,FALSE}
616 }
617 },
618 { "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, 0,
619 {
620 {"file://C:\\test\\test.mp3#fragment|part",S_OK,FALSE},
621 {"",S_FALSE,FALSE},
622 {"file://C:\\test\\test.mp3#fragment|part",S_OK,FALSE},
623 {"",S_FALSE,FALSE},
624 {".mp3#fragment|part",S_OK,FALSE},
625 {"",S_FALSE,FALSE},
626 {"",S_FALSE,FALSE},
627 {"",S_FALSE,FALSE},
628 {"C:\\test\\test.mp3#fragment|part",S_OK,FALSE},
629 {"C:\\test\\test.mp3#fragment|part",S_OK,FALSE},
630 {"",S_FALSE,FALSE},
631 {"C:/test/test.mp3#fragment|part",S_OK,FALSE},
632 {"file",S_OK,FALSE},
633 {"",S_FALSE,FALSE},
634 {"",S_FALSE,FALSE}
635 },
636 {
637 {Uri_HOST_UNKNOWN,S_OK,FALSE},
638 {0,S_FALSE,FALSE},
640 {URLZONE_INVALID,E_NOTIMPL,FALSE}
641 }
642 },
643 { "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, 0,
644 {
645 {"file://C:\\test\\test.mp3?query|part",S_OK,FALSE},
646 {"",S_FALSE,FALSE},
647 {"file://C:\\test\\test.mp3?query|part",S_OK,FALSE},
648 {"",S_FALSE,FALSE},
649 {".mp3",S_OK,FALSE},
650 {"",S_FALSE,FALSE},
651 {"",S_FALSE,FALSE},
652 {"",S_FALSE,FALSE},
653 {"C:\\test\\test.mp3",S_OK,FALSE},
654 {"C:\\test\\test.mp3?query|part",S_OK,FALSE},
655 {"?query|part",S_OK,FALSE},
656 {"C:/test/test.mp3?query|part",S_OK,FALSE},
657 {"file",S_OK,FALSE},
658 {"",S_FALSE,FALSE},
659 {"",S_FALSE,FALSE}
660 },
661 {
662 {Uri_HOST_UNKNOWN,S_OK,FALSE},
663 {0,S_FALSE,FALSE},
665 {URLZONE_INVALID,E_NOTIMPL,FALSE}
666 }
667 },
668 { "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, 0,
669 {
670 {"file://C:\\test\\test.mp3?query|part#hash|part",S_OK,FALSE},
671 {"",S_FALSE,FALSE},
672 {"file://C:\\test\\test.mp3?query|part#hash|part",S_OK,FALSE},
673 {"",S_FALSE,FALSE},
674 {".mp3",S_OK,FALSE},
675 {"#hash|part",S_OK,FALSE},
676 {"",S_FALSE,FALSE},
677 {"",S_FALSE,FALSE},
678 {"C:\\test\\test.mp3",S_OK,FALSE},
679 {"C:\\test\\test.mp3?query|part",S_OK,FALSE},
680 {"?query|part",S_OK,FALSE},
681 {"C:/test/test.mp3?query|part#hash|part",S_OK,FALSE},
682 {"file",S_OK,FALSE},
683 {"",S_FALSE,FALSE},
684 {"",S_FALSE,FALSE}
685 },
686 {
687 {Uri_HOST_UNKNOWN,S_OK,FALSE},
688 {0,S_FALSE,FALSE},
690 {URLZONE_INVALID,E_NOTIMPL,FALSE}
691 }
692 },
693 { "www.winehq.org/test", Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME, S_OK, FALSE, 0,
694 {
695 {"*:www.winehq.org/test",S_OK,FALSE},
696 {"www.winehq.org",S_OK,FALSE},
697 {"*:www.winehq.org/test",S_OK,FALSE},
698 {"winehq.org",S_OK,FALSE},
699 {"",S_FALSE,FALSE},
700 {"",S_FALSE,FALSE},
701 {"www.winehq.org",S_OK,FALSE},
702 {"",S_FALSE,FALSE},
703 {"/test",S_OK,FALSE},
704 {"/test",S_OK,FALSE},
705 {"",S_FALSE,FALSE},
706 {"www.winehq.org/test",S_OK,FALSE},
707 {"*",S_OK,FALSE},
708 {"",S_FALSE,FALSE},
709 {"",S_FALSE,FALSE}
710 },
711 {
712 {Uri_HOST_DNS,S_OK,FALSE},
713 {0,S_FALSE,FALSE},
715 {URLZONE_INVALID,E_NOTIMPL,FALSE}
716 }
717 },
718 /* Valid since the '*' is the only character in the scheme name. */
719 { "*:www.winehq.org/test", 0, S_OK, FALSE, 0,
720 {
721 {"*:www.winehq.org/test",S_OK,FALSE},
722 {"www.winehq.org",S_OK,FALSE},
723 {"*:www.winehq.org/test",S_OK,FALSE},
724 {"winehq.org",S_OK,FALSE},
725 {"",S_FALSE,FALSE},
726 {"",S_FALSE,FALSE},
727 {"www.winehq.org",S_OK,FALSE},
728 {"",S_FALSE,FALSE},
729 {"/test",S_OK,FALSE},
730 {"/test",S_OK,FALSE},
731 {"",S_FALSE,FALSE},
732 {"*:www.winehq.org/test",S_OK,FALSE},
733 {"*",S_OK,FALSE},
734 {"",S_FALSE,FALSE},
735 {"",S_FALSE,FALSE}
736 },
737 {
738 {Uri_HOST_DNS,S_OK,FALSE},
739 {0,S_FALSE,FALSE},
741 {URLZONE_INVALID,E_NOTIMPL,FALSE}
742 }
743 },
744 { "/../some dir/test.ext", Uri_CREATE_ALLOW_RELATIVE, S_OK, FALSE, 0,
745 {
746 {"/../some dir/test.ext",S_OK,FALSE},
747 {"",S_FALSE,FALSE},
748 {"/../some dir/test.ext",S_OK,FALSE},
749 {"",S_FALSE,FALSE},
750 {".ext",S_OK,FALSE},
751 {"",S_FALSE,FALSE},
752 {"",S_FALSE,FALSE},
753 {"",S_FALSE,FALSE},
754 {"/../some dir/test.ext",S_OK,FALSE},
755 {"/../some dir/test.ext",S_OK,FALSE},
756 {"",S_FALSE,FALSE},
757 {"/../some dir/test.ext",S_OK,FALSE},
758 {"",S_FALSE,FALSE},
759 {"",S_FALSE,FALSE},
760 {"",S_FALSE,FALSE}
761 },
762 {
763 {Uri_HOST_UNKNOWN,S_OK,FALSE},
764 {0,S_FALSE,FALSE},
766 {URLZONE_INVALID,E_NOTIMPL,FALSE}
767 }
768 },
769 { "//implicit/wildcard/uri scheme", Uri_CREATE_ALLOW_RELATIVE|Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME, S_OK, FALSE, 0,
770 {
771 {"*://implicit/wildcard/uri%20scheme",S_OK,FALSE},
772 {"",S_OK,FALSE},
773 {"*://implicit/wildcard/uri%20scheme",S_OK,FALSE},
774 {"",S_FALSE,FALSE},
775 {"",S_FALSE,FALSE},
776 {"",S_FALSE,FALSE},
777 {"",S_OK,FALSE},
778 {"",S_FALSE,FALSE},
779 {"//implicit/wildcard/uri%20scheme",S_OK,FALSE},
780 {"//implicit/wildcard/uri%20scheme",S_OK,FALSE},
781 {"",S_FALSE,FALSE},
782 {"//implicit/wildcard/uri scheme",S_OK,FALSE},
783 {"*",S_OK,FALSE},
784 {"",S_FALSE,FALSE},
785 {"",S_FALSE,FALSE},
786 },
787 {
788 {Uri_HOST_UNKNOWN,S_OK,FALSE},
789 {0,S_FALSE,FALSE},
791 {URLZONE_INVALID,E_NOTIMPL,FALSE}
792 }
793 },
794 /* URI is considered opaque since CREATE_NO_CRACK_UNKNOWN_SCHEMES is set and it's an unknown scheme. */
795 { "zip://google.com", Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES, S_OK, FALSE, 0,
796 {
797 {"zip:/.//google.com",S_OK,FALSE},
798 {"",S_FALSE,FALSE},
799 {"zip:/.//google.com",S_OK,FALSE},
800 {"",S_FALSE,FALSE},
801 {".com",S_OK,FALSE},
802 {"",S_FALSE,FALSE},
803 {"",S_FALSE,FALSE},
804 {"",S_FALSE,FALSE},
805 {"/.//google.com",S_OK,FALSE},
806 {"/.//google.com",S_OK,FALSE},
807 {"",S_FALSE,FALSE},
808 {"zip://google.com",S_OK,FALSE},
809 {"zip",S_OK,FALSE},
810 {"",S_FALSE,FALSE},
811 {"",S_FALSE,FALSE}
812 },
813 {
814 {Uri_HOST_UNKNOWN,S_OK,FALSE},
815 {0,S_FALSE,FALSE},
817 {URLZONE_INVALID,E_NOTIMPL,FALSE}
818 }
819 },
820 /* Windows uses the first occurrence of ':' to delimit the userinfo. */
821 { "ftp://user:pass:word@winehq.org/", 0, S_OK, FALSE, 0,
822 {
823 {"ftp://user:pass:word@winehq.org/",S_OK,FALSE},
824 {"user:pass:word@winehq.org",S_OK,FALSE},
825 {"ftp://winehq.org/",S_OK,FALSE},
826 {"winehq.org",S_OK,FALSE},
827 {"",S_FALSE,FALSE},
828 {"",S_FALSE,FALSE},
829 {"winehq.org",S_OK,FALSE},
830 {"pass:word",S_OK,FALSE},
831 {"/",S_OK,FALSE},
832 {"/",S_OK,FALSE},
833 {"",S_FALSE,FALSE},
834 {"ftp://user:pass:word@winehq.org/",S_OK,FALSE},
835 {"ftp",S_OK,FALSE},
836 {"user:pass:word",S_OK,FALSE},
837 {"user",S_OK,FALSE}
838 },
839 {
840 {Uri_HOST_DNS,S_OK,FALSE},
841 {21,S_OK,FALSE},
843 {URLZONE_INVALID,E_NOTIMPL,FALSE}
844 }
845 },
846 /* Make sure % encoded unreserved characters are decoded. */
847 { "ftp://w%49%4Ee:PA%53%53@ftp.google.com/", 0, S_OK, FALSE, 0,
848 {
849 {"ftp://wINe:PASS@ftp.google.com/",S_OK,FALSE},
850 {"wINe:PASS@ftp.google.com",S_OK,FALSE},
851 {"ftp://ftp.google.com/",S_OK,FALSE},
852 {"google.com",S_OK,FALSE},
853 {"",S_FALSE,FALSE},
854 {"",S_FALSE,FALSE},
855 {"ftp.google.com",S_OK,FALSE},
856 {"PASS",S_OK,FALSE},
857 {"/",S_OK,FALSE},
858 {"/",S_OK,FALSE},
859 {"",S_FALSE,FALSE},
860 {"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK,FALSE},
861 {"ftp",S_OK,FALSE},
862 {"wINe:PASS",S_OK,FALSE},
863 {"wINe",S_OK,FALSE}
864 },
865 {
866 {Uri_HOST_DNS,S_OK,FALSE},
867 {21,S_OK,FALSE},
869 {URLZONE_INVALID,E_NOTIMPL,FALSE}
870 }
871 },
872 /* Make sure % encoded characters which are NOT unreserved are NOT decoded. */
873 { "ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/", 0, S_OK, FALSE, 0,
874 {
875 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,FALSE},
876 {"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK,FALSE},
877 {"ftp://ftp.google.com/",S_OK,FALSE},
878 {"google.com",S_OK,FALSE},
879 {"",S_FALSE,FALSE},
880 {"",S_FALSE,FALSE},
881 {"ftp.google.com",S_OK,FALSE},
882 {"PA%7B%7D",S_OK,FALSE},
883 {"/",S_OK,FALSE},
884 {"/",S_OK,FALSE},
885 {"",S_FALSE,FALSE},
886 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,FALSE},
887 {"ftp",S_OK,FALSE},
888 {"w%5D%5Be:PA%7B%7D",S_OK,FALSE},
889 {"w%5D%5Be",S_OK,FALSE}
890 },
891 {
892 {Uri_HOST_DNS,S_OK,FALSE},
893 {21,S_OK,FALSE},
895 {URLZONE_INVALID,E_NOTIMPL,FALSE}
896 }
897 },
898 /* You're allowed to have an empty password portion in the userinfo section. */
899 { "ftp://empty:@ftp.google.com/", 0, S_OK, FALSE, 0,
900 {
901 {"ftp://empty:@ftp.google.com/",S_OK,FALSE},
902 {"empty:@ftp.google.com",S_OK,FALSE},
903 {"ftp://ftp.google.com/",S_OK,FALSE},
904 {"google.com",S_OK,FALSE},
905 {"",S_FALSE,FALSE},
906 {"",S_FALSE,FALSE},
907 {"ftp.google.com",S_OK,FALSE},
908 {"",S_OK,FALSE},
909 {"/",S_OK,FALSE},
910 {"/",S_OK,FALSE},
911 {"",S_FALSE,FALSE},
912 {"ftp://empty:@ftp.google.com/",S_OK,FALSE},
913 {"ftp",S_OK,FALSE},
914 {"empty:",S_OK,FALSE},
915 {"empty",S_OK,FALSE}
916 },
917 {
918 {Uri_HOST_DNS,S_OK,FALSE},
919 {21,S_OK,FALSE},
921 {URLZONE_INVALID,E_NOTIMPL,FALSE}
922 }
923 },
924 /* Make sure forbidden characters in "userinfo" get encoded. */
925 { "ftp://\" \"weird@ftp.google.com/", 0, S_OK, FALSE, 0,
926 {
927 {"ftp://%22%20%22weird@ftp.google.com/",S_OK,FALSE},
928 {"%22%20%22weird@ftp.google.com",S_OK,FALSE},
929 {"ftp://ftp.google.com/",S_OK,FALSE},
930 {"google.com",S_OK,FALSE},
931 {"",S_FALSE,FALSE},
932 {"",S_FALSE,FALSE},
933 {"ftp.google.com",S_OK,FALSE},
934 {"",S_FALSE,FALSE},
935 {"/",S_OK,FALSE},
936 {"/",S_OK,FALSE},
937 {"",S_FALSE,FALSE},
938 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
939 {"ftp",S_OK,FALSE},
940 {"%22%20%22weird",S_OK,FALSE},
941 {"%22%20%22weird",S_OK,FALSE}
942 },
943 {
944 {Uri_HOST_DNS,S_OK,FALSE},
945 {21,S_OK,FALSE},
947 {URLZONE_INVALID,E_NOTIMPL,FALSE}
948 }
949 },
950 /* Make sure the forbidden characters don't get percent encoded. */
951 { "ftp://\" \"weird@ftp.google.com/", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE, 0,
952 {
953 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
954 {"\" \"weird@ftp.google.com",S_OK,FALSE},
955 {"ftp://ftp.google.com/",S_OK,FALSE},
956 {"google.com",S_OK,FALSE},
957 {"",S_FALSE,FALSE},
958 {"",S_FALSE,FALSE},
959 {"ftp.google.com",S_OK,FALSE},
960 {"",S_FALSE,FALSE},
961 {"/",S_OK,FALSE},
962 {"/",S_OK,FALSE},
963 {"",S_FALSE,FALSE},
964 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
965 {"ftp",S_OK,FALSE},
966 {"\" \"weird",S_OK,FALSE},
967 {"\" \"weird",S_OK,FALSE}
968 },
969 {
970 {Uri_HOST_DNS,S_OK,FALSE},
971 {21,S_OK,FALSE},
973 {URLZONE_INVALID,E_NOTIMPL,FALSE}
974 }
975 },
976 /* Make sure already percent encoded characters don't get unencoded. */
977 { "ftp://\"%20\"weird@ftp.google.com/\"%20\"weird", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE, 0,
978 {
979 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK,FALSE},
980 {"\"%20\"weird@ftp.google.com",S_OK,FALSE},
981 {"ftp://ftp.google.com/\"%20\"weird",S_OK,FALSE},
982 {"google.com",S_OK,FALSE},
983 {"",S_FALSE,FALSE},
984 {"",S_FALSE,FALSE},
985 {"ftp.google.com",S_OK,FALSE},
986 {"",S_FALSE,FALSE},
987 {"/\"%20\"weird",S_OK,FALSE},
988 {"/\"%20\"weird",S_OK,FALSE},
989 {"",S_FALSE,FALSE},
990 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK,FALSE},
991 {"ftp",S_OK,FALSE},
992 {"\"%20\"weird",S_OK,FALSE},
993 {"\"%20\"weird",S_OK,FALSE}
994 },
995 {
996 {Uri_HOST_DNS,S_OK,FALSE},
997 {21,S_OK,FALSE},
999 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1000 }
1001 },
1002 /* Allowed to have invalid % encoded because it's an unknown scheme type. */
1003 { "zip://%xy:word@winehq.org/", 0, S_OK, FALSE, 0,
1004 {
1005 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
1006 {"%xy:word@winehq.org",S_OK,FALSE},
1007 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
1008 {"winehq.org",S_OK,FALSE},
1009 {"",S_FALSE,FALSE},
1010 {"",S_FALSE,FALSE},
1011 {"winehq.org",S_OK,FALSE},
1012 {"word",S_OK,FALSE},
1013 {"/",S_OK,FALSE},
1014 {"/",S_OK,FALSE},
1015 {"",S_FALSE,FALSE},
1016 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
1017 {"zip",S_OK,FALSE},
1018 {"%xy:word",S_OK,FALSE},
1019 {"%xy",S_OK,FALSE}
1020 },
1021 {
1022 {Uri_HOST_DNS,S_OK,FALSE},
1023 {0,S_FALSE,FALSE},
1025 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1026 }
1027 },
1028 /* Unreserved, percent encoded characters aren't decoded in the userinfo because the scheme
1029 * isn't known.
1030 */
1031 { "zip://%2E:%52%53ord@winehq.org/", 0, S_OK, FALSE, 0,
1032 {
1033 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
1034 {"%2E:%52%53ord@winehq.org",S_OK,FALSE},
1035 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
1036 {"winehq.org",S_OK,FALSE},
1037 {"",S_FALSE,FALSE},
1038 {"",S_FALSE,FALSE},
1039 {"winehq.org",S_OK,FALSE},
1040 {"%52%53ord",S_OK,FALSE},
1041 {"/",S_OK,FALSE},
1042 {"/",S_OK,FALSE},
1043 {"",S_FALSE,FALSE},
1044 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
1045 {"zip",S_OK,FALSE},
1046 {"%2E:%52%53ord",S_OK,FALSE},
1047 {"%2E",S_OK,FALSE}
1048 },
1049 {
1050 {Uri_HOST_DNS,S_OK,FALSE},
1051 {0,S_FALSE,FALSE},
1053 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1054 }
1055 },
1056 { "ftp://[](),'test':word@winehq.org/", 0, S_OK, FALSE, 0,
1057 {
1058 {"ftp://[](),'test':word@winehq.org/",S_OK,FALSE},
1059 {"[](),'test':word@winehq.org",S_OK,FALSE},
1060 {"ftp://winehq.org/",S_OK,FALSE},
1061 {"winehq.org",S_OK,FALSE},
1062 {"",S_FALSE,FALSE},
1063 {"",S_FALSE,FALSE},
1064 {"winehq.org",S_OK,FALSE},
1065 {"word",S_OK,FALSE},
1066 {"/",S_OK,FALSE},
1067 {"/",S_OK,FALSE},
1068 {"",S_FALSE,FALSE},
1069 {"ftp://[](),'test':word@winehq.org/",S_OK,FALSE},
1070 {"ftp",S_OK,FALSE},
1071 {"[](),'test':word",S_OK,FALSE},
1072 {"[](),'test'",S_OK,FALSE}
1073 },
1074 {
1075 {Uri_HOST_DNS,S_OK,FALSE},
1076 {21,S_OK,FALSE},
1078 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1079 }
1080 },
1081 { "ftp://test?:word@winehq.org/", 0, S_OK, FALSE, 0,
1082 {
1083 {"ftp://test/?:word@winehq.org/",S_OK,FALSE},
1084 {"test",S_OK,FALSE},
1085 {"ftp://test/?:word@winehq.org/",S_OK,FALSE},
1086 {"",S_FALSE,FALSE},
1087 {"",S_FALSE,FALSE},
1088 {"",S_FALSE,FALSE},
1089 {"test",S_OK,FALSE},
1090 {"",S_FALSE,FALSE},
1091 {"/",S_OK,FALSE},
1092 {"/?:word@winehq.org/",S_OK,FALSE},
1093 {"?:word@winehq.org/",S_OK,FALSE},
1094 {"ftp://test?:word@winehq.org/",S_OK,FALSE},
1095 {"ftp",S_OK,FALSE},
1096 {"",S_FALSE,FALSE},
1097 {"",S_FALSE,FALSE}
1098 },
1099 {
1100 {Uri_HOST_DNS,S_OK,FALSE},
1101 {21,S_OK,FALSE},
1103 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1104 }
1105 },
1106 { "ftp://test#:word@winehq.org/", 0, S_OK, FALSE, 0,
1107 {
1108 {"ftp://test/#:word@winehq.org/",S_OK,FALSE},
1109 {"test",S_OK,FALSE},
1110 {"ftp://test/#:word@winehq.org/",S_OK,FALSE},
1111 {"",S_FALSE,FALSE},
1112 {"",S_FALSE,FALSE},
1113 {"#:word@winehq.org/",S_OK,FALSE},
1114 {"test",S_OK,FALSE},
1115 {"",S_FALSE,FALSE},
1116 {"/",S_OK,FALSE},
1117 {"/",S_OK,FALSE},
1118 {"",S_FALSE,FALSE},
1119 {"ftp://test#:word@winehq.org/",S_OK,FALSE},
1120 {"ftp",S_OK,FALSE},
1121 {"",S_FALSE,FALSE},
1122 {"",S_FALSE,FALSE}
1123 },
1124 {
1125 {Uri_HOST_DNS,S_OK,FALSE},
1126 {21,S_OK,FALSE},
1128 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1129 }
1130 },
1131 /* Allowed to have a backslash in the userinfo since it's an unknown scheme. */
1132 { "zip://test\\:word@winehq.org/", 0, S_OK, FALSE, 0,
1133 {
1134 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
1135 {"test\\:word@winehq.org",S_OK,FALSE},
1136 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
1137 {"winehq.org",S_OK,FALSE},
1138 {"",S_FALSE,FALSE},
1139 {"",S_FALSE,FALSE},
1140 {"winehq.org",S_OK,FALSE},
1141 {"word",S_OK,FALSE},
1142 {"/",S_OK,FALSE},
1143 {"/",S_OK,FALSE},
1144 {"",S_FALSE,FALSE},
1145 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
1146 {"zip",S_OK,FALSE},
1147 {"test\\:word",S_OK,FALSE},
1148 {"test\\",S_OK,FALSE}
1149 },
1150 {
1151 {Uri_HOST_DNS,S_OK,FALSE},
1152 {0,S_FALSE,FALSE},
1154 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1155 }
1156 },
1157 /* It normalizes IPv4 addresses correctly. */
1158 { "http://127.000.000.100/", 0, S_OK, FALSE, 0,
1159 {
1160 {"http://127.0.0.100/",S_OK,FALSE},
1161 {"127.0.0.100",S_OK,FALSE},
1162 {"http://127.0.0.100/",S_OK,FALSE},
1163 {"",S_FALSE,FALSE},
1164 {"",S_FALSE,FALSE},
1165 {"",S_FALSE,FALSE},
1166 {"127.0.0.100",S_OK,FALSE},
1167 {"",S_FALSE,FALSE},
1168 {"/",S_OK,FALSE},
1169 {"/",S_OK,FALSE},
1170 {"",S_FALSE,FALSE},
1171 {"http://127.000.000.100/",S_OK,FALSE},
1172 {"http",S_OK,FALSE},
1173 {"",S_FALSE,FALSE},
1174 {"",S_FALSE,FALSE}
1175 },
1176 {
1177 {Uri_HOST_IPV4,S_OK,FALSE},
1178 {80,S_OK,FALSE},
1180 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1181 }
1182 },
1183 { "http://127.0.0.1:8000", 0, S_OK, FALSE, 0,
1184 {
1185 {"http://127.0.0.1:8000/",S_OK},
1186 {"127.0.0.1:8000",S_OK},
1187 {"http://127.0.0.1:8000/",S_OK},
1188 {"",S_FALSE},
1189 {"",S_FALSE},
1190 {"",S_FALSE},
1191 {"127.0.0.1",S_OK},
1192 {"",S_FALSE},
1193 {"/",S_OK},
1194 {"/",S_OK},
1195 {"",S_FALSE},
1196 {"http://127.0.0.1:8000",S_OK},
1197 {"http",S_OK},
1198 {"",S_FALSE},
1199 {"",S_FALSE}
1200 },
1201 {
1202 {Uri_HOST_IPV4,S_OK,FALSE},
1203 {8000,S_OK,FALSE},
1205 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1206 }
1207 },
1208 /* Make sure it normalizes partial IPv4 addresses correctly. */
1209 { "http://127.0/", 0, S_OK, FALSE, 0,
1210 {
1211 {"http://127.0.0.0/",S_OK,FALSE},
1212 {"127.0.0.0",S_OK,FALSE},
1213 {"http://127.0.0.0/",S_OK,FALSE},
1214 {"",S_FALSE,FALSE},
1215 {"",S_FALSE,FALSE},
1216 {"",S_FALSE,FALSE},
1217 {"127.0.0.0",S_OK,FALSE},
1218 {"",S_FALSE,FALSE},
1219 {"/",S_OK,FALSE},
1220 {"/",S_OK,FALSE},
1221 {"",S_FALSE,FALSE},
1222 {"http://127.0/",S_OK,FALSE},
1223 {"http",S_OK,FALSE},
1224 {"",S_FALSE,FALSE},
1225 {"",S_FALSE,FALSE}
1226 },
1227 {
1228 {Uri_HOST_IPV4,S_OK,FALSE},
1229 {80,S_OK,FALSE},
1231 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1232 }
1233 },
1234 /* Make sure it converts implicit IPv4's correctly. */
1235 { "http://123456/", 0, S_OK, FALSE, 0,
1236 {
1237 {"http://0.1.226.64/",S_OK,FALSE},
1238 {"0.1.226.64",S_OK,FALSE},
1239 {"http://0.1.226.64/",S_OK,FALSE},
1240 {"",S_FALSE,FALSE},
1241 {"",S_FALSE,FALSE},
1242 {"",S_FALSE,FALSE},
1243 {"0.1.226.64",S_OK,FALSE},
1244 {"",S_FALSE,FALSE},
1245 {"/",S_OK,FALSE},
1246 {"/",S_OK,FALSE},
1247 {"",S_FALSE,FALSE},
1248 {"http://123456/",S_OK,FALSE},
1249 {"http",S_OK,FALSE},
1250 {"",S_FALSE,FALSE},
1251 {"",S_FALSE,FALSE}
1252 },
1253 {
1254 {Uri_HOST_IPV4,S_OK,FALSE},
1255 {80,S_OK,FALSE},
1257 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1258 }
1259 },
1260 /* UINT_MAX */
1261 { "http://4294967295/", 0, S_OK, FALSE, 0,
1262 {
1263 {"http://255.255.255.255/",S_OK,FALSE},
1264 {"255.255.255.255",S_OK,FALSE},
1265 {"http://255.255.255.255/",S_OK,FALSE},
1266 {"",S_FALSE,FALSE},
1267 {"",S_FALSE,FALSE},
1268 {"",S_FALSE,FALSE},
1269 {"255.255.255.255",S_OK,FALSE},
1270 {"",S_FALSE,FALSE},
1271 {"/",S_OK,FALSE},
1272 {"/",S_OK,FALSE},
1273 {"",S_FALSE,FALSE},
1274 {"http://4294967295/",S_OK,FALSE},
1275 {"http",S_OK,FALSE},
1276 {"",S_FALSE,FALSE},
1277 {"",S_FALSE,FALSE}
1278 },
1279 {
1280 {Uri_HOST_IPV4,S_OK,FALSE},
1281 {80,S_OK,FALSE},
1283 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1284 }
1285 },
1286 /* UINT_MAX+1 */
1287 { "http://4294967296/", 0, S_OK, FALSE, 0,
1288 {
1289 {"http://4294967296/",S_OK,FALSE},
1290 {"4294967296",S_OK,FALSE},
1291 {"http://4294967296/",S_OK,FALSE},
1292 {"",S_FALSE,FALSE},
1293 {"",S_FALSE,FALSE},
1294 {"",S_FALSE,FALSE},
1295 {"4294967296",S_OK,FALSE},
1296 {"",S_FALSE,FALSE},
1297 {"/",S_OK,FALSE},
1298 {"/",S_OK,FALSE},
1299 {"",S_FALSE,FALSE},
1300 {"http://4294967296/",S_OK,FALSE},
1301 {"http",S_OK,FALSE},
1302 {"",S_FALSE,FALSE},
1303 {"",S_FALSE,FALSE}
1304 },
1305 {
1306 {Uri_HOST_DNS,S_OK,FALSE},
1307 {80,S_OK,FALSE},
1309 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1310 }
1311 },
1312 /* Window's doesn't normalize IP address for unknown schemes. */
1313 { "1234://4294967295/", 0, S_OK, FALSE, 0,
1314 {
1315 {"1234://4294967295/",S_OK,FALSE},
1316 {"4294967295",S_OK,FALSE},
1317 {"1234://4294967295/",S_OK,FALSE},
1318 {"",S_FALSE,FALSE},
1319 {"",S_FALSE,FALSE},
1320 {"",S_FALSE,FALSE},
1321 {"4294967295",S_OK,FALSE},
1322 {"",S_FALSE,FALSE},
1323 {"/",S_OK,FALSE},
1324 {"/",S_OK,FALSE},
1325 {"",S_FALSE,FALSE},
1326 {"1234://4294967295/",S_OK,FALSE},
1327 {"1234",S_OK,FALSE},
1328 {"",S_FALSE,FALSE},
1329 {"",S_FALSE,FALSE}
1330 },
1331 {
1332 {Uri_HOST_IPV4,S_OK,FALSE},
1333 {0,S_FALSE,FALSE},
1335 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1336 }
1337 },
1338 /* Window's doesn't normalize IP address for unknown schemes. */
1339 { "1234://127.001/", 0, S_OK, FALSE, 0,
1340 {
1341 {"1234://127.001/",S_OK,FALSE},
1342 {"127.001",S_OK,FALSE},
1343 {"1234://127.001/",S_OK,FALSE},
1344 {"",S_FALSE,FALSE},
1345 {"",S_FALSE,FALSE},
1346 {"",S_FALSE,FALSE},
1347 {"127.001",S_OK,FALSE},
1348 {"",S_FALSE,FALSE},
1349 {"/",S_OK,FALSE},
1350 {"/",S_OK,FALSE},
1351 {"",S_FALSE,FALSE},
1352 {"1234://127.001/",S_OK,FALSE},
1353 {"1234",S_OK,FALSE},
1354 {"",S_FALSE,FALSE},
1355 {"",S_FALSE,FALSE}
1356 },
1357 {
1358 {Uri_HOST_IPV4,S_OK,FALSE},
1359 {0,S_FALSE,FALSE},
1361 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1362 }
1363 },
1364 { "http://[FEDC:BA98::3210]", 0, S_OK, FALSE, 0,
1365 {
1366 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
1367 {"[fedc:ba98::3210]",S_OK,FALSE},
1368 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
1369 {"",S_FALSE,FALSE},
1370 {"",S_FALSE,FALSE},
1371 {"",S_FALSE,FALSE},
1372 {"fedc:ba98::3210",S_OK,FALSE},
1373 {"",S_FALSE,FALSE},
1374 {"/",S_OK,FALSE},
1375 {"/",S_OK,FALSE},
1376 {"",S_FALSE,FALSE},
1377 {"http://[FEDC:BA98::3210]",S_OK,FALSE},
1378 {"http",S_OK,FALSE},
1379 {"",S_FALSE,FALSE},
1380 {"",S_FALSE,FALSE},
1381 },
1382 {
1383 {Uri_HOST_IPV6,S_OK,FALSE},
1384 {80,S_OK,FALSE},
1386 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1387 }
1388 },
1389 { "http://[::]", 0, S_OK, FALSE, 0,
1390 {
1391 {"http://[::]/",S_OK,FALSE},
1392 {"[::]",S_OK,FALSE},
1393 {"http://[::]/",S_OK,FALSE},
1394 {"",S_FALSE,FALSE},
1395 {"",S_FALSE,FALSE},
1396 {"",S_FALSE,FALSE},
1397 {"::",S_OK,FALSE},
1398 {"",S_FALSE,FALSE},
1399 {"/",S_OK,FALSE},
1400 {"/",S_OK,FALSE},
1401 {"",S_FALSE,FALSE},
1402 {"http://[::]",S_OK,FALSE},
1403 {"http",S_OK,FALSE},
1404 {"",S_FALSE,FALSE},
1405 {"",S_FALSE,FALSE},
1406 },
1407 {
1408 {Uri_HOST_IPV6,S_OK,FALSE},
1409 {80,S_OK,FALSE},
1411 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1412 }
1413 },
1414 { "http://[FEDC:BA98::]", 0, S_OK, FALSE, 0,
1415 {
1416 {"http://[fedc:ba98::]/",S_OK,FALSE},
1417 {"[fedc:ba98::]",S_OK,FALSE},
1418 {"http://[fedc:ba98::]/",S_OK,FALSE},
1419 {"",S_FALSE,FALSE},
1420 {"",S_FALSE,FALSE},
1421 {"",S_FALSE,FALSE},
1422 {"fedc:ba98::",S_OK,FALSE},
1423 {"",S_FALSE,FALSE},
1424 {"/",S_OK,FALSE},
1425 {"/",S_OK,FALSE},
1426 {"",S_FALSE,FALSE},
1427 {"http://[FEDC:BA98::]",S_OK,FALSE},
1428 {"http",S_OK,FALSE},
1429 {"",S_FALSE,FALSE},
1430 {"",S_FALSE,FALSE},
1431 },
1432 {
1433 {Uri_HOST_IPV6,S_OK,FALSE},
1434 {80,S_OK,FALSE},
1436 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1437 }
1438 },
1439 /* Valid even with 2 byte elision because it doesn't appear the beginning or end. */
1440 { "http://[1::3:4:5:6:7:8]", 0, S_OK, FALSE, 0,
1441 {
1442 {"http://[1:0:3:4:5:6:7:8]/",S_OK,FALSE},
1443 {"[1:0:3:4:5:6:7:8]",S_OK,FALSE},
1444 {"http://[1:0:3:4:5:6:7:8]/",S_OK,FALSE},
1445 {"",S_FALSE,FALSE},
1446 {"",S_FALSE,FALSE},
1447 {"",S_FALSE,FALSE},
1448 {"1:0:3:4:5:6:7:8",S_OK,FALSE},
1449 {"",S_FALSE,FALSE},
1450 {"/",S_OK,FALSE},
1451 {"/",S_OK,FALSE},
1452 {"",S_FALSE,FALSE},
1453 {"http://[1::3:4:5:6:7:8]",S_OK,FALSE},
1454 {"http",S_OK,FALSE},
1455 {"",S_FALSE,FALSE},
1456 {"",S_FALSE,FALSE},
1457 },
1458 {
1459 {Uri_HOST_IPV6,S_OK,FALSE},
1460 {80,S_OK,FALSE},
1462 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1463 }
1464 },
1465 { "http://[v2.34]/", 0, S_OK, FALSE, 0,
1466 {
1467 {"http://[v2.34]/",S_OK,FALSE},
1468 {"[v2.34]",S_OK,FALSE},
1469 {"http://[v2.34]/",S_OK,FALSE},
1470 {"",S_FALSE,FALSE},
1471 {"",S_FALSE,FALSE},
1472 {"",S_FALSE,FALSE},
1473 {"[v2.34]",S_OK,FALSE},
1474 {"",S_FALSE,FALSE},
1475 {"/",S_OK,FALSE},
1476 {"/",S_OK,FALSE},
1477 {"",S_FALSE,FALSE},
1478 {"http://[v2.34]/",S_OK,FALSE},
1479 {"http",S_OK,FALSE},
1480 {"",S_FALSE,FALSE},
1481 {"",S_FALSE,FALSE}
1482 },
1483 {
1484 {Uri_HOST_UNKNOWN,S_OK,FALSE},
1485 {80,S_OK,FALSE},
1487 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1488 }
1489 },
1490 /* Windows ignores ':' if they appear after a '[' on a non-IPLiteral host. */
1491 { "http://[xyz:12345.com/test", 0, S_OK, FALSE, 0,
1492 {
1493 {"http://[xyz:12345.com/test",S_OK,FALSE},
1494 {"[xyz:12345.com",S_OK,FALSE},
1495 {"http://[xyz:12345.com/test",S_OK,FALSE},
1496 {"[xyz:12345.com",S_OK,FALSE},
1497 {"",S_FALSE,FALSE},
1498 {"",S_FALSE,FALSE},
1499 {"[xyz:12345.com",S_OK,FALSE},
1500 {"",S_FALSE,FALSE},
1501 {"/test",S_OK,FALSE},
1502 {"/test",S_OK,FALSE},
1503 {"",S_FALSE,FALSE},
1504 {"http://[xyz:12345.com/test",S_OK,FALSE},
1505 {"http",S_OK,FALSE},
1506 {"",S_FALSE,FALSE},
1507 {"",S_FALSE,FALSE}
1508 },
1509 {
1510 {Uri_HOST_DNS,S_OK,FALSE},
1511 {80,S_OK,FALSE},
1513 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1514 }
1515 },
1516 /* Valid URI since the '[' and ']' don't appear at the beginning and end
1517 * of the host name (respectively).
1518 */
1519 { "ftp://www.[works].com/", 0, S_OK, FALSE, 0,
1520 {
1521 {"ftp://www.[works].com/",S_OK,FALSE},
1522 {"www.[works].com",S_OK,FALSE},
1523 {"ftp://www.[works].com/",S_OK,FALSE},
1524 {"[works].com",S_OK,FALSE},
1525 {"",S_FALSE,FALSE},
1526 {"",S_FALSE,FALSE},
1527 {"www.[works].com",S_OK,FALSE},
1528 {"",S_FALSE,FALSE},
1529 {"/",S_OK,FALSE},
1530 {"/",S_OK,FALSE},
1531 {"",S_FALSE,FALSE},
1532 {"ftp://www.[works].com/",S_OK,FALSE},
1533 {"ftp",S_OK,FALSE},
1534 {"",S_FALSE,FALSE},
1535 {"",S_FALSE,FALSE}
1536 },
1537 {
1538 {Uri_HOST_DNS,S_OK,FALSE},
1539 {21,S_OK,FALSE},
1541 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1542 }
1543 },
1544 /* Considers ':' a delimiter since it appears after the ']'. */
1545 { "http://www.google.com]:12345/", 0, S_OK, FALSE, 0,
1546 {
1547 {"http://www.google.com]:12345/",S_OK,FALSE},
1548 {"www.google.com]:12345",S_OK,FALSE},
1549 {"http://www.google.com]:12345/",S_OK,FALSE},
1550 {"google.com]",S_OK,FALSE},
1551 {"",S_FALSE,FALSE},
1552 {"",S_FALSE,FALSE},
1553 {"www.google.com]",S_OK,FALSE},
1554 {"",S_FALSE,FALSE},
1555 {"/",S_OK,FALSE},
1556 {"/",S_OK,FALSE},
1557 {"",S_FALSE,FALSE},
1558 {"http://www.google.com]:12345/",S_OK,FALSE},
1559 {"http",S_OK,FALSE},
1560 {"",S_FALSE,FALSE},
1561 {"",S_FALSE,FALSE}
1562 },
1563 {
1564 {Uri_HOST_DNS,S_OK,FALSE},
1565 {12345,S_OK,FALSE},
1567 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1568 }
1569 },
1570 /* Unknown scheme types can have invalid % encoded data in the hostname. */
1571 { "zip://w%XXw%GEw.google.com/", 0, S_OK, FALSE, 0,
1572 {
1573 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1574 {"w%XXw%GEw.google.com",S_OK,FALSE},
1575 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1576 {"google.com",S_OK,FALSE},
1577 {"",S_FALSE,FALSE},
1578 {"",S_FALSE,FALSE},
1579 {"w%XXw%GEw.google.com",S_OK,FALSE},
1580 {"",S_FALSE,FALSE},
1581 {"/",S_OK,FALSE},
1582 {"/",S_OK,FALSE},
1583 {"",S_FALSE,FALSE},
1584 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1585 {"zip",S_OK,FALSE},
1586 {"",S_FALSE,FALSE},
1587 {"",S_FALSE,FALSE}
1588 },
1589 {
1590 {Uri_HOST_DNS,S_OK,FALSE},
1591 {0,S_FALSE,FALSE},
1593 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1594 }
1595 },
1596 /* Unknown scheme types hostname doesn't get lower cased. */
1597 { "zip://GOOGLE.com/", 0, S_OK, FALSE, 0,
1598 {
1599 {"zip://GOOGLE.com/",S_OK,FALSE},
1600 {"GOOGLE.com",S_OK,FALSE},
1601 {"zip://GOOGLE.com/",S_OK,FALSE},
1602 {"GOOGLE.com",S_OK,FALSE},
1603 {"",S_FALSE,FALSE},
1604 {"",S_FALSE,FALSE},
1605 {"GOOGLE.com",S_OK,FALSE},
1606 {"",S_FALSE,FALSE},
1607 {"/",S_OK,FALSE},
1608 {"/",S_OK,FALSE},
1609 {"",S_FALSE,FALSE},
1610 {"zip://GOOGLE.com/",S_OK,FALSE},
1611 {"zip",S_OK,FALSE},
1612 {"",S_FALSE,FALSE},
1613 {"",S_FALSE,FALSE}
1614 },
1615 {
1616 {Uri_HOST_DNS,S_OK,FALSE},
1617 {0,S_FALSE,FALSE},
1619 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1620 }
1621 },
1622 /* Hostname gets lower-cased for known scheme types. */
1623 { "http://WWW.GOOGLE.com/", 0, S_OK, FALSE, 0,
1624 {
1625 {"http://www.google.com/",S_OK,FALSE},
1626 {"www.google.com",S_OK,FALSE},
1627 {"http://www.google.com/",S_OK,FALSE},
1628 {"google.com",S_OK,FALSE},
1629 {"",S_FALSE,FALSE},
1630 {"",S_FALSE,FALSE},
1631 {"www.google.com",S_OK,FALSE},
1632 {"",S_FALSE,FALSE},
1633 {"/",S_OK,FALSE},
1634 {"/",S_OK,FALSE},
1635 {"",S_FALSE,FALSE},
1636 {"http://WWW.GOOGLE.com/",S_OK,FALSE},
1637 {"http",S_OK,FALSE},
1638 {"",S_FALSE,FALSE},
1639 {"",S_FALSE,FALSE}
1640 },
1641 {
1642 {Uri_HOST_DNS,S_OK,FALSE},
1643 {80,S_OK,FALSE},
1645 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1646 }
1647 },
1648 /* Characters that get % encoded in the hostname also have their percent
1649 * encoded forms lower cased.
1650 */
1651 { "http://www.%7Cgoogle|.com/", 0, S_OK, FALSE, 0,
1652 {
1653 {"http://www.%7cgoogle%7c.com/",S_OK,FALSE},
1654 {"www.%7cgoogle%7c.com",S_OK,FALSE},
1655 {"http://www.%7cgoogle%7c.com/",S_OK,FALSE},
1656 {"%7cgoogle%7c.com",S_OK,FALSE},
1657 {"",S_FALSE,FALSE},
1658 {"",S_FALSE,FALSE},
1659 {"www.%7cgoogle%7c.com",S_OK,FALSE},
1660 {"",S_FALSE,FALSE},
1661 {"/",S_OK,FALSE},
1662 {"/",S_OK,FALSE},
1663 {"",S_FALSE,FALSE},
1664 {"http://www.%7Cgoogle|.com/",S_OK,FALSE},
1665 {"http",S_OK,FALSE},
1666 {"",S_FALSE,FALSE},
1667 {"",S_FALSE,FALSE}
1668 },
1669 {
1670 {Uri_HOST_DNS,S_OK,FALSE},
1671 {80,S_OK,FALSE},
1673 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1674 }
1675 },
1676 /* IPv4 addresses attached to IPv6 can be included in elisions. */
1677 { "http://[1:2:3:4:5:6:0.0.0.0]", 0, S_OK, FALSE, 0,
1678 {
1679 {"http://[1:2:3:4:5:6::]/",S_OK,FALSE},
1680 {"[1:2:3:4:5:6::]",S_OK,FALSE},
1681 {"http://[1:2:3:4:5:6::]/",S_OK,FALSE},
1682 {"",S_FALSE,FALSE},
1683 {"",S_FALSE,FALSE},
1684 {"",S_FALSE,FALSE},
1685 {"1:2:3:4:5:6::",S_OK,FALSE},
1686 {"",S_FALSE,FALSE},
1687 {"/",S_OK,FALSE},
1688 {"/",S_OK,FALSE},
1689 {"",S_FALSE,FALSE},
1690 {"http://[1:2:3:4:5:6:0.0.0.0]",S_OK,FALSE},
1691 {"http",S_OK,FALSE},
1692 {"",S_FALSE,FALSE},
1693 {"",S_FALSE,FALSE},
1694 },
1695 {
1696 {Uri_HOST_IPV6,S_OK,FALSE},
1697 {80,S_OK,FALSE},
1699 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1700 }
1701 },
1702 /* IPv4 addresses get normalized. */
1703 { "http://[::001.002.003.000]", 0, S_OK, FALSE, 0,
1704 {
1705 {"http://[::1.2.3.0]/",S_OK,FALSE},
1706 {"[::1.2.3.0]",S_OK,FALSE},
1707 {"http://[::1.2.3.0]/",S_OK,FALSE},
1708 {"",S_FALSE,FALSE},
1709 {"",S_FALSE,FALSE},
1710 {"",S_FALSE,FALSE},
1711 {"::1.2.3.0",S_OK,FALSE},
1712 {"",S_FALSE,FALSE},
1713 {"/",S_OK,FALSE},
1714 {"/",S_OK,FALSE},
1715 {"",S_FALSE,FALSE},
1716 {"http://[::001.002.003.000]",S_OK,FALSE},
1717 {"http",S_OK,FALSE},
1718 {"",S_FALSE,FALSE},
1719 {"",S_FALSE,FALSE},
1720 },
1721 {
1722 {Uri_HOST_IPV6,S_OK,FALSE},
1723 {80,S_OK,FALSE},
1725 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1726 }
1727 },
1728 { "http://[::5efe:1.2.3.4]", 0, S_OK, FALSE, 0,
1729 {
1730 {"http://[::5efe:1.2.3.4]/",S_OK,FALSE},
1731 {"[::5efe:1.2.3.4]",S_OK,FALSE},
1732 {"http://[::5efe:1.2.3.4]/",S_OK,FALSE},
1733 {"",S_FALSE,FALSE},
1734 {"",S_FALSE,FALSE},
1735 {"",S_FALSE,FALSE},
1736 {"::5efe:1.2.3.4",S_OK,FALSE},
1737 {"",S_FALSE,FALSE},
1738 {"/",S_OK,FALSE},
1739 {"/",S_OK,FALSE},
1740 {"",S_FALSE,FALSE},
1741 {"http://[::5efe:1.2.3.4]",S_OK,FALSE},
1742 {"http",S_OK,FALSE},
1743 {"",S_FALSE,FALSE},
1744 {"",S_FALSE,FALSE},
1745 },
1746 {
1747 {Uri_HOST_IPV6,S_OK,FALSE},
1748 {80,S_OK,FALSE},
1750 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1751 }
1752 },
1753 /* Windows doesn't do anything to IPv6's in unknown schemes. */
1754 { "zip://[0001:0:000:0004:0005:0006:001.002.003.000]", 0, S_OK, FALSE, 0,
1755 {
1756 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,FALSE},
1757 {"[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK,FALSE},
1758 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,FALSE},
1759 {"",S_FALSE,FALSE},
1760 {"",S_FALSE,FALSE},
1761 {"",S_FALSE,FALSE},
1762 {"0001:0:000:0004:0005:0006:001.002.003.000",S_OK,FALSE},
1763 {"",S_FALSE,FALSE},
1764 {"/",S_OK,FALSE},
1765 {"/",S_OK,FALSE},
1766 {"",S_FALSE,FALSE},
1767 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK,FALSE},
1768 {"zip",S_OK,FALSE},
1769 {"",S_FALSE,FALSE},
1770 {"",S_FALSE,FALSE},
1771 },
1772 {
1773 {Uri_HOST_IPV6,S_OK,FALSE},
1774 {0,S_FALSE,FALSE},
1776 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1777 }
1778 },
1779 /* IPv4 address is converted into 2 h16 components. */
1780 { "http://[ffff::192.222.111.32]", 0, S_OK, FALSE, 0,
1781 {
1782 {"http://[ffff::c0de:6f20]/",S_OK,FALSE},
1783 {"[ffff::c0de:6f20]",S_OK,FALSE},
1784 {"http://[ffff::c0de:6f20]/",S_OK,FALSE},
1785 {"",S_FALSE,FALSE},
1786 {"",S_FALSE,FALSE},
1787 {"",S_FALSE,FALSE},
1788 {"ffff::c0de:6f20",S_OK,FALSE},
1789 {"",S_FALSE,FALSE},
1790 {"/",S_OK,FALSE},
1791 {"/",S_OK,FALSE},
1792 {"",S_FALSE,FALSE},
1793 {"http://[ffff::192.222.111.32]",S_OK,FALSE},
1794 {"http",S_OK,FALSE},
1795 {"",S_FALSE,FALSE},
1796 {"",S_FALSE,FALSE},
1797 },
1798 {
1799 {Uri_HOST_IPV6,S_OK,FALSE},
1800 {80,S_OK,FALSE},
1802 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1803 }
1804 },
1805 /* Max value for a port. */
1806 { "http://google.com:65535", 0, S_OK, FALSE, 0,
1807 {
1808 {"http://google.com:65535/",S_OK,FALSE},
1809 {"google.com:65535",S_OK,FALSE},
1810 {"http://google.com:65535/",S_OK,FALSE},
1811 {"google.com",S_OK,FALSE},
1812 {"",S_FALSE,FALSE},
1813 {"",S_FALSE,FALSE},
1814 {"google.com",S_OK,FALSE},
1815 {"",S_FALSE,FALSE},
1816 {"/",S_OK,FALSE},
1817 {"/",S_OK,FALSE},
1818 {"",S_FALSE,FALSE},
1819 {"http://google.com:65535",S_OK,FALSE},
1820 {"http",S_OK,FALSE},
1821 {"",S_FALSE,FALSE},
1822 {"",S_FALSE,FALSE}
1823 },
1824 {
1825 {Uri_HOST_DNS,S_OK,FALSE},
1826 {65535,S_OK,FALSE},
1828 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1829 }
1830 },
1831 { "zip://google.com:65536", 0, S_OK, FALSE, 0,
1832 {
1833 {"zip://google.com:65536/",S_OK,FALSE},
1834 {"google.com:65536",S_OK,FALSE},
1835 {"zip://google.com:65536/",S_OK,FALSE},
1836 {"google.com:65536",S_OK,FALSE},
1837 {"",S_FALSE,FALSE},
1838 {"",S_FALSE,FALSE},
1839 {"google.com:65536",S_OK,FALSE},
1840 {"",S_FALSE,FALSE},
1841 {"/",S_OK,FALSE},
1842 {"/",S_OK,FALSE},
1843 {"",S_FALSE,FALSE},
1844 {"zip://google.com:65536",S_OK,FALSE},
1845 {"zip",S_OK,FALSE},
1846 {"",S_FALSE,FALSE},
1847 {"",S_FALSE,FALSE}
1848 },
1849 {
1850 {Uri_HOST_DNS,S_OK,FALSE},
1851 {0,S_FALSE,FALSE},
1853 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1854 }
1855 },
1856 { "zip://google.com:65536:25", 0, S_OK, FALSE, 0,
1857 {
1858 {"zip://google.com:65536:25/",S_OK,FALSE},
1859 {"google.com:65536:25",S_OK,FALSE},
1860 {"zip://google.com:65536:25/",S_OK,FALSE},
1861 {"google.com:65536:25",S_OK,FALSE},
1862 {"",S_FALSE,FALSE},
1863 {"",S_FALSE,FALSE},
1864 {"google.com:65536:25",S_OK,FALSE},
1865 {"",S_FALSE,FALSE},
1866 {"/",S_OK,FALSE},
1867 {"/",S_OK,FALSE},
1868 {"",S_FALSE,FALSE},
1869 {"zip://google.com:65536:25",S_OK,FALSE},
1870 {"zip",S_OK,FALSE},
1871 {"",S_FALSE,FALSE},
1872 {"",S_FALSE,FALSE}
1873 },
1874 {
1875 {Uri_HOST_DNS,S_OK,FALSE},
1876 {0,S_FALSE,FALSE},
1878 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1879 }
1880 },
1881 { "zip://[::ffff]:abcd", 0, S_OK, FALSE, 0,
1882 {
1883 {"zip://[::ffff]:abcd/",S_OK,FALSE},
1884 {"[::ffff]:abcd",S_OK,FALSE},
1885 {"zip://[::ffff]:abcd/",S_OK,FALSE},
1886 {"",S_FALSE,FALSE},
1887 {"",S_FALSE,FALSE},
1888 {"",S_FALSE,FALSE},
1889 {"[::ffff]:abcd",S_OK,FALSE},
1890 {"",S_FALSE,FALSE},
1891 {"/",S_OK,FALSE},
1892 {"/",S_OK,FALSE},
1893 {"",S_FALSE,FALSE},
1894 {"zip://[::ffff]:abcd",S_OK,FALSE},
1895 {"zip",S_OK,FALSE},
1896 {"",S_FALSE,FALSE},
1897 {"",S_FALSE,FALSE}
1898 },
1899 {
1900 {Uri_HOST_DNS,S_OK,FALSE},
1901 {0,S_FALSE,FALSE},
1903 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1904 }
1905 },
1906 { "zip://127.0.0.1:abcd", 0, S_OK, FALSE, 0,
1907 {
1908 {"zip://127.0.0.1:abcd/",S_OK,FALSE},
1909 {"127.0.0.1:abcd",S_OK,FALSE},
1910 {"zip://127.0.0.1:abcd/",S_OK,FALSE},
1911 {"0.1:abcd",S_OK,FALSE},
1912 {"",S_FALSE,FALSE},
1913 {"",S_FALSE,FALSE},
1914 {"127.0.0.1:abcd",S_OK,FALSE},
1915 {"",S_FALSE,FALSE},
1916 {"/",S_OK,FALSE},
1917 {"/",S_OK,FALSE},
1918 {"",S_FALSE,FALSE},
1919 {"zip://127.0.0.1:abcd",S_OK,FALSE},
1920 {"zip",S_OK,FALSE},
1921 {"",S_FALSE,FALSE},
1922 {"",S_FALSE,FALSE}
1923 },
1924 {
1925 {Uri_HOST_DNS,S_OK,FALSE},
1926 {0,S_FALSE,FALSE},
1928 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1929 }
1930 },
1931 /* Port is just copied over. */
1932 { "http://google.com:00035", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
1933 {
1934 {"http://google.com:00035",S_OK,FALSE},
1935 {"google.com:00035",S_OK,FALSE},
1936 {"http://google.com:00035",S_OK,FALSE,"http://google.com:35"},
1937 {"google.com",S_OK,FALSE},
1938 {"",S_FALSE,FALSE},
1939 {"",S_FALSE,FALSE},
1940 {"google.com",S_OK,FALSE},
1941 {"",S_FALSE,FALSE},
1942 {"",S_FALSE,FALSE},
1943 {"",S_FALSE,FALSE},
1944 {"",S_FALSE,FALSE},
1945 {"http://google.com:00035",S_OK,FALSE},
1946 {"http",S_OK,FALSE},
1947 {"",S_FALSE,FALSE},
1948 {"",S_FALSE,FALSE}
1949 },
1950 {
1951 {Uri_HOST_DNS,S_OK,FALSE},
1952 {35,S_OK,FALSE},
1954 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1955 }
1956 },
1957 /* Default port is copied over. */
1958 { "http://google.com:80", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
1959 {
1960 {"http://google.com:80",S_OK,FALSE},
1961 {"google.com:80",S_OK,FALSE},
1962 {"http://google.com:80",S_OK,FALSE},
1963 {"google.com",S_OK,FALSE},
1964 {"",S_FALSE,FALSE},
1965 {"",S_FALSE,FALSE},
1966 {"google.com",S_OK,FALSE},
1967 {"",S_FALSE,FALSE},
1968 {"",S_FALSE,FALSE},
1969 {"",S_FALSE,FALSE},
1970 {"",S_FALSE,FALSE},
1971 {"http://google.com:80",S_OK,FALSE},
1972 {"http",S_OK,FALSE},
1973 {"",S_FALSE,FALSE},
1974 {"",S_FALSE,FALSE}
1975 },
1976 {
1977 {Uri_HOST_DNS,S_OK,FALSE},
1978 {80,S_OK,FALSE},
1980 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1981 }
1982 },
1983 { "http://google.com.uk", 0, S_OK, FALSE, 0,
1984 {
1985 {"http://google.com.uk/",S_OK,FALSE},
1986 {"google.com.uk",S_OK,FALSE},
1987 {"http://google.com.uk/",S_OK,FALSE},
1988 {"google.com.uk",S_OK,FALSE,NULL,"com.uk",S_OK}, /* cf. google.co.uk below */
1989 {"",S_FALSE,FALSE},
1990 {"",S_FALSE,FALSE},
1991 {"google.com.uk",S_OK,FALSE},
1992 {"",S_FALSE,FALSE},
1993 {"/",S_OK,FALSE},
1994 {"/",S_OK,FALSE},
1995 {"",S_FALSE,FALSE},
1996 {"http://google.com.uk",S_OK,FALSE},
1997 {"http",S_OK,FALSE},
1998 {"",S_FALSE,FALSE},
1999 {"",S_FALSE,FALSE}
2000 },
2001 {
2002 {Uri_HOST_DNS,S_OK,FALSE},
2003 {80,S_OK,FALSE},
2005 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2006 }
2007 },
2008 { "http://google.co.uk", 0, S_OK, FALSE, 0,
2009 {
2010 {"http://google.co.uk/",S_OK,FALSE},
2011 {"google.co.uk",S_OK,FALSE},
2012 {"http://google.co.uk/",S_OK,FALSE},
2013 {"google.co.uk",S_OK,FALSE},
2014 {"",S_FALSE,FALSE},
2015 {"",S_FALSE,FALSE},
2016 {"google.co.uk",S_OK,FALSE},
2017 {"",S_FALSE,FALSE},
2018 {"/",S_OK,FALSE},
2019 {"/",S_OK,FALSE},
2020 {"",S_FALSE,FALSE},
2021 {"http://google.co.uk",S_OK,FALSE},
2022 {"http",S_OK,FALSE},
2023 {"",S_FALSE,FALSE},
2024 {"",S_FALSE,FALSE}
2025 },
2026 {
2027 {Uri_HOST_DNS,S_OK,FALSE},
2028 {80,S_OK,FALSE},
2030 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2031 }
2032 },
2033 { "http://google.com.com", 0, S_OK, FALSE, 0,
2034 {
2035 {"http://google.com.com/",S_OK,FALSE},
2036 {"google.com.com",S_OK,FALSE},
2037 {"http://google.com.com/",S_OK,FALSE},
2038 {"com.com",S_OK,FALSE},
2039 {"",S_FALSE,FALSE},
2040 {"",S_FALSE,FALSE},
2041 {"google.com.com",S_OK,FALSE},
2042 {"",S_FALSE,FALSE},
2043 {"/",S_OK,FALSE},
2044 {"/",S_OK,FALSE},
2045 {"",S_FALSE,FALSE},
2046 {"http://google.com.com",S_OK,FALSE},
2047 {"http",S_OK,FALSE},
2048 {"",S_FALSE,FALSE},
2049 {"",S_FALSE,FALSE}
2050 },
2051 {
2052 {Uri_HOST_DNS,S_OK,FALSE},
2053 {80,S_OK,FALSE},
2055 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2056 }
2057 },
2058 { "http://google.uk.1", 0, S_OK, FALSE, 0,
2059 {
2060 {"http://google.uk.1/",S_OK,FALSE},
2061 {"google.uk.1",S_OK,FALSE},
2062 {"http://google.uk.1/",S_OK,FALSE},
2063 {"google.uk.1",S_OK,FALSE,NULL,"uk.1",S_OK},
2064 {"",S_FALSE,FALSE},
2065 {"",S_FALSE,FALSE},
2066 {"google.uk.1",S_OK,FALSE},
2067 {"",S_FALSE,FALSE},
2068 {"/",S_OK,FALSE},
2069 {"/",S_OK,FALSE},
2070 {"",S_FALSE,FALSE},
2071 {"http://google.uk.1",S_OK,FALSE},
2072 {"http",S_OK,FALSE},
2073 {"",S_FALSE,FALSE},
2074 {"",S_FALSE,FALSE}
2075 },
2076 {
2077 {Uri_HOST_DNS,S_OK,FALSE},
2078 {80,S_OK,FALSE},
2080 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2081 }
2082 },
2083 /* Since foo isn't a recognized 3 character TLD it's considered the domain name. */
2084 { "http://google.foo.uk", 0, S_OK, FALSE, 0,
2085 {
2086 {"http://google.foo.uk/",S_OK,FALSE},
2087 {"google.foo.uk",S_OK,FALSE},
2088 {"http://google.foo.uk/",S_OK,FALSE},
2089 {"foo.uk",S_OK,FALSE},
2090 {"",S_FALSE,FALSE},
2091 {"",S_FALSE,FALSE},
2092 {"google.foo.uk",S_OK,FALSE},
2093 {"",S_FALSE,FALSE},
2094 {"/",S_OK,FALSE},
2095 {"/",S_OK,FALSE},
2096 {"",S_FALSE,FALSE},
2097 {"http://google.foo.uk",S_OK,FALSE},
2098 {"http",S_OK,FALSE},
2099 {"",S_FALSE,FALSE},
2100 {"",S_FALSE,FALSE}
2101 },
2102 {
2103 {Uri_HOST_DNS,S_OK,FALSE},
2104 {80,S_OK,FALSE},
2106 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2107 }
2108 },
2109 { "http://.com", 0, S_OK, FALSE, 0,
2110 {
2111 {"http://.com/",S_OK,FALSE},
2112 {".com",S_OK,FALSE},
2113 {"http://.com/",S_OK,FALSE},
2114 {".com",S_OK,FALSE},
2115 {"",S_FALSE,FALSE},
2116 {"",S_FALSE,FALSE},
2117 {".com",S_OK,FALSE},
2118 {"",S_FALSE,FALSE},
2119 {"/",S_OK,FALSE},
2120 {"/",S_OK,FALSE},
2121 {"",S_FALSE,FALSE},
2122 {"http://.com",S_OK,FALSE},
2123 {"http",S_OK,FALSE},
2124 {"",S_FALSE,FALSE},
2125 {"",S_FALSE,FALSE}
2126 },
2127 {
2128 {Uri_HOST_DNS,S_OK,FALSE},
2129 {80,S_OK,FALSE},
2131 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2132 }
2133 },
2134 { "http://.uk", 0, S_OK, FALSE, 0,
2135 {
2136 {"http://.uk/",S_OK,FALSE},
2137 {".uk",S_OK,FALSE},
2138 {"http://.uk/",S_OK,FALSE},
2139 {"",S_FALSE,FALSE,NULL,".uk",S_OK},
2140 {"",S_FALSE,FALSE},
2141 {"",S_FALSE,FALSE},
2142 {".uk",S_OK,FALSE},
2143 {"",S_FALSE,FALSE},
2144 {"/",S_OK,FALSE},
2145 {"/",S_OK,FALSE},
2146 {"",S_FALSE,FALSE},
2147 {"http://.uk",S_OK,FALSE},
2148 {"http",S_OK,FALSE},
2149 {"",S_FALSE,FALSE},
2150 {"",S_FALSE,FALSE}
2151 },
2152 {
2153 {Uri_HOST_DNS,S_OK,FALSE},
2154 {80,S_OK,FALSE},
2156 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2157 }
2158 },
2159 { "http://www.co.google.com.[]", 0, S_OK, FALSE, 0,
2160 {
2161 {"http://www.co.google.com.[]/",S_OK,FALSE},
2162 {"www.co.google.com.[]",S_OK,FALSE},
2163 {"http://www.co.google.com.[]/",S_OK,FALSE},
2164 {"google.com.[]",S_OK,FALSE,NULL,"com.[]",S_OK},
2165 {"",S_FALSE,FALSE},
2166 {"",S_FALSE,FALSE},
2167 {"www.co.google.com.[]",S_OK,FALSE},
2168 {"",S_FALSE,FALSE},
2169 {"/",S_OK,FALSE},
2170 {"/",S_OK,FALSE},
2171 {"",S_FALSE,FALSE},
2172 {"http://www.co.google.com.[]",S_OK,FALSE},
2173 {"http",S_OK,FALSE},
2174 {"",S_FALSE,FALSE},
2175 {"",S_FALSE,FALSE}
2176 },
2177 {
2178 {Uri_HOST_DNS,S_OK,FALSE},
2179 {80,S_OK,FALSE},
2181 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2182 }
2183 },
2184 { "http://co.uk", 0, S_OK, FALSE, 0,
2185 {
2186 {"http://co.uk/",S_OK,FALSE},
2187 {"co.uk",S_OK,FALSE},
2188 {"http://co.uk/",S_OK,FALSE},
2189 {"",S_FALSE,FALSE},
2190 {"",S_FALSE,FALSE},
2191 {"",S_FALSE,FALSE},
2192 {"co.uk",S_OK,FALSE},
2193 {"",S_FALSE,FALSE},
2194 {"/",S_OK,FALSE},
2195 {"/",S_OK,FALSE},
2196 {"",S_FALSE,FALSE},
2197 {"http://co.uk",S_OK,FALSE},
2198 {"http",S_OK,FALSE},
2199 {"",S_FALSE,FALSE},
2200 {"",S_FALSE,FALSE}
2201 },
2202 {
2203 {Uri_HOST_DNS,S_OK,FALSE},
2204 {80,S_OK,FALSE},
2206 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2207 }
2208 },
2209 { "http://www.co.google.us.test", 0, S_OK, FALSE, 0,
2210 {
2211 {"http://www.co.google.us.test/",S_OK,FALSE},
2212 {"www.co.google.us.test",S_OK,FALSE},
2213 {"http://www.co.google.us.test/",S_OK,FALSE},
2214 {"us.test",S_OK,FALSE},
2215 {"",S_FALSE,FALSE},
2216 {"",S_FALSE,FALSE},
2217 {"www.co.google.us.test",S_OK,FALSE},
2218 {"",S_FALSE,FALSE},
2219 {"/",S_OK,FALSE},
2220 {"/",S_OK,FALSE},
2221 {"",S_FALSE,FALSE},
2222 {"http://www.co.google.us.test",S_OK,FALSE},
2223 {"http",S_OK,FALSE},
2224 {"",S_FALSE,FALSE},
2225 {"",S_FALSE,FALSE}
2226 },
2227 {
2228 {Uri_HOST_DNS,S_OK,FALSE},
2229 {80,S_OK,FALSE},
2231 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2232 }
2233 },
2234 { "http://gov.uk", 0, S_OK, FALSE, 0,
2235 {
2236 {"http://gov.uk/",S_OK,FALSE},
2237 {"gov.uk",S_OK,FALSE},
2238 {"http://gov.uk/",S_OK,FALSE},
2239 {"",S_FALSE,FALSE},
2240 {"",S_FALSE,FALSE},
2241 {"",S_FALSE,FALSE},
2242 {"gov.uk",S_OK,FALSE},
2243 {"",S_FALSE,FALSE},
2244 {"/",S_OK,FALSE},
2245 {"/",S_OK,FALSE},
2246 {"",S_FALSE,FALSE},
2247 {"http://gov.uk",S_OK,FALSE},
2248 {"http",S_OK,FALSE},
2249 {"",S_FALSE,FALSE},
2250 {"",S_FALSE,FALSE}
2251 },
2252 {
2253 {Uri_HOST_DNS,S_OK,FALSE},
2254 {80,S_OK,FALSE},
2256 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2257 }
2258 },
2259 { "zip://www.google.com\\test", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
2260 {
2261 {"zip://www.google.com\\test",S_OK,FALSE},
2262 {"www.google.com\\test",S_OK,FALSE},
2263 {"zip://www.google.com\\test",S_OK,FALSE},
2264 {"google.com\\test",S_OK,FALSE},
2265 {"",S_FALSE,FALSE},
2266 {"",S_FALSE,FALSE},
2267 {"www.google.com\\test",S_OK,FALSE},
2268 {"",S_FALSE,FALSE},
2269 {"",S_FALSE,FALSE},
2270 {"",S_FALSE,FALSE},
2271 {"",S_FALSE,FALSE},
2272 {"zip://www.google.com\\test",S_OK,FALSE},
2273 {"zip",S_OK,FALSE},
2274 {"",S_FALSE,FALSE},
2275 {"",S_FALSE,FALSE}
2276 },
2277 {
2278 {Uri_HOST_DNS,S_OK,FALSE},
2279 {0,S_FALSE,FALSE},
2281 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2282 }
2283 },
2284 { "urn:excepts:bad:%XY:encoded", 0, S_OK, FALSE, 0,
2285 {
2286 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2287 {"",S_FALSE,FALSE},
2288 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2289 {"",S_FALSE,FALSE},
2290 {"",S_FALSE,FALSE},
2291 {"",S_FALSE,FALSE},
2292 {"",S_FALSE,FALSE},
2293 {"",S_FALSE,FALSE},
2294 {"excepts:bad:%XY:encoded",S_OK,FALSE},
2295 {"excepts:bad:%XY:encoded",S_OK,FALSE},
2296 {"",S_FALSE,FALSE},
2297 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2298 {"urn",S_OK,FALSE},
2299 {"",S_FALSE,FALSE},
2300 {"",S_FALSE,FALSE}
2301 },
2302 {
2303 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2304 {0,S_FALSE,FALSE},
2306 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2307 }
2308 },
2309 /* Since the original URI doesn't contain an extra '/' before the path no % encoded values
2310 * are decoded and all '%' are encoded.
2311 */
2312 { "file://C:/te%3Es%2Et/tes%t.mp3", 0, S_OK, FALSE, 0,
2313 {
2314 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2315 {"",S_FALSE,FALSE},
2316 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2317 {"",S_FALSE,FALSE},
2318 {".mp3",S_OK,FALSE},
2319 {"",S_FALSE,FALSE},
2320 {"",S_FALSE,FALSE},
2321 {"",S_FALSE,FALSE},
2322 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2323 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2324 {"",S_FALSE,FALSE},
2325 {"file://C:/te%3Es%2Et/tes%t.mp3",S_OK,FALSE},
2326 {"file",S_OK,FALSE},
2327 {"",S_FALSE,FALSE},
2328 {"",S_FALSE,FALSE}
2329 },
2330 {
2331 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2332 {0,S_FALSE,FALSE},
2334 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2335 }
2336 },
2337 /* Since there's a '/' in front of the drive letter, any percent encoded, non-forbidden character
2338 * is decoded and only %'s in front of invalid hex digits are encoded.
2339 */
2340 { "file:///C:/te%3Es%2Et/t%23es%t.mp3", 0, S_OK, FALSE, 0,
2341 {
2342 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2343 {"",S_FALSE,FALSE},
2344 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2345 {"",S_FALSE,FALSE},
2346 {".mp3",S_OK,FALSE},
2347 {"",S_FALSE,FALSE},
2348 {"",S_FALSE,FALSE},
2349 {"",S_FALSE,FALSE},
2350 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2351 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2352 {"",S_FALSE,FALSE},
2353 {"file:///C:/te%3Es%2Et/t%23es%t.mp3",S_OK,FALSE},
2354 {"file",S_OK,FALSE},
2355 {"",S_FALSE,FALSE},
2356 {"",S_FALSE,FALSE}
2357 },
2358 {
2359 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2360 {0,S_FALSE,FALSE},
2362 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2363 }
2364 },
2365 /* Only unreserved percent encoded characters are decoded for known schemes that aren't file. */
2366 { "http://[::001.002.003.000]/%3F%23%2E%54/test", 0, S_OK, FALSE, 0,
2367 {
2368 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK,FALSE},
2369 {"[::1.2.3.0]",S_OK,FALSE},
2370 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK,FALSE},
2371 {"",S_FALSE,FALSE},
2372 {"",S_FALSE,FALSE},
2373 {"",S_FALSE,FALSE},
2374 {"::1.2.3.0",S_OK,FALSE},
2375 {"",S_FALSE,FALSE},
2376 {"/%3F%23.T/test",S_OK,FALSE},
2377 {"/%3F%23.T/test",S_OK,FALSE},
2378 {"",S_FALSE,FALSE},
2379 {"http://[::001.002.003.000]/%3F%23%2E%54/test",S_OK,FALSE},
2380 {"http",S_OK,FALSE},
2381 {"",S_FALSE,FALSE},
2382 {"",S_FALSE,FALSE},
2383 },
2384 {
2385 {Uri_HOST_IPV6,S_OK,FALSE},
2386 {80,S_OK,FALSE},
2388 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2389 }
2390 },
2391 /* Forbidden characters are always encoded for file URIs. */
2392 { "file:///C:/\"test\"/test.mp3", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE, 0,
2393 {
2394 {"file:///C:/%22test%22/test.mp3",S_OK,FALSE},
2395 {"",S_FALSE,FALSE},
2396 {"file:///C:/%22test%22/test.mp3",S_OK,FALSE},
2397 {"",S_FALSE,FALSE},
2398 {".mp3",S_OK,FALSE},
2399 {"",S_FALSE,FALSE},
2400 {"",S_FALSE,FALSE},
2401 {"",S_FALSE,FALSE},
2402 {"/C:/%22test%22/test.mp3",S_OK,FALSE},
2403 {"/C:/%22test%22/test.mp3",S_OK,FALSE},
2404 {"",S_FALSE,FALSE},
2405 {"file:///C:/\"test\"/test.mp3",S_OK,FALSE},
2406 {"file",S_OK,FALSE},
2407 {"",S_FALSE,FALSE},
2408 {"",S_FALSE,FALSE}
2409 },
2410 {
2411 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2412 {0,S_FALSE,FALSE},
2414 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2415 }
2416 },
2417 /* Forbidden characters are never encoded for unknown scheme types. */
2418 { "1234://4294967295/<|>\" test<|>", 0, S_OK, FALSE, 0,
2419 {
2420 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2421 {"4294967295",S_OK,FALSE},
2422 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2423 {"",S_FALSE,FALSE},
2424 {"",S_FALSE,FALSE},
2425 {"",S_FALSE,FALSE},
2426 {"4294967295",S_OK,FALSE},
2427 {"",S_FALSE,FALSE},
2428 {"/<|>\" test<|>",S_OK,FALSE},
2429 {"/<|>\" test<|>",S_OK,FALSE},
2430 {"",S_FALSE,FALSE},
2431 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2432 {"1234",S_OK,FALSE},
2433 {"",S_FALSE,FALSE},
2434 {"",S_FALSE,FALSE}
2435 },
2436 {
2437 {Uri_HOST_IPV4,S_OK,FALSE},
2438 {0,S_FALSE,FALSE},
2440 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2441 }
2442 },
2443 /* Make sure forbidden characters are percent encoded. */
2444 { "http://gov.uk/<|> test<|>", 0, S_OK, FALSE, 0,
2445 {
2446 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2447 {"gov.uk",S_OK,FALSE},
2448 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2449 {"",S_FALSE,FALSE},
2450 {"",S_FALSE,FALSE},
2451 {"",S_FALSE,FALSE},
2452 {"gov.uk",S_OK,FALSE},
2453 {"",S_FALSE,FALSE},
2454 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2455 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2456 {"",S_FALSE,FALSE},
2457 {"http://gov.uk/<|> test<|>",S_OK,FALSE},
2458 {"http",S_OK,FALSE},
2459 {"",S_FALSE,FALSE},
2460 {"",S_FALSE,FALSE}
2461 },
2462 {
2463 {Uri_HOST_DNS,S_OK,FALSE},
2464 {80,S_OK,FALSE},
2466 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2467 }
2468 },
2469 { "http://gov.uk/test/../test2/././../test3/.././././", 0, S_OK, FALSE, 0,
2470 {
2471 {"http://gov.uk/",S_OK,FALSE},
2472 {"gov.uk",S_OK,FALSE},
2473 {"http://gov.uk/",S_OK,FALSE},
2474 {"",S_FALSE,FALSE},
2475 {"",S_FALSE,FALSE},
2476 {"",S_FALSE,FALSE},
2477 {"gov.uk",S_OK,FALSE},
2478 {"",S_FALSE,FALSE},
2479 {"/",S_OK,FALSE},
2480 {"/",S_OK,FALSE},
2481 {"",S_FALSE,FALSE},
2482 {"http://gov.uk/test/../test2/././../test3/.././././",S_OK,FALSE},
2483 {"http",S_OK,FALSE},
2484 {"",S_FALSE,FALSE},
2485 {"",S_FALSE,FALSE}
2486 },
2487 {
2488 {Uri_HOST_DNS,S_OK,FALSE},
2489 {80,S_OK,FALSE},
2491 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2492 }
2493 },
2494 { "http://gov.uk/test/test2/../../..", 0, S_OK, FALSE, 0,
2495 {
2496 {"http://gov.uk/",S_OK,FALSE},
2497 {"gov.uk",S_OK,FALSE},
2498 {"http://gov.uk/",S_OK,FALSE},
2499 {"",S_FALSE,FALSE},
2500 {"",S_FALSE,FALSE},
2501 {"",S_FALSE,FALSE},
2502 {"gov.uk",S_OK,FALSE},
2503 {"",S_FALSE,FALSE},
2504 {"/",S_OK,FALSE},
2505 {"/",S_OK,FALSE},
2506 {"",S_FALSE,FALSE},
2507 {"http://gov.uk/test/test2/../../..",S_OK,FALSE},
2508 {"http",S_OK,FALSE},
2509 {"",S_FALSE,FALSE},
2510 {"",S_FALSE,FALSE}
2511 },
2512 {
2513 {Uri_HOST_DNS,S_OK,FALSE},
2514 {80,S_OK,FALSE},
2516 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2517 }
2518 },
2519 { "http://gov.uk/test/test2/../../.", 0, S_OK, FALSE, 0,
2520 {
2521 {"http://gov.uk/",S_OK,FALSE},
2522 {"gov.uk",S_OK,FALSE},
2523 {"http://gov.uk/",S_OK,FALSE},
2524 {"",S_FALSE,FALSE},
2525 {"",S_FALSE,FALSE},
2526 {"",S_FALSE,FALSE},
2527 {"gov.uk",S_OK,FALSE},
2528 {"",S_FALSE,FALSE},
2529 {"/",S_OK,FALSE},
2530 {"/",S_OK,FALSE},
2531 {"",S_FALSE,FALSE},
2532 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2533 {"http",S_OK,FALSE},
2534 {"",S_FALSE,FALSE},
2535 {"",S_FALSE,FALSE}
2536 },
2537 {
2538 {Uri_HOST_DNS,S_OK,FALSE},
2539 {80,S_OK,FALSE},
2541 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2542 }
2543 },
2544 { "file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3", 0, S_OK, FALSE, 0,
2545 {
2546 {"file:///c:/foo%2520bar.mp3",S_OK,FALSE},
2547 {"",S_FALSE,FALSE},
2548 {"file:///c:/foo%2520bar.mp3",S_OK,FALSE},
2549 {"",S_FALSE,FALSE},
2550 {".mp3",S_OK,FALSE},
2551 {"",S_FALSE,FALSE},
2552 {"",S_FALSE,FALSE},
2553 {"",S_FALSE,FALSE},
2554 {"/c:/foo%2520bar.mp3",S_OK,FALSE},
2555 {"/c:/foo%2520bar.mp3",S_OK,FALSE},
2556 {"",S_FALSE,FALSE},
2557 {"file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3",S_OK,FALSE},
2558 {"file",S_OK,FALSE},
2559 {"",S_FALSE,FALSE},
2560 {"",S_FALSE,FALSE}
2561 },
2562 {
2563 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2564 {0,S_FALSE,FALSE},
2566 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2567 }
2568 },
2569 /* Dot removal happens for unknown scheme types. */
2570 { "zip://gov.uk/test/test2/../../.", 0, S_OK, FALSE, 0,
2571 {
2572 {"zip://gov.uk/",S_OK,FALSE},
2573 {"gov.uk",S_OK,FALSE},
2574 {"zip://gov.uk/",S_OK,FALSE},
2575 {"",S_FALSE,FALSE},
2576 {"",S_FALSE,FALSE},
2577 {"",S_FALSE,FALSE},
2578 {"gov.uk",S_OK,FALSE},
2579 {"",S_FALSE,FALSE},
2580 {"/",S_OK,FALSE},
2581 {"/",S_OK,FALSE},
2582 {"",S_FALSE,FALSE},
2583 {"zip://gov.uk/test/test2/../../.",S_OK,FALSE},
2584 {"zip",S_OK,FALSE},
2585 {"",S_FALSE,FALSE},
2586 {"",S_FALSE,FALSE}
2587 },
2588 {
2589 {Uri_HOST_DNS,S_OK,FALSE},
2590 {0,S_FALSE,FALSE},
2592 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2593 }
2594 },
2595 /* Dot removal doesn't happen if NO_CANONICALIZE is set. */
2596 { "http://gov.uk/test/test2/../../.", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
2597 {
2598 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2599 {"gov.uk",S_OK,FALSE},
2600 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2601 {"",S_FALSE,FALSE},
2602 {".",S_OK,FALSE},
2603 {"",S_FALSE,FALSE},
2604 {"gov.uk",S_OK,FALSE},
2605 {"",S_FALSE,FALSE},
2606 {"/test/test2/../../.",S_OK,FALSE},
2607 {"/test/test2/../../.",S_OK,FALSE},
2608 {"",S_FALSE,FALSE},
2609 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2610 {"http",S_OK,FALSE},
2611 {"",S_FALSE,FALSE},
2612 {"",S_FALSE,FALSE}
2613 },
2614 {
2615 {Uri_HOST_DNS,S_OK,FALSE},
2616 {80,S_OK,FALSE},
2618 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2619 }
2620 },
2621 /* Dot removal doesn't happen for wildcard scheme types. */
2622 { "*:gov.uk/test/test2/../../.", 0, S_OK, FALSE, 0,
2623 {
2624 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2625 {"gov.uk",S_OK,FALSE},
2626 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2627 {"",S_FALSE,FALSE},
2628 {".",S_OK,FALSE},
2629 {"",S_FALSE,FALSE},
2630 {"gov.uk",S_OK,FALSE},
2631 {"",S_FALSE,FALSE},
2632 {"/test/test2/../../.",S_OK,FALSE},
2633 {"/test/test2/../../.",S_OK,FALSE},
2634 {"",S_FALSE,FALSE},
2635 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2636 {"*",S_OK,FALSE},
2637 {"",S_FALSE,FALSE},
2638 {"",S_FALSE,FALSE}
2639 },
2640 {
2641 {Uri_HOST_DNS,S_OK,FALSE},
2642 {0,S_FALSE,FALSE},
2644 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2645 }
2646 },
2647 /* Forbidden characters are encoded for opaque known scheme types. */
2648 { "mailto:\"acco<|>unt@example.com\"", 0, S_OK, FALSE, 0,
2649 {
2650 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2651 {"",S_FALSE,FALSE},
2652 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2653 {"",S_FALSE,FALSE},
2654 {".com%22",S_OK,FALSE},
2655 {"",S_FALSE,FALSE},
2656 {"",S_FALSE,FALSE},
2657 {"",S_FALSE,FALSE},
2658 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2659 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2660 {"",S_FALSE,FALSE},
2661 {"mailto:\"acco<|>unt@example.com\"",S_OK,FALSE},
2662 {"mailto",S_OK,FALSE},
2663 {"",S_FALSE,FALSE},
2664 {"",S_FALSE,FALSE}
2665 },
2666 {
2667 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2668 {0,S_FALSE,FALSE},
2670 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2671 }
2672 },
2673 { "news:test.tes<|>t.com", 0, S_OK, FALSE, 0,
2674 {
2675 {"news:test.tes%3C%7C%3Et.com",S_OK,FALSE},
2676 {"",S_FALSE,FALSE},
2677 {"news:test.tes%3C%7C%3Et.com",S_OK,FALSE},
2678 {"",S_FALSE,FALSE},
2679 {".com",S_OK,FALSE},
2680 {"",S_FALSE,FALSE},
2681 {"",S_FALSE,FALSE},
2682 {"",S_FALSE,FALSE},
2683 {"test.tes%3C%7C%3Et.com",S_OK,FALSE},
2684 {"test.tes%3C%7C%3Et.com",S_OK,FALSE},
2685 {"",S_FALSE,FALSE},
2686 {"news:test.tes<|>t.com",S_OK,FALSE},
2687 {"news",S_OK,FALSE},
2688 {"",S_FALSE,FALSE},
2689 {"",S_FALSE,FALSE}
2690 },
2691 {
2692 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2693 {0,S_FALSE,FALSE},
2695 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2696 }
2697 },
2698 /* Don't encode forbidden characters. */
2699 { "news:test.tes<|>t.com", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE, 0,
2700 {
2701 {"news:test.tes<|>t.com",S_OK,FALSE},
2702 {"",S_FALSE,FALSE},
2703 {"news:test.tes<|>t.com",S_OK,FALSE},
2704 {"",S_FALSE,FALSE},
2705 {".com",S_OK,FALSE},
2706 {"",S_FALSE,FALSE},
2707 {"",S_FALSE,FALSE},
2708 {"",S_FALSE,FALSE},
2709 {"test.tes<|>t.com",S_OK,FALSE},
2710 {"test.tes<|>t.com",S_OK,FALSE},
2711 {"",S_FALSE,FALSE},
2712 {"news:test.tes<|>t.com",S_OK,FALSE},
2713 {"news",S_OK,FALSE},
2714 {"",S_FALSE,FALSE},
2715 {"",S_FALSE,FALSE}
2716 },
2717 {
2718 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2719 {0,S_FALSE,FALSE},
2721 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2722 }
2723 },
2724 /* Forbidden characters aren't encoded for unknown, opaque URIs. */
2725 { "urn:test.tes<|>t.com", 0, S_OK, FALSE, 0,
2726 {
2727 {"urn:test.tes<|>t.com",S_OK,FALSE},
2728 {"",S_FALSE,FALSE},
2729 {"urn:test.tes<|>t.com",S_OK,FALSE},
2730 {"",S_FALSE,FALSE},
2731 {".com",S_OK,FALSE},
2732 {"",S_FALSE,FALSE},
2733 {"",S_FALSE,FALSE},
2734 {"",S_FALSE,FALSE},
2735 {"test.tes<|>t.com",S_OK,FALSE},
2736 {"test.tes<|>t.com",S_OK,FALSE},
2737 {"",S_FALSE,FALSE},
2738 {"urn:test.tes<|>t.com",S_OK,FALSE},
2739 {"urn",S_OK,FALSE},
2740 {"",S_FALSE,FALSE},
2741 {"",S_FALSE,FALSE}
2742 },
2743 {
2744 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2745 {0,S_FALSE,FALSE},
2747 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2748 }
2749 },
2750 /* Percent encoded unreserved characters are decoded for known opaque URIs. */
2751 { "news:test.%74%65%73%74.com", 0, S_OK, FALSE, 0,
2752 {
2753 {"news:test.test.com",S_OK,FALSE},
2754 {"",S_FALSE,FALSE},
2755 {"news:test.test.com",S_OK,FALSE},
2756 {"",S_FALSE,FALSE},
2757 {".com",S_OK,FALSE},
2758 {"",S_FALSE,FALSE},
2759 {"",S_FALSE,FALSE},
2760 {"",S_FALSE,FALSE},
2761 {"test.test.com",S_OK,FALSE},
2762 {"test.test.com",S_OK,FALSE},
2763 {"",S_FALSE,FALSE},
2764 {"news:test.%74%65%73%74.com",S_OK,FALSE},
2765 {"news",S_OK,FALSE},
2766 {"",S_FALSE,FALSE},
2767 {"",S_FALSE,FALSE}
2768 },
2769 {
2770 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2771 {0,S_FALSE,FALSE},
2773 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2774 }
2775 },
2776 /* Percent encoded characters are still decoded for known scheme types. */
2777 { "news:test.%74%65%73%74.com", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
2778 {
2779 {"news:test.test.com",S_OK,FALSE},
2780 {"",S_FALSE,FALSE},
2781 {"news:test.test.com",S_OK,FALSE},
2782 {"",S_FALSE,FALSE},
2783 {".com",S_OK,FALSE},
2784 {"",S_FALSE,FALSE},
2785 {"",S_FALSE,FALSE},
2786 {"",S_FALSE,FALSE},
2787 {"test.test.com",S_OK,FALSE},
2788 {"test.test.com",S_OK,FALSE},
2789 {"",S_FALSE,FALSE},
2790 {"news:test.%74%65%73%74.com",S_OK,FALSE},
2791 {"news",S_OK,FALSE},
2792 {"",S_FALSE,FALSE},
2793 {"",S_FALSE,FALSE}
2794 },
2795 {
2796 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2797 {0,S_FALSE,FALSE},
2799 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2800 }
2801 },
2802 /* Percent encoded characters aren't decoded for unknown scheme types. */
2803 { "urn:test.%74%65%73%74.com", 0, S_OK, FALSE, 0,
2804 {
2805 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2806 {"",S_FALSE,FALSE},
2807 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2808 {"",S_FALSE,FALSE},
2809 {".com",S_OK,FALSE},
2810 {"",S_FALSE,FALSE},
2811 {"",S_FALSE,FALSE},
2812 {"",S_FALSE,FALSE},
2813 {"test.%74%65%73%74.com",S_OK,FALSE},
2814 {"test.%74%65%73%74.com",S_OK,FALSE},
2815 {"",S_FALSE,FALSE},
2816 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2817 {"urn",S_OK,FALSE},
2818 {"",S_FALSE,FALSE},
2819 {"",S_FALSE,FALSE}
2820 },
2821 {
2822 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2823 {0,S_FALSE,FALSE},
2825 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2826 }
2827 },
2828 /* Unknown scheme types can have invalid % encoded data in query string. */
2829 { "zip://www.winehq.org/tests/..?query=%xx&return=y", 0, S_OK, FALSE, 0,
2830 {
2831 {"zip://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2832 {"www.winehq.org",S_OK,FALSE},
2833 {"zip://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2834 {"winehq.org",S_OK,FALSE},
2835 {"",S_FALSE,FALSE},
2836 {"",S_FALSE,FALSE},
2837 {"www.winehq.org",S_OK,FALSE},
2838 {"",S_FALSE,FALSE},
2839 {"/",S_OK,FALSE},
2840 {"/?query=%xx&return=y",S_OK,FALSE},
2841 {"?query=%xx&return=y",S_OK,FALSE},
2842 {"zip://www.winehq.org/tests/..?query=%xx&return=y",S_OK,FALSE},
2843 {"zip",S_OK,FALSE},
2844 {"",S_FALSE,FALSE},
2845 {"",S_FALSE,FALSE}
2846 },
2847 {
2848 {Uri_HOST_DNS,S_OK,FALSE},
2849 {0,S_FALSE,FALSE},
2851 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2852 }
2853 },
2854 /* Known scheme types can have invalid % encoded data with the right flags. */
2855 { "http://www.winehq.org/tests/..?query=%xx&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE, 0,
2856 {
2857 {"http://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2858 {"www.winehq.org",S_OK,FALSE},
2859 {"http://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2860 {"winehq.org",S_OK,FALSE},
2861 {"",S_FALSE,FALSE},
2862 {"",S_FALSE,FALSE},
2863 {"www.winehq.org",S_OK,FALSE},
2864 {"",S_FALSE,FALSE},
2865 {"/",S_OK,FALSE},
2866 {"/?query=%xx&return=y",S_OK,FALSE},
2867 {"?query=%xx&return=y",S_OK,FALSE},
2868 {"http://www.winehq.org/tests/..?query=%xx&return=y",S_OK,FALSE},
2869 {"http",S_OK,FALSE},
2870 {"",S_FALSE,FALSE},
2871 {"",S_FALSE,FALSE}
2872 },
2873 {
2874 {Uri_HOST_DNS,S_OK,FALSE},
2875 {80,S_OK,FALSE},
2877 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2878 }
2879 },
2880 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2881 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE, 0,
2882 {
2883 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2884 {"www.winehq.org",S_OK,FALSE},
2885 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2886 {"winehq.org",S_OK,FALSE},
2887 {"",S_FALSE,FALSE},
2888 {"",S_FALSE,FALSE},
2889 {"www.winehq.org",S_OK,FALSE},
2890 {"",S_FALSE,FALSE},
2891 {"/",S_OK,FALSE},
2892 {"/?query=<|>&return=y",S_OK,FALSE},
2893 {"?query=<|>&return=y",S_OK,FALSE},
2894 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2895 {"http",S_OK,FALSE},
2896 {"",S_FALSE,FALSE},
2897 {"",S_FALSE,FALSE}
2898 },
2899 {
2900 {Uri_HOST_DNS,S_OK,FALSE},
2901 {80,S_OK,FALSE},
2903 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2904 }
2905 },
2906 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2907 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE, 0,
2908 {
2909 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2910 {"www.winehq.org",S_OK,FALSE},
2911 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2912 {"winehq.org",S_OK,FALSE},
2913 {"",S_FALSE,FALSE},
2914 {"",S_FALSE,FALSE},
2915 {"www.winehq.org",S_OK,FALSE},
2916 {"",S_FALSE,FALSE},
2917 {"/",S_OK,FALSE},
2918 {"/?query=<|>&return=y",S_OK,FALSE},
2919 {"?query=<|>&return=y",S_OK,FALSE},
2920 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2921 {"http",S_OK,FALSE},
2922 {"",S_FALSE,FALSE},
2923 {"",S_FALSE,FALSE}
2924 },
2925 {
2926 {Uri_HOST_DNS,S_OK,FALSE},
2927 {80,S_OK,FALSE},
2929 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2930 }
2931 },
2932 /* Forbidden characters are encoded for known scheme types. */
2933 { "http://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK, FALSE, 0,
2934 {
2935 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2936 {"www.winehq.org",S_OK,FALSE},
2937 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2938 {"winehq.org",S_OK,FALSE},
2939 {"",S_FALSE,FALSE},
2940 {"",S_FALSE,FALSE},
2941 {"www.winehq.org",S_OK,FALSE},
2942 {"",S_FALSE,FALSE},
2943 {"/",S_OK,FALSE},
2944 {"/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2945 {"?query=%3C%7C%3E&return=y",S_OK,FALSE},
2946 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2947 {"http",S_OK,FALSE},
2948 {"",S_FALSE,FALSE},
2949 {"",S_FALSE,FALSE}
2950 },
2951 {
2952 {Uri_HOST_DNS,S_OK,FALSE},
2953 {80,S_OK,FALSE},
2955 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2956 }
2957 },
2958 /* Forbidden characters are not encoded for unknown scheme types. */
2959 { "zip://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK, FALSE, 0,
2960 {
2961 {"zip://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2962 {"www.winehq.org",S_OK,FALSE},
2963 {"zip://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2964 {"winehq.org",S_OK,FALSE},
2965 {"",S_FALSE,FALSE},
2966 {"",S_FALSE,FALSE},
2967 {"www.winehq.org",S_OK,FALSE},
2968 {"",S_FALSE,FALSE},
2969 {"/",S_OK,FALSE},
2970 {"/?query=<|>&return=y",S_OK,FALSE},
2971 {"?query=<|>&return=y",S_OK,FALSE},
2972 {"zip://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2973 {"zip",S_OK,FALSE},
2974 {"",S_FALSE,FALSE},
2975 {"",S_FALSE,FALSE}
2976 },
2977 {
2978 {Uri_HOST_DNS,S_OK,FALSE},
2979 {0,S_FALSE,FALSE},
2981 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2982 }
2983 },
2984 /* Percent encoded, unreserved characters are decoded for known scheme types. */
2985 { "http://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK, FALSE, 0,
2986 {
2987 {"http://www.winehq.org/?query=01&return=y",S_OK,FALSE},
2988 {"www.winehq.org",S_OK,FALSE},
2989 {"http://www.winehq.org/?query=01&return=y",S_OK,FALSE},
2990 {"winehq.org",S_OK,FALSE},
2991 {"",S_FALSE,FALSE},
2992 {"",S_FALSE,FALSE},
2993 {"www.winehq.org",S_OK,FALSE},
2994 {"",S_FALSE,FALSE},
2995 {"/",S_OK,FALSE},
2996 {"/?query=01&return=y",S_OK,FALSE},
2997 {"?query=01&return=y",S_OK,FALSE},
2998 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
2999 {"http",S_OK,FALSE},
3000 {"",S_FALSE,FALSE},
3001 {"",S_FALSE,FALSE}
3002 },
3003 {
3004 {Uri_HOST_DNS,S_OK,FALSE},
3005 {80,S_OK,FALSE},
3007 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3008 }
3009 },
3010 /* Percent encoded, unreserved characters aren't decoded for unknown scheme types. */
3011 { "zip://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK, FALSE, 0,
3012 {
3013 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
3014 {"www.winehq.org",S_OK,FALSE},
3015 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
3016 {"winehq.org",S_OK,FALSE},
3017 {"",S_FALSE,FALSE},
3018 {"",S_FALSE,FALSE},
3019 {"www.winehq.org",S_OK,FALSE},
3020 {"",S_FALSE,FALSE},
3021 {"/",S_OK,FALSE},
3022 {"/?query=%30%31&return=y",S_OK,FALSE},
3023 {"?query=%30%31&return=y",S_OK,FALSE},
3024 {"zip://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
3025 {"zip",S_OK,FALSE},
3026 {"",S_FALSE,FALSE},
3027 {"",S_FALSE,FALSE}
3028 },
3029 {
3030 {Uri_HOST_DNS,S_OK,FALSE},
3031 {0,S_FALSE,FALSE},
3033 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3034 }
3035 },
3036 /* Percent encoded characters aren't decoded when NO_DECODE_EXTRA_INFO is set. */
3037 { "http://www.winehq.org/tests/..?query=%30%31&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE, 0,
3038 {
3039 {"http://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
3040 {"www.winehq.org",S_OK,FALSE},
3041 {"http://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
3042 {"winehq.org",S_OK,FALSE},
3043 {"",S_FALSE,FALSE},
3044 {"",S_FALSE,FALSE},
3045 {"www.winehq.org",S_OK,FALSE},
3046 {"",S_FALSE,FALSE},
3047 {"/",S_OK,FALSE},
3048 {"/?query=%30%31&return=y",S_OK,FALSE},
3049 {"?query=%30%31&return=y",S_OK,FALSE},
3050 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
3051 {"http",S_OK,FALSE},
3052 {"",S_FALSE,FALSE},
3053 {"",S_FALSE,FALSE}
3054 },
3055 {
3056 {Uri_HOST_DNS,S_OK,FALSE},
3057 {80,S_OK,FALSE},
3059 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3060 }
3061 },
3062 { "http://www.winehq.org?query=12&return=y", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
3063 {
3064 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
3065 {"www.winehq.org",S_OK,FALSE},
3066 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
3067 {"winehq.org",S_OK,FALSE},
3068 {"",S_FALSE,FALSE},
3069 {"",S_FALSE,FALSE},
3070 {"www.winehq.org",S_OK,FALSE},
3071 {"",S_FALSE,FALSE},
3072 {"",S_FALSE,FALSE},
3073 {"?query=12&return=y",S_OK,FALSE},
3074 {"?query=12&return=y",S_OK,FALSE},
3075 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
3076 {"http",S_OK,FALSE},
3077 {"",S_FALSE,FALSE},
3078 {"",S_FALSE,FALSE}
3079 },
3080 {
3081 {Uri_HOST_DNS,S_OK,FALSE},
3082 {80,S_OK,FALSE},
3084 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3085 }
3086 },
3087 /* Unknown scheme types can have invalid % encoded data in fragments. */
3088 { "zip://www.winehq.org/tests/#Te%xx", 0, S_OK, FALSE, 0,
3089 {
3090 {"zip://www.winehq.org/tests/#Te%xx",S_OK,FALSE},
3091 {"www.winehq.org",S_OK,FALSE},
3092 {"zip://www.winehq.org/tests/#Te%xx",S_OK,FALSE},
3093 {"winehq.org",S_OK,FALSE},
3094 {"",S_FALSE,FALSE},
3095 {"#Te%xx",S_OK,FALSE},
3096 {"www.winehq.org",S_OK,FALSE},
3097 {"",S_FALSE,FALSE},
3098 {"/tests/",S_OK,FALSE},
3099 {"/tests/",S_OK,FALSE},
3100 {"",S_FALSE,FALSE},
3101 {"zip://www.winehq.org/tests/#Te%xx",S_OK,FALSE},
3102 {"zip",S_OK,FALSE},
3103 {"",S_FALSE,FALSE},
3104 {"",S_FALSE,FALSE}
3105 },
3106 {
3107 {Uri_HOST_DNS,S_OK,FALSE},
3108 {0,S_FALSE,FALSE},
3110 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3111 }
3112 },
3113 /* Forbidden characters in fragment aren't encoded for unknown schemes. */
3114 { "zip://www.winehq.org/tests/#Te<|>", 0, S_OK, FALSE, 0,
3115 {
3116 {"zip://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3117 {"www.winehq.org",S_OK,FALSE},
3118 {"zip://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3119 {"winehq.org",S_OK,FALSE},
3120 {"",S_FALSE,FALSE},
3121 {"#Te<|>",S_OK,FALSE},
3122 {"www.winehq.org",S_OK,FALSE},
3123 {"",S_FALSE,FALSE},
3124 {"/tests/",S_OK,FALSE},
3125 {"/tests/",S_OK,FALSE},
3126 {"",S_FALSE,FALSE},
3127 {"zip://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3128 {"zip",S_OK,FALSE},
3129 {"",S_FALSE,FALSE},
3130 {"",S_FALSE,FALSE}
3131 },
3132 {
3133 {Uri_HOST_DNS,S_OK,FALSE},
3134 {0,S_FALSE,FALSE},
3136 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3137 }
3138 },
3139 /* Forbidden characters in the fragment are percent encoded for known schemes. */
3140 { "http://www.winehq.org/tests/#Te<|>", 0, S_OK, FALSE, 0,
3141 {
3142 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK,FALSE},
3143 {"www.winehq.org",S_OK,FALSE},
3144 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK,FALSE},
3145 {"winehq.org",S_OK,FALSE},
3146 {"",S_FALSE,FALSE},
3147 {"#Te%3C%7C%3E",S_OK,FALSE},
3148 {"www.winehq.org",S_OK,FALSE},
3149 {"",S_FALSE,FALSE},
3150 {"/tests/",S_OK,FALSE},
3151 {"/tests/",S_OK,FALSE},
3152 {"",S_FALSE,FALSE},
3153 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3154 {"http",S_OK,FALSE},
3155 {"",S_FALSE,FALSE},
3156 {"",S_FALSE,FALSE}
3157 },
3158 {
3159 {Uri_HOST_DNS,S_OK,FALSE},
3160 {80,S_OK,FALSE},
3162 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3163 }
3164 },
3165 /* Forbidden characters aren't encoded in the fragment with this flag. */
3166 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE, 0,
3167 {
3168 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3169 {"www.winehq.org",S_OK,FALSE},
3170 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3171 {"winehq.org",S_OK,FALSE},
3172 {"",S_FALSE,FALSE},
3173 {"#Te<|>",S_OK,FALSE},
3174 {"www.winehq.org",S_OK,FALSE},
3175 {"",S_FALSE,FALSE},
3176 {"/tests/",S_OK,FALSE},
3177 {"/tests/",S_OK,FALSE},
3178 {"",S_FALSE,FALSE},
3179 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3180 {"http",S_OK,FALSE},
3181 {"",S_FALSE,FALSE},
3182 {"",S_FALSE,FALSE}
3183 },
3184 {
3185 {Uri_HOST_DNS,S_OK,FALSE},
3186 {80,S_OK,FALSE},
3188 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3189 }
3190 },
3191 /* Forbidden characters aren't encoded in the fragment with this flag. */
3192 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE, 0,
3193 {
3194 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3195 {"www.winehq.org",S_OK,FALSE},
3196 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3197 {"winehq.org",S_OK,FALSE},
3198 {"",S_FALSE,FALSE},
3199 {"#Te<|>",S_OK,FALSE},
3200 {"www.winehq.org",S_OK,FALSE},
3201 {"",S_FALSE,FALSE},
3202 {"/tests/",S_OK,FALSE},
3203 {"/tests/",S_OK,FALSE},
3204 {"",S_FALSE,FALSE},
3205 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3206 {"http",S_OK,FALSE},
3207 {"",S_FALSE,FALSE},
3208 {"",S_FALSE,FALSE}
3209 },
3210 {
3211 {Uri_HOST_DNS,S_OK,FALSE},
3212 {80,S_OK,FALSE},
3214 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3215 }
3216 },
3217 /* Percent encoded, unreserved characters aren't decoded for known scheme types. */
3218 { "zip://www.winehq.org/tests/#Te%30%31%32", 0, S_OK, FALSE, 0,
3219 {
3220 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3221 {"www.winehq.org",S_OK,FALSE},
3222 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3223 {"winehq.org",S_OK,FALSE},
3224 {"",S_FALSE,FALSE},
3225 {"#Te%30%31%32",S_OK,FALSE},
3226 {"www.winehq.org",S_OK,FALSE},
3227 {"",S_FALSE,FALSE},
3228 {"/tests/",S_OK,FALSE},
3229 {"/tests/",S_OK,FALSE},
3230 {"",S_FALSE,FALSE},
3231 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3232 {"zip",S_OK,FALSE},
3233 {"",S_FALSE,FALSE},
3234 {"",S_FALSE,FALSE}
3235 },
3236 {
3237 {Uri_HOST_DNS,S_OK,FALSE},
3238 {0,S_FALSE,FALSE},
3240 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3241 }
3242 },
3243 /* Percent encoded, unreserved characters are decoded for known schemes. */
3244 { "http://www.winehq.org/tests/#Te%30%31%32", 0, S_OK, FALSE, 0,
3245 {
3246 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3247 {"www.winehq.org",S_OK,FALSE},
3248 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3249 {"winehq.org",S_OK,FALSE},
3250 {"",S_FALSE,FALSE},
3251 {"#Te012",S_OK,FALSE},
3252 {"www.winehq.org",S_OK,FALSE},
3253 {"",S_FALSE,FALSE},
3254 {"/tests/",S_OK,FALSE},
3255 {"/tests/",S_OK,FALSE},
3256 {"",S_FALSE,FALSE},
3257 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3258 {"http",S_OK,FALSE},
3259 {"",S_FALSE,FALSE},
3260 {"",S_FALSE,FALSE}
3261 },
3262 {
3263 {Uri_HOST_DNS,S_OK,FALSE},
3264 {80,S_OK,FALSE},
3266 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3267 }
3268 },
3269 /* Percent encoded, unreserved characters are decoded even if NO_CANONICALIZE is set. */
3270 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
3271 {
3272 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3273 {"www.winehq.org",S_OK,FALSE},
3274 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3275 {"winehq.org",S_OK,FALSE},
3276 {"",S_FALSE,FALSE},
3277 {"#Te012",S_OK,FALSE},
3278 {"www.winehq.org",S_OK,FALSE},
3279 {"",S_FALSE,FALSE},
3280 {"/tests/",S_OK,FALSE},
3281 {"/tests/",S_OK,FALSE},
3282 {"",S_FALSE,FALSE},
3283 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3284 {"http",S_OK,FALSE},
3285 {"",S_FALSE,FALSE},
3286 {"",S_FALSE,FALSE}
3287 },
3288 {
3289 {Uri_HOST_DNS,S_OK,FALSE},
3290 {80,S_OK,FALSE},
3292 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3293 }
3294 },
3295 /* Percent encoded, unreserved characters aren't decoded when NO_DECODE_EXTRA is set. */
3296 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE, 0,
3297 {
3298 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3299 {"www.winehq.org",S_OK,FALSE},
3300 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3301 {"winehq.org",S_OK,FALSE},
3302 {"",S_FALSE,FALSE},
3303 {"#Te%30%31%32",S_OK,FALSE},
3304 {"www.winehq.org",S_OK,FALSE},
3305 {"",S_FALSE,FALSE},
3306 {"/tests/",S_OK,FALSE},
3307 {"/tests/",S_OK,FALSE},
3308 {"",S_FALSE,FALSE},
3309 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3310 {"http",S_OK,FALSE},
3311 {"",S_FALSE,FALSE},
3312 {"",S_FALSE,FALSE}
3313 },
3314 {
3315 {Uri_HOST_DNS,S_OK,FALSE},
3316 {80,S_OK,FALSE},
3318 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3319 }
3320 },
3321 /* Leading/Trailing whitespace is removed. */
3322 { " http://google.com/ ", 0, S_OK, FALSE, 0,
3323 {
3324 {"http://google.com/",S_OK,FALSE},
3325 {"google.com",S_OK,FALSE},
3326 {"http://google.com/",S_OK,FALSE},
3327 {"google.com",S_OK,FALSE},
3328 {"",S_FALSE,FALSE},
3329 {"",S_FALSE,FALSE},
3330 {"google.com",S_OK,FALSE},
3331 {"",S_FALSE,FALSE},
3332 {"/",S_OK,FALSE},
3333 {"/",S_OK,FALSE},
3334 {"",S_FALSE,FALSE},
3335 {"http://google.com/",S_OK,FALSE},
3336 {"http",S_OK,FALSE},
3337 {"",S_FALSE,FALSE},
3338 {"",S_FALSE,FALSE}
3339 },
3340 {
3341 {Uri_HOST_DNS,S_OK,FALSE},
3342 {80,S_OK,FALSE},
3344 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3345 }
3346 },
3347 { "\t\t\r\nhttp\n://g\noogle.co\rm/\n\n\n", 0, S_OK, FALSE, 0,
3348 {
3349 {"http://google.com/",S_OK,FALSE},
3350 {"google.com",S_OK,FALSE},
3351 {"http://google.com/",S_OK,FALSE},
3352 {"google.com",S_OK,FALSE},
3353 {"",S_FALSE,FALSE},
3354 {"",S_FALSE,FALSE},
3355 {"google.com",S_OK,FALSE},
3356 {"",S_FALSE,FALSE},
3357 {"/",S_OK,FALSE},
3358 {"/",S_OK,FALSE},
3359 {"",S_FALSE,FALSE},
3360 {"http://google.com/",S_OK,FALSE},
3361 {"http",S_OK,FALSE},
3362 {"",S_FALSE,FALSE},
3363 {"",S_FALSE,FALSE}
3364 },
3365 {
3366 {Uri_HOST_DNS,S_OK,FALSE},
3367 {80,S_OK,FALSE},
3369 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3370 }
3371 },
3372 { "http://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI, S_OK, FALSE, 0,
3373 {
3374 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK,FALSE},
3375 {"g%0aoogle.co%0dm",S_OK,FALSE},
3376 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK,FALSE},
3377 {"g%0aoogle.co%0dm",S_OK,FALSE},
3378 {"",S_FALSE,FALSE},
3379 {"",S_FALSE,FALSE},
3380 {"g%0aoogle.co%0dm",S_OK,FALSE},
3381 {"",S_FALSE,FALSE},
3382 {"/%0A%0A%0A",S_OK,FALSE},
3383 {"/%0A%0A%0A",S_OK,FALSE},
3384 {"",S_FALSE,FALSE},
3385 {"http://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3386 {"http",S_OK,FALSE},
3387 {"",S_FALSE,FALSE},
3388 {"",S_FALSE,FALSE}
3389 },
3390 {
3391 {Uri_HOST_DNS,S_OK,FALSE},
3392 {80,S_OK,FALSE},
3394 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3395 }
3396 },
3397 { "zip://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI, S_OK, FALSE, 0,
3398 {
3399 {"zip://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3400 {"g\noogle.co\rm",S_OK,FALSE},
3401 {"zip://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3402 {"g\noogle.co\rm",S_OK,FALSE},
3403 {"",S_FALSE,FALSE},
3404 {"",S_FALSE,FALSE},
3405 {"g\noogle.co\rm",S_OK,FALSE},
3406 {"",S_FALSE,FALSE},
3407 {"/\n\n\n",S_OK,FALSE},
3408 {"/\n\n\n",S_OK,FALSE},
3409 {"",S_FALSE,FALSE},
3410 {"zip://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3411 {"zip",S_OK,FALSE},
3412 {"",S_FALSE,FALSE},
3413 {"",S_FALSE,FALSE}
3414 },
3415 {
3416 {Uri_HOST_DNS,S_OK,FALSE},
3417 {0,S_FALSE,FALSE},
3419 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3420 }
3421 },
3422 /* Since file URLs are usually hierarchical, it returns an empty string
3423 * for the absolute URI property since it was declared as an opaque URI.
3424 */
3425 { "file:index.html", 0, S_OK, FALSE, 0,
3426 {
3427 {"",S_FALSE,FALSE},
3428 {"",S_FALSE,FALSE},
3429 {"file:index.html",S_OK,FALSE},
3430 {"",S_FALSE,FALSE},
3431 {".html",S_OK,FALSE},
3432 {"",S_FALSE,FALSE},
3433 {"",S_FALSE,FALSE},
3434 {"",S_FALSE,FALSE},
3435 {"index.html",S_OK,FALSE},
3436 {"index.html",S_OK,FALSE},
3437 {"",S_FALSE,FALSE},
3438 {"file:index.html",S_OK,FALSE},
3439 {"file",S_OK,FALSE},
3440 {"",S_FALSE,FALSE},
3441 {"",S_FALSE,FALSE}
3442 },
3443 {
3444 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3445 {0,S_FALSE,FALSE},
3447 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3448 }
3449 },
3450 /* Doesn't have an absolute since it's opaque, but gets it port set. */
3451 { "http:test.com/index.html", 0, S_OK, FALSE, 0,
3452 {
3453 {"",S_FALSE,FALSE},
3454 {"",S_FALSE,FALSE},
3455 {"http:test.com/index.html",S_OK,FALSE},
3456 {"",S_FALSE,FALSE},
3457 {".html",S_OK,FALSE},
3458 {"",S_FALSE,FALSE},
3459 {"",S_FALSE,FALSE},
3460 {"",S_FALSE,FALSE},
3461 {"test.com/index.html",S_OK,FALSE},
3462 {"test.com/index.html",S_OK,FALSE},
3463 {"",S_FALSE,FALSE},
3464 {"http:test.com/index.html",S_OK,FALSE},
3465 {"http",S_OK,FALSE},
3466 {"",S_FALSE,FALSE},
3467 {"",S_FALSE,FALSE}
3468 },
3469 {
3470 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3471 {80,S_OK,FALSE},
3473 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3474 }
3475 },
3476 { "ftp:test.com/index.html", 0, S_OK, FALSE, 0,
3477 {
3478 {"",S_FALSE,FALSE},
3479 {"",S_FALSE,FALSE},
3480 {"ftp:test.com/index.html",S_OK,FALSE},
3481 {"",S_FALSE,FALSE},
3482 {".html",S_OK,FALSE},
3483 {"",S_FALSE,FALSE},
3484 {"",S_FALSE,FALSE},
3485 {"",S_FALSE,FALSE},
3486 {"test.com/index.html",S_OK,FALSE},
3487 {"test.com/index.html",S_OK,FALSE},
3488 {"",S_FALSE,FALSE},
3489 {"ftp:test.com/index.html",S_OK,FALSE},
3490 {"ftp",S_OK,FALSE},
3491 {"",S_FALSE,FALSE},
3492 {"",S_FALSE,FALSE}
3493 },
3494 {
3495 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3496 {21,S_OK,FALSE},
3498 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3499 }
3500 },
3501 { "file://C|/test.mp3", 0, S_OK, FALSE, 0,
3502 {
3503 {"file:///C:/test.mp3",S_OK,FALSE},
3504 {"",S_FALSE,FALSE},
3505 {"file:///C:/test.mp3",S_OK,FALSE},
3506 {"",S_FALSE,FALSE},
3507 {".mp3",S_OK,FALSE},
3508 {"",S_FALSE,FALSE},
3509 {"",S_FALSE,FALSE},
3510 {"",S_FALSE,FALSE},
3511 {"/C:/test.mp3",S_OK,FALSE},
3512 {"/C:/test.mp3",S_OK,FALSE},
3513 {"",S_FALSE,FALSE},
3514 {"file://C|/test.mp3",S_OK,FALSE},
3515 {"file",S_OK,FALSE},
3516 {"",S_FALSE,FALSE},
3517 {"",S_FALSE,FALSE}
3518 },
3519 {
3520 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3521 {0,S_FALSE,FALSE},
3523 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3524 }
3525 },
3526 { "file:///C|/test.mp3", 0, S_OK, FALSE, 0,
3527 {
3528 {"file:///C:/test.mp3",S_OK,FALSE},
3529 {"",S_FALSE,FALSE},
3530 {"file:///C:/test.mp3",S_OK,FALSE},
3531 {"",S_FALSE,FALSE},
3532 {".mp3",S_OK,FALSE},
3533 {"",S_FALSE,FALSE},
3534 {"",S_FALSE,FALSE},
3535 {"",S_FALSE,FALSE},
3536 {"/C:/test.mp3",S_OK,FALSE},
3537 {"/C:/test.mp3",S_OK,FALSE},
3538 {"",S_FALSE,FALSE},
3539 {"file:///C|/test.mp3",S_OK,FALSE},
3540 {"file",S_OK,FALSE},
3541 {"",S_FALSE,FALSE},
3542 {"",S_FALSE,FALSE}
3543 },
3544 {
3545 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3546 {0,S_FALSE,FALSE},
3548 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3549 }
3550 },
3551 /* Extra '/' isn't added before "c:" since USE_DOS_PATH is set and '/' are converted
3552 * to '\\'.
3553 */
3554 { "file://c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, 0,
3555 {
3556 {"file://c:\\dir\\index.html",S_OK,FALSE},
3557 {"",S_FALSE,FALSE},
3558 {"file://c:\\dir\\index.html",S_OK,FALSE},
3559 {"",S_FALSE,FALSE},
3560 {".html",S_OK,FALSE},
3561 {"",S_FALSE,FALSE},
3562 {"",S_FALSE,FALSE},
3563 {"",S_FALSE,FALSE},
3564 {"c:\\dir\\index.html",S_OK,FALSE},
3565 {"c:\\dir\\index.html",S_OK,FALSE},
3566 {"",S_FALSE,FALSE},
3567 {"file://c:/dir/index.html",S_OK,FALSE},
3568 {"file",S_OK,FALSE},
3569 {"",S_FALSE,FALSE},
3570 {"",S_FALSE,FALSE}
3571 },
3572 {
3573 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3574 {0,S_FALSE,FALSE},
3576 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3577 }
3578 },
3579 /* Extra '/' after "file://" is removed. */
3580 { "file:///c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, 0,
3581 {
3582 {"file://c:\\dir\\index.html",S_OK,FALSE},
3583 {"",S_FALSE,FALSE},
3584 {"file://c:\\dir\\index.html",S_OK,FALSE},
3585 {"",S_FALSE,FALSE},
3586 {".html",S_OK,FALSE},
3587 {"",S_FALSE,FALSE},
3588 {"",S_FALSE,FALSE},
3589 {"",S_FALSE,FALSE},
3590 {"c:\\dir\\index.html",S_OK,FALSE},
3591 {"c:\\dir\\index.html",S_OK,FALSE},
3592 {"",S_FALSE,FALSE},
3593 {"file:///c:/dir/index.html",S_OK,FALSE},
3594 {"file",S_OK,FALSE},
3595 {"",S_FALSE,FALSE},
3596 {"",S_FALSE,FALSE}
3597 },
3598 {
3599 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3600 {0,S_FALSE,FALSE},
3602 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3603 }
3604 },
3605 /* Allow more characters when Uri_CREATE_FILE_USE_DOS_PATH is specified */
3606 { "file:///c:/dir\\%%61%20%5Fname/file%2A.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, 0,
3607 {
3608 {"file://c:\\dir\\%a _name\\file*.html",S_OK,FALSE},
3609 {"",S_FALSE,FALSE},
3610 {"file://c:\\dir\\%a _name\\file*.html",S_OK,FALSE},
3611 {"",S_FALSE,FALSE},
3612 {".html",S_OK,FALSE},
3613 {"",S_FALSE,FALSE},
3614 {"",S_FALSE,FALSE},
3615 {"",S_FALSE,FALSE},
3616 {"c:\\dir\\%a _name\\file*.html",S_OK,FALSE},
3617 {"c:\\dir\\%a _name\\file*.html",S_OK,FALSE},
3618 {"",S_FALSE,FALSE},
3619 {"file:///c:/dir\\%%61%20%5Fname/file%2A.html",S_OK,FALSE},
3620 {"file",S_OK,FALSE},
3621 {"",S_FALSE,FALSE},
3622 {"",S_FALSE,FALSE}
3623 },
3624 {
3625 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3626 {0,S_FALSE,FALSE},
3628 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3629 }
3630 },
3631 { "file://c|/dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, 0,
3632 {
3633 {"file://c:\\dir\\index.html",S_OK,FALSE},
3634 {"",S_FALSE,FALSE},
3635 {"file://c:\\dir\\index.html",S_OK,FALSE},
3636 {"",S_FALSE,FALSE},
3637 {".html",S_OK,FALSE},
3638 {"",S_FALSE,FALSE},
3639 {"",S_FALSE,FALSE},
3640 {"",S_FALSE,FALSE},
3641 {"c:\\dir\\index.html",S_OK,FALSE},
3642 {"c:\\dir\\index.html",S_OK,FALSE},
3643 {"",S_FALSE,FALSE},
3644 {"file://c|/dir\\index.html",S_OK,FALSE},
3645 {"file",S_OK,FALSE},
3646 {"",S_FALSE,FALSE},
3647 {"",S_FALSE,FALSE}
3648 },
3649 {
3650 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3651 {0,S_FALSE,FALSE},
3653 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3654 }
3655 },
3656 /* The backslashes after the scheme name are converted to forward slashes. */
3657 { "file:\\\\c:\\dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, 0,
3658 {
3659 {"file://c:\\dir\\index.html",S_OK,FALSE},
3660 {"",S_FALSE,FALSE},
3661 {"file://c:\\dir\\index.html",S_OK,FALSE},
3662 {"",S_FALSE,FALSE},
3663 {".html",S_OK,FALSE},
3664 {"",S_FALSE,FALSE},
3665 {"",S_FALSE,FALSE},
3666 {"",S_FALSE,FALSE},
3667 {"c:\\dir\\index.html",S_OK,FALSE},
3668 {"c:\\dir\\index.html",S_OK,FALSE},
3669 {"",S_FALSE,FALSE},
3670 {"file:\\\\c:\\dir\\index.html",S_OK,FALSE},
3671 {"file",S_OK,FALSE},
3672 {"",S_FALSE,FALSE},
3673 {"",S_FALSE,FALSE}
3674 },
3675 {
3676 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3677 {0,S_FALSE,FALSE},
3679 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3680 }
3681 },
3682 { "file:\\\\c:/dir/index.html", 0, S_OK, FALSE, 0,
3683 {
3684 {"file:///c:/dir/index.html",S_OK,FALSE},
3685 {"",S_FALSE,FALSE},
3686 {"file:///c:/dir/index.html",S_OK,FALSE},
3687 {"",S_FALSE,FALSE},
3688 {".html",S_OK,FALSE},
3689 {"",S_FALSE,FALSE},
3690 {"",S_FALSE,FALSE},
3691 {"",S_FALSE,FALSE},
3692 {"/c:/dir/index.html",S_OK,FALSE},
3693 {"/c:/dir/index.html",S_OK,FALSE},
3694 {"",S_FALSE,FALSE},
3695 {"file:\\\\c:/dir/index.html",S_OK,FALSE},
3696 {"file",S_OK,FALSE},
3697 {"",S_FALSE,FALSE},
3698 {"",S_FALSE,FALSE}
3699 },
3700 {
3701 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3702 {0,S_FALSE,FALSE},
3704 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3705 }
3706 },
3707 { "http:\\\\google.com", 0, S_OK, FALSE, 0,
3708 {
3709 {"http://google.com/",S_OK,FALSE},
3710 {"google.com",S_OK,FALSE},
3711 {"http://google.com/",S_OK,FALSE},
3712 {"google.com",S_OK,FALSE},
3713 {"",S_FALSE,FALSE},
3714 {"",S_FALSE,FALSE},
3715 {"google.com",S_OK,FALSE},
3716 {"",S_FALSE,FALSE},
3717 {"/",S_OK,FALSE},
3718 {"/",S_OK,FALSE},
3719 {"",S_FALSE,FALSE},
3720 {"http:\\\\google.com",S_OK,FALSE},
3721 {"http",S_OK,FALSE},
3722 {"",S_FALSE,FALSE},
3723 {"",S_FALSE,FALSE}
3724 },
3725 {
3726 {Uri_HOST_DNS,S_OK,FALSE},
3727 {80,S_OK,FALSE},
3729 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3730 }
3731 },
3732 /* the "\\\\" aren't converted to "//" for unknown scheme types and it's considered opaque. */
3733 { "zip:\\\\google.com", 0, S_OK, FALSE, 0,
3734 {
3735 {"zip:\\\\google.com",S_OK,FALSE},
3736 {"",S_FALSE,FALSE},
3737 {"zip:\\\\google.com",S_OK,FALSE},
3738 {"",S_FALSE,FALSE},
3739 {".com",S_OK,FALSE},
3740 {"",S_FALSE,FALSE},
3741 {"",S_FALSE,FALSE},
3742 {"",S_FALSE,FALSE},
3743 {"\\\\google.com",S_OK,FALSE},
3744 {"\\\\google.com",S_OK,FALSE},
3745 {"",S_FALSE,FALSE},
3746 {"zip:\\\\google.com",S_OK,FALSE},
3747 {"zip",S_OK,FALSE},
3748 {"",S_FALSE,FALSE},
3749 {"",S_FALSE,FALSE}
3750 },
3751 {
3752 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3753 {0,S_FALSE,FALSE},
3755 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3756 }
3757 },
3758 /* Dot segments aren't removed. */
3759 { "file://c:\\dir\\../..\\./index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, 0,
3760 {
3761 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3762 {"",S_FALSE,FALSE},
3763 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3764 {"",S_FALSE,FALSE},
3765 {".html",S_OK,FALSE},
3766 {"",S_FALSE,FALSE},
3767 {"",S_FALSE,FALSE},
3768 {"",S_FALSE,FALSE},
3769 {"c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3770 {"c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3771 {"",S_FALSE,FALSE},
3772 {"file://c:\\dir\\../..\\./index.html",S_OK,FALSE},
3773 {"file",S_OK,FALSE},
3774 {"",S_FALSE,FALSE},
3775 {"",S_FALSE,FALSE}
3776 },
3777 {
3778 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3779 {0,S_FALSE,FALSE},
3781 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3782 }
3783 },
3784 /* Forbidden characters aren't percent encoded. */
3785 { "file://c:\\dir\\i^|ndex.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, 0,
3786 {
3787 {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE},
3788 {"",S_FALSE,FALSE},
3789 {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE},
3790 {"",S_FALSE,FALSE},
3791 {".html",S_OK,FALSE},
3792 {"",S_FALSE,FALSE},
3793 {"",S_FALSE,FALSE},
3794 {"",S_FALSE,FALSE},
3795 {"c:\\dir\\i^|ndex.html",S_OK,FALSE},
3796 {"c:\\dir\\i^|ndex.html",S_OK,FALSE},
3797 {"",S_FALSE,FALSE},
3798 {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE},
3799 {"file",S_OK,FALSE},
3800 {"",S_FALSE,FALSE},
3801 {"",S_FALSE,FALSE}
3802 },
3803 {
3804 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3805 {0,S_FALSE,FALSE},
3807 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3808 }
3809 },
3810 /* The '\' are still converted to '/' even though it's an opaque file URI. */
3811 { "file:c:\\dir\\../..\\index.html", 0, S_OK, FALSE, 0,
3812 {
3813 {"",S_FALSE,FALSE},
3814 {"",S_FALSE,FALSE},
3815 {"file:c:/dir/../../index.html",S_OK,FALSE},
3816 {"",S_FALSE,FALSE},
3817 {".html",S_OK,FALSE},
3818 {"",S_FALSE,FALSE},
3819 {"",S_FALSE,FALSE},
3820 {"",S_FALSE,FALSE},
3821 {"c:/dir/../../index.html",S_OK,FALSE},
3822 {"c:/dir/../../index.html",S_OK,FALSE},
3823 {"",S_FALSE,FALSE},
3824 {"file:c:\\dir\\../..\\index.html",S_OK,FALSE},
3825 {"file",S_OK,FALSE},
3826 {"",S_FALSE,FALSE},
3827 {"",S_FALSE,FALSE}
3828 },
3829 {
3830 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3831 {0,S_FALSE,FALSE},
3833 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3834 }
3835 },
3836 /* '/' are still converted to '\' even though it's an opaque URI. */
3837 { "file:c:/dir\\../..\\index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, 0,
3838 {
3839 {"",S_FALSE,FALSE},
3840 {"",S_FALSE,FALSE},
3841 {"file:c:\\dir\\..\\..\\index.html",S_OK,FALSE},
3842 {"",S_FALSE,FALSE},
3843 {".html",S_OK,FALSE},
3844 {"",S_FALSE,FALSE},
3845 {"",S_FALSE,FALSE},
3846 {"",S_FALSE,FALSE},
3847 {"c:\\dir\\..\\..\\index.html",S_OK,FALSE},
3848 {"c:\\dir\\..\\..\\index.html",S_OK,FALSE},
3849 {"",S_FALSE,FALSE},
3850 {"file:c:/dir\\../..\\index.html",S_OK,FALSE},
3851 {"file",S_OK,FALSE},
3852 {"",S_FALSE,FALSE},
3853 {"",S_FALSE,FALSE}
3854 },
3855 {
3856 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3857 {0,S_FALSE,FALSE},
3859 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3860 }
3861 },
3862 /* Forbidden characters aren't percent encoded. */
3863 { "file:c:\\in^|dex.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, 0,
3864 {
3865 {"",S_FALSE,FALSE},
3866 {"",S_FALSE,FALSE},
3867 {"file:c:\\in^|dex.html",S_OK,FALSE},
3868 {"",S_FALSE,FALSE},
3869 {".html",S_OK,FALSE},
3870 {"",S_FALSE,FALSE},
3871 {"",S_FALSE,FALSE},
3872 {"",S_FALSE,FALSE},
3873 {"c:\\in^|dex.html",S_OK,FALSE},
3874 {"c:\\in^|dex.html",S_OK,FALSE},
3875 {"",S_FALSE,FALSE},
3876 {"file:c:\\in^|dex.html",S_OK,FALSE},
3877 {"file",S_OK,FALSE},
3878 {"",S_FALSE,FALSE},
3879 {"",S_FALSE,FALSE}
3880 },
3881 {
3882 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3883 {0,S_FALSE,FALSE},
3885 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3886 }
3887 },
3888 /* Doesn't have a UserName since the ':' appears at the beginning of the
3889 * userinfo section.
3890 */
3891 { "http://:password@gov.uk", 0, S_OK, FALSE, 0,
3892 {
3893 {"http://:password@gov.uk/",S_OK,FALSE},
3894 {":password@gov.uk",S_OK,FALSE},
3895 {"http://gov.uk/",S_OK,FALSE},
3896 {"",S_FALSE,FALSE},
3897 {"",S_FALSE,FALSE},
3898 {"",S_FALSE,FALSE},
3899 {"gov.uk",S_OK,FALSE},
3900 {"password",S_OK,FALSE},
3901 {"/",S_OK,FALSE},
3902 {"/",S_OK,FALSE},
3903 {"",S_FALSE,FALSE},
3904 {"http://:password@gov.uk",S_OK,FALSE},
3905 {"http",S_OK,FALSE},
3906 {":password",S_OK,FALSE},
3907 {"",S_FALSE,FALSE}
3908 },
3909 {
3910 {Uri_HOST_DNS,S_OK,FALSE},
3911 {80,S_OK,FALSE},
3913 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3914 }
3915 },
3916 /* Has a UserName since the userinfo section doesn't contain a password. */
3917 { "http://@gov.uk", 0, S_OK, FALSE, 0,
3918 {
3919 {"http://gov.uk/",S_OK,FALSE,"http://@gov.uk/"},
3920 {"@gov.uk",S_OK,FALSE},
3921 {"http://gov.uk/",S_OK,FALSE},
3922 {"",S_FALSE,FALSE},
3923 {"",S_FALSE,FALSE},
3924 {"",S_FALSE,FALSE},
3925 {"gov.uk",S_OK,FALSE},
3926 {"",S_FALSE,FALSE},
3927 {"/",S_OK,FALSE},
3928 {"/",S_OK,FALSE},
3929 {"",S_FALSE,FALSE},
3930 {"http://@gov.uk",S_OK,FALSE},
3931 {"http",S_OK,FALSE},
3932 {"",S_OK,FALSE},
3933 {"",S_OK,FALSE}
3934 },
3935 {
3936 {Uri_HOST_DNS,S_OK,FALSE},
3937 {80,S_OK,FALSE},
3939 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3940 }
3941 },
3942 /* ":@" not included in the absolute URI. */
3943 { "http://:@gov.uk", 0, S_OK, FALSE, 0,
3944 {
3945 {"http://gov.uk/",S_OK,FALSE,"http://:@gov.uk/"},
3946 {":@gov.uk",S_OK,FALSE},
3947 {"http://gov.uk/",S_OK,FALSE},
3948 {"",S_FALSE,FALSE},
3949 {"",S_FALSE,FALSE},
3950 {"",S_FALSE,FALSE},
3951 {"gov.uk",S_OK,FALSE},
3952 {"",S_OK,FALSE},
3953 {"/",S_OK,FALSE},
3954 {"/",S_OK,FALSE},
3955 {"",S_FALSE,FALSE},
3956 {"http://:@gov.uk",S_OK,FALSE},
3957 {"http",S_OK,FALSE},
3958 {":",S_OK,FALSE},
3959 {"",S_FALSE,FALSE}
3960 },
3961 {
3962 {Uri_HOST_DNS,S_OK,FALSE},
3963 {80,S_OK,FALSE},
3965 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3966 }
3967 },
3968 /* '@' is included because it's an unknown scheme type. */
3969 { "zip://@gov.uk", 0, S_OK, FALSE, 0,
3970 {
3971 {"zip://@gov.uk/",S_OK,FALSE},
3972 {"@gov.uk",S_OK,FALSE},
3973 {"zip://@gov.uk/",S_OK,FALSE},
3974 {"",S_FALSE,FALSE},
3975 {"",S_FALSE,FALSE},
3976 {"",S_FALSE,FALSE},
3977 {"gov.uk",S_OK,FALSE},
3978 {"",S_FALSE,FALSE},
3979 {"/",S_OK,FALSE},
3980 {"/",S_OK,FALSE},
3981 {"",S_FALSE,FALSE},
3982 {"zip://@gov.uk",S_OK,FALSE},
3983 {"zip",S_OK,FALSE},
3984 {"",S_OK,FALSE},
3985 {"",S_OK,FALSE}
3986 },
3987 {
3988 {Uri_HOST_DNS,S_OK,FALSE},
3989 {0,S_FALSE,FALSE},
3991 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3992 }
3993 },
3994 /* ":@" are included because it's an unknown scheme type. */
3995 { "zip://:@gov.uk", 0, S_OK, FALSE, 0,
3996 {
3997 {"zip://:@gov.uk/",S_OK,FALSE},
3998 {":@gov.uk",S_OK,FALSE},
3999 {"zip://:@gov.uk/",S_OK,FALSE},
4000 {"",S_FALSE,FALSE},
4001 {"",S_FALSE,FALSE},
4002 {"",S_FALSE,FALSE},
4003 {"gov.uk",S_OK,FALSE},
4004 {"",S_OK,FALSE},
4005 {"/",S_OK,FALSE},
4006 {"/",S_OK,FALSE},
4007 {"",S_FALSE,FALSE},
4008 {"zip://:@gov.uk",S_OK,FALSE},
4009 {"zip",S_OK,FALSE},
4010 {":",S_OK,FALSE},
4011 {"",S_FALSE,FALSE}
4012 },
4013 {
4014 {Uri_HOST_DNS,S_OK,FALSE},
4015 {0,S_FALSE,FALSE},
4017 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4018 }
4019 },
4020 { "about:blank", 0, S_OK, FALSE, 0,
4021 {
4022 {"about:blank",S_OK,FALSE},
4023 {"",S_FALSE,FALSE},
4024 {"about:blank",S_OK,FALSE},
4025 {"",S_FALSE,FALSE},
4026 {"",S_FALSE,FALSE},
4027 {"",S_FALSE,FALSE},
4028 {"",S_FALSE,FALSE},
4029 {"",S_FALSE,FALSE},
4030 {"blank",S_OK,FALSE},
4031 {"blank",S_OK,FALSE},
4032 {"",S_FALSE,FALSE},
4033 {"about:blank",S_OK,FALSE},
4034 {"about",S_OK,FALSE},
4035 {"",S_FALSE,FALSE},
4036 {"",S_FALSE,FALSE}
4037 },
4038 {
4039 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4040 {0,S_FALSE,FALSE},
4042 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4043 }
4044 },
4045 { "mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",0,S_OK,FALSE, 0,
4046 {
4047 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
4048 {"",S_FALSE,FALSE},
4049 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
4050 {"",S_FALSE,FALSE},
4051 {".htm",S_OK,FALSE},
4052 {"",S_FALSE,FALSE},
4053 {"",S_FALSE,FALSE},
4054 {"",S_FALSE,FALSE},
4055 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
4056 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
4057 {"",S_FALSE,FALSE},
4058 {"mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
4059 {"mk",S_OK,FALSE},
4060 {"",S_FALSE,FALSE},
4061 {"",S_FALSE,FALSE}
4062 },
4063 {
4064 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4065 {0,S_FALSE,FALSE},
4067 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4068 }
4069 },
4070 { "mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",0,S_OK,FALSE, 0,
4071 {
4072 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
4073 {"",S_FALSE,FALSE},
4074 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
4075 {"",S_FALSE,FALSE},
4076 {".htm",S_OK,FALSE},
4077 {"",S_FALSE,FALSE},
4078 {"",S_FALSE,FALSE},
4079 {"",S_FALSE,FALSE},
4080 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
4081 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
4082 {"",S_FALSE,FALSE},
4083 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
4084 {"mk",S_OK,FALSE},
4085 {"",S_FALSE,FALSE},
4086 {"",S_FALSE,FALSE}
4087 },
4088 {
4089 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4090 {0,S_FALSE,FALSE},
4092 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4093 }
4094 },
4095 /* Two '\' are added to the URI when USE_DOS_PATH is set, and it's a UNC path. */
4096 { "file://server/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, 0,
4097 {
4098 {"file://\\\\server\\dir\\index.html",S_OK,FALSE},
4099 {"server",S_OK,FALSE},
4100 {"file://\\\\server\\dir\\index.html",S_OK,FALSE},
4101 {"",S_FALSE,FALSE},
4102 {".html",S_OK,FALSE},
4103 {"",S_FALSE,FALSE},
4104 {"server",S_OK,FALSE},
4105 {"",S_FALSE,FALSE},
4106 {"\\dir\\index.html",S_OK,FALSE},
4107 {"\\dir\\index.html",S_OK,FALSE},
4108 {"",S_FALSE,FALSE},
4109 {"file://server/dir/index.html",S_OK,FALSE},
4110 {"file",S_OK,FALSE},
4111 {"",S_FALSE,FALSE},
4112 {"",S_FALSE,FALSE}
4113 },
4114 {
4115 {Uri_HOST_DNS,S_OK,FALSE},
4116 {0,S_FALSE,FALSE},
4118 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4119 }
4120 },
4121 /* When CreateUri generates an IUri, it still displays the default port in the
4122 * authority.
4123 */
4124 { "http://google.com:80/", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
4125 {
4126 {"http://google.com:80/",S_OK,FALSE},
4127 {"google.com:80",S_OK,FALSE},
4128 {"http://google.com:80/",S_OK,FALSE},
4129 {"google.com",S_OK,FALSE},
4130 {"",S_FALSE,FALSE},
4131 {"",S_FALSE,FALSE},
4132 {"google.com",S_OK,FALSE},
4133 {"",S_FALSE,FALSE},
4134 {"/",S_OK,FALSE},
4135 {"/",S_OK,FALSE},
4136 {"",S_FALSE,FALSE},
4137 {"http://google.com:80/",S_OK,FALSE},
4138 {"http",S_OK,FALSE},
4139 {"",S_FALSE,FALSE},
4140 {"",S_FALSE,FALSE}
4141 },
4142 {
4143 {Uri_HOST_DNS,S_OK,FALSE},
4144 {80,S_OK,FALSE},
4146 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4147 }
4148 },
4149 /* For res URIs the host is everything up until the first '/'. */
4150 { "res://C:\\dir\\file.exe/DATA/test.html", 0, S_OK, FALSE, 0,
4151 {
4152 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK,FALSE},
4153 {"C:\\dir\\file.exe",S_OK,FALSE},
4154 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK,FALSE},
4155 {"",S_FALSE,FALSE},
4156 {".html",S_OK,FALSE},
4157 {"",S_FALSE,FALSE},
4158 {"C:\\dir\\file.exe",S_OK,FALSE},
4159 {"",S_FALSE,FALSE},
4160 {"/DATA/test.html",S_OK,FALSE},
4161 {"/DATA/test.html",S_OK,FALSE},
4162 {"",S_FALSE,FALSE},
4163 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK,FALSE},
4164 {"res",S_OK,FALSE},
4165 {"",S_FALSE,FALSE},
4166 {"",S_FALSE,FALSE}
4167 },
4168 {
4169 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4170 {0,S_FALSE,FALSE},
4172 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4173 }
4174 },
4175 /* Res URI can contain a '|' in the host name. */
4176 { "res://c:\\di|r\\file.exe/test", 0, S_OK, FALSE, 0,
4177 {
4178 {"res://c:\\di|r\\file.exe/test",S_OK,FALSE},
4179 {"c:\\di|r\\file.exe",S_OK,FALSE},
4180 {"res://c:\\di|r\\file.exe/test",S_OK,FALSE},
4181 {"",S_FALSE,FALSE},
4182 {"",S_FALSE,FALSE},
4183 {"",S_FALSE,FALSE},
4184 {"c:\\di|r\\file.exe",S_OK,FALSE},
4185 {"",S_FALSE,FALSE},
4186 {"/test",S_OK,FALSE},
4187 {"/test",S_OK,FALSE},
4188 {"",S_FALSE,FALSE},
4189 {"res://c:\\di|r\\file.exe/test",S_OK,FALSE},
4190 {"res",S_OK,FALSE},
4191 {"",S_FALSE,FALSE},
4192 {"",S_FALSE,FALSE}
4193 },
4194 {
4195 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4196 {0,S_FALSE,FALSE},
4198 {URLZONE_INVALID,E_NOTIMPL,FALSE},
4199 }
4200 },
4201 /* Res URIs can have invalid percent encoded values. */
4202 { "res://c:\\dir%xx\\file.exe/test", 0, S_OK, FALSE, 0,
4203 {
4204 {"res://c:\\dir%xx\\file.exe/test",S_OK,FALSE},
4205 {"c:\\dir%xx\\file.exe",S_OK,FALSE},
4206 {"res://c:\\dir%xx\\file.exe/test",S_OK,FALSE},
4207 {"",S_FALSE,FALSE},
4208 {"",S_FALSE,FALSE},
4209 {"",S_FALSE,FALSE},
4210 {"c:\\dir%xx\\file.exe",S_OK,FALSE},
4211 {"",S_FALSE,FALSE},
4212 {"/test",S_OK,FALSE},
4213 {"/test",S_OK,FALSE},
4214 {"",S_FALSE,FALSE},
4215 {"res://c:\\dir%xx\\file.exe/test",S_OK,FALSE},
4216 {"res",S_OK,FALSE},
4217 {"",S_FALSE,FALSE},
4218 {"",S_FALSE,FALSE}
4219 },
4220 {
4221 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4222 {0,S_FALSE,FALSE},
4224 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4225 }
4226 },
4227 /* Res doesn't get forbidden characters percent encoded in its path. */
4228 { "res://c:\\test/tes<|>t", 0, S_OK, FALSE, 0,
4229 {
4230 {"res://c:\\test/tes<|>t",S_OK,FALSE},
4231 {"c:\\test",S_OK,FALSE},
4232 {"res://c:\\test/tes<|>t",S_OK,FALSE},
4233 {"",S_FALSE,FALSE},
4234 {"",S_FALSE,FALSE},
4235 {"",S_FALSE,FALSE},
4236 {"c:\\test",S_OK,FALSE},
4237 {"",S_FALSE,FALSE},
4238 {"/tes<|>t",S_OK,FALSE},
4239 {"/tes<|>t",S_OK,FALSE},
4240 {"",S_FALSE,FALSE},
4241 {"res://c:\\test/tes<|>t",S_OK,FALSE},
4242 {"res",S_OK,FALSE},
4243 {"",S_FALSE,FALSE},
4244 {"",S_FALSE,FALSE}
4245 },
4246 {
4247 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4248 {0,S_FALSE,FALSE},
4250 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4251 }
4252 },
4253 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK, FALSE, 0,
4254 {
4255 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK,FALSE},
4256 {"",S_FALSE,FALSE},
4257 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK,FALSE},
4258 {"",S_FALSE,FALSE},
4259 {".jpg",S_OK,FALSE},
4260 {"",S_FALSE,FALSE},
4261 {"",S_FALSE,FALSE},
4262 {"",S_FALSE,FALSE},
4263 {"@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK,FALSE},
4264 {"@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK,FALSE},
4265 {"",S_FALSE,FALSE},
4266 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4267 {"mk",S_OK,FALSE},
4268 {"",S_FALSE,FALSE},
4269 {"",S_FALSE,FALSE}
4270 },
4271 {
4272 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4273 {0,S_FALSE,FALSE},
4275 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4276 }
4277 },
4278 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
4279 {
4280 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4281 {"",S_FALSE,FALSE},
4282 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4283 {"",S_FALSE,FALSE},
4284 {".jpg",S_OK,FALSE},
4285 {"",S_FALSE,FALSE},
4286 {"",S_FALSE,FALSE},
4287 {"",S_FALSE,FALSE},
4288 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4289 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4290 {"",S_FALSE,FALSE},
4291 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4292 {"mk",S_OK,FALSE},
4293 {"",S_FALSE,FALSE},
4294 {"",S_FALSE,FALSE}
4295 },
4296 {
4297 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4298 {0,S_FALSE,FALSE},
4300 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4301 }
4302 },
4303 { "xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK, FALSE, 0,
4304 {
4305 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4306 {"",S_FALSE,FALSE},
4307 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4308 {"",S_FALSE,FALSE},
4309 {".jpg",S_OK,FALSE},
4310 {"",S_FALSE,FALSE},
4311 {"",S_FALSE,FALSE},
4312 {"",S_FALSE,FALSE},
4313 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4314 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4315 {"",S_FALSE,FALSE},
4316 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4317 {"xx",S_OK,FALSE},
4318 {"",S_FALSE,FALSE},
4319 {"",S_FALSE,FALSE}
4320 },
4321 {
4322 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4323 {0,S_FALSE,FALSE},
4325 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4326 }
4327 },
4328 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg", 0, S_OK, FALSE, 0,
4329 {
4330 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4331 {"",S_FALSE,FALSE},
4332 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4333 {"",S_FALSE,FALSE},
4334 {".jpg",S_OK,FALSE},
4335 {"",S_FALSE,FALSE},
4336 {"",S_FALSE,FALSE},
4337 {"",S_FALSE,FALSE},
4338 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4339 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4340 {"",S_FALSE,FALSE},
4341 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg",S_OK,FALSE},
4342 {"mk",S_OK,FALSE},
4343 {"",S_FALSE,FALSE},
4344 {"",S_FALSE,FALSE}
4345 },
4346 {
4347 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4348 {0,S_FALSE,FALSE},
4350 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4351 }
4352 },
4353 { "mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg", 0, S_OK, FALSE, 0,
4354 {
4355 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4356 {"",S_FALSE,FALSE},
4357 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4358 {"",S_FALSE,FALSE},
4359 {".jpg",S_OK,FALSE},
4360 {"",S_FALSE,FALSE},
4361 {"",S_FALSE,FALSE},
4362 {"",S_FALSE,FALSE},
4363 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4364 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4365 {"",S_FALSE,FALSE},
4366 {"mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg",S_OK,FALSE},
4367 {"mk",S_OK,FALSE},
4368 {"",S_FALSE,FALSE},
4369 {"",S_FALSE,FALSE}
4370 },
4371 {
4372 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4373 {0,S_FALSE,FALSE},
4375 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4376 }
4377 },
4378 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg", 0, S_OK, FALSE, 0,
4379 {
4380 {"mk:images/xxx.jpg",S_OK,FALSE},
4381 {"",S_FALSE,FALSE},
4382 {"mk:images/xxx.jpg",S_OK,FALSE},
4383 {"",S_FALSE,FALSE},
4384 {".jpg",S_OK,FALSE},
4385 {"",S_FALSE,FALSE},
4386 {"",S_FALSE,FALSE},
4387 {"",S_FALSE,FALSE},
4388 {"images/xxx.jpg",S_OK,FALSE},
4389 {"images/xxx.jpg",S_OK,FALSE},
4390 {"",S_FALSE,FALSE},
4391 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg",S_OK,FALSE},
4392 {"mk",S_OK,FALSE},
4393 {"",S_FALSE,FALSE},
4394 {"",S_FALSE,FALSE}
4395 },
4396 {
4397 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4398 {0,S_FALSE,FALSE},
4400 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4401 }
4402 },
4403 { "", Uri_CREATE_ALLOW_RELATIVE, S_OK, FALSE, 0,
4404 {
4405 {"",S_OK,FALSE},
4406 {"",S_FALSE,FALSE},
4407 {"",S_OK,FALSE},
4408 {"",S_FALSE,FALSE},
4409 {"",S_FALSE,FALSE},
4410 {"",S_FALSE,FALSE},
4411 {"",S_FALSE,FALSE},
4412 {"",S_FALSE,FALSE},
4413 {"",S_OK,FALSE},
4414 {"",S_OK,FALSE},
4415 {"",S_FALSE,FALSE},
4416 {"",S_OK,FALSE},
4417 {"",S_FALSE,FALSE},
4418 {"",S_FALSE,FALSE},
4419 {"",S_FALSE,FALSE}
4420 },
4421 {
4422 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4423 {0,S_FALSE,FALSE},
4425 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4426 }
4427 },
4428 { " \t ", Uri_CREATE_ALLOW_RELATIVE, S_OK, FALSE, 0,
4429 {
4430 {"",S_OK,FALSE},
4431 {"",S_FALSE,FALSE},
4432 {"",S_OK,FALSE},
4433 {"",S_FALSE,FALSE},
4434 {"",S_FALSE,FALSE},
4435 {"",S_FALSE,FALSE},
4436 {"",S_FALSE,FALSE},
4437 {"",S_FALSE,FALSE},
4438 {"",S_OK,FALSE},
4439 {"",S_OK,FALSE},
4440 {"",S_FALSE,FALSE},
4441 {"",S_OK,FALSE},
4442 {"",S_FALSE,FALSE},
4443 {"",S_FALSE,FALSE},
4444 {"",S_FALSE,FALSE}
4445 },
4446 {
4447 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4448 {0,S_FALSE,FALSE},
4450 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4451 }
4452 },
4453 { "javascript:void", 0, S_OK, FALSE, 0,
4454 {
4455 {"javascript:void",S_OK},
4456 {"",S_FALSE},
4457 {"javascript:void",S_OK},
4458 {"",S_FALSE},
4459 {"",S_FALSE},
4460 {"",S_FALSE},
4461 {"",S_FALSE},
4462 {"",S_FALSE},
4463 {"void",S_OK},
4464 {"void",S_OK},
4465 {"",S_FALSE},
4466 {"javascript:void",S_OK},
4467 {"javascript",S_OK},
4468 {"",S_FALSE},
4469 {"",S_FALSE}
4470 },
4471 {
4472 {Uri_HOST_UNKNOWN,S_OK},
4473 {0,S_FALSE},
4475 {URLZONE_INVALID,E_NOTIMPL}
4476 }
4477 },
4478 { "javascript://undefined", 0, S_OK, FALSE, 0,
4479 {
4480 {"javascript://undefined",S_OK},
4481 {"",S_FALSE},
4482 {"javascript://undefined",S_OK},
4483 {"",S_FALSE},
4484 {"",S_FALSE},
4485 {"",S_FALSE},
4486 {"",S_FALSE},
4487 {"",S_FALSE},
4488 {"//undefined",S_OK},
4489 {"//undefined",S_OK},
4490 {"",S_FALSE},
4491 {"javascript://undefined",S_OK},
4492 {"javascript",S_OK},
4493 {"",S_FALSE},
4494 {"",S_FALSE}
4495 },
4496 {
4497 {Uri_HOST_UNKNOWN,S_OK},
4498 {0,S_FALSE},
4500 {URLZONE_INVALID,E_NOTIMPL}
4501 }
4502 },
4503 { "JavaSCript:escape('/\\?#?')", 0, S_OK, FALSE, 0,
4504 {
4505 {"javascript:escape('/\\?#?')",S_OK},
4506 {"",S_FALSE},
4507 {"javascript:escape('/\\?#?')",S_OK},
4508 {"",S_FALSE},
4509 {"",S_FALSE},
4510 {"",S_FALSE},
4511 {"",S_FALSE},
4512 {"",S_FALSE},
4513 {"escape('/\\?#?')",S_OK},
4514 {"escape('/\\?#?')",S_OK},
4515 {"",S_FALSE},
4516 {"JavaSCript:escape('/\\?#?')",S_OK},
4517 {"javascript",S_OK},
4518 {"",S_FALSE},
4519 {"",S_FALSE}
4520 },
4521 {
4522 {Uri_HOST_UNKNOWN,S_OK},
4523 {0,S_FALSE},
4525 {URLZONE_INVALID,E_NOTIMPL}
4526 }
4527 },
4528 { "*://google.com", 0, S_OK, FALSE, 0,
4529 {
4530 {"*:google.com/",S_OK,FALSE},
4531 {"google.com",S_OK},
4532 {"*:google.com/",S_OK,FALSE},
4533 {"google.com",S_OK,FALSE},
4534 {"",S_FALSE,FALSE},
4535 {"",S_FALSE,FALSE},
4536 {"google.com",S_OK,FALSE},
4537 {"",S_FALSE,FALSE},
4538 {"/",S_OK,FALSE},
4539 {"/",S_OK,FALSE},
4540 {"",S_FALSE,FALSE},
4541 {"*://google.com",S_OK,FALSE},
4542 {"*",S_OK,FALSE},
4543 {"",S_FALSE,FALSE},
4544 {"",S_FALSE,FALSE}
4545 },
4546 {
4547 {Uri_HOST_DNS,S_OK,FALSE},
4548 {0,S_FALSE,FALSE},
4550 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4551 }
4552 },
4553 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt", 0, S_OK, FALSE, 0,
4554 {
4555 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK},
4556 {"",S_FALSE},
4557 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK},
4558 {"",S_FALSE},
4559 {".txt",S_OK},
4560 {"",S_FALSE},
4561 {"",S_FALSE},
4562 {"",S_FALSE},
4563 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK},
4564 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK},
4565 {"",S_FALSE},
4566 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK},
4567 {"mk",S_OK},
4568 {"",S_FALSE},
4569 {"",S_FALSE}
4570 },
4571 {
4572 {Uri_HOST_UNKNOWN,S_OK},
4573 {0,S_FALSE},
4575 {URLZONE_INVALID,E_NOTIMPL}
4576 }
4577 },
4578 { "gopher://test.winehq.org:151/file.txt", 0, S_OK, FALSE, 0,
4579 {
4580 {"gopher://test.winehq.org:151/file.txt",S_OK},
4581 {"test.winehq.org:151",S_OK},
4582 {"gopher://test.winehq.org:151/file.txt",S_OK},
4583 {"winehq.org",S_OK},
4584 {".txt",S_OK},
4585 {"",S_FALSE},
4586 {"test.winehq.org",S_OK},
4587 {"",S_FALSE},
4588 {"/file.txt",S_OK},
4589 {"/file.txt",S_OK},
4590 {"",S_FALSE},
4591 {"gopher://test.winehq.org:151/file.txt",S_OK},
4592 {"gopher",S_OK},
4593 {"",S_FALSE},
4594 {"",S_FALSE}
4595 },
4596 {
4597 {Uri_HOST_DNS,S_OK},
4598 {151,S_OK},
4600 {URLZONE_INVALID,E_NOTIMPL}
4601 }
4602 },
4603 { "//host.com/path/file.txt?query", Uri_CREATE_ALLOW_RELATIVE, S_OK, FALSE, 0,
4604 {
4605 {"//host.com/path/file.txt?query",S_OK},
4606 {"host.com",S_OK},
4607 {"//host.com/path/file.txt?query",S_OK},
4608 {"host.com",S_OK},
4609 {".txt",S_OK},
4610 {"",S_FALSE},
4611 {"host.com",S_OK},
4612 {"",S_FALSE},
4613 {"/path/file.txt",S_OK},
4614 {"/path/file.txt?query",S_OK},
4615 {"?query",S_OK},
4616 {"//host.com/path/file.txt?query",S_OK},
4617 {"",S_FALSE},
4618 {"",S_FALSE},
4619 {"",S_FALSE},
4620 },
4621 {
4622 {Uri_HOST_DNS,S_OK},
4623 {0,S_FALSE},
4625 {URLZONE_INVALID,E_NOTIMPL}
4626 }
4627 },
4628 { "//host/path/file.txt?query", Uri_CREATE_ALLOW_RELATIVE, S_OK, FALSE, 0,
4629 {
4630 {"//host/path/file.txt?query",S_OK},
4631 {"host",S_OK},
4632 {"//host/path/file.txt?query",S_OK},
4633 {"",S_FALSE},
4634 {".txt",S_OK},
4635 {"",S_FALSE},
4636 {"host",S_OK},
4637 {"",S_FALSE},
4638 {"/path/file.txt",S_OK},
4639 {"/path/file.txt?query",S_OK},
4640 {"?query",S_OK},
4641 {"//host/path/file.txt?query",S_OK},
4642 {"",S_FALSE},
4643 {"",S_FALSE},
4644 {"",S_FALSE},
4645 },
4646 {
4647 {Uri_HOST_DNS,S_OK},
4648 {0,S_FALSE},
4650 {URLZONE_INVALID,E_NOTIMPL}
4651 }
4652 },
4653 { "//host", Uri_CREATE_ALLOW_RELATIVE, S_OK, FALSE, 0,
4654 {
4655 {"//host/",S_OK},
4656 {"host",S_OK},
4657 {"//host/",S_OK},
4658 {"",S_FALSE},
4659 {"",S_FALSE},
4660 {"",S_FALSE},
4661 {"host",S_OK},
4662 {"",S_FALSE},
4663 {"/",S_OK},
4664 {"/",S_OK},
4665 {"",S_FALSE},
4666 {"//host",S_OK},
4667 {"",S_FALSE},
4668 {"",S_FALSE},
4669 {"",S_FALSE},
4670 },
4671 {
4672 {Uri_HOST_DNS,S_OK},
4673 {0,S_FALSE},
4675 {URLZONE_INVALID,E_NOTIMPL}
4676 }
4677 },
4678 { "mailto://", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
4679 {
4680 {"mailto:",S_OK},
4681 {"",S_FALSE},
4682 {"mailto:",S_OK},
4683 {"",S_FALSE},
4684 {"",S_FALSE},
4685 {"",S_FALSE},
4686 {"",S_FALSE},
4687 {"",S_FALSE},
4688 {"",S_FALSE},
4689 {"",S_FALSE},
4690 {"",S_FALSE},
4691 {"mailto://",S_OK,FALSE,"mailto:"},
4692 {"mailto",S_OK},
4693 {"",S_FALSE},
4694 {"",S_FALSE}
4695 },
4696 {
4697 {Uri_HOST_UNKNOWN,S_OK},
4698 {0,S_FALSE},
4700 {URLZONE_INVALID,E_NOTIMPL}
4701 }
4702 },
4703 { "mailto://a@b.com", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, 0,
4704 {
4705 {"mailto:a@b.com",S_OK},
4706 {"",S_FALSE},
4707 {"mailto:a@b.com",S_OK},
4708 {"",S_FALSE},
4709 {".com",S_OK},
4710 {"",S_FALSE},
4711 {"",S_FALSE},
4712 {"",S_FALSE},
4713 {"a@b.com",S_OK},
4714 {"a@b.com",S_OK},
4715 {"",S_FALSE},
4716 {"mailto://a@b.com",S_OK,FALSE,"mailto:a@b.com"},
4717 {"mailto",S_OK},
4718 {"",S_FALSE},
4719 {"",S_FALSE}
4720 },
4721 {
4722 {Uri_HOST_UNKNOWN,S_OK},
4723 {0,S_FALSE},
4725 {URLZONE_INVALID,E_NOTIMPL}
4726 }
4727 },
4728 { "c:\\test file.html", Uri_CREATE_FILE_USE_DOS_PATH|Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE, 0,
4729 {
4730 {"file://c:\\test file.html",S_OK,FALSE},
4731 {"",S_FALSE,FALSE},
4732 {"file://c:\\test file.html",S_OK,FALSE},
4733 {"",S_FALSE,FALSE},
4734 {".html",S_OK,FALSE},
4735 {"",S_FALSE,FALSE},
4736 {"",S_FALSE,FALSE},
4737 {"",S_FALSE,FALSE},
4738 {"c:\\test file.html",S_OK,FALSE},
4739 {"c:\\test file.html",S_OK,FALSE},
4740 {"",S_FALSE,FALSE},
4741 {"c:\\test file.html",S_OK,FALSE},
4742 {"file",S_OK,FALSE},
4743 {"",S_FALSE,FALSE},
4744 {"",S_FALSE,FALSE}
4745 },
4746 {
4747 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4748 {0,S_FALSE,FALSE},
4750 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4751 }
4752 },
4753 { "c:\\test%20file.html", Uri_CREATE_FILE_USE_DOS_PATH|Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE, 0,
4754 {
4755 {"file://c:\\test%20file.html",S_OK,FALSE},
4756 {"",S_FALSE,FALSE},
4757 {"file://c:\\test%20file.html",S_OK,FALSE},
4758 {"",S_FALSE,FALSE},
4759 {".html",S_OK,FALSE},
4760 {"",S_FALSE,FALSE},
4761 {"",S_FALSE,FALSE},
4762 {"",S_FALSE,FALSE},
4763 {"c:\\test%20file.html",S_OK,FALSE},
4764 {"c:\\test%20file.html",S_OK,FALSE},
4765 {"",S_FALSE,FALSE},
4766 {"c:\\test%20file.html",S_OK,FALSE},
4767 {"file",S_OK,FALSE},
4768 {"",S_FALSE,FALSE},
4769 {"",S_FALSE,FALSE}
4770 },
4771 {
4772 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4773 {0,S_FALSE,FALSE},
4775 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4776 }
4777 },
4778 { "c:\\test file.html", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE, 0,
4779 {
4780 {"file:///c:/test%20file.html",S_OK,FALSE},
4781 {"",S_FALSE,FALSE},
4782 {"file:///c:/test%20file.html",S_OK,FALSE},
4783 {"",S_FALSE,FALSE},
4784 {".html",S_OK,FALSE},
4785 {"",S_FALSE,FALSE},
4786 {"",S_FALSE,FALSE},
4787 {"",S_FALSE,FALSE},
4788 {"/c:/test%20file.html",S_OK,FALSE},
4789 {"/c:/test%20file.html",S_OK,FALSE},
4790 {"",S_FALSE,FALSE},
4791 {"c:\\test file.html",S_OK,FALSE},
4792 {"file",S_OK,FALSE},
4793 {"",S_FALSE,FALSE},
4794 {"",S_FALSE,FALSE}
4795 },
4796 {
4797 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4798 {0,S_FALSE,FALSE},
4800 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4801 }
4802 },
4803 { "c:\\test%20file.html", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE, 0,
4804 {
4805 {"file:///c:/test%2520file.html",S_OK,FALSE},
4806 {"",S_FALSE,FALSE},
4807 {"file:///c:/test%2520file.html",S_OK,FALSE},
4808 {"",S_FALSE,FALSE},
4809 {".html",S_OK,FALSE},
4810 {"",S_FALSE,FALSE},
4811 {"",S_FALSE,FALSE},
4812 {"",S_FALSE,FALSE},
4813 {"/c:/test%2520file.html",S_OK,FALSE},
4814 {"/c:/test%2520file.html",S_OK,FALSE},
4815 {"",S_FALSE,FALSE},
4816 {"c:\\test%20file.html",S_OK,FALSE},
4817 {"file",S_OK,FALSE},
4818 {"",S_FALSE,FALSE},
4819 {"",S_FALSE,FALSE}
4820 },
4821 {
4822 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4823 {0,S_FALSE,FALSE},
4825 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4826 }
4827 },
4828 /* Path with Unicode characters. Unicode characters should not be encoded */
4829 {/* "http://127.0.0.1/测试/test.txt" with Chinese in UTF-8 encoding */
4830 "http://127.0.0.1/\xE6\xB5\x8B\xE8\xAF\x95/test.txt", 0, S_OK, FALSE, 0,
4831 {
4832 {"http://127.0.0.1/\xE6\xB5\x8B\xE8\xAF\x95/test.txt",S_OK,FALSE},
4833 {"127.0.0.1",S_OK,FALSE},
4834 {"http://127.0.0.1/\xE6\xB5\x8B\xE8\xAF\x95/test.txt",S_OK,FALSE},
4835 {"",S_FALSE,FALSE},
4836 {".txt",S_OK,FALSE},
4837 {"",S_FALSE,FALSE},
4838 {"127.0.0.1",S_OK,FALSE},
4839 {"",S_FALSE,FALSE},
4840 {"/\xE6\xB5\x8B\xE8\xAF\x95/test.txt",S_OK,FALSE},
4841 {"/\xE6\xB5\x8B\xE8\xAF\x95/test.txt",S_OK,FALSE},
4842 {"",S_FALSE,FALSE},
4843 {"http://127.0.0.1/\xE6\xB5\x8B\xE8\xAF\x95/test.txt",S_OK,FALSE},
4844 {"http",S_OK,FALSE},
4845 {"",S_FALSE,FALSE},
4846 {"",S_FALSE,FALSE}
4847 },
4848 {
4849 {Uri_HOST_IPV4,S_OK,FALSE},
4850 {80,S_OK,FALSE},
4852 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4853 }
4854 },
4855 { "file:\xE6\xB5\x8B\xE8\xAF\x95.html", 0, S_OK, FALSE, 0,
4856 {
4857 {"",S_FALSE,FALSE},
4858 {"",S_FALSE,FALSE},
4859 {"file:\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK,FALSE},
4860 {"",S_FALSE,FALSE},
4861 {".html",S_OK,FALSE},
4862 {"",S_FALSE,FALSE},
4863 {"",S_FALSE,FALSE},
4864 {"",S_FALSE,FALSE},
4865 {"\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK,FALSE},
4866 {"\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK,FALSE},
4867 {"",S_FALSE,FALSE},
4868 {"file:\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK,FALSE},
4869 {"file",S_OK,FALSE},
4870 {"",S_FALSE,FALSE},
4871 {"",S_FALSE,FALSE}
4872 },
4873 {
4874 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4875 {0,S_FALSE,FALSE},
4877 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4878 }
4879 },
4880 /* Username with Unicode characters. Unicode characters should not be encoded */
4881 { "ftp://\xE6\xB5\x8B\xE8\xAF\x95:wine@ftp.winehq.org:9999/dir/foobar.txt", 0, S_OK, FALSE, 0,
4882 {
4883 {"ftp://\xE6\xB5\x8B\xE8\xAF\x95:wine@ftp.winehq.org:9999/dir/foobar.txt",S_OK,FALSE},
4884 {"\xE6\xB5\x8B\xE8\xAF\x95:wine@ftp.winehq.org:9999",S_OK,FALSE},
4885 {"ftp://ftp.winehq.org:9999/dir/foobar.txt",S_OK,FALSE},
4886 {"winehq.org",S_OK,FALSE},
4887 {".txt",S_OK,FALSE},
4888 {"",S_FALSE,FALSE},
4889 {"ftp.winehq.org",S_OK,FALSE},
4890 {"wine",S_OK,FALSE},
4891 {"/dir/foobar.txt",S_OK,FALSE},
4892 {"/dir/foobar.txt",S_OK,FALSE},
4893 {"",S_FALSE,FALSE},
4894 {"ftp://\xE6\xB5\x8B\xE8\xAF\x95:wine@ftp.winehq.org:9999/dir/foobar.txt",S_OK,FALSE},
4895 {"ftp",S_OK,FALSE},
4896 {"\xE6\xB5\x8B\xE8\xAF\x95:wine",S_OK,FALSE},
4897 {"\xE6\xB5\x8B\xE8\xAF\x95",S_OK,FALSE}
4898 },
4899 {
4900 {Uri_HOST_DNS,S_OK,FALSE},
4901 {9999,S_OK,FALSE},
4903 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4904 }
4905 },
4906 /* Password with Unicode characters. Unicode characters should not be encoded */
4907 { "ftp://winepass:\xE6\xB5\x8B\xE8\xAF\x95@ftp.winehq.org:9999/dir/foobar.txt", 0, S_OK, FALSE, 0,
4908 {
4909 {"ftp://winepass:\xE6\xB5\x8B\xE8\xAF\x95@ftp.winehq.org:9999/dir/foobar.txt",S_OK,FALSE},
4910 {"winepass:\xE6\xB5\x8B\xE8\xAF\x95@ftp.winehq.org:9999",S_OK,FALSE},
4911 {"ftp://ftp.winehq.org:9999/dir/foobar.txt",S_OK,FALSE},
4912 {"winehq.org",S_OK,FALSE},
4913 {".txt",S_OK,FALSE},
4914 {"",S_FALSE,FALSE},
4915 {"ftp.winehq.org",S_OK,FALSE},
4916 {"\xE6\xB5\x8B\xE8\xAF\x95",S_OK,FALSE},
4917 {"/dir/foobar.txt",S_OK,FALSE},
4918 {"/dir/foobar.txt",S_OK,FALSE},
4919 {"",S_FALSE,FALSE},
4920 {"ftp://winepass:\xE6\xB5\x8B\xE8\xAF\x95@ftp.winehq.org:9999/dir/foobar.txt",S_OK,FALSE},
4921 {"ftp",S_OK,FALSE},
4922 {"winepass:\xE6\xB5\x8B\xE8\xAF\x95",S_OK,FALSE},
4923 {"winepass",S_OK,FALSE}
4924 },
4925 {
4926 {Uri_HOST_DNS,S_OK,FALSE},
4927 {9999,S_OK,FALSE},
4929 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4930 }
4931 },
4932 /* Query with Unicode characters. Unicode characters should not be encoded */
4933 { "http://www.winehq.org/tests/..?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y", 0, S_OK, FALSE, 0,
4934 {
4935 {"http://www.winehq.org/?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y",S_OK,FALSE},
4936 {"www.winehq.org",S_OK,FALSE},
4937 {"http://www.winehq.org/?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y",S_OK,FALSE},
4938 {"winehq.org",S_OK,FALSE},
4939 {"",S_FALSE,FALSE},
4940 {"",S_FALSE,FALSE},
4941 {"www.winehq.org",S_OK,FALSE},
4942 {"",S_FALSE,FALSE},
4943 {"/",S_OK,FALSE},
4944 {"/?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y",S_OK,FALSE},
4945 {"?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y",S_OK,FALSE},
4946 {"http://www.winehq.org/tests/..?query=\xE6\xB5\x8B\xE8\xAF\x95&return=y",S_OK,FALSE},
4947 {"http",S_OK,FALSE},
4948 {"",S_FALSE,FALSE},
4949 {"",S_FALSE,FALSE}
4950 },
4951 {
4952 {Uri_HOST_DNS,S_OK,FALSE},
4953 {80,S_OK,FALSE},
4955 {URLZONE_INVALID,E_NOTIMPL,FALSE},
4956 }
4957 },
4958 /* Fragment with Unicode characters. Unicode characters should not be encoded */
4959 { "http://www.winehq.org/tests/#\xE6\xB5\x8B\xE8\xAF\x95", 0, S_OK, FALSE, 0,
4960 {
4961 {"http://www.winehq.org/tests/#\xE6\xB5\x8B\xE8\xAF\x95",S_OK,FALSE},
4962 {"www.winehq.org",S_OK,FALSE},
4963 {"http://www.winehq.org/tests/#\xE6\xB5\x8B\xE8\xAF\x95",S_OK,FALSE},
4964 {"winehq.org",S_OK,FALSE},
4965 {"",S_FALSE,FALSE},
4966 {"#\xE6\xB5\x8B\xE8\xAF\x95",S_OK,FALSE},
4967 {"www.winehq.org",S_OK,FALSE},
4968 {"",S_FALSE,FALSE},
4969 {"/tests/",S_OK,FALSE},
4970 {"/tests/",S_OK,FALSE},
4971 {"",S_FALSE,FALSE},
4972 {"http://www.winehq.org/tests/#\xE6\xB5\x8B\xE8\xAF\x95",S_OK,FALSE},
4973 {"http",S_OK,FALSE},
4974 {"",S_FALSE,FALSE},
4975 {"",S_FALSE,FALSE}
4976 },
4977 {
4978 {Uri_HOST_DNS,S_OK,FALSE},
4979 {80,S_OK,FALSE},
4981 {URLZONE_INVALID,E_NOTIMPL,FALSE},
4982 }
4983 },
4984 /* ZERO WIDTH JOINER as non-printing Unicode characters should not be encoded if not preprocessed. */
4985 { "file:a\xE2\x80\x8D.html", Uri_CREATE_NO_PRE_PROCESS_HTML_URI, S_OK, FALSE, 0,
4986 {
4987 {"",S_FALSE,FALSE},
4988 {"",S_FALSE,FALSE},
4989 {"file:a\xE2\x80\x8D.html",S_OK,FALSE},
4990 {"",S_FALSE,FALSE},
4991 {".html",S_OK,FALSE},
4992 {"",S_FALSE,FALSE},
4993 {"",S_FALSE,FALSE},
4994 {"",S_FALSE,FALSE},
4995 {"a\xE2\x80\x8D.html",S_OK,FALSE},
4996 {"a\xE2\x80\x8D.html",S_OK,FALSE},
4997 {"",S_FALSE,FALSE},
4998 {"file:a\xE2\x80\x8D.html",S_OK,FALSE},
4999 {"file",S_OK,FALSE},
5000 {"",S_FALSE,FALSE},
5001 {"",S_FALSE,FALSE}
5002 },
5003 {
5004 {Uri_HOST_UNKNOWN,S_OK,FALSE},
5005 {0,S_FALSE,FALSE},
5007 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5008 }
5009 },
5010 /* LEFT-TO-RIGHT MARK as non-printing Unicode characters should not be encoded if not preprocessed. */
5011 { "file:ab\xE2\x80\x8E.html", Uri_CREATE_NO_PRE_PROCESS_HTML_URI, S_OK, FALSE, 0,
5012 {
5013 {"",S_FALSE,FALSE},
5014 {"",S_FALSE,FALSE},
5015 {"file:ab\xE2\x80\x8D.html",S_OK,FALSE},
5016 {"",S_FALSE,FALSE},
5017 {".html",S_OK,FALSE},
5018 {"",S_FALSE,FALSE},
5019 {"",S_FALSE,FALSE},
5020 {"",S_FALSE,FALSE},
5021 {"ab\xE2\x80\x8D.html",S_OK,FALSE},
5022 {"ab\xE2\x80\x8D.html",S_OK,FALSE},
5023 {"",S_FALSE,FALSE},
5024 {"file:ab\xE2\x80\x8D.html",S_OK,FALSE},
5025 {"file",S_OK,FALSE},
5026 {"",S_FALSE,FALSE},
5027 {"",S_FALSE,FALSE}
5028 },
5029 {
5030 {Uri_HOST_UNKNOWN,S_OK,FALSE},
5031 {0,S_FALSE,FALSE},
5033 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5034 }
5035 },
5036 /* Invalid Unicode characters should not be filtered */
5037 { "file:ab\xc3\x28.html", 0, S_OK, FALSE, 0,
5038 {
5039 {"",S_FALSE,FALSE},
5040 {"",S_FALSE,FALSE},
5041 {"file:ab\xc3\x28.html",S_OK,FALSE},
5042 {"",S_FALSE,FALSE},
5043 {".html",S_OK,FALSE},
5044 {"",S_FALSE,FALSE},
5045 {"",S_FALSE,FALSE},
5046 {"",S_FALSE,FALSE},
5047 {"ab\xc3\x28.html",S_OK,FALSE},
5048 {"ab\xc3\x28.html",S_OK,FALSE},
5049 {"",S_FALSE,FALSE},
5050 {"file:ab\xc3\x28.html",S_OK,FALSE},
5051 {"file",S_OK,FALSE},
5052 {"",S_FALSE,FALSE},
5053 {"",S_FALSE,FALSE}
5054 },
5055 {
5056 {Uri_HOST_UNKNOWN,S_OK,FALSE},
5057 {0,S_FALSE,FALSE},
5059 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5060 }
5061 },
5062 /* Make sure % encoded unicode characters are not decoded. */
5063 { "ftp://%E6%B5%8B%E8%AF%95:%E6%B5%8B%E8%AF%95@ftp.google.com/", 0, S_OK, FALSE, 0,
5064 {
5065 {"ftp://%E6%B5%8B%E8%AF%95:%E6%B5%8B%E8%AF%95@ftp.google.com/",S_OK,FALSE},
5066 {"%E6%B5%8B%E8%AF%95:%E6%B5%8B%E8%AF%95@ftp.google.com",S_OK,FALSE},
5067 {"ftp://ftp.google.com/",S_OK,FALSE},
5068 {"google.com",S_OK,FALSE},
5069 {"",S_FALSE,FALSE},
5070 {"",S_FALSE,FALSE},
5071 {"ftp.google.com",S_OK,FALSE},
5072 {"%E6%B5%8B%E8%AF%95",S_OK,FALSE},
5073 {"/",S_OK,FALSE},
5074 {"/",S_OK,FALSE},
5075 {"",S_FALSE,FALSE},
5076 {"ftp://%E6%B5%8B%E8%AF%95:%E6%B5%8B%E8%AF%95@ftp.google.com/",S_OK,FALSE},
5077 {"ftp",S_OK,FALSE},
5078 {"%E6%B5%8B%E8%AF%95:%E6%B5%8B%E8%AF%95",S_OK,FALSE},
5079 {"%E6%B5%8B%E8%AF%95",S_OK,FALSE}
5080 },
5081 {
5082 {Uri_HOST_DNS,S_OK,FALSE},
5083 {21,S_OK,FALSE},
5085 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5086 }
5087 },
5088 /* Hostname is an IDN */
5089 {
5090 /* "http://测试.org/" with Chinese in UTF-8 encoding */
5091 "http://\xE6\xB5\x8B\xE8\xAF\x95.org/", 0, S_OK, FALSE, 0,
5092 {
5093 {"http://\xE6\xB5\x8B\xE8\xAF\x95.org/",S_OK,FALSE},
5094 {"\xE6\xB5\x8B\xE8\xAF\x95.org",S_OK,FALSE},
5095 {"http://xn--0zwm56d.org/",S_OK,FALSE,NULL,"http://\xE6\xB5\x8B\xE8\xAF\x95.org/",S_OK},
5096 {"\xE6\xB5\x8B\xE8\xAF\x95.org",S_OK,FALSE},
5097 {"",S_FALSE,FALSE},
5098 {"",S_FALSE,FALSE},
5099 {"\xE6\xB5\x8B\xE8\xAF\x95.org",S_OK,FALSE},
5100 {"",S_FALSE,FALSE},
5101 {"/",S_OK,FALSE},
5102 {"/",S_OK,FALSE},
5103 {"",S_FALSE,FALSE},
5104 {"http://\xE6\xB5\x8B\xE8\xAF\x95.org/",S_OK,FALSE},
5105 {"http",S_OK,FALSE},
5106 {"",S_FALSE,FALSE},
5107 {"",S_FALSE,FALSE}
5108 },
5109 {
5110 {Uri_HOST_IDN,S_OK,FALSE},
5111 {80,S_OK,FALSE},
5113 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5114 }
5115 },
5116 /* Hostname is an IDN that has percent encoded characters*/
5117 {
5118 /* "http://测试%74%65%73%74.org/" with Chinese in UTF-8 encoding */
5119 "http://\xE6\xB5\x8B\xE8\xAF\x95%74%65%73%74.org/", 0, S_OK, FALSE, 0,
5120 {
5121 {"http://\xE6\xB5\x8B\xE8\xAF\x95test.org/",S_OK,FALSE},
5122 {"\xE6\xB5\x8B\xE8\xAF\x95test.org",S_OK,FALSE},
5123 {"http://xn--test-zx7if72m.org/",S_OK,FALSE,NULL,"http://\xE6\xB5\x8B\xE8\xAF\x95test.org/",S_OK},
5124 {"\xE6\xB5\x8B\xE8\xAF\x95test.org",S_OK,FALSE},
5125 {"",S_FALSE,FALSE},
5126 {"",S_FALSE,FALSE},
5127 {"\xE6\xB5\x8B\xE8\xAF\x95test.org",S_OK,FALSE},
5128 {"",S_FALSE,FALSE},
5129 {"/",S_OK,FALSE},
5130 {"/",S_OK,FALSE},
5131 {"",S_FALSE,FALSE},
5132 {"http://\xE6\xB5\x8B\xE8\xAF\x95%74%65%73%74.org/",S_OK,FALSE},
5133 {"http",S_OK,FALSE},
5134 {"",S_FALSE,FALSE},
5135 {"",S_FALSE,FALSE}
5136 },
5137 {
5138 {Uri_HOST_IDN,S_OK,FALSE},
5139 {80,S_OK,FALSE},
5141 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5142 }
5143 },
5144 /* Uri_DISPLAY_NO_FRAGMENT a URI that has no PASSWORD, QUERY, USER_INFO and USER_NAME.
5145 * GetPropertyBSTR() returns E_INVALIDARG for PASSWORD, QUERY, USER_INFO and USER_NAME while
5146 * GetPropertyLength() returns S_FALSE. This means in GetPropertyLength() the check for property
5147 * existence happens before the check of Uri_DISPLAY_NO_FRAGMENT for property */
5148 { "http://www.winehq.org/foo.html#fragment", 0, S_OK, FALSE, Uri_DISPLAY_NO_FRAGMENT,
5149 {
5152 {"http://www.winehq.org/foo.html",S_OK,FALSE}, /* DISPLAY_URI */
5157 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* PASSWORD */
5160 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* QUERY */
5163 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* USER_INFO */
5164 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* USER_NAME */
5165 },
5166 {
5167 {Uri_HOST_DNS,S_OK,FALSE},
5168 {80,S_OK,FALSE},
5170 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5171 }
5172 },
5173 /* Uri_DISPLAY_NO_FRAGMENT with a URI that has PASSWORD, QUERY, USER_INFO and USER_NAME */
5174 { "http://username:password@www.winehq.org/foo.html?query=value#fragment", 0, S_OK, FALSE, Uri_DISPLAY_NO_FRAGMENT,
5175 {
5178 {"http://www.winehq.org/foo.html?query=value",S_OK,FALSE}, /* DISPLAY_URI */
5191 },
5192 {
5193 {Uri_HOST_DNS,S_OK,FALSE},
5194 {80,S_OK,FALSE},
5196 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5197 }
5198 },
5199 /* Uri_PUNYCODE_IDN_HOST with a ASCII host name that has no EXTENSION, FRAGMENT, PASSWORD, QUERY, USER_INFO and USER_NAME.
5200 * GetPropertyBSTR() returns E_INVALIDARG for EXTENSION, FRAGMENT, PASSWORD, QUERY, USER_INFO
5201 * and USER_NAME while GetPropertyLength() returns S_FALSE. This means the check for property
5202 * existence happens before the check of Uri_PUNYCODE_IDN_HOST for property */
5203 { "http://www.winehq.org/", 0, S_OK, FALSE, Uri_PUNYCODE_IDN_HOST,
5204 {
5205 {"http://www.winehq.org/",S_OK,FALSE},
5208 {"winehq.org",S_OK,FALSE},
5209 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* EXTENSION */
5210 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* FRAGMENT */
5211 {"www.winehq.org",S_OK,FALSE},
5212 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* PASSWORD */
5215 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* QUERY */
5218 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* USER_INFO */
5219 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* USER_NAME */
5220 },
5221 {
5222 {Uri_HOST_DNS,S_OK,FALSE},
5223 {80,S_OK,FALSE},
5225 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5226 }
5227 },
5228 /* Uri_PUNYCODE_IDN_HOST with a ASCII host name that has EXTENSION, FRAGMENT, PASSWORD, QUERY, USER_INFO and USER_NAME */
5229 { "http://username:password@www.winehq.org/index.html?query=value#fragment", 0, S_OK, FALSE, Uri_PUNYCODE_IDN_HOST,
5230 {
5231 {"http://username:password@www.winehq.org/index.html?query=value#fragment",S_OK,FALSE},
5234 {"winehq.org",S_OK,FALSE},
5237 {"www.winehq.org",S_OK,FALSE},
5246 },
5247 {
5248 {Uri_HOST_DNS,S_OK,FALSE},
5249 {80,S_OK,FALSE},
5251 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5252 }
5253 },
5254 /* Uri_PUNYCODE_IDN_HOST with an IDN that has EXTENSION, FRAGMENT, PASSWORD, QUERY, USER_INFO and USER_NAME */
5255 {
5256 /* "http://username:password@测试.org/index.html?query=value#fragment" with Chinese in UTF-8 encoding */
5257 "http://username:password@\xE6\xB5\x8B\xE8\xAF\x95.org/index.html?query=value#fragment", 0, S_OK, FALSE, Uri_PUNYCODE_IDN_HOST,
5258 {
5259 {"http://username:password@xn--0zwm56d.org/index.html?query=value#fragment",S_OK,FALSE},
5262 {"xn--0zwm56d.org",S_OK,FALSE},
5265 {"xn--0zwm56d.org",S_OK,FALSE},
5274 },
5275 {
5276 {Uri_HOST_IDN,S_OK,FALSE},
5277 {80,S_OK,FALSE},
5279 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5280 }
5281 },
5282 {
5283 /* "http://username:password@www.测试.org/index.html?query=value#fragment" with Chinese in UTF-8 encoding */
5284 "http://username:password@www.\xE6\xB5\x8B\xE8\xAF\x95.org/index.html?query=value#fragment", 0, S_OK, FALSE, Uri_PUNYCODE_IDN_HOST,
5285 {
5286 {"http://username:password@www.xn--0zwm56d.org/index.html?query=value#fragment",S_OK,FALSE},
5289 {"xn--0zwm56d.org",S_OK,FALSE},
5292 {"www.xn--0zwm56d.org",S_OK,FALSE},
5301 },
5302 {
5303 {Uri_HOST_IDN,S_OK,FALSE},
5304 {80,S_OK,FALSE},
5306 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5307 }
5308 },
5309 /* Uri_PUNYCODE_IDN_HOST with an IDN that has EXTENSION, FRAGMENT, PASSWORD, QUERY, USER_INFO and USER_NAME.
5310 * User info is ":@" and not removed in the Uri_PROPERTY_ABSOLUTE_URI property */
5311 {
5312 /* "http://:@www.测试.org/index.html?query=value#fragment" with Chinese in UTF-8 encoding */
5313 "http://:@www.\xE6\xB5\x8B\xE8\xAF\x95.org/index.html?query=value#fragment", 0, S_OK, FALSE, Uri_PUNYCODE_IDN_HOST,
5314 {
5315 {"http://:@www.xn--0zwm56d.org/index.html?query=value#fragment",S_OK,FALSE},
5318 {"xn--0zwm56d.org",S_OK,FALSE},
5321 {"www.xn--0zwm56d.org",S_OK,FALSE},
5329 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* USER_NAME */
5330 },
5331 {
5332 {Uri_HOST_IDN,S_OK,FALSE},
5333 {80,S_OK,FALSE},
5335 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5336 }
5337 },
5338 /* Uri_PUNYCODE_IDN_HOST with an IDN that has EXTENSION, FRAGMENT, PASSWORD, QUERY, USER_INFO and USER_NAME.
5339 * User info is "@" and not removed in the Uri_PROPERTY_ABSOLUTE_URI property */
5340 {/* "http://@www.测试.org/index.html?query=value#fragment" with Chinese in UTF-8 encoding */
5341 "http://@www.\xE6\xB5\x8B\xE8\xAF\x95.org/index.html?query=value#fragment", 0, S_OK, FALSE, Uri_PUNYCODE_IDN_HOST,
5342 {
5343 {"http://@www.xn--0zwm56d.org/index.html?query=value#fragment",S_OK,FALSE},
5346 {"xn--0zwm56d.org",S_OK,FALSE},
5349 {"www.xn--0zwm56d.org",S_OK,FALSE},
5350 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* PASSWORD */
5357 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* USER_NAME */
5358 },
5359 {
5360 {Uri_HOST_IDN,S_OK,FALSE},
5361 {80,S_OK,FALSE},
5363 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5364 }
5365 },
5366 /* Uri_PUNYCODE_IDN_HOST with a path in Unicode characters */
5367 {
5368 /* "http://username:password@winehq.org/测试.html?query=value#fragment" with Chinese in UTF-8 encoding */
5369 "http://username:password@winehq.org/\xE6\xB5\x8B\xE8\xAF\x95.html?query=value#fragment", 0, S_OK, FALSE, Uri_PUNYCODE_IDN_HOST,
5370 {
5371 {"http://username:password@winehq.org/\xE6\xB5\x8B\xE8\xAF\x95.html?query=value#fragment",S_OK,FALSE},
5374 {"winehq.org",S_OK,FALSE},
5377 {"winehq.org",S_OK,FALSE},
5386 },
5387 {
5388 {Uri_HOST_DNS,S_OK,FALSE},
5389 {80,S_OK,FALSE},
5391 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5392 }
5393 },
5394 /* Uri_DISPLAY_IDN_HOST with an IDN and URI has no EXTENSION, FRAGMENT, PASSWORD, QUERY, USER_INFO and USER_NAME.
5395 * GetPropertyBSTR() returns E_INVALIDARG for EXTENSION, FRAGMENT, PASSWORD, QUERY, USER_INFO
5396 * and USER_NAME while GetPropertyLength() returns S_FALSE. This means the check for property
5397 * existence happens before the check of Uri_DISPLAY_IDN_HOST for property */
5398 {
5399 /* "http://测试.org/" with Chinese in UTF-8 encoding */
5400 "http://\xE6\xB5\x8B\xE8\xAF\x95.org/", 0, S_OK, FALSE, Uri_DISPLAY_IDN_HOST,
5401 {
5402 {"http://xn--0zwm56d.org/",S_OK,FALSE,NULL,"http://\xE6\xB5\x8B\xE8\xAF\x95.org/",S_OK},
5405 {"xn--0zwm56d.org",S_OK,FALSE,NULL,"\xE6\xB5\x8B\xE8\xAF\x95.org",S_OK},
5406 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* EXTENSION */
5407 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* FRAGMENT */
5408 {"xn--0zwm56d.org",S_OK,FALSE,NULL,"\xE6\xB5\x8B\xE8\xAF\x95.org",S_OK},
5409 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* PASSWORD */
5412 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* QUERY */
5415 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* USER_INFO */
5416 {NULL,E_INVALIDARG,FALSE,NULL,"",S_FALSE}, /* USER_NAME */
5417 },
5418 {
5419 {Uri_HOST_IDN,S_OK,FALSE},
5420 {80,S_OK,FALSE},
5422 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5423 }
5424 },
5425 /* Uri_DISPLAY_IDN_HOST with an IDN and URI has EXTENSION, FRAGMENT, PASSWORD, QUERY, USER_INFO and USER_NAME.*/
5426 {
5427 /* "http://username:password@测试.org/index.html?query=value#fragment" with Chinese in UTF-8 encoding */
5428 "http://username:password@\xE6\xB5\x8B\xE8\xAF\x95.org/index.html?query=value#fragment", 0, S_OK, FALSE, Uri_DISPLAY_IDN_HOST,
5429 {
5430 {"http://username:password@xn--0zwm56d.org/index.html?query=value#fragment",S_OK,FALSE,NULL,"http://username:password@\xE6\xB5\x8B\xE8\xAF\x95.org/index.html?query=value#fragment",S_OK},
5433 {"xn--0zwm56d.org",S_OK,FALSE,NULL,"\xE6\xB5\x8B\xE8\xAF\x95.org",S_OK},
5436 {"xn--0zwm56d.org",S_OK,FALSE,NULL,"\xE6\xB5\x8B\xE8\xAF\x95.org",S_OK},
5445 },
5446 {
5447 {Uri_HOST_IDN,S_OK,FALSE},
5448 {80,S_OK,FALSE},
5450 {URLZONE_INVALID,E_NOTIMPL,FALSE}
5451 }
5452 },
5453 /* Multiple flags */
5454 { "http://username:password@winehq.org/index.html?query=value#fragment", 0, S_OK, FALSE, Uri_DISPLAY_NO_FRAGMENT | Uri_DISPLAY_IDN_HOST,
5455 {
5471 },
5472 {
5473 {Uri_HOST_DNS,S_OK,FALSE}, /* HOST_TYPE */
5474 {80,S_OK,FALSE}, /* PORT */
5475 {URL_SCHEME_HTTP,S_OK,FALSE}, /* SCHEME */
5476 {URLZONE_INVALID,E_NOTIMPL,FALSE} /* ZONE */
5477 }
5478 },
5479};
5480
5481typedef struct _invalid_uri {
5482 const char* uri;
5486
5488 /* Has to have a scheme name. */
5489 {"://www.winehq.org",0,FALSE},
5490 /* Windows doesn't like URIs which are implicitly file paths without the
5491 * ALLOW_IMPLICIT_FILE_SCHEME flag set.
5492 */
5493 {"C:/test/test.mp3",0,FALSE},
5494 {"\\\\Server/test/test.mp3",0,FALSE},
5495 {"C:/test/test.mp3",Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME,FALSE},
5496 {"\\\\Server/test/test.mp3",Uri_CREATE_ALLOW_RELATIVE,FALSE},
5497 /* Invalid schemes. */
5498 {"*abcd://not.valid.com",0,FALSE},
5499 {"*a*b*c*d://not.valid.com",0,FALSE},
5500 /* Not allowed to have invalid % encoded data. */
5501 {"ftp://google.co%XX/",0,FALSE},
5502 /* Too many h16 components. */
5503 {"http://[1:2:3:4:5:6:7:8:9]",0,FALSE},
5504 /* Not enough room for IPv4 address. */
5505 {"http://[1:2:3:4:5:6:7:192.0.1.0]",0,FALSE},
5506 /* Not enough h16 components. */
5507 {"http://[1:2:3:4]",0,FALSE},
5508 /* Not enough components including IPv4. */
5509 {"http://[1:192.0.1.0]",0,FALSE},
5510 /* Not allowed to have partial IPv4 in IPv6. */
5511 {"http://[::192.0]",0,FALSE},
5512 /* Expects a valid IP Literal. */
5513 {"ftp://[not.valid.uri]/",0,FALSE},
5514 /* Expects valid port for a known scheme type. */
5515 {"ftp://www.winehq.org:123fgh",0,FALSE},
5516 /* Port exceeds USHORT_MAX for known scheme type. */
5517 {"ftp://www.winehq.org:65536",0,FALSE},
5518 /* Invalid port with IPv4 address. */
5519 {"http://www.winehq.org:1abcd",0,FALSE},
5520 /* Invalid port with IPv6 address. */
5521 {"http://[::ffff]:32xy",0,FALSE},
5522 /* Not allowed to have backslashes with NO_CANONICALIZE. */
5523 {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE,FALSE},
5524 /* Not allowed to have invalid % encoded data in opaque URI path. */
5525 {"news:test%XX",0,FALSE},
5526 {"mailto:wine@winehq%G8.com",0,FALSE},
5527 /* Known scheme types can't have invalid % encoded data in query string. */
5528 {"http://google.com/?query=te%xx",0,FALSE},
5529 /* Invalid % encoded data in fragment of know scheme type. */
5530 {"ftp://google.com/#Test%xx",0,FALSE},
5531 {" http://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI,FALSE},
5532 {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI,FALSE},
5533 {"file://c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
5534 {"file://c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
5535 {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
5536 {"file:c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
5537 {"file:c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
5538 {"file:c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
5539 /* res URIs aren't allowed to have forbidden dos path characters in the
5540 * hostname.
5541 */
5542 {"res://c:\\te<st\\test/test",0,FALSE},
5543 {"res://c:\\te>st\\test/test",0,FALSE},
5544 {"res://c:\\te\"st\\test/test",0,FALSE},
5545 {"res://c:\\test/te%xxst",0,FALSE}
5546};
5547
5548typedef struct _uri_equality {
5549 const char* a;
5551 const char* b;
5556
5558 {
5559 "HTTP://www.winehq.org/test dir/./",0,
5560 "http://www.winehq.org/test dir/../test dir/",0,
5561 TRUE
5562 },
5563 {
5564 /* http://www.winehq.org/test%20dir */
5565 "http://%77%77%77%2E%77%69%6E%65%68%71%2E%6F%72%67/%74%65%73%74%20%64%69%72",0,
5566 "http://www.winehq.org/test dir",0,
5567 TRUE
5568 },
5569 {
5570 "c:\\test.mp3",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME,
5571 "file:///c:/test.mp3",0,
5572 TRUE
5573 },
5574 {
5575 "ftp://ftp.winehq.org/",0,
5576 "ftp://ftp.winehq.org",0,
5577 TRUE
5578 },
5579 {
5580 "ftp://ftp.winehq.org/test/test2/../../testB/",0,
5581 "ftp://ftp.winehq.org/t%45stB/",0,
5582 FALSE
5583 },
5584 {
5585 "http://google.com/TEST",0,
5586 "http://google.com/test",0,
5587 FALSE
5588 },
5589 {
5590 "http://GOOGLE.com/",0,
5591 "http://google.com/",0,
5592 TRUE
5593 },
5594 /* Performs case insensitive compare of host names (for known scheme types). */
5595 {
5596 "ftp://GOOGLE.com/",Uri_CREATE_NO_CANONICALIZE,
5597 "ftp://google.com/",0,
5598 TRUE
5599 },
5600 {
5601 "zip://GOOGLE.com/",0,
5602 "zip://google.com/",0,
5603 FALSE
5604 },
5605 {
5606 "file:///c:/TEST/TeST/",0,
5607 "file:///c:/test/test/",0,
5608 TRUE
5609 },
5610 {
5611 "file:///server/TEST",0,
5612 "file:///SERVER/TEST",0,
5613 TRUE
5614 },
5615 {
5616 "http://google.com",Uri_CREATE_NO_CANONICALIZE,
5617 "http://google.com/",0,
5618 TRUE
5619 },
5620 {
5621 "ftp://google.com:21/",0,
5622 "ftp://google.com/",0,
5623 TRUE
5624 },
5625 {
5626 "http://google.com:80/",Uri_CREATE_NO_CANONICALIZE,
5627 "http://google.com/",0,
5628 TRUE
5629 },
5630 {
5631 "http://google.com:70/",0,
5632 "http://google.com:71/",0,
5633 FALSE
5634 },
5635 {
5636 "file:///c:/dir/file.txt", 0,
5637 "file:///c:/dir/file.txt", Uri_CREATE_FILE_USE_DOS_PATH,
5638 TRUE
5639 },
5640 {
5641 "file:///c:/dir/file.txt", 0,
5642 "file:///c:\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE,
5643 TRUE
5644 },
5645 {
5646 "file:///c:/dir/file.txt", 0,
5647 "file:///c:\\dir2\\..\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE,
5648 TRUE
5649 },
5650 {
5651 "file:///c:\\dir2\\..\\ dir\\file.txt", Uri_CREATE_NO_CANONICALIZE,
5652 "file:///c:/%20dir/file.txt", 0,
5653 TRUE
5654 },
5655 {
5656 "file:///c:/Dir/file.txt", 0,
5657 "file:///C:/dir/file.TXT", Uri_CREATE_FILE_USE_DOS_PATH,
5658 TRUE
5659 },
5660 {
5661 "file:///c:/dir/file.txt", 0,
5662 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH,
5663 TRUE
5664 },
5665 {
5666 "file:///c:/dir/file.txt#a", 0,
5667 "file:///c:\\dir\\file.txt#b", Uri_CREATE_FILE_USE_DOS_PATH,
5668 FALSE
5669 },
5670 /* Tests of an empty hash/fragment part */
5671 {
5672 "http://google.com/test",0,
5673 "http://google.com/test#",0,
5674 FALSE
5675 },
5676 {
5677 "ftp://ftp.winehq.org/",0,
5678 "ftp://ftp.winehq.org/#",0,
5679 FALSE
5680 },
5681 {
5682 "file:///c:/dir/file.txt#", 0,
5683 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH,
5684 FALSE
5685 }
5686};
5687
5688typedef struct _uri_with_fragment {
5689 const char* uri;
5690 const char* fragment;
5694
5695 const char* expected_uri;
5698
5700 {
5701 "http://google.com/","#fragment",0,S_OK,FALSE,
5702 "http://google.com/#fragment",FALSE
5703 },
5704 {
5705 "http://google.com/","fragment",0,S_OK,FALSE,
5706 "http://google.com/#fragment",FALSE
5707 },
5708 {
5709 "zip://test.com/","?test",0,S_OK,FALSE,
5710 "zip://test.com/#?test",FALSE
5711 },
5712 /* The fragment can be empty. */
5713 {
5714 "ftp://ftp.google.com/","",0,S_OK,FALSE,
5715 "ftp://ftp.google.com/#",FALSE
5716 }
5717};
5718
5721 const char *value;
5722 const char *expected_value;
5723 Uri_PROPERTY property;
5727
5728typedef struct _uri_builder_port {
5735
5737 const char* expected;
5741
5747
5748typedef struct _uri_builder_test {
5749 const char *uri;
5753
5755
5757
5761
5765
5771
5775
5777 { "http://google.com/",0,S_OK,FALSE,
5778 {
5779 {TRUE,"#fragment",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE},
5780 {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE},
5781 {TRUE,"?query=x",NULL,Uri_PROPERTY_QUERY,S_OK,FALSE},
5782 {TRUE,"username",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5783 },
5784 {FALSE},
5785 0,S_OK,FALSE,
5786 0,S_OK,FALSE,
5787 0,0,0,S_OK,FALSE,
5788 {
5789 {"http://username:password@google.com/?query=x#fragment",S_OK},
5790 {"username:password@google.com",S_OK},
5791 {"http://google.com/?query=x#fragment",S_OK},
5792 {"google.com",S_OK},
5793 {"",S_FALSE},
5794 {"#fragment",S_OK},
5795 {"google.com",S_OK},
5796 {"password",S_OK},
5797 {"/",S_OK},
5798 {"/?query=x",S_OK},
5799 {"?query=x",S_OK},
5800 {"http://username:password@google.com/?query=x#fragment",S_OK},
5801 {"http",S_OK},
5802 {"username:password",S_OK},
5803 {"username",S_OK}
5804 },
5805 {
5806 {Uri_HOST_DNS,S_OK},
5807 {80,S_OK},
5809 {URLZONE_INVALID,E_NOTIMPL}
5810 }
5811 },
5812 { "http://google.com/",0,S_OK,FALSE,
5813 {
5814 {TRUE,"test",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE}
5815 },
5816 {TRUE,TRUE,120,S_OK,FALSE},
5817 0,S_OK,FALSE,
5818 0,S_OK,FALSE,
5819 0,0,0,S_OK,FALSE,
5820 {
5821 {"test://google.com:120/",S_OK},
5822 {"google.com:120",S_OK},
5823 {"test://google.com:120/",S_OK},
5824 {"google.com",S_OK},
5825 {"",S_FALSE},
5826 {"",S_FALSE},
5827 {"google.com",S_OK},
5828 {"",S_FALSE},
5829 {"/",S_OK},
5830 {"/",S_OK},
5831 {"",S_FALSE},
5832 {"test://google.com:120/",S_OK},
5833 {"test",S_OK},
5834 {"",S_FALSE},
5835 {"",S_FALSE}
5836 },
5837 {
5838 {Uri_HOST_DNS,S_OK},
5839 {120,S_OK},
5841 {URLZONE_INVALID,E_NOTIMPL}
5842 }
5843 },
5844 { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE,
5845 {
5846 {TRUE,"http",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE},
5847 {TRUE,"::192.2.3.4",NULL,Uri_PROPERTY_HOST,S_OK,FALSE},
5848 {TRUE,NULL,NULL,Uri_PROPERTY_PATH,S_OK,FALSE}
5849 },
5850 {FALSE},
5851 0,S_OK,FALSE,
5852 0,S_OK,FALSE,
5853 0,0,0,S_OK,FALSE,
5854 {
5855 {"http://[::192.2.3.4]/",S_OK},
5856 {"[::192.2.3.4]",S_OK},
5857 {"http://[::192.2.3.4]/",S_OK},
5858 {"",S_FALSE},
5859 {"",S_FALSE},
5860 {"",S_FALSE},
5861 {"::192.2.3.4",S_OK},
5862 {"",S_FALSE},
5863 {"/",S_OK},
5864 {"/",S_OK},
5865 {"",S_FALSE},
5866 {"http://[::192.2.3.4]/",S_OK},
5867 {"http",S_OK},
5868 {"",S_FALSE},
5869 {"",S_FALSE}
5870 },
5871 {
5872 {Uri_HOST_IPV6,S_OK},
5873 {80,S_OK},
5875 {URLZONE_INVALID,E_NOTIMPL}
5876 }
5877 },
5878 { "http://google.com/",0,S_OK,FALSE,
5879 {
5880 {TRUE,"Frag","#Frag",Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
5881 },
5882 {FALSE},
5883 0,S_OK,FALSE,
5884 0,S_OK,FALSE,
5885 0,0,0,S_OK,FALSE,
5886 {
5887 {"http://google.com/#Frag",S_OK},
5888 {"google.com",S_OK},
5889 {"http://google.com/#Frag",S_OK},
5890 {"google.com",S_OK},
5891 {"",S_FALSE},
5892 {"#Frag",S_OK},
5893 {"google.com",S_OK},
5894 {"",S_FALSE},
5895 {"/",S_OK},
5896 {"/",S_OK},
5897 {"",S_FALSE},
5898 {"http://google.com/#Frag",S_OK},
5899 {"http",S_OK},
5900 {"",S_FALSE},
5901 {"",S_FALSE}
5902 },
5903 {
5904 {Uri_HOST_DNS,S_OK},
5905 {80,S_OK},
5907 {URLZONE_INVALID,E_NOTIMPL}
5908 }
5909 },
5910 { "http://google.com/",0,S_OK,FALSE,
5911 {
5912 {TRUE,"","#",Uri_PROPERTY_FRAGMENT,S_OK,FALSE},
5913 },
5914 {FALSE},
5915 0,S_OK,FALSE,
5916 0,S_OK,FALSE,
5917 0,0,0,S_OK,FALSE,
5918 {
5919 {"http://google.com/#",S_OK},
5920 {"google.com",S_OK},
5921 {"http://google.com/#",S_OK},
5922 {"google.com",S_OK},
5923 {"",S_FALSE},
5924 {"#",S_OK},
5925 {"google.com",S_OK},
5926 {"",S_FALSE},
5927 {"/",S_OK},
5928 {"/",S_OK},
5929 {"",S_FALSE},
5930 {"http://google.com/#",S_OK},
5931 {"http",S_OK},
5932 {"",S_FALSE},
5933 {"",S_FALSE}
5934 },
5935 {
5936 {Uri_HOST_DNS,S_OK},
5937 {80,S_OK},
5939 {URLZONE_INVALID,E_NOTIMPL}
5940 }
5941 },
5942 { "http://google.com/",0,S_OK,FALSE,
5943 {
5944 {TRUE,":password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5945 },
5946 {FALSE},
5947 0,S_OK,FALSE,
5948 0,S_OK,FALSE,
5949 0,0,0,S_OK,FALSE,
5950 {
5951 {"http://::password@google.com/",S_OK},
5952 {"::password@google.com",S_OK},
5953 {"http://google.com/",S_OK},
5954 {"google.com",S_OK},
5955 {"",S_FALSE},
5956 {"",S_FALSE},
5957 {"google.com",S_OK},
5958 {":password",S_OK},
5959 {"/",S_OK},
5960 {"/",S_OK},
5961 {"",S_FALSE},
5962 {"http://::password@google.com/",S_OK},
5963 {"http",S_OK},
5964 {"::password",S_OK},
5965 {"",S_FALSE}
5966 },
5967 {
5968 {Uri_HOST_DNS,S_OK},
5969 {80,S_OK},
5971 {URLZONE_INVALID,E_NOTIMPL}
5972 }
5973 },
5974 { "test/test",Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE,
5975 {
5976 {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5977 },
5978 {FALSE},
5979 Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE,
5980 0,S_OK,FALSE,
5981 Uri_CREATE_ALLOW_RELATIVE,0,0,S_OK,FALSE,
5982 {
5983 {":password@test/test",S_OK},
5984 {":password@",S_OK},
5985 {":password@test/test",S_OK},
5986 {"",S_FALSE},
5987 {"",S_FALSE},
5988 {"",S_FALSE},
5989 {"",S_FALSE},
5990 {"password",S_OK},
5991 {"test/test",S_OK},
5992 {"test/test",S_OK},
5993 {"",S_FALSE},
5994 {":password@test/test",S_OK},
5995 {"",S_FALSE},
5996 {":password",S_OK},
5997 {"",S_FALSE}
5998 },
5999 {
6000 {Uri_HOST_UNKNOWN,S_OK},
6001 {0,S_FALSE},
6003 {URLZONE_INVALID,E_NOTIMPL}
6004 }
6005 },
6006 { "http://google.com/",0,S_OK,FALSE,
6007 {
6008 {TRUE,"test/test",NULL,Uri_PROPERTY_PATH,S_OK,FALSE},
6009 },
6010 {FALSE},
6011 0,S_OK,FALSE,
6012 0,S_OK,FALSE,
6013 0,0,0,S_OK,FALSE,
6014 {
6015 {"http://google.com/test/test",S_OK},
6016 {"google.com",S_OK},
6017 {"http://google.com/test/test",S_OK},
6018 {"google.com",S_OK},
6019 {"",S_FALSE},
6020 {"",S_FALSE},
6021 {"google.com",S_OK},
6022 {"",S_FALSE},
6023 {"/test/test",S_OK},
6024 {"/test/test",S_OK},
6025 {"",S_FALSE},
6026 {"http://google.com/test/test",S_OK},
6027 {"http",S_OK},
6028 {"",S_FALSE},
6029 {"",S_FALSE}
6030 },
6031 {
6032 {Uri_HOST_DNS,S_OK},
6033 {80,S_OK},
6035 {URLZONE_INVALID,E_NOTIMPL}
6036 }
6037 },
6038 { "zip:testing/test",0,S_OK,FALSE,
6039 {
6040 {TRUE,"test",NULL,Uri_PROPERTY_PATH,S_OK,FALSE},
6041 },
6042 {FALSE},
6043 0,S_OK,FALSE,
6044 0,S_OK,FALSE,
6045 0,0,0,S_OK,FALSE,
6046 {
6047 {"zip:test",S_OK},
6048 {"",S_FALSE},
6049 {"zip:test",S_OK},
6050 {"",S_FALSE},
6051 {"",S_FALSE},
6052 {"",S_FALSE},
6053 {"",S_FALSE},
6054 {"",S_FALSE},
6055 {"test",S_OK},
6056 {"test",S_OK},
6057 {"",S_FALSE},
6058 {"zip:test",S_OK},
6059 {"zip",S_OK},
6060 {"",S_FALSE},
6061 {"",S_FALSE}
6062 },
6063 {
6064 {Uri_HOST_UNKNOWN,S_OK},
6065 {0,S_FALSE},
6067 {URLZONE_INVALID,E_NOTIMPL}
6068 }
6069 },
6070 { "http://google.com/",0,S_OK,FALSE,
6071 {
6072 {FALSE},
6073 },
6074 /* 555 will be returned from GetPort even though FALSE was passed as the hasPort parameter. */
6075 {TRUE,FALSE,555,S_OK,FALSE},
6076 0,S_OK,FALSE,
6077 0,S_OK,FALSE,
6078 0,0,0,S_OK,FALSE,
6079 {
6080 {"http://google.com/",S_OK},
6081 {"google.com",S_OK},
6082 {"http://google.com/",S_OK},
6083 {"google.com",S_OK},
6084 {"",S_FALSE},
6085 {"",S_FALSE},
6086 {"google.com",S_OK},
6087 {"",S_FALSE},
6088 {"/",S_OK},
6089 {"/",S_OK},
6090 {"",S_FALSE},
6091 {"http://google.com/",S_OK},
6092 {"http",S_OK},
6093 {"",S_FALSE},
6094 {"",S_FALSE}
6095 },
6096 {
6097 {Uri_HOST_DNS,S_OK},
6098 /* Still returns 80, even though earlier the port was disabled. */
6099 {80,S_OK},
6101 {URLZONE_INVALID,E_NOTIMPL}
6102 }
6103 },
6104 { "http://google.com/",0,S_OK,FALSE,
6105 {
6106 {FALSE},
6107 },
6108 /* Instead of getting "TRUE" back as the "hasPort" parameter in GetPort,
6109 * you'll get 122345 instead.
6110 */
6111 {TRUE,122345,222,S_OK,FALSE},
6112 0,S_OK,FALSE,
6113 0,S_OK,FALSE,
6114 0,0,0,S_OK,FALSE,
6115 {
6116 {"http://google.com:222/",S_OK},
6117 {"google.com:222",S_OK},
6118 {"http://google.com:222/",S_OK},
6119 {"google.com",S_OK},
6120 {"",S_FALSE},
6121 {"",S_FALSE},
6122 {"google.com",S_OK},
6123 {"",S_FALSE},
6124 {"/",S_OK},
6125 {"/",S_OK},
6126 {"",S_FALSE},
6127 {"http://google.com:222/",S_OK},
6128 {"http",S_OK},
6129 {"",S_FALSE},
6130 {"",S_FALSE}
6131 },
6132 {
6133 {Uri_HOST_DNS,S_OK},
6134 {222,S_OK},
6136 {URLZONE_INVALID,E_NOTIMPL}
6137 }
6138 },
6139 /* IUri's created with the IUriBuilder can have ports that exceed USHORT_MAX. */
6140 { "http://google.com/",0,S_OK,FALSE,
6141 {
6142 {FALSE},
6143 },
6144 {TRUE,TRUE,999999,S_OK,FALSE},
6145 0,S_OK,FALSE,
6146 0,S_OK,FALSE,
6147 0,0,0,S_OK,FALSE,
6148 {
6149 {"http://google.com:999999/",S_OK},
6150 {"google.com:999999",S_OK},
6151 {"http://google.com:999999/",S_OK},
6152 {"google.com",S_OK},
6153 {"",S_FALSE},
6154 {"",S_FALSE},
6155 {"google.com",S_OK},
6156 {"",S_FALSE},
6157 {"/",S_OK},
6158 {"/",S_OK},
6159 {"",S_FALSE},
6160 {"http://google.com:999999/",S_OK},
6161 {"http",S_OK},
6162 {"",S_FALSE},
6163 {"",S_FALSE}
6164 },
6165 {
6166 {Uri_HOST_DNS,S_OK},
6167 {999999,S_OK},
6169 {URLZONE_INVALID,E_NOTIMPL}
6170 }
6171 },
6172 { "http://google.com/",0,S_OK,FALSE,
6173 {
6174 {TRUE,"test","?test",Uri_PROPERTY_QUERY,S_OK,FALSE},
6175 },
6176
6177 {FALSE},
6178 0,S_OK,FALSE,
6179 0,S_OK,FALSE,
6180 0,0,0,S_OK,FALSE,
6181 {
6182 {"http://google.com/?test",S_OK},
6183 {"google.com",S_OK},
6184 {"http://google.com/?test",S_OK},
6185 {"google.com",S_OK},
6186 {"",S_FALSE},
6187 {"",S_FALSE},
6188 {"google.com",S_OK},
6189 {"",S_FALSE},
6190 {"/",S_OK},
6191 {"/?test",S_OK},
6192 {"?test",S_OK},
6193 {"http://google.com/?test",S_OK},
6194 {"http",S_OK},
6195 {"",S_FALSE},
6196 {"",S_FALSE}
6197 },
6198 {
6199 {Uri_HOST_DNS,S_OK},
6200 {80,S_OK},
6202 {URLZONE_INVALID,E_NOTIMPL}
6203 }
6204 },
6205 { "http://:password@google.com/",0,S_OK,FALSE,
6206 {
6207 {FALSE},
6208 },
6209 {FALSE},
6210 0,S_OK,FALSE,
6211 0,S_OK,FALSE,
6212 0,0,0,S_OK,FALSE,
6213 {
6214 {"http://:password@google.com/",S_OK},
6215 {":password@google.com",S_OK},
6216 {"http://google.com/",S_OK},
6217 {"google.com",S_OK},
6218 {"",S_FALSE},
6219 {"",S_FALSE},
6220 {"google.com",S_OK},
6221 {"password",S_OK},
6222 {"/",S_OK},
6223 {"/",S_OK},
6224 {"",S_FALSE},
6225 {"http://:password@google.com/",S_OK},
6226 {"http",S_OK},
6227 {":password",S_OK},
6228 {"",S_FALSE}
6229 },
6230 {
6231 {Uri_HOST_DNS,S_OK},
6232 {80,S_OK},
6234 {URLZONE_INVALID,E_NOTIMPL}
6235 }
6236 },
6237 /* IUriBuilder doesn't need a base IUri to build a IUri. */
6238 { NULL,0,S_OK,FALSE,
6239 {
6240 {TRUE,"http",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE},
6241 {TRUE,"google.com",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
6242 },
6243 {FALSE},
6244 0,S_OK,FALSE,
6245 0,S_OK,FALSE,
6246 0,0,0,S_OK,FALSE,
6247 {
6248 {"http://google.com/",S_OK},
6249 {"google.com",S_OK},
6250 {"http://google.com/",S_OK},
6251 {"google.com",S_OK},
6252 {"",S_FALSE},
6253 {"",S_FALSE},
6254 {"google.com",S_OK},
6255 {"",S_FALSE},
6256 {"/",S_OK},
6257 {"/",S_OK},
6258 {"",S_FALSE},
6259 {"http://google.com/",S_OK},
6260 {"http",S_OK},
6261 {"",S_FALSE},
6262 {"",S_FALSE}
6263 },
6264 {
6265 {Uri_HOST_DNS,S_OK},
6266 {80,S_OK},
6268 {URLZONE_INVALID,E_NOTIMPL}
6269 }
6270 },
6271 /* Can't set the scheme name to NULL. */
6272 { "zip://google.com/",0,S_OK,FALSE,
6273 {
6274 {TRUE,NULL,"zip",Uri_PROPERTY_SCHEME_NAME,E_INVALIDARG,FALSE}
6275 },
6276 {FALSE},
6277 0,S_OK,FALSE,
6278 0,S_OK,FALSE,
6279 0,0,0,S_OK,FALSE,
6280 {
6281 {"zip://google.com/",S_OK},
6282 {"google.com",S_OK},
6283 {"zip://google.com/",S_OK},
6284 {"google.com",S_OK},
6285 {"",S_FALSE},
6286 {"",S_FALSE},
6287 {"google.com",S_OK},
6288 {"",S_FALSE},
6289 {"/",S_OK},
6290 {"/",S_OK},
6291 {"",S_FALSE},
6292 {"zip://google.com/",S_OK},
6293 {"zip",S_OK},
6294 {"",S_FALSE},
6295 {"",S_FALSE}
6296 },
6297 {
6298 {Uri_HOST_DNS,S_OK},
6299 {0,S_FALSE},
6301 {URLZONE_INVALID,E_NOTIMPL}
6302 }
6303 },
6304 /* Can't set the scheme name to an empty string. */
6305 { "zip://google.com/",0,S_OK,FALSE,
6306 {
6307 {TRUE,"","zip",Uri_PROPERTY_SCHEME_NAME,E_INVALIDARG,FALSE}
6308 },
6309 {FALSE},
6310 0,S_OK,FALSE,
6311 0,S_OK,FALSE,
6312 0,0,0,S_OK,FALSE,
6313 {
6314 {"zip://google.com/",S_OK},
6315 {"google.com",S_OK},
6316 {"zip://google.com/",S_OK},
6317 {"google.com",S_OK},
6318 {"",S_FALSE},
6319 {"",S_FALSE},
6320 {"google.com",S_OK},
6321 {"",S_FALSE},
6322 {"/",S_OK},
6323 {"/",S_OK},
6324 {"",S_FALSE},
6325 {"zip://google.com/",S_OK},
6326 {"zip",S_OK},
6327 {"",S_FALSE},
6328 {"",S_FALSE}
6329 },
6330 {
6331 {Uri_HOST_DNS,S_OK},
6332 {0,S_FALSE},
6334 {URLZONE_INVALID,E_NOTIMPL}
6335 }
6336 },
6337 /* -1 to CreateUri makes it use the same flags as the base IUri was created with.
6338 * CreateUriSimple always uses the flags the base IUri was created with (if any).
6339 */
6340 { "http://google.com/../../",Uri_CREATE_NO_CANONICALIZE,S_OK,FALSE,
6341 {{FALSE}},
6342 {FALSE},
6343 -1,S_OK,FALSE,
6344 0,S_OK,FALSE,
6345 0,UriBuilder_USE_ORIGINAL_FLAGS,0,S_OK,FALSE,
6346 {
6347 {"http://google.com/../../",S_OK},
6348 {"google.com",S_OK},
6349 {"http://google.com/../../",S_OK},
6350 {"google.com",S_OK},
6351 {"",S_FALSE},
6352 {"",S_FALSE},
6353 {"google.com",S_OK},
6354 {"",S_FALSE},
6355 {"/../../",S_OK},
6356 {"/../../",S_OK},
6357 {"",S_FALSE},
6358 {"http://google.com/../../",S_OK},
6359 {"http",S_OK},
6360 {"",S_FALSE},
6361 {"",S_FALSE}
6362 },
6363 {
6364 {Uri_HOST_DNS,S_OK},
6365 {80,S_OK},
6367 {URLZONE_INVALID,E_NOTIMPL}
6368 }
6369 },
6370 { "http://google.com/",0,S_OK,FALSE,
6371 {
6372 {TRUE,"#Fr<|>g",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
6373 },
6374 {FALSE},
6375 -1,S_OK,FALSE,
6376 0,S_OK,FALSE,
6377 Uri_CREATE_NO_DECODE_EXTRA_INFO,UriBuilder_USE_ORIGINAL_FLAGS,0,S_OK,FALSE,
6378 {
6379 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
6380 {"google.com",S_OK},
6381 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
6382 {"google.com",S_OK},
6383 {"",S_FALSE},
6384 {"#Fr%3C%7C%3Eg",S_OK},
6385 {"google.com",S_OK},
6386 {"",S_FALSE},
6387 {"/",S_OK},
6388 {"/",S_OK},
6389 {"",S_FALSE},
6390 {"http://google.com/#Fr<|>g",S_OK},
6391 {"http",S_OK},
6392 {"",S_FALSE},
6393 {"",S_FALSE}
6394 },
6395 {
6396 {Uri_HOST_DNS,S_OK},
6397 {80,S_OK},
6399 {URLZONE_INVALID,E_NOTIMPL}
6400 }
6401 },
6402 { "http://google.com/",0,S_OK,FALSE,
6403 {
6404 {TRUE,"#Fr<|>g",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
6405 },
6406 {FALSE},
6407 Uri_CREATE_CANONICALIZE|Uri_CREATE_NO_CANONICALIZE,E_INVALIDARG,FALSE,
6408 0,S_OK,FALSE,
6409 Uri_CREATE_CANONICALIZE|Uri_CREATE_NO_CANONICALIZE,UriBuilder_USE_ORIGINAL_FLAGS,0,S_OK,FALSE,
6410 {
6411 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
6412 {"google.com",S_OK},
6413 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
6414 {"google.com",S_OK},
6415 {"",S_FALSE},
6416 {"#Fr%3C%7C%3Eg",S_OK},
6417 {"google.com",S_OK},
6418 {"",S_FALSE},
6419 {"/",S_OK},
6420 {"/",S_OK},
6421 {"",S_FALSE},
6422 {"http://google.com/#Fr<|>g",S_OK},
6423 {"http",S_OK},
6424 {"",S_FALSE},
6425 {"",S_FALSE}
6426 },
6427 {
6428 {Uri_HOST_DNS,S_OK},
6429 {80,S_OK},
6431 {URLZONE_INVALID,E_NOTIMPL}
6432 }
6433 },
6434 { NULL,0,S_OK,FALSE,
6435 {
6436 {TRUE,"/test/test/",NULL,Uri_PROPERTY_PATH,S_OK,FALSE},
6437 {TRUE,"#Fr<|>g",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
6438 },
6439 {FALSE},
6443 },
6444 { "http://google.com/",0,S_OK,FALSE,
6445 {
6446 {TRUE,"ht%xxtp",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE}
6447 },
6448 {FALSE},
6452 },
6453 /* File scheme's can't have a username set. */
6454 { "file://google.com/",0,S_OK,FALSE,
6455 {
6456 {TRUE,"username",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
6457 },
6458 {FALSE},
6462 },
6463 /* File schemes can't have a password set. */
6464 { "file://google.com/",0,S_OK,FALSE,
6465 {
6466 {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
6467 },
6468 {FALSE},
6472 },
6473 /* UserName can't contain any character that is a delimiter for another
6474 * component that appears after it in a normal URI.
6475 */
6476 { "http://google.com/",0,S_OK,FALSE,
6477 {
6478 {TRUE,"user:pass",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
6479 },
6480 {FALSE},
6484 },
6485 { "http://google.com/",0,S_OK,FALSE,
6486 {
6487 {TRUE,"user@google.com",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
6488 },
6489 {FALSE},
6493 },
6494 { "http://google.com/",0,S_OK,FALSE,
6495 {
6496 {TRUE,"user/path",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
6497 },
6498 {FALSE},
6502 },
6503 { "http://google.com/",0,S_OK,FALSE,
6504 {
6505 {TRUE,"user?Query",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
6506 },
6507 {FALSE},
6511 },
6512 { "http://google.com/",0,S_OK,FALSE,
6513 {
6514 {TRUE,"user#Frag",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
6515 },
6516 {FALSE},
6520 },
6521 { "http://google.com/",0,S_OK,FALSE,
6522 {
6523 {TRUE,"pass@google.com",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
6524 },
6525 {FALSE},
6529 },
6530 { "http://google.com/",0,S_OK,FALSE,
6531 {
6532 {TRUE,"pass/path",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
6533 },
6534 {FALSE},
6538 },
6539 { "http://google.com/",0,S_OK,FALSE,
6540 {
6541 {TRUE,"pass?query",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
6542 },
6543 {FALSE},
6547 },
6548 { "http://google.com/",0,S_OK,FALSE,
6549 {
6550 {TRUE,"pass#frag",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
6551 },
6552 {FALSE},
6556 },
6557 { "http://google.com/",0,S_OK,FALSE,
6558 {
6559 {TRUE,"winehq.org/test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
6560 },
6561 {FALSE},
6565 },
6566 { "http://google.com/",0,S_OK,FALSE,
6567 {
6568 {TRUE,"winehq.org?test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
6569 },
6570 {FALSE},
6574 },
6575 { "http://google.com/",0,S_OK,FALSE,
6576 {
6577 {TRUE,"winehq.org#test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
6578 },
6579 {FALSE},
6583 },
6584 /* Hostname is allowed to contain a ':' (even for known scheme types). */
6585 { "http://google.com/",0,S_OK,FALSE,
6586 {
6587 {TRUE,"winehq.org:test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE},
6588 },
6589 {FALSE},
6590 0,S_OK,FALSE,
6591 0,S_OK,FALSE,
6592 0,0,0,S_OK,FALSE,
6593 {
6594 {"http://winehq.org:test/",S_OK},
6595 {"winehq.org:test",S_OK},
6596 {"http://winehq.org:test/",S_OK},
6597 {"winehq.org:test",S_OK},
6598 {"",S_FALSE},
6599 {"",S_FALSE},
6600 {"winehq.org:test",S_OK},
6601 {"",S_FALSE},
6602 {"/",S_OK},
6603 {"/",S_OK},
6604 {"",S_FALSE},
6605 {"http://winehq.org:test/",S_OK},
6606 {"http",S_OK},
6607 {"",S_FALSE},
6608 {"",S_FALSE}
6609 },
6610 {
6611 {Uri_HOST_DNS,S_OK},
6612 {80,S_OK},
6614 {URLZONE_INVALID,E_NOTIMPL}
6615 }
6616 },
6617 /* Can't set the host name to NULL. */
6618 { "http://google.com/",0,S_OK,FALSE,
6619 {
6620 {TRUE,NULL,"google.com",Uri_PROPERTY_HOST,E_INVALIDARG,FALSE}
6621 },
6622 {FALSE},
6623 0,S_OK,FALSE,
6624 0,S_OK,FALSE,
6625 0,0,0,S_OK,FALSE,
6626 {
6627 {"http://google.com/",S_OK},
6628 {"google.com",S_OK},
6629 {"http://google.com/",S_OK},
6630 {"google.com",S_OK},
6631 {"",S_FALSE},
6632 {"",S_FALSE},
6633 {"google.com",S_OK},
6634 {"",S_FALSE},
6635 {"/",S_OK},
6636 {"/",S_OK},
6637 {"",S_FALSE},
6638 {"http://google.com/",S_OK},
6639 {"http",S_OK},
6640 {"",S_FALSE},
6641 {"",S_FALSE}
6642 },
6643 {
6644 {Uri_HOST_DNS,S_OK},
6645 {80,S_OK},
6647 {URLZONE_INVALID,E_NOTIMPL}
6648 }
6649 },
6650 /* Can set the host name to an empty string. */
6651 { "http://google.com/",0,S_OK,FALSE,
6652 {
6653 {TRUE,"",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
6654 },
6655 {FALSE},
6656 0,S_OK,FALSE,
6657 0,S_OK,FALSE,
6658 0,0,0,S_OK,FALSE,
6659 {
6660 {"http:///",S_OK},
6661 {"",S_OK},
6662 {"http:///",S_OK},
6663 {"",S_FALSE},
6664 {"",S_FALSE},
6665 {"",S_FALSE},
6666 {"",S_OK},
6667 {"",S_FALSE},
6668 {"/",S_OK},
6669 {"/",S_OK},
6670 {"",S_FALSE},
6671 {"http:///",S_OK},
6672 {"http",S_OK},
6673 {"",S_FALSE},
6674 {"",S_FALSE}
6675 },
6676 {
6677 {Uri_HOST_UNKNOWN,S_OK},
6678 {80,S_OK},
6680 {URLZONE_INVALID,E_NOTIMPL}
6681 }
6682 },
6683 { "http://google.com/",0,S_OK,FALSE,
6684 {
6685 {TRUE,"/path?query",NULL,Uri_PROPERTY_PATH,S_OK,FALSE}
6686 },
6687 {FALSE},
6691 },
6692 { "http://google.com/",0,S_OK,FALSE,
6693 {
6694 {TRUE,"/path#test",NULL,Uri_PROPERTY_PATH,S_OK,FALSE}
6695 },
6696 {FALSE},
6700 },
6701 { "http://google.com/",0,S_OK,FALSE,
6702 {
6703 {TRUE,"?path#test",NULL,Uri_PROPERTY_QUERY,S_OK,FALSE}
6704 },
6705 {FALSE},
6709 },
6710 { "file:///c:/dir/file.html",0,S_OK,FALSE,
6711 {
6712 {TRUE,NULL,NULL,Uri_PROPERTY_FRAGMENT,S_OK},
6713 },
6714 {FALSE},
6715 0,S_OK,FALSE,
6716 0,S_OK,FALSE,
6717 0,0,0,S_OK,FALSE,
6718 {
6719 {"file:///c:/dir/file.html",S_OK},
6720 {"",S_FALSE},
6721 {"file:///c:/dir/file.html",S_OK},
6722 {"",S_FALSE},
6723 {".html",S_OK},
6724 {"",S_FALSE},
6725 {"",S_FALSE},
6726 {"",S_FALSE},
6727 {"/c:/dir/file.html",S_OK},
6728 {"/c:/dir/file.html",S_OK},
6729 {"",S_FALSE},
6730 {"file:///c:/dir/file.html",S_OK},
6731 {"file",S_OK},
6732 {"",S_FALSE},
6733 {"",S_FALSE}
6734 },
6735 {
6736 {Uri_HOST_UNKNOWN,S_OK},
6737 {0,S_FALSE},
6739 {URLZONE_INVALID,E_NOTIMPL}
6740 }
6741 },
6742 { "file:///c:/dir/file.html",0,S_OK,FALSE,
6743 {
6744 {TRUE,"#",NULL,Uri_PROPERTY_FRAGMENT,S_OK},
6745 },
6746 {FALSE},
6747 0,S_OK,FALSE,
6748 0,S_OK,FALSE,
6749 0,0,0,S_OK,FALSE,
6750 {
6751 {"file:///c:/dir/file.html#",S_OK},
6752 {"",S_FALSE},
6753 {"file:///c:/dir/file.html#",S_OK},
6754 {"",S_FALSE},
6755 {".html",S_OK},
6756 {"#",S_OK},
6757 {"",S_FALSE},
6758 {"",S_FALSE},
6759 {"/c:/dir/file.html",S_OK},
6760 {"/c:/dir/file.html",S_OK},
6761 {"",S_FALSE},
6762 {"file:///c:/dir/file.html#",S_OK},
6763 {"file",S_OK},
6764 {"",S_FALSE},
6765 {"",S_FALSE}
6766 },
6767 {
6768 {Uri_HOST_UNKNOWN,S_OK},
6769 {0,S_FALSE},
6771 {URLZONE_INVALID,E_NOTIMPL}
6772 }
6773 }
6774};
6775
6777 const char *uri;
6781
6785
6786 const char *expected_uri;
6791
6793 { "http://google.com/test?test=y#Frag",0,S_OK,FALSE,
6794 Uri_HAS_FRAGMENT|Uri_HAS_PATH|Uri_HAS_QUERY,S_OK,FALSE,
6795 "http://google.com/",0,S_OK,FALSE
6796 },
6797 { "http://user:pass@winehq.org/",0,S_OK,FALSE,
6798 Uri_HAS_USER_NAME|Uri_HAS_PASSWORD,S_OK,FALSE,
6799 "http://winehq.org/",0,S_OK,FALSE
6800 },
6801 { "zip://google.com?Test=x",0,S_OK,FALSE,
6802 Uri_HAS_HOST,S_OK,FALSE,
6803 "zip:/?Test=x",0,S_OK,FALSE
6804 },
6805 /* Doesn't remove the whole userinfo component. */
6806 { "http://username:pass@google.com/",0,S_OK,FALSE,
6807 Uri_HAS_USER_INFO,S_OK,FALSE,
6808 "http://username:pass@google.com/",0,S_OK,FALSE
6809 },
6810 /* Doesn't remove the domain. */
6811 { "http://google.com/",0,S_OK,FALSE,
6812 Uri_HAS_DOMAIN,S_OK,FALSE,
6813 "http://google.com/",0,S_OK,FALSE
6814 },
6815 { "http://google.com:120/",0,S_OK,FALSE,
6816 Uri_HAS_AUTHORITY,S_OK,FALSE,
6817 "http://google.com:120/",0,S_OK,FALSE
6818 },
6819 { "http://google.com/test.com/",0,S_OK,FALSE,
6820 Uri_HAS_EXTENSION,S_OK,FALSE,
6821 "http://google.com/test.com/",0,S_OK,FALSE
6822 },
6823 { "http://google.com/?test=x",0,S_OK,FALSE,
6824 Uri_HAS_PATH_AND_QUERY,S_OK,FALSE,
6825 "http://google.com/?test=x",0,S_OK,FALSE
6826 },
6827 /* Can't remove the scheme name. */
6828 { "http://google.com/?test=x",0,S_OK,FALSE,
6829 Uri_HAS_SCHEME_NAME|Uri_HAS_QUERY,E_INVALIDARG,FALSE,
6830 "http://google.com/?test=x",0,S_OK,FALSE
6831 }
6832};
6833
6835 const char *value;
6838 const char *broken_value;
6839 const char *value_ex;
6841
6842typedef struct _uri_combine_test {
6843 const char *base_uri;
6845 const char *relative_uri;
6850
6854
6856 { "http://google.com/fun/stuff",0,
6857 "../not/fun/stuff",Uri_CREATE_ALLOW_RELATIVE,
6858 0,S_OK,FALSE,
6859 {
6860 {"http://google.com/not/fun/stuff",S_OK},
6861 {"google.com",S_OK},
6862 {"http://google.com/not/fun/stuff",S_OK},
6863 {"google.com",S_OK},
6864 {"",S_FALSE},
6865 {"",S_FALSE},
6866 {"google.com",S_OK},
6867 {"",S_FALSE},
6868 {"/not/fun/stuff",S_OK},
6869 {"/not/fun/stuff",S_OK},
6870 {"",S_FALSE},
6871 {"http://google.com/not/fun/stuff",S_OK},
6872 {"http",S_OK},
6873 {"",S_FALSE},
6874 {"",S_FALSE}
6875 },
6876 {
6877 {Uri_HOST_DNS,S_OK},
6878 {80,S_OK},
6880 {URLZONE_INVALID,E_NOTIMPL}
6881 }
6882 },
6883 { "http://google.com/test",0,
6884 "zip://test.com/cool",0,
6885 0,S_OK,FALSE,
6886 {
6887 {"zip://test.com/cool",S_OK},
6888 {"test.com",S_OK},
6889 {"zip://test.com/cool",S_OK},
6890 {"test.com",S_OK},
6891 {"",S_FALSE},
6892 {"",S_FALSE},
6893 {"test.com",S_OK},
6894 {"",S_FALSE},
6895 {"/cool",S_OK},
6896 {"/cool",S_OK},
6897 {"",S_FALSE},
6898 {"zip://test.com/cool",S_OK},
6899 {"zip",S_OK},
6900 {"",S_FALSE},
6901 {"",S_FALSE}
6902 },
6903 {
6904 {Uri_HOST_DNS,S_OK},
6905 {0,S_FALSE},
6907 {URLZONE_INVALID,E_NOTIMPL}
6908 }
6909 },
6910 { "http://google.com/use/base/path",0,
6911 "?relative",Uri_CREATE_ALLOW_RELATIVE,
6912 0,S_OK,FALSE,
6913 {
6914 {"http://google.com/use/base/path?relative",S_OK},
6915 {"google.com",S_OK},
6916 {"http://google.com/use/base/path?relative",S_OK},
6917 {"google.com",S_OK},
6918 {"",S_FALSE},
6919 {"",S_FALSE},
6920 {"google.com",S_OK},
6921 {"",S_FALSE},
6922 {"/use/base/path",S_OK},
6923 {"/use/base/path?relative",S_OK},
6924 {"?relative",S_OK},
6925 {"http://google.com/use/base/path?relative",S_OK},
6926 {"http",S_OK},
6927 {"",S_FALSE},
6928 {"",S_FALSE}
6929 },
6930 {
6931 {Uri_HOST_DNS,S_OK},
6932 {80,S_OK},
6934 {URLZONE_INVALID,E_NOTIMPL}
6935 }
6936 },
6937 { "http://google.com/path",0,
6938 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE,
6939 0,S_OK,FALSE,
6940 {
6941 {"http://google.com/testing",S_OK},
6942 {"google.com",S_OK},
6943 {"http://google.com/testing",S_OK},
6944 {"google.com",S_OK},
6945 {"",S_FALSE},
6946 {"",S_FALSE},
6947 {"google.com",S_OK},
6948 {"",S_FALSE},
6949 {"/testing",S_OK},
6950 {"/testing",S_OK},
6951 {"",S_FALSE},
6952 {"http://google.com/testing",S_OK},
6953 {"http",S_OK},
6954 {"",S_FALSE},
6955 {"",S_FALSE}
6956 },
6957 {
6958 {Uri_HOST_DNS,S_OK},
6959 {80,S_OK},
6961 {URLZONE_INVALID,E_NOTIMPL}
6962 }
6963 },
6964 { "http://google.com/path",0,
6965 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE,
6967 {
6968 {"http://google.com:80/test/../test/.././testing",S_OK},
6969 {"google.com",S_OK},
6970 {"http://google.com:80/test/../test/.././testing",S_OK},
6971 {"google.com",S_OK},
6972 {"",S_FALSE},
6973 {"",S_FALSE},
6974 {"google.com",S_OK},
6975 {"",S_FALSE},
6976 {"/test/../test/.././testing",S_OK},
6977 {"/test/../test/.././testing",S_OK},
6978 {"",S_FALSE},
6979 {"http://google.com:80/test/../test/.././testing",S_OK},
6980 {"http",S_OK},
6981 {"",S_FALSE},
6982 {"",S_FALSE}
6983 },
6984 {
6985 {Uri_HOST_DNS,S_OK},
6986 {80,S_OK},
6988 {URLZONE_INVALID,E_NOTIMPL}
6989 }
6990 },
6991 { "http://winehq.org/test/abc",0,
6992 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE,
6993 0,S_OK,FALSE,
6994 {
6995 {"http://winehq.org/test/testing/test",S_OK},
6996 {"winehq.org",S_OK},
6997 {"http://winehq.org/test/testing/test",S_OK},
6998 {"winehq.org",S_OK},
6999 {"",S_FALSE},
7000 {"",S_FALSE},
7001 {"winehq.org",S_OK},
7002 {"",S_FALSE},
7003 {"/test/testing/test",S_OK},
7004 {"/test/testing/test",S_OK},
7005 {"",S_FALSE},
7006 {"http://winehq.org/test/testing/test",S_OK},
7007 {"http",S_OK},
7008 {"",S_FALSE},
7009 {"",S_FALSE}
7010 },
7011 {
7012 {Uri_HOST_DNS,S_OK},
7013 {80,S_OK},
7015 {URLZONE_INVALID,E_NOTIMPL}
7016 }
7017 },
7018 { "http://winehq.org/test/abc",0,
7019 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE,
7021 {
7022 {"http://winehq.org:80/test/testing/abc/../test",S_OK},
7023 /* Default port is hidden in the authority. */
7024 {"winehq.org",S_OK},
7025 {"http://winehq.org:80/test/testing/abc/../test",S_OK},
7026 {"winehq.org",S_OK},
7027 {"",S_FALSE},
7028 {"",S_FALSE},
7029 {"winehq.org",S_OK},
7030 {"",S_FALSE},
7031 {"/test/testing/abc/../test",S_OK},
7032 {"/test/testing/abc/../test",S_OK},
7033 {"",S_FALSE},
7034 {"http://winehq.org:80/test/testing/abc/../test",S_OK},
7035 {"http",S_OK},
7036 {"",S_FALSE},
7037 {"",S_FALSE}
7038 },
7039 {
7040 {Uri_HOST_DNS,S_OK},
7041 {80,S_OK},
7043 {URLZONE_INVALID,E_NOTIMPL}
7044 }
7045 },
7046 { "http://winehq.org/test?query",0,
7047 "testing",Uri_CREATE_ALLOW_RELATIVE,
7048 0,S_OK,FALSE,
7049 {
7050 {"http://winehq.org/testing",S_OK},
7051 {"winehq.org",S_OK},
7052 {"http://winehq.org/testing",S_OK},
7053 {"winehq.org",S_OK},
7054 {"",S_FALSE},
7055 {"",S_FALSE},
7056 {"winehq.org",S_OK},
7057 {"",S_FALSE},
7058 {"/testing",S_OK},
7059 {"/testing",S_OK},
7060 {"",S_FALSE},
7061 {"http://winehq.org/testing",S_OK},
7062 {"http",S_OK},
7063 {"",S_FALSE},
7064 {"",S_FALSE}
7065 },
7066 {
7067 {Uri_HOST_DNS,S_OK},
7068 {80,S_OK},
7070 {URLZONE_INVALID,E_NOTIMPL}
7071 }
7072 },
7073 { "http://winehq.org/test#frag",0,
7074 "testing",Uri_CREATE_ALLOW_RELATIVE,
7075 0,S_OK,FALSE,
7076 {
7077 {"http://winehq.org/testing",S_OK},
7078 {"winehq.org",S_OK},
7079 {"http://winehq.org/testing",S_OK},
7080 {"winehq.org",S_OK},
7081 {"",S_FALSE},
7082 {"",S_FALSE},
7083 {"winehq.org",S_OK},
7084 {"",S_FALSE},
7085 {"/testing",S_OK},
7086 {"/testing",S_OK},
7087 {"",S_FALSE},
7088 {"http://winehq.org/testing",S_OK},
7089 {"http",S_OK},
7090 {"",S_FALSE},
7091 {"",S_FALSE}
7092 },
7093 {
7094 {Uri_HOST_DNS,S_OK},
7095 {80,S_OK},
7097 {URLZONE_INVALID,E_NOTIMPL}
7098 }
7099 },
7100 { "testing?query#frag",Uri_CREATE_ALLOW_RELATIVE,
7101 "test",Uri_CREATE_ALLOW_RELATIVE,
7102 0,S_OK,FALSE,
7103 {
7104 {"test",S_OK},
7105 {"",S_FALSE},
7106 {"test",S_OK},
7107 {"",S_FALSE},
7108 {"",S_FALSE},
7109 {"",S_FALSE},
7110 {"",S_FALSE},
7111 {"",S_FALSE},
7112 {"test",S_OK},
7113 {"test",S_OK},
7114 {"",S_FALSE},
7115 {"test",S_OK},
7116 {"",S_FALSE},
7117 {"",S_FALSE},
7118 {"",S_FALSE}
7119 },
7120 {
7121 {Uri_HOST_UNKNOWN,S_OK},
7122 {0,S_FALSE},
7124 {URLZONE_INVALID,E_NOTIMPL}
7125 }
7126 },
7127 { "file:///c:/test/test",0,
7128 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE,
7130 {
7131 {"file://c:\\testing.mp3",S_OK},
7132 {"",S_FALSE},
7133 {"file://c:\\testing.mp3",S_OK},
7134 {"",S_FALSE},
7135 {".mp3",S_OK},
7136 {"",S_FALSE},
7137 {"",S_FALSE},
7138 {"",S_FALSE},
7139 {"c:\\testing.mp3",S_OK},
7140 {"c:\\testing.mp3",S_OK},
7141 {"",S_FALSE},
7142 {"file://c:\\testing.mp3",S_OK},
7143 {"file",S_OK},
7144 {"",S_FALSE},
7145 {"",S_FALSE}
7146 },
7147 {
7148 {Uri_HOST_UNKNOWN,S_OK},
7149 {0,S_FALSE},
7151 {URLZONE_INVALID,E_NOTIMPL}
7152 }
7153 },
7154 { "file:///c:/test/test",0,
7155 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE,
7156 0,S_OK,FALSE,
7157 {
7158 {"file:///c:/testing.mp3",S_OK},
7159 {"",S_FALSE},
7160 {"file:///c:/testing.mp3",S_OK},
7161 {"",S_FALSE},
7162 {".mp3",S_OK},
7163 {"",S_FALSE},
7164 {"",S_FALSE},
7165 {"",S_FALSE},
7166 {"/c:/testing.mp3",S_OK},
7167 {"/c:/testing.mp3",S_OK},
7168 {"",S_FALSE},
7169 {"file:///c:/testing.mp3",S_OK},
7170 {"file",S_OK},
7171 {"",S_FALSE},
7172 {"",S_FALSE}
7173 },
7174 {
7175 {Uri_HOST_UNKNOWN,S_OK},
7176 {0,S_FALSE},
7178 {URLZONE_INVALID,E_NOTIMPL}
7179 }
7180 },
7181 { "file://test.com/test/test",0,
7182 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE,
7184 {
7185 {"file://\\\\test.com\\testing.mp3",S_OK},
7186 {"test.com",S_OK},
7187 {"file://\\\\test.com\\testing.mp3",S_OK},
7188 {"test.com",S_OK},
7189 {".mp3",S_OK},
7190 {"",S_FALSE},
7191 {"test.com",S_OK},
7192 {"",S_FALSE},
7193 {"\\testing.mp3",S_OK},
7194 {"\\testing.mp3",S_OK},
7195 {"",S_FALSE},
7196 {"file://\\\\test.com\\testing.mp3",S_OK},
7197 {"file",S_OK},
7198 {"",S_FALSE},
7199 {"",S_FALSE}
7200 },
7201 {
7202 {Uri_HOST_DNS,S_OK},
7203 {0,S_FALSE},
7205 {URLZONE_INVALID,E_NOTIMPL}
7206 }
7207 },
7208 /* URL_DONT_SIMPLIFY has no effect. */
7209 { "http://google.com/test",0,
7210 "zip://test.com/cool/../cool/test",0,
7212 {
7213 {"zip://test.com/cool/test",S_OK,FALSE,NULL,"zip://test.com/cool/../cool/test"},
7214 {"test.com",S_OK},
7215 {"zip://test.com/cool/test",S_OK,FALSE,NULL,"zip://test.com/cool/../cool/test"},
7216 {"test.com",S_OK},
7217 {"",S_FALSE},
7218 {"",S_FALSE},
7219 {"test.com",S_OK},
7220 {"",S_FALSE},
7221 {"/cool/test",S_OK,FALSE,NULL,"/cool/../cool/test"},
7222 {"/cool/test",S_OK,FALSE,NULL,"/cool/../cool/test"},
7223 {"",S_FALSE},
7224 /* The resulting IUri has the same Raw URI as the relative URI (only IE 8).
7225 * On IE 7 it reduces the path in the Raw URI.
7226 */
7227 {"zip://test.com/cool/../cool/test",S_OK,FALSE,"zip://test.com/cool/test"},
7228 {"zip",S_OK},
7229 {"",S_FALSE},
7230 {"",S_FALSE}
7231 },
7232 {
7233 {Uri_HOST_DNS,S_OK},
7234 {0,S_FALSE},
7236 {URLZONE_INVALID,E_NOTIMPL}
7237 }
7238 },
7239 /* FILE_USE_PATHURL has no effect in IE 8, in IE 7 the
7240 * resulting URI is converted into a dos path.
7241 */
7242 { "http://google.com/test",0,
7243 "file:///c:/test/",0,
7245 {
7246 {"file:///c:/test/",S_OK,FALSE,"file://c:\\test\\"},
7247 {"",S_FALSE},
7248 {"file:///c:/test/",S_OK,FALSE,"file://c:\\test\\"},
7249 {"",S_FALSE},
7250 {"",S_FALSE},
7251 {"",S_FALSE},
7252 {"",S_FALSE},
7253 {"",S_FALSE},
7254 {"/c:/test/",S_OK,FALSE,"c:\\test\\"},
7255 {"/c:/test/",S_OK,FALSE,"c:\\test\\"},
7256 {"",S_FALSE},
7257 {"file:///c:/test/",S_OK,FALSE,"file://c:\\test\\"},
7258 {"file",S_OK},
7259 {"",S_FALSE},
7260 {"",S_FALSE}
7261 },
7262 {
7263 {Uri_HOST_UNKNOWN,S_OK},
7264 {0,S_FALSE},
7266 {URLZONE_INVALID,E_NOTIMPL}
7267 }
7268 },
7269 { "http://google.com/test",0,
7270 "http://test.com/test#%30test",0,
7272 {
7273 {"http://test.com/test#0test",S_OK,FALSE,NULL,"http://test.com/test#%30test"},
7274 {"test.com",S_OK},
7275 {"http://test.com/test#0test",S_OK,FALSE,NULL,"http://test.com/test#%30test"},
7276 {"test.com",S_OK},
7277 {"",S_FALSE},
7278 {"#0test",S_OK,FALSE,NULL,"#%30test"},
7279 {"test.com",S_OK},
7280 {"",S_FALSE},
7281 {"/test",S_OK},
7282 {"/test",S_OK},
7283 {"",S_FALSE},
7284 /* IE 7 decodes the %30 to a 0 in the Raw URI. */
7285 {"http://test.com/test#%30test",S_OK,FALSE,"http://test.com/test#0test"},
7286 {"http",S_OK},
7287 {"",S_FALSE},
7288 {"",S_FALSE}
7289 },
7290 {
7291 {Uri_HOST_DNS,S_OK},
7292 {80,S_OK},
7294 {URLZONE_INVALID,E_NOTIMPL}
7295 }
7296 },
7297 /* Windows validates the path component from the relative Uri. */
7298 { "http://google.com/test",0,
7299 "/Te%XXst",Uri_CREATE_ALLOW_RELATIVE,
7301 },
7302 /* Windows doesn't validate the query from the relative Uri. */
7303 { "http://google.com/test",0,
7304 "?Tes%XXt",Uri_CREATE_ALLOW_RELATIVE,
7305 0,S_OK,FALSE,
7306 {
7307 {"http://google.com/test?Tes%XXt",S_OK},
7308 {"google.com",S_OK},
7309 {"http://google.com/test?Tes%XXt",S_OK},
7310 {"google.com",S_OK},
7311 {"",S_FALSE},
7312 {"",S_FALSE},
7313 {"google.com",S_OK},
7314 {"",S_FALSE},
7315 {"/test",S_OK},
7316 {"/test?Tes%XXt",S_OK},
7317 {"?Tes%XXt",S_OK},
7318 {"http://google.com/test?Tes%XXt",S_OK},
7319 {"http",S_OK},
7320 {"",S_FALSE},
7321 {"",S_FALSE}
7322 },
7323 {
7324 {Uri_HOST_DNS,S_OK},
7325 {80,S_OK},
7327 {URLZONE_INVALID,E_NOTIMPL}
7328 }
7329 },
7330 /* Windows doesn't validate the fragment from the relative Uri. */
7331 { "http://google.com/test",0,
7332 "#Tes%XXt",Uri_CREATE_ALLOW_RELATIVE,
7333 0,S_OK,FALSE,
7334 {
7335 {"http://google.com/test#Tes%XXt",S_OK},
7336 {"google.com",S_OK},
7337 {"http://google.com/test#Tes%XXt",S_OK},
7338 {"google.com",S_OK},
7339 {"",S_FALSE},
7340 {"#Tes%XXt",S_OK},
7341 {"google.com",S_OK},
7342 {"",S_FALSE},
7343 {"/test",S_OK},
7344 {"/test",S_OK},
7345 {"",S_FALSE},
7346 {"http://google.com/test#Tes%XXt",S_OK},
7347 {"http",S_OK},
7348 {"",S_FALSE},
7349 {"",S_FALSE}
7350 },
7351 {
7352 {Uri_HOST_DNS,S_OK},
7353 {80,S_OK},
7355 {URLZONE_INVALID,E_NOTIMPL}
7356 }
7357 },
7358 /* Creates an IUri which contains an invalid dos path char. */
7359 { "file:///c:/test",0,
7360 "/test<ing",Uri_CREATE_ALLOW_RELATIVE,
7362 {
7363 {"file://c:\\test<ing",S_OK},
7364 {"",S_FALSE},
7365 {"file://c:\\test<ing",S_OK},
7366 {"",S_FALSE},
7367 {"",S_FALSE},
7368 {"",S_FALSE},
7369 {"",S_FALSE},
7370 {"",S_FALSE},
7371 {"c:\\test<ing",S_OK},
7372 {"c:\\test<ing",S_OK},
7373 {"",S_FALSE},
7374 {"file://c:\\test<ing",S_OK},
7375 {"file",S_OK},
7376 {"",S_FALSE},
7377 {"",S_FALSE}
7378 },
7379 {
7380 {Uri_HOST_UNKNOWN,S_OK},
7381 {0,S_FALSE},
7383 {URLZONE_INVALID,E_NOTIMPL}
7384 }
7385 },
7386 /* Appends the path after the drive letter (if any). */
7387 { "file:///c:/test",0,
7388 "/c:/testing",Uri_CREATE_ALLOW_RELATIVE,
7389 0,S_OK,FALSE,
7390 {
7391 {"file:///c:/c:/testing",S_OK},
7392 {"",S_FALSE},
7393 {"file:///c:/c:/testing",S_OK},
7394 {"",S_FALSE},
7395 {"",S_FALSE},
7396 {"",S_FALSE},
7397 {"",S_FALSE},
7398 {"",S_FALSE},
7399 {"/c:/c:/testing",S_OK},
7400 {"/c:/c:/testing",S_OK},
7401 {"",S_FALSE},
7402 {"file:///c:/c:/testing",S_OK},
7403 {"file",S_OK},
7404 {"",S_FALSE},
7405 {"",S_FALSE}
7406 },
7407 {
7408 {Uri_HOST_UNKNOWN,S_OK},
7409 {0,S_FALSE},
7411 {URLZONE_INVALID,E_NOTIMPL}
7412 }
7413 },
7414 /* A '/' is added if the base URI doesn't have a path and the
7415 * relative URI doesn't contain a path (since the base URI is
7416 * hierarchical.
7417 */
7418 { "http://google.com",Uri_CREATE_NO_CANONICALIZE,
7419 "?test",Uri_CREATE_ALLOW_RELATIVE,
7420 0,S_OK,FALSE,
7421 {
7422 {"http://google.com/?test",S_OK},
7423 {"google.com",S_OK},
7424 {"http://google.com/?test",S_OK},
7425 {"google.com",S_OK},
7426 {"",S_FALSE},
7427 {"",S_FALSE},
7428 {"google.com",S_OK},
7429 {"",S_FALSE},
7430 {"/",S_OK},
7431 {"/?test",S_OK},
7432 {"?test",S_OK},
7433 {"http://google.com/?test",S_OK},
7434 {"http",S_OK},
7435 {"",S_FALSE},
7436 {"",S_FALSE}
7437 },
7438 {
7439 {Uri_HOST_DNS,S_OK},
7440 {80,S_OK},
7442 {URLZONE_INVALID,E_NOTIMPL}
7443 }
7444 },
7445 { "zip://google.com",Uri_CREATE_NO_CANONICALIZE,
7446 "?test",Uri_CREATE_ALLOW_RELATIVE,
7447 0,S_OK,FALSE,
7448 {
7449 {"zip://google.com/?test",S_OK},
7450 {"google.com",S_OK},
7451 {"zip://google.com/?test",S_OK},
7452 {"google.com",S_OK},
7453 {"",S_FALSE},
7454 {"",S_FALSE},
7455 {"google.com",S_OK},
7456 {"",S_FALSE},
7457 {"/",S_OK},
7458 {"/?test",S_OK},
7459 {"?test",S_OK},
7460 {"zip://google.com/?test",S_OK},
7461 {"zip",S_OK},
7462 {"",S_FALSE},
7463 {"",S_FALSE}
7464 },
7465 {
7466 {Uri_HOST_DNS,S_OK},
7467 {0,S_FALSE},
7469 {URLZONE_INVALID,E_NOTIMPL}
7470 }
7471 },
7472 /* No path is appended since the base URI is opaque. */
7473 { "zip:?testing",0,
7474 "?test",Uri_CREATE_ALLOW_RELATIVE,
7475 0,S_OK,FALSE,
7476 {
7477 {"zip:?test",S_OK},
7478 {"",S_FALSE},
7479 {"zip:?test",S_OK},
7480 {"",S_FALSE},
7481 {"",S_FALSE},
7482 {"",S_FALSE},
7483 {"",S_FALSE},
7484 {"",S_FALSE},
7485 {"",S_OK},
7486 {"?test",S_OK},
7487 {"?test",S_OK},
7488 {"zip:?test",S_OK},
7489 {"zip",S_OK},
7490 {"",S_FALSE},
7491 {"",S_FALSE}
7492 },
7493 {
7494 {Uri_HOST_UNKNOWN,S_OK},
7495 {0,S_FALSE},
7497 {URLZONE_INVALID,E_NOTIMPL}
7498 }
7499 },
7500 { "file:///c:/",0,
7501 "../testing/test",Uri_CREATE_ALLOW_RELATIVE,
7502 0,S_OK,FALSE,
7503 {
7504 {"file:///c:/testing/test",S_OK},
7505 {"",S_FALSE},
7506 {"file:///c:/testing/test",S_OK},
7507 {"",S_FALSE},
7508 {"",S_FALSE},
7509 {"",S_FALSE},
7510 {"",S_FALSE},
7511 {"",S_FALSE},
7512 {"/c:/testing/test",S_OK},
7513 {"/c:/testing/test",S_OK},
7514 {"",S_FALSE},
7515 {"file:///c:/testing/test",S_OK},
7516 {"file",S_OK},
7517 {"",S_FALSE},
7518 {"",S_FALSE}
7519 },
7520 {
7521 {Uri_HOST_UNKNOWN,S_OK},
7522 {0,S_FALSE},
7524 {URLZONE_INVALID,E_NOTIMPL}
7525 }
7526 },
7527 { "http://winehq.org/dir/testfile",0,
7528 "test?querystring",Uri_CREATE_ALLOW_RELATIVE,
7529 0,S_OK,FALSE,
7530 {
7531 {"http://winehq.org/dir/test?querystring",S_OK},
7532 {"winehq.org",S_OK},
7533 {"http://winehq.org/dir/test?querystring",S_OK},
7534 {"winehq.org",S_OK},
7535 {"",S_FALSE},
7536 {"",S_FALSE},
7537 {"winehq.org",S_OK},
7538 {"",S_FALSE},
7539 {"/dir/test",S_OK},
7540 {"/dir/test?querystring",S_OK},
7541 {"?querystring",S_OK},
7542 {"http://winehq.org/dir/test?querystring",S_OK},
7543 {"http",S_OK},
7544 {"",S_FALSE},
7545 {"",S_FALSE}
7546 },
7547 {
7548 {Uri_HOST_DNS,S_OK},
7549 {80,S_OK},
7551 {URLZONE_INVALID,E_NOTIMPL}
7552 }
7553 },
7554 { "http://winehq.org/dir/test",0,
7555 "test?querystring",Uri_CREATE_ALLOW_RELATIVE,
7556 0,S_OK,FALSE,
7557 {
7558 {"http://winehq.org/dir/test?querystring",S_OK},
7559 {"winehq.org",S_OK},
7560 {"http://winehq.org/dir/test?querystring",S_OK},
7561 {"winehq.org",S_OK},
7562 {"",S_FALSE},
7563 {"",S_FALSE},
7564 {"winehq.org",S_OK},
7565 {"",S_FALSE},
7566 {"/dir/test",S_OK},
7567 {"/dir/test?querystring",S_OK},
7568 {"?querystring",S_OK},
7569 {"http://winehq.org/dir/test?querystring",S_OK},
7570 {"http",S_OK},
7571 {"",S_FALSE},
7572 {"",S_FALSE}
7573 },
7574 {
7575 {Uri_HOST_DNS,S_OK},
7576 {80,S_OK},
7578 {URLZONE_INVALID,E_NOTIMPL}
7579 }
7580 },
7581 { "http://winehq.org/dir/test?querystring",0,
7582 "#hash",Uri_CREATE_ALLOW_RELATIVE,
7583 0,S_OK,FALSE,
7584 {
7585 {"http://winehq.org/dir/test?querystring#hash",S_OK},
7586 {"winehq.org",S_OK},
7587 {"http://winehq.org/dir/test?querystring#hash",S_OK},
7588 {"winehq.org",S_OK},
7589 {"",S_FALSE},
7590 {"#hash",S_OK},
7591 {"winehq.org",S_OK},
7592 {"",S_FALSE},
7593 {"/dir/test",S_OK},
7594 {"/dir/test?querystring",S_OK},
7595 {"?querystring",S_OK},
7596 {"http://winehq.org/dir/test?querystring#hash",S_OK},
7597 {"http",S_OK},
7598 {"",S_FALSE},
7599 {"",S_FALSE}
7600 },
7601 {
7602 {Uri_HOST_DNS,S_OK},
7603 {80,S_OK},
7605 {URLZONE_INVALID,E_NOTIMPL}
7606 }
7607 },
7608 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir\\file.txt",0,
7609 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE,
7610 0,S_OK,FALSE,
7611 {
7612 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK},
7613 {"",S_FALSE},
7614 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK},
7615 {"",S_FALSE},
7616 {".txt",S_OK},
7617 {"",S_FALSE},
7618 {"",S_FALSE},
7619 {"",S_FALSE},
7620 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK},
7621 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK},
7622 {"",S_FALSE},
7623 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK},
7624 {"mk",S_OK},
7625 {"",S_FALSE},
7626 {"",S_FALSE}
7627 },
7628 {
7629 {Uri_HOST_UNKNOWN,S_OK},
7630 {0,S_FALSE},
7632 {URLZONE_INVALID,E_NOTIMPL}
7633 }
7634 },
7635 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::\\subdir\\file.txt",0,
7636 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE,
7637 0,S_OK,FALSE,
7638 {
7639 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK},
7640 {"",S_FALSE},
7641 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK},
7642 {"",S_FALSE},
7643 {".txt",S_OK},
7644 {"",S_FALSE},
7645 {"",S_FALSE},
7646 {"",S_FALSE},
7647 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK},
7648 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK},
7649 {"",S_FALSE},
7650 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK},
7651 {"mk",S_OK},
7652 {"",S_FALSE},
7653 {"",S_FALSE}
7654 },
7655 {
7656 {Uri_HOST_UNKNOWN,S_OK},
7657 {0,S_FALSE},
7659 {URLZONE_INVALID,E_NOTIMPL}
7660 }
7661 },
7662 { "mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir\\file.txt",0,
7663 "relative\\path.txt",Uri_CREATE_ALLOW_RELATIVE,
7664 0,S_OK,FALSE,
7665 {
7666 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK},
7667 {"",S_FALSE},
7668 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK},
7669 {"",S_FALSE},
7670 {".txt",S_OK},
7671 {"",S_FALSE},
7672 {"",S_FALSE},
7673 {"",S_FALSE},
7674 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK},
7675 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK},
7676 {"",S_FALSE},
7677 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK},
7678 {"mk",S_OK},
7679 {"",S_FALSE},
7680 {"",S_FALSE}
7681 },
7682 {
7683 {Uri_HOST_UNKNOWN,S_OK},
7684 {0,S_FALSE},
7686 {URLZONE_INVALID,E_NOTIMPL}
7687 }
7688 },
7689 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
7690 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE,
7691 0,S_OK,FALSE,
7692 {
7693 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK},
7694 {"",S_FALSE},
7695 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK},
7696 {"",S_FALSE},
7697 {".txt",S_OK},
7698 {"",S_FALSE},
7699 {"",S_FALSE},
7700 {"",S_FALSE},
7701 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK},
7702 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK},
7703 {"",S_FALSE},
7704 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK},
7705 {"mk",S_OK},
7706 {"",S_FALSE},
7707 {"",S_FALSE}
7708 },
7709 {
7710 {Uri_HOST_UNKNOWN,S_OK},
7711 {0,S_FALSE},
7713 {URLZONE_INVALID,E_NOTIMPL}
7714 }
7715 },
7716 { "mk:MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
7717 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE,
7718 0,S_OK,FALSE,
7719 {
7720 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK},
7721 {"",S_FALSE},
7722 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK},
7723 {"",S_FALSE},
7724 {".txt",S_OK},
7725 {"",S_FALSE},
7726 {"",S_FALSE},
7727 {"",S_FALSE},
7728 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK},
7729 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK},
7730 {"",S_FALSE},
7731 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK},
7732 {"mk",S_OK},
7733 {"",S_FALSE},
7734 {"",S_FALSE}
7735 },
7736 {
7737 {Uri_HOST_UNKNOWN,S_OK},
7738 {0,S_FALSE},
7740 {URLZONE_INVALID,E_NOTIMPL}
7741 }
7742 },
7743 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/../../file.txt",0,
7744 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE,
7745 0,S_OK,FALSE,
7746 {
7747 {"mk:@MSITSTORE:/relative/path.txt",S_OK},
7748 {"",S_FALSE},
7749 {"mk:@MSITSTORE:/relative/path.txt",S_OK},
7750 {"",S_FALSE},
7751 {".txt",S_OK},
7752 {"",S_FALSE},
7753 {"",S_FALSE},
7754 {"",S_FALSE},
7755 {"@MSITSTORE:/relative/path.txt",S_OK},
7756 {"@MSITSTORE:/relative/path.txt",S_OK},
7757 {"",S_FALSE},
7758 {"mk:@MSITSTORE:/relative/path.txt",S_OK},
7759 {"mk",S_OK},
7760 {"",S_FALSE},
7761 {"",S_FALSE}
7762 },
7763 {
7764 {Uri_HOST_UNKNOWN,S_OK},
7765 {0,S_FALSE},
7767 {URLZONE_INVALID,E_NOTIMPL}
7768 }
7769 },
7770 { "mk:@xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
7771 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE,
7772 0,S_OK,FALSE,
7773 {
7774 {"mk:@xxx:/relative/path.txt",S_OK},
7775 {"",S_FALSE},
7776 {"mk:@xxx:/relative/path.txt",S_OK},
7777 {"",S_FALSE},
7778 {".txt",S_OK},
7779 {"",S_FALSE},
7780 {"",S_FALSE},
7781 {"",S_FALSE},
7782 {"@xxx:/relative/path.txt",S_OK},
7783 {"@xxx:/relative/path.txt",S_OK},
7784 {"",S_FALSE},
7785 {"mk:@xxx:/relative/path.txt",S_OK},
7786 {"mk",S_OK},
7787 {"",S_FALSE},
7788 {"",S_FALSE}
7789 },
7790 {
7791 {Uri_HOST_UNKNOWN,S_OK},
7792 {0,S_FALSE},
7794 {URLZONE_INVALID,E_NOTIMPL}
7795 }
7796 },
7797 { "mk:xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
7798 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE,
7799 0,S_OK,FALSE,
7800 {
7801 {"mk:/relative/path.txt",S_OK},
7802 {"",S_FALSE},
7803 {"mk:/relative/path.txt",S_OK},
7804 {"",S_FALSE},
7805 {".txt",S_OK},
7806 {"",S_FALSE},
7807 {"",S_FALSE},
7808 {"",S_FALSE},
7809 {"/relative/path.txt",S_OK},
7810 {"/relative/path.txt",S_OK},
7811 {"",S_FALSE},
7812 {"mk:/relative/path.txt",S_OK},
7813 {"mk",S_OK},
7814 {"",S_FALSE},
7815 {"",S_FALSE}
7816 },
7817 {
7818 {Uri_HOST_UNKNOWN,S_OK},
7819 {0,S_FALSE},
7821 {URLZONE_INVALID,E_NOTIMPL}
7822 }
7823 },
7824 { "ml:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
7825 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE,
7826 0,S_OK,FALSE,
7827 {
7828 {"ml:/relative/path.txt",S_OK},
7829 {"",S_FALSE},
7830 {"ml:/relative/path.txt",S_OK},
7831 {"",S_FALSE},
7832 {".txt",S_OK},
7833 {"",S_FALSE},
7834 {"",S_FALSE},
7835 {"",S_FALSE},
7836 {"/relative/path.txt",S_OK},
7837 {"/relative/path.txt",S_OK},
7838 {"",S_FALSE},
7839 {"ml:/relative/path.txt",S_OK},
7840 {"ml",S_OK},
7841 {"",S_FALSE},
7842 {"",S_FALSE}
7843 },
7844 {
7845 {Uri_HOST_UNKNOWN,S_OK},
7846 {0,S_FALSE},
7848 {URLZONE_INVALID,E_NOTIMPL}
7849 }
7850 },
7851 { "http://winehq.org/dir/test?querystring",0,
7852 "//winehq.com/#hash",Uri_CREATE_ALLOW_RELATIVE,
7853 0,S_OK,FALSE,
7854 {
7855 {"http://winehq.com/#hash",S_OK},
7856 {"winehq.com",S_OK},
7857 {"http://winehq.com/#hash",S_OK},
7858 {"winehq.com",S_OK},
7859 {"",S_FALSE},
7860 {"#hash",S_OK},
7861 {"winehq.com",S_OK},
7862 {"",S_FALSE},
7863 {"/",S_OK},
7864 {"/",S_OK},
7865 {"",S_FALSE},
7866 {"http://winehq.com/#hash",S_OK},
7867 {"http",S_OK},
7868 {"",S_FALSE},
7869 {"",S_FALSE}
7870 },
7871 {
7872 {Uri_HOST_DNS,S_OK},
7873 {80,S_OK,FALSE,TRUE},
7875 {URLZONE_INVALID,E_NOTIMPL}
7876 }
7877 },
7878 { "http://winehq.org/dir/test?querystring",0,
7879 "//winehq.com/dir2/../dir/file.txt?query#hash",Uri_CREATE_ALLOW_RELATIVE,
7880 0,S_OK,FALSE,
7881 {
7882 {"http://winehq.com/dir/file.txt?query#hash",S_OK},
7883 {"winehq.com",S_OK},
7884 {"http://winehq.com/dir/file.txt?query#hash",S_OK},
7885 {"winehq.com",S_OK},
7886 {".txt",S_OK},
7887 {"#hash",S_OK},
7888 {"winehq.com",S_OK},
7889 {"",S_FALSE},
7890 {"/dir/file.txt",S_OK},
7891 {"/dir/file.txt?query",S_OK},
7892 {"?query",S_OK},
7893 {"http://winehq.com/dir/file.txt?query#hash",S_OK},
7894 {"http",S_OK},
7895 {"",S_FALSE},
7896 {"",S_FALSE}
7897 },
7898 {
7899 {Uri_HOST_DNS,S_OK},
7900 {80,S_OK,FALSE,TRUE},
7902 {URLZONE_INVALID,E_NOTIMPL}
7903 }
7904 },
7905 { "http://google.com/test",0,
7906 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME,
7907 0,S_OK,FALSE,
7908 {
7909 {"file:///c:/test/",S_OK},
7910 {"",S_FALSE},
7911 {"file:///c:/test/",S_OK},
7912 {"",S_FALSE},
7913 {"",S_FALSE},
7914 {"",S_FALSE},
7915 {"",S_FALSE},
7916 {"",S_FALSE},
7917 {"/c:/test/",S_OK},
7918 {"/c:/test/",S_OK},
7919 {"",S_FALSE},
7920 {"c:\\test\\",S_OK,FALSE,"file:///c:/test/"},
7921 {"file",S_OK},
7922 {"",S_FALSE},
7923 {"",S_FALSE}
7924 },
7925 {
7926 {Uri_HOST_UNKNOWN,S_OK},
7927 {0,S_FALSE},
7929 {URLZONE_INVALID,E_NOTIMPL}
7930 }
7931 },
7932 { "http://google.com/test",0,
7933 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME,
7934 0,S_OK,FALSE,
7935 {
7936 {"file:///c:/test/",S_OK},
7937 {"",S_FALSE},
7938 {"file:///c:/test/",S_OK},
7939 {"",S_FALSE},
7940 {"",S_FALSE},
7941 {"",S_FALSE},
7942 {"",S_FALSE},
7943 {"",S_FALSE},
7944 {"/c:/test/",S_OK},
7945 {"/c:/test/",S_OK},
7946 {"",S_FALSE},
7947 {"c:\\test\\",S_OK,FALSE,"file:///c:/test/"},
7948 {"file",S_OK},
7949 {"",S_FALSE},
7950 {"",S_FALSE}
7951 },
7952 {
7953 {Uri_HOST_UNKNOWN,S_OK},
7954 {0,S_FALSE},
7956 {URLZONE_INVALID,E_NOTIMPL}
7957 }
7958 },
7959 { "http://winehq.org",0,
7960 "mailto://",Uri_CREATE_NO_CANONICALIZE,
7961 0,S_OK,FALSE,
7962 {
7963 {"mailto:",S_OK},
7964 {"",S_FALSE},
7965 {"mailto:",S_OK},
7966 {"",S_FALSE},
7967 {"",S_FALSE},
7968 {"",S_FALSE},
7969 {"",S_FALSE},
7970 {"",S_FALSE},
7971 {"",S_FALSE},
7972 {"",S_FALSE},
7973 {"",S_FALSE},
7974 {"mailto://",S_OK,FALSE,"mailto:"},
7975 {"mailto",S_OK},
7976 {"",S_FALSE},
7977 {"",S_FALSE}
7978 },
7979 {
7980 {Uri_HOST_UNKNOWN,S_OK},
7981 {0,S_FALSE},
7983 {URLZONE_INVALID,E_NOTIMPL}
7984 }
7985 },
7986 { "http://winehq.org",0,
7987 "mailto://a@b.com",Uri_CREATE_NO_CANONICALIZE,
7988 0,S_OK,FALSE,
7989 {
7990 {"mailto:a@b.com",S_OK},
7991 {"",S_FALSE},
7992 {"mailto:a@b.com",S_OK},
7993 {"",S_FALSE},
7994 {".com",S_OK},
7995 {"",S_FALSE},
7996 {"",S_FALSE},
7997 {"",S_FALSE},
7998 {"a@b.com",S_OK},
7999 {"a@b.com",S_OK},
8000 {"",S_FALSE},
8001 {"mailto://a@b.com",S_OK,FALSE,"mailto:a@b.com"},
8002 {"mailto",S_OK},
8003 {"",S_FALSE},
8004 {"",S_FALSE}
8005 },
8006 {
8007 {Uri_HOST_UNKNOWN,S_OK},
8008 {0,S_FALSE},
8010 {URLZONE_INVALID,E_NOTIMPL}
8011 }
8012 },
8013 { "http://[::1]",0,
8014 "/",Uri_CREATE_ALLOW_RELATIVE,
8015 0,S_OK,FALSE,
8016 {
8017 {"http://[::1]/",S_OK},
8018 {"[::1]",S_OK},
8019 {"http://[::1]/",S_OK},
8020 {"",S_FALSE},
8021 {"",S_FALSE},
8022 {"",S_FALSE},
8023 {"::1",S_OK},
8024 {"",S_FALSE},
8025 {"/",S_OK},
8026 {"/",S_OK},
8027 {"",S_FALSE},
8028 {"http://[::1]/",S_OK},
8029 {"http",S_OK},
8030 {"",S_FALSE},
8031 {"",S_FALSE}
8032 },
8033 {
8034 {Uri_HOST_IPV6,S_OK},
8035 {80,S_OK,FALSE,TRUE},
8037 {URLZONE_INVALID,E_NOTIMPL}
8038 }
8039 },
8040};
8041
8042typedef struct _uri_parse_test {
8043 const char *uri;
8047 const char *property;
8050 const char *property2;
8052
8054 /* PARSE_CANONICALIZE tests. */
8055 {"zip://google.com/test<|>",0,PARSE_CANONICALIZE,0,"zip://google.com/test<|>",S_OK,FALSE},
8056 {"http://google.com/test<|>",0,PARSE_CANONICALIZE,0,"http://google.com/test%3C%7C%3E",S_OK,FALSE},
8057 {"http://google.com/%30%23%3F",0,PARSE_CANONICALIZE,URL_UNESCAPE,"http://google.com/0#?",S_OK,FALSE},
8058 {"test <|>",Uri_CREATE_ALLOW_RELATIVE,PARSE_CANONICALIZE,URL_ESCAPE_UNSAFE,"test %3C%7C%3E",S_OK,FALSE},
8059 {"test <|>",Uri_CREATE_ALLOW_RELATIVE,PARSE_CANONICALIZE,URL_ESCAPE_SPACES_ONLY,"test%20<|>",S_OK,FALSE},
8060 {"test%20<|>",Uri_CREATE_ALLOW_RELATIVE,PARSE_CANONICALIZE,URL_UNESCAPE|URL_ESCAPE_UNSAFE,"test%20%3C%7C%3E",S_OK,FALSE},
8061 {"http://google.com/%20",0,PARSE_CANONICALIZE,URL_ESCAPE_PERCENT,"http://google.com/%2520",S_OK,FALSE},
8062 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE,PARSE_CANONICALIZE,URL_DONT_SIMPLIFY,"http://google.com/test/../",S_OK,FALSE},
8063 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE,PARSE_CANONICALIZE,URL_NO_META,"http://google.com/test/../",S_OK,FALSE},
8064 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE,PARSE_CANONICALIZE,0,"http://google.com/",S_OK,FALSE},
8065 {"zip://google.com/test/../",Uri_CREATE_NO_CANONICALIZE,PARSE_CANONICALIZE,0,"zip://google.com/",S_OK,FALSE},
8066 {"file:///c:/test/../test",Uri_CREATE_NO_CANONICALIZE,PARSE_CANONICALIZE,URL_DONT_SIMPLIFY,"file:///c:/test/../test",S_OK,FALSE},
8067
8068 /* PARSE_FRIENDLY tests. */
8069 {"http://test@google.com/test#test",0,PARSE_FRIENDLY,0,"http://google.com/test#test",S_OK,FALSE},
8070 {"zip://test@google.com/test",0,PARSE_FRIENDLY,0,"zip://test@google.com/test",S_OK,FALSE},
8071
8072 /* PARSE_ROOTDOCUMENT tests. */
8073 {"http://google.com:200/test/test",0,PARSE_ROOTDOCUMENT,0,"http://google.com:200/",S_OK,FALSE},
8074 {"http://google.com",Uri_CREATE_NO_CANONICALIZE,PARSE_ROOTDOCUMENT,0,"http://google.com/",S_OK,FALSE},
8075 {"zip://google.com/",0,PARSE_ROOTDOCUMENT,0,"",S_OK,FALSE},
8076 {"file:///c:/testing/",0,PARSE_ROOTDOCUMENT,0,"",S_OK,FALSE},
8077 {"file://server/test",0,PARSE_ROOTDOCUMENT,0,"",S_OK,FALSE},
8078 {"zip:test/test",0,PARSE_ROOTDOCUMENT,0,"",S_OK,FALSE},
8079
8080 /* PARSE_DOCUMENT tests. */
8081 {"http://test@google.com/test?query#frag",0,PARSE_DOCUMENT,0,"http://test@google.com/test?query",S_OK,FALSE},
8082 {"http:testing#frag",0,PARSE_DOCUMENT,0,"",S_OK,FALSE},
8083 {"file:///c:/test#frag",0,PARSE_DOCUMENT,0,"",S_OK,FALSE},
8084 {"zip://google.com/#frag",0,PARSE_DOCUMENT,0,"",S_OK,FALSE},
8085 {"zip:test#frag",0,PARSE_DOCUMENT,0,"",S_OK,FALSE},
8086 {"testing#frag",Uri_CREATE_ALLOW_RELATIVE,PARSE_DOCUMENT,0,"",S_OK,FALSE},
8087
8088 /* PARSE_PATH_FROM_URL tests. */
8089 {"file:///c:/test.mp3",0,PARSE_PATH_FROM_URL,0,"c:\\test.mp3",S_OK,FALSE},
8090 {"file:///c:/t<|>est.mp3",0,PARSE_PATH_FROM_URL,0,"c:\\t<|>est.mp3",S_OK,FALSE},
8091 {"file:///c:/te%XX t/",0,PARSE_PATH_FROM_URL,0,"c:\\te%XX t\\",S_OK,FALSE},
8092 {"file://server/test",0,PARSE_PATH_FROM_URL,0,"\\\\server\\test",S_OK,FALSE},
8093 {"http://google.com/",0,PARSE_PATH_FROM_URL,0,"",E_INVALIDARG,FALSE},
8094 {"file:/c:/dir/test.mp3",0,PARSE_PATH_FROM_URL,0,"c:\\dir\\test.mp3",S_OK},
8095 {"file:/c:/test.mp3",0,PARSE_PATH_FROM_URL,0,"c:\\test.mp3",S_OK},
8096 {"file://c:\\test.mp3",0,PARSE_PATH_FROM_URL,0,"c:\\test.mp3",S_OK},
8097
8098 /* PARSE_URL_FROM_PATH tests. */
8099 /* This function almost seems to useless (just returns the absolute uri). */
8100 {"test.com",Uri_CREATE_ALLOW_RELATIVE,PARSE_URL_FROM_PATH,0,"test.com",S_OK,FALSE},
8101 {"/test/test",Uri_CREATE_ALLOW_RELATIVE,PARSE_URL_FROM_PATH,0,"/test/test",S_OK,FALSE},
8102 {"file://c:\\test\\test",Uri_CREATE_FILE_USE_DOS_PATH,PARSE_URL_FROM_PATH,0,"file://c:\\test\\test",S_OK,FALSE},
8103 {"file:c:/test",0,PARSE_URL_FROM_PATH,0,"",S_OK,FALSE},
8104 {"http:google.com/",0,PARSE_URL_FROM_PATH,0,"",S_OK,FALSE},
8105
8106 /* PARSE_SCHEMA tests. */
8107 {"http://google.com/test",0,PARSE_SCHEMA,0,"http",S_OK,FALSE},
8108 {"test",Uri_CREATE_ALLOW_RELATIVE,PARSE_SCHEMA,0,"",S_OK,FALSE},
8109
8110 /* PARSE_SITE tests. */
8111 {"http://google.uk.com/",0,PARSE_SITE,0,"google.uk.com",S_OK,FALSE},
8112 {"http://google.com.com/",0,PARSE_SITE,0,"google.com.com",S_OK,FALSE},
8113 {"google.com",Uri_CREATE_ALLOW_RELATIVE,PARSE_SITE,0,"",S_OK,FALSE},
8114 {"file://server/test",0,PARSE_SITE,0,"server",S_OK,FALSE},
8115
8116 /* PARSE_DOMAIN tests. */
8117 {"http://google.com.uk/",0,PARSE_DOMAIN,0,"google.com.uk",S_OK,FALSE,"com.uk"},
8118 {"http://google.com.com/",0,PARSE_DOMAIN,0,"com.com",S_OK,FALSE},
8119 {"test/test",Uri_CREATE_ALLOW_RELATIVE,PARSE_DOMAIN,0,"",S_OK,FALSE},
8120 {"file://server/test",0,PARSE_DOMAIN,0,"",S_OK,FALSE},
8121
8122 /* PARSE_LOCATION and PARSE_ANCHOR tests. */
8123 {"http://google.com/test#Test",0,PARSE_ANCHOR,0,"#Test",S_OK,FALSE},
8124 {"http://google.com/test#Test",0,PARSE_LOCATION,0,"#Test",S_OK,FALSE},
8125 {"test",Uri_CREATE_ALLOW_RELATIVE,PARSE_ANCHOR,0,"",S_OK,FALSE},
8126 {"test",Uri_CREATE_ALLOW_RELATIVE,PARSE_LOCATION,0,"",S_OK,FALSE}
8127};
8128
8129static inline LPWSTR a2w(LPCSTR str) {
8130 LPWSTR ret = NULL;
8131
8132 if(str) {
8134 ret = malloc(len * sizeof(WCHAR));
8136 }
8137
8138 return ret;
8139}
8140
8141static inline DWORD strcmp_aw(LPCSTR strA, LPCWSTR strB) {
8142 LPWSTR strAW = a2w(strA);
8143 DWORD ret = lstrcmpW(strAW, strB);
8144 free(strAW);
8145 return ret;
8146}
8147
8148static inline ULONG get_refcnt(IUri *uri) {
8149 IUri_AddRef(uri);
8150 return IUri_Release(uri);
8151}
8152
8153static void change_property(IUriBuilder *builder, const uri_builder_property *prop,
8154 DWORD test_index) {
8155 HRESULT hr;
8156 LPWSTR valueW;
8157
8158 valueW = a2w(prop->value);
8159 switch(prop->property) {
8160 case Uri_PROPERTY_FRAGMENT:
8161 hr = IUriBuilder_SetFragment(builder, valueW);
8162 todo_wine_if(prop->todo) {
8163 ok(hr == prop->expected,
8164 "Error: IUriBuilder_SetFragment returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
8165 hr, prop->expected, test_index);
8166 }
8167 break;
8168 case Uri_PROPERTY_HOST:
8169 hr = IUriBuilder_SetHost(builder, valueW);
8170 todo_wine_if(prop->todo) {
8171 ok(hr == prop->expected,
8172 "Error: IUriBuilder_SetHost returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
8173 hr, prop->expected, test_index);
8174 }
8175 break;
8176 case Uri_PROPERTY_PASSWORD:
8177 hr = IUriBuilder_SetPassword(builder, valueW);
8178 todo_wine_if(prop->todo) {
8179 ok(hr == prop->expected,
8180 "Error: IUriBuilder_SetPassword returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
8181 hr, prop->expected, test_index);
8182 }
8183 break;
8184 case Uri_PROPERTY_PATH:
8185 hr = IUriBuilder_SetPath(builder, valueW);
8186 todo_wine_if(prop->todo) {
8187 ok(hr == prop->expected,
8188 "Error: IUriBuilder_SetPath returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
8189 hr, prop->expected, test_index);
8190 }
8191 break;
8192 case Uri_PROPERTY_QUERY:
8193 hr = IUriBuilder_SetQuery(builder, valueW);
8194 todo_wine_if(prop->todo) {
8195 ok(hr == prop->expected,
8196 "Error: IUriBuilder_SetQuery returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
8197 hr, prop->expected, test_index);
8198 }
8199 break;
8200 case Uri_PROPERTY_SCHEME_NAME:
8201 hr = IUriBuilder_SetSchemeName(builder, valueW);
8202 todo_wine_if(prop->todo) {
8203 ok(hr == prop->expected,
8204 "Error: IUriBuilder_SetSchemeName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
8205 hr, prop->expected, test_index);
8206 }
8207 break;
8208 case Uri_PROPERTY_USER_NAME:
8209 hr = IUriBuilder_SetUserName(builder, valueW);
8210 todo_wine_if(prop->todo) {
8211 ok(hr == prop->expected,
8212 "Error: IUriBuilder_SetUserName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
8213 hr, prop->expected, test_index);
8214 }
8215 break;
8216 default:
8217 trace("Unsupported operation for %d on uri_builder_tests[%ld].\n", prop->property, test_index);
8218 }
8219
8220 free(valueW);
8221}
8222
8223/*
8224 * Simple tests to make sure the CreateUri function handles invalid flag combinations
8225 * correctly.
8226 */
8228 DWORD i;
8229
8230 for(i = 0; i < ARRAY_SIZE(invalid_flag_tests); ++i) {
8231 HRESULT hr;
8232 IUri *uri = (void*) 0xdeadbeef;
8233
8234 hr = pCreateUri(http_urlW, invalid_flag_tests[i].flags, 0, &uri);
8235 ok(hr == invalid_flag_tests[i].expected, "Error: CreateUri returned 0x%08lx, expected 0x%08lx, flags=0x%08lx\n",
8237 ok(uri == NULL, "Error: expected the IUri to be NULL, but it was %p instead\n", uri);
8238 }
8239}
8240
8242 HRESULT hr;
8243 IUri *uri = (void*) 0xdeadbeef;
8244
8245 const WCHAR invalidW[] = {'i','n','v','a','l','i','d',0};
8246 static const WCHAR emptyW[] = {0};
8247
8248 hr = pCreateUri(http_urlW, 0, 0, NULL);
8249 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08lx, expected 0x%08lx\n", hr, E_INVALIDARG);
8250
8251 hr = pCreateUri(NULL, 0, 0, &uri);
8252 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08lx, expected 0x%08lx\n", hr, E_INVALIDARG);
8253 ok(uri == NULL, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri);
8254
8255 uri = (void*) 0xdeadbeef;
8256 hr = pCreateUri(invalidW, 0, 0, &uri);
8257 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8258 ok(uri == NULL, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri);
8259
8260 uri = (void*) 0xdeadbeef;
8261 hr = pCreateUri(emptyW, 0, 0, &uri);
8262 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8263 ok(uri == NULL, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri);
8264}
8265
8266static void test_CreateUri_InvalidUri(void) {
8267 DWORD i;
8268
8269 for(i = 0; i < ARRAY_SIZE(invalid_uri_tests); ++i) {
8271 IUri *uri = NULL;
8272 LPWSTR uriW;
8273 HRESULT hr;
8274
8275 uriW = a2w(test.uri);
8276 hr = pCreateUri(uriW, test.flags, 0, &uri);
8277 todo_wine_if(test.todo)
8278 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on invalid_uri_tests[%ld].\n",
8279 hr, E_INVALIDARG, i);
8280 if(uri) IUri_Release(uri);
8281
8282 free(uriW);
8283 }
8284}
8285
8286static void test_IUri_GetPropertyBSTR(void) {
8287 IUri *uri = NULL;
8288 HRESULT hr;
8289 DWORD i;
8290
8291 /* Make sure GetPropertyBSTR handles 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);
8294 if(SUCCEEDED(hr)) {
8295 BSTR received = NULL;
8296
8297 hr = IUri_GetPropertyBSTR(uri, Uri_PROPERTY_RAW_URI, NULL, 0);
8298 ok(hr == E_POINTER, "Error: GetPropertyBSTR returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8299
8300 /* Make sure it handles an invalid Uri_PROPERTY correctly. */
8301 hr = IUri_GetPropertyBSTR(uri, Uri_PROPERTY_PORT, &received, 0);
8302 ok(hr == E_INVALIDARG /* IE10 */ || broken(hr == S_OK), "Error: GetPropertyBSTR returned 0x%08lx, expected E_INVALIDARG or S_OK.\n", hr);
8303 if(SUCCEEDED(hr)) {
8304 ok(received != NULL, "Error: Expected the string not to be NULL.\n");
8305 ok(!SysStringLen(received), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received));
8307 }else {
8308 ok(!received, "received = %s\n", wine_dbgstr_w(received));
8309 }
8310
8311 /* Make sure it handles the ZONE property correctly. */
8312 received = NULL;
8313 hr = IUri_GetPropertyBSTR(uri, Uri_PROPERTY_ZONE, &received, 0);
8314 ok(hr == S_FALSE, "Error: GetPropertyBSTR returned 0x%08lx, expected 0x%08lx.\n", hr, S_FALSE);
8315 ok(received != NULL, "Error: Expected the string not to be NULL.\n");
8316 ok(!SysStringLen(received), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received));
8318 }
8319 if(uri) IUri_Release(uri);
8320
8321 for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
8323 LPWSTR uriW;
8324 uri = NULL;
8325
8326 uriW = a2w(test.uri);
8327 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
8328 todo_wine_if(test.create_todo)
8329 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08lx, expected 0x%08lx. Failed on uri_tests[%ld].\n",
8330 hr, test.create_expected, i);
8331
8332 if(SUCCEEDED(hr)) {
8333 DWORD j;
8334
8335 /* Checks all the string properties of the uri. */
8336 for(j = Uri_PROPERTY_STRING_START; j <= Uri_PROPERTY_STRING_LAST; ++j) {
8337 BSTR received = NULL;
8338 uri_str_property prop = test.str_props[j];
8339
8340 hr = IUri_GetPropertyBSTR(uri, j, &received, test.flags);
8341 todo_wine_if(prop.todo) {
8342 ok(hr == prop.expected ||
8343 (prop.value2 && hr == prop.expected2),
8344 "GetPropertyBSTR returned 0x%08lx, expected 0x%08lx. On uri_tests[%ld].str_props[%ld].\n",
8345 hr, prop.expected, i, j);
8346 ok(!strcmp_aw(prop.value, received) || (prop.value2 && !strcmp_aw(prop.value2, received)) ||
8348 "Expected %s but got %s on uri_tests[%ld].str_props[%ld].\n",
8349 prop.value, wine_dbgstr_w(received), i, j);
8350 }
8351
8353 }
8354 }
8355
8356 if(uri) IUri_Release(uri);
8357
8358 free(uriW);
8359 }
8360}
8361
8363 IUri *uri = NULL;
8364 HRESULT hr;
8365 DWORD i;
8366
8367 hr = pCreateUri(http_urlW, 0, 0, &uri);
8368 ok(hr == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
8369 if(SUCCEEDED(hr)) {
8370 DWORD received = 0xdeadbeef;
8371
8372 hr = IUri_GetPropertyDWORD(uri, Uri_PROPERTY_DWORD_START, NULL, 0);
8373 ok(hr == E_INVALIDARG, "Error: GetPropertyDWORD returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8374
8375 hr = IUri_GetPropertyDWORD(uri, Uri_PROPERTY_ABSOLUTE_URI, &received, 0);
8376 ok(hr == E_INVALIDARG, "Error: GetPropertyDWORD returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8377 ok(received == 0, "Error: Expected received=%d but instead received=%ld.\n", 0, received);
8378 }
8379 if(uri) IUri_Release(uri);
8380
8381 for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
8383 LPWSTR uriW;
8384 uri = NULL;
8385
8386 uriW = a2w(test.uri);
8387 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
8388 todo_wine_if(test.create_todo)
8389 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08lx, expected 0x%08lx. Failed on uri_tests[%ld].\n",
8390 hr, test.create_expected, i);
8391
8392 if(SUCCEEDED(hr)) {
8393 DWORD j;
8394
8395 /* Checks all the DWORD properties of the uri. */
8396 for(j = 0; j < ARRAY_SIZE(test.dword_props); ++j) {
8398 uri_dword_property prop = test.dword_props[j];
8399
8400 hr = IUri_GetPropertyDWORD(uri, j+Uri_PROPERTY_DWORD_START, &received, 0);
8401 todo_wine_if(prop.todo) {
8402 ok(hr == prop.expected, "GetPropertyDWORD returned 0x%08lx, expected 0x%08lx. On uri_tests[%ld].dword_props[%ld].\n",
8403 hr, prop.expected, i, j);
8404 ok(prop.value == received, "Expected %ld but got %ld on uri_tests[%ld].dword_props[%ld].\n",
8405 prop.value, received, i, j);
8406 }
8407 }
8408 }
8409
8410 if(uri) IUri_Release(uri);
8411
8412 free(uriW);
8413 }
8414}
8415
8416/* Tests all the 'Get*' property functions which deal with strings. */
8418 IUri *uri = NULL;
8419 HRESULT hr;
8420 DWORD i;
8421
8422 /* Make sure all the 'Get*' string property functions handle invalid args correctly. */
8423 hr = pCreateUri(http_urlW, 0, 0, &uri);
8424 ok(hr == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
8425 if(SUCCEEDED(hr)) {
8426 hr = IUri_GetAbsoluteUri(uri, NULL);
8427 ok(hr == E_POINTER, "Error: GetAbsoluteUri returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8428
8429 hr = IUri_GetAuthority(uri, NULL);
8430 ok(hr == E_POINTER, "Error: GetAuthority returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8431
8432 hr = IUri_GetDisplayUri(uri, NULL);
8433 ok(hr == E_POINTER, "Error: GetDisplayUri returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8434
8435 hr = IUri_GetDomain(uri, NULL);
8436 ok(hr == E_POINTER, "Error: GetDomain returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8437
8438 hr = IUri_GetExtension(uri, NULL);
8439 ok(hr == E_POINTER, "Error: GetExtension returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8440
8441 hr = IUri_GetFragment(uri, NULL);
8442 ok(hr == E_POINTER, "Error: GetFragment returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8443
8444 hr = IUri_GetHost(uri, NULL);
8445 ok(hr == E_POINTER, "Error: GetHost returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8446
8447 hr = IUri_GetPassword(uri, NULL);
8448 ok(hr == E_POINTER, "Error: GetPassword returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8449
8450 hr = IUri_GetPath(uri, NULL);
8451 ok(hr == E_POINTER, "Error: GetPath returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8452
8453 hr = IUri_GetPathAndQuery(uri, NULL);
8454 ok(hr == E_POINTER, "Error: GetPathAndQuery returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8455
8456 hr = IUri_GetQuery(uri, NULL);
8457 ok(hr == E_POINTER, "Error: GetQuery returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8458
8459 hr = IUri_GetRawUri(uri, NULL);
8460 ok(hr == E_POINTER, "Error: GetRawUri returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8461
8462 hr = IUri_GetSchemeName(uri, NULL);
8463 ok(hr == E_POINTER, "Error: GetSchemeName returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8464
8465 hr = IUri_GetUserInfo(uri, NULL);
8466 ok(hr == E_POINTER, "Error: GetUserInfo returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8467
8468 hr = IUri_GetUserName(uri, NULL);
8469 ok(hr == E_POINTER, "Error: GetUserName returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
8470 }
8471 if(uri) IUri_Release(uri);
8472
8473 for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
8475 LPWSTR uriW;
8476 uri = NULL;
8477
8478 if (test.flags) continue;
8479
8480 uriW = a2w(test.uri);
8481 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
8482 todo_wine_if(test.create_todo)
8483 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8484 hr, test.create_expected, i);
8485
8486 if(SUCCEEDED(hr)) {
8487 uri_str_property prop;
8488 BSTR received = NULL;
8489
8490 /* GetAbsoluteUri() tests. */
8491 prop = test.str_props[Uri_PROPERTY_ABSOLUTE_URI];
8492 hr = IUri_GetAbsoluteUri(uri, &received);
8493 todo_wine_if(prop.todo) {
8494 ok(hr == prop.expected, "Error: GetAbsoluteUri returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8495 hr, prop.expected, i);
8497 "Error: Expected %s but got %s on uri_tests[%ld].\n",
8498 prop.value, wine_dbgstr_w(received), i);
8499 }
8501 received = NULL;
8502
8503 /* GetAuthority() tests. */
8504 prop = test.str_props[Uri_PROPERTY_AUTHORITY];
8505 hr = IUri_GetAuthority(uri, &received);
8506 todo_wine_if(prop.todo) {
8507 ok(hr == prop.expected, "Error: GetAuthority returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8508 hr, prop.expected, i);
8509 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8510 prop.value, wine_dbgstr_w(received), i);
8511 }
8513 received = NULL;
8514
8515 /* GetDisplayUri() tests. */
8516 prop = test.str_props[Uri_PROPERTY_DISPLAY_URI];
8517 hr = IUri_GetDisplayUri(uri, &received);
8518 todo_wine_if(prop.todo) {
8519 ok(hr == prop.expected,
8520 "Error: GetDisplayUri returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8521 hr, prop.expected, i);
8522 ok(!strcmp_aw(prop.value, received) || (prop.value2 && !strcmp_aw(prop.value2, received))
8524 "Error: Expected %s but got %s on uri_tests[%ld].\n",
8525 prop.value, wine_dbgstr_w(received), i);
8526 }
8528 received = NULL;
8529
8530 /* GetDomain() tests. */
8531 prop = test.str_props[Uri_PROPERTY_DOMAIN];
8532 hr = IUri_GetDomain(uri, &received);
8533 todo_wine_if(prop.todo) {
8534 ok(hr == prop.expected || (prop.value2 && hr == prop.expected2),
8535 "Error: GetDomain returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8536 hr, prop.expected, i);
8537 ok(!strcmp_aw(prop.value, received) || (prop.value2 && !strcmp_aw(prop.value2, received)),
8538 "Error: Expected %s but got %s on uri_tests[%ld].\n",
8539 prop.value, wine_dbgstr_w(received), i);
8540 }
8542 received = NULL;
8543
8544 /* GetExtension() tests. */
8545 prop = test.str_props[Uri_PROPERTY_EXTENSION];
8546 hr = IUri_GetExtension(uri, &received);
8547 todo_wine_if(prop.todo) {
8548 ok(hr == prop.expected, "Error: GetExtension returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8549 hr, prop.expected, i);
8550 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8551 prop.value, wine_dbgstr_w(received), i);
8552 }
8554 received = NULL;
8555
8556 /* GetFragment() tests. */
8557 prop = test.str_props[Uri_PROPERTY_FRAGMENT];
8558 hr = IUri_GetFragment(uri, &received);
8559 todo_wine_if(prop.todo) {
8560 ok(hr == prop.expected, "Error: GetFragment returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8561 hr, prop.expected, i);
8562 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8563 prop.value, wine_dbgstr_w(received), i);
8564 }
8566 received = NULL;
8567
8568 /* GetHost() tests. */
8569 prop = test.str_props[Uri_PROPERTY_HOST];
8570 hr = IUri_GetHost(uri, &received);
8571 todo_wine_if(prop.todo) {
8572 ok(hr == prop.expected, "Error: GetHost returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8573 hr, prop.expected, i);
8574 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8575 prop.value, wine_dbgstr_w(received), i);
8576 }
8578 received = NULL;
8579
8580 /* GetPassword() tests. */
8581 prop = test.str_props[Uri_PROPERTY_PASSWORD];
8582 hr = IUri_GetPassword(uri, &received);
8583 todo_wine_if(prop.todo) {
8584 ok(hr == prop.expected, "Error: GetPassword returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8585 hr, prop.expected, i);
8586 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8587 prop.value, wine_dbgstr_w(received), i);
8588 }
8590 received = NULL;
8591
8592 /* GetPath() tests. */
8593 prop = test.str_props[Uri_PROPERTY_PATH];
8594 hr = IUri_GetPath(uri, &received);
8595 todo_wine_if(prop.todo) {
8596 ok(hr == prop.expected, "Error: GetPath returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8597 hr, prop.expected, i);
8598 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8599 prop.value, wine_dbgstr_w(received), i);
8600 }
8602 received = NULL;
8603
8604 /* GetPathAndQuery() tests. */
8605 prop = test.str_props[Uri_PROPERTY_PATH_AND_QUERY];
8606 hr = IUri_GetPathAndQuery(uri, &received);
8607 todo_wine_if(prop.todo) {
8608 ok(hr == prop.expected, "Error: GetPathAndQuery returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8609 hr, prop.expected, i);
8610 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8611 prop.value, wine_dbgstr_w(received), i);
8612 }
8614 received = NULL;
8615
8616 /* GetQuery() tests. */
8617 prop = test.str_props[Uri_PROPERTY_QUERY];
8618 hr = IUri_GetQuery(uri, &received);
8619 todo_wine_if(prop.todo) {
8620 ok(hr == prop.expected, "Error: GetQuery returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8621 hr, prop.expected, i);
8622 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8623 prop.value, wine_dbgstr_w(received), i);
8624 }
8626 received = NULL;
8627
8628 /* GetRawUri() tests. */
8629 prop = test.str_props[Uri_PROPERTY_RAW_URI];
8630 hr = IUri_GetRawUri(uri, &received);
8631 todo_wine_if(prop.todo) {
8632 ok(hr == prop.expected, "Error: GetRawUri returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8633 hr, prop.expected, i);
8634 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8635 prop.value, wine_dbgstr_w(received), i);
8636 }
8638 received = NULL;
8639
8640 /* GetSchemeName() tests. */
8641 prop = test.str_props[Uri_PROPERTY_SCHEME_NAME];
8642 hr = IUri_GetSchemeName(uri, &received);
8643 todo_wine_if(prop.todo) {
8644 ok(hr == prop.expected, "Error: GetSchemeName returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8645 hr, prop.expected, i);
8646 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8647 prop.value, wine_dbgstr_w(received), i);
8648 }
8650 received = NULL;
8651
8652 /* GetUserInfo() tests. */
8653 prop = test.str_props[Uri_PROPERTY_USER_INFO];
8654 hr = IUri_GetUserInfo(uri, &received);
8655 todo_wine_if(prop.todo) {
8656 ok(hr == prop.expected, "Error: GetUserInfo returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8657 hr, prop.expected, i);
8658 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8659 prop.value, wine_dbgstr_w(received), i);
8660 }
8662 received = NULL;
8663
8664 /* GetUserName() tests. */
8665 prop = test.str_props[Uri_PROPERTY_USER_NAME];
8666 hr = IUri_GetUserName(uri, &received);
8667 todo_wine_if(prop.todo) {
8668 ok(hr == prop.expected, "Error: GetUserName returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8669 hr, prop.expected, i);
8670 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%ld].\n",
8671 prop.value, wine_dbgstr_w(received), i);
8672 }
8674 }
8675
8676 if(uri) IUri_Release(uri);
8677
8678 free(uriW);
8679 }
8680}
8681
8683 IUri *uri = NULL;
8684 HRESULT hr;
8685 DWORD i;
8686
8687 /* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
8688 hr = pCreateUri(http_urlW, 0, 0, &uri);
8689 ok(hr == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
8690 if(SUCCEEDED(hr)) {
8691 hr = IUri_GetHostType(uri, NULL);
8692 ok(hr == E_INVALIDARG, "Error: GetHostType returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8693
8694 hr = IUri_GetPort(uri, NULL);
8695 ok(hr == E_INVALIDARG, "Error: GetPort returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8696
8697 hr = IUri_GetScheme(uri, NULL);
8698 ok(hr == E_INVALIDARG, "Error: GetScheme returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8699
8700 hr = IUri_GetZone(uri, NULL);
8701 ok(hr == E_INVALIDARG, "Error: GetZone returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8702 }
8703 if(uri) IUri_Release(uri);
8704
8705 for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
8707 LPWSTR uriW;
8708 uri = NULL;
8709
8710 uriW = a2w(test.uri);
8711 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
8712 todo_wine_if(test.create_todo)
8713 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8714 hr, test.create_expected, i);
8715
8716 if(SUCCEEDED(hr)) {
8717 uri_dword_property prop;
8719
8720 /* Assign an insane value so tests don't accidentally pass when
8721 * they shouldn't!
8722 */
8723 received = -9999999;
8724
8725 /* GetHostType() tests. */
8726 prop = test.dword_props[Uri_PROPERTY_HOST_TYPE-Uri_PROPERTY_DWORD_START];
8727 hr = IUri_GetHostType(uri, &received);
8728 todo_wine_if(prop.todo) {
8729 ok(hr == prop.expected, "Error: GetHostType returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8730 hr, prop.expected, i);
8731 ok(received == prop.value, "Error: Expected %ld but got %ld on uri_tests[%ld].\n", prop.value, received, i);
8732 }
8733 received = -9999999;
8734
8735 /* GetPort() tests. */
8736 prop = test.dword_props[Uri_PROPERTY_PORT-Uri_PROPERTY_DWORD_START];
8737 hr = IUri_GetPort(uri, &received);
8738 todo_wine_if(prop.todo) {
8739 ok(hr == prop.expected, "Error: GetPort returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8740 hr, prop.expected, i);
8741 ok(received == prop.value, "Error: Expected %ld but got %ld on uri_tests[%ld].\n", prop.value, received, i);
8742 }
8743 received = -9999999;
8744
8745 /* GetScheme() tests. */
8746 prop = test.dword_props[Uri_PROPERTY_SCHEME-Uri_PROPERTY_DWORD_START];
8747 hr = IUri_GetScheme(uri, &received);
8748 todo_wine_if(prop.todo) {
8749 ok(hr == prop.expected, "Error: GetScheme returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8750 hr, prop.expected, i);
8751 ok(received == prop.value, "Error: Expected %ld but got %ld on uri_tests[%ld].\n", prop.value, received, i);
8752 }
8753 received = -9999999;
8754
8755 /* GetZone() tests. */
8756 prop = test.dword_props[Uri_PROPERTY_ZONE-Uri_PROPERTY_DWORD_START];
8757 hr = IUri_GetZone(uri, &received);
8758 todo_wine_if(prop.todo) {
8759 ok(hr == prop.expected, "Error: GetZone returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].\n",
8760 hr, prop.expected, i);
8761 ok(received == prop.value, "Error: Expected %ld but got %ld on uri_tests[%ld].\n", prop.value, received, i);
8762 }
8763 }
8764
8765 if(uri) IUri_Release(uri);
8766
8767 free(uriW);
8768 }
8769}
8770
8772 IUri *uri = NULL;
8773 HRESULT hr;
8774 DWORD i;
8775
8776 /* Make sure it handles invalid args correctly. */
8777 hr = pCreateUri(http_urlW, 0, 0, &uri);
8778 ok(hr == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
8779 if(SUCCEEDED(hr)) {
8780 DWORD received = 0xdeadbeef;
8781
8782 hr = IUri_GetPropertyLength(uri, Uri_PROPERTY_STRING_START, NULL, 0);
8783 ok(hr == E_INVALIDARG, "Error: GetPropertyLength returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8784
8785 hr = IUri_GetPropertyLength(uri, Uri_PROPERTY_DWORD_START, &received, 0);
8786 ok(hr == E_INVALIDARG, "Error: GetPropertyLength return 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8787 ok(received == 0xdeadbeef, "Error: Expected 0xdeadbeef but got 0x%08lx.\n", received);
8788 }
8789 if(uri) IUri_Release(uri);
8790
8791 for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
8793 LPWSTR uriW;
8794 uri = NULL;
8795
8796 uriW = a2w(test.uri);
8797 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
8798 todo_wine_if(test.create_todo)
8799 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on uri_test[%ld].\n",
8800 hr, test.create_expected, i);
8801
8802 if(SUCCEEDED(hr)) {
8803 DWORD j;
8804
8805 for(j = Uri_PROPERTY_STRING_START; j <= Uri_PROPERTY_STRING_LAST; ++j) {
8806 DWORD expectedLen, expectedLen2, receivedLen;
8807 uri_str_property prop = test.str_props[j];
8808 LPWSTR expectedValueW;
8809
8810 if (prop.value)
8811 {
8812 expectedLen = lstrlenA(prop.value);
8813 /* Value may be unicode encoded */
8814 expectedValueW = a2w(prop.value);
8815 expectedLen = lstrlenW(expectedValueW);
8816 free(expectedValueW);
8817 }
8818 else
8819 {
8820 expectedLen = 0;
8821 }
8822
8823 if (prop.value2)
8824 {
8825 expectedLen2 = lstrlenA(prop.value2);
8826 /* Value may be unicode encoded */
8827 expectedValueW = a2w(prop.value2);
8828 expectedLen2 = lstrlenW(expectedValueW);
8829 free(expectedValueW);
8830 }
8831 else
8832 {
8833 expectedLen2 = 0;
8834 }
8835
8836 /* This won't be necessary once GetPropertyLength is implemented. */
8837 receivedLen = -1;
8838
8839 hr = IUri_GetPropertyLength(uri, j, &receivedLen, test.flags);
8840 todo_wine_if(prop.todo) {
8841 ok(hr == prop.expected || (prop.value2 && hr == prop.expected2),
8842 "Error: GetPropertyLength returned 0x%08lx, expected 0x%08lx on uri_tests[%ld].str_props[%ld].\n",
8843 hr, prop.expected, i, j);
8844 ok(receivedLen == expectedLen || (prop.value2 && receivedLen == expectedLen2) ||
8845 broken(prop.broken_value && receivedLen == lstrlenA(prop.broken_value)),
8846 "Error: Expected a length of %ld but got %ld on uri_tests[%ld].str_props[%ld].\n",
8847 expectedLen, receivedLen, i, j);
8848 }
8849 }
8850 }
8851
8852 if(uri) IUri_Release(uri);
8853
8854 free(uriW);
8855 }
8856}
8857
8859{
8860 DWORD ret = 0, i;
8861
8862 *mask = 0;
8863
8864 for(i=Uri_PROPERTY_STRING_START; i <= Uri_PROPERTY_STRING_LAST; i++) {
8865 if(test->str_props[i-Uri_PROPERTY_STRING_START].expected == S_OK)
8866 ret |= 1<<i;
8867 if(test->str_props[i-Uri_PROPERTY_STRING_START].value2 == NULL ||
8868 test->str_props[i-Uri_PROPERTY_STRING_START].expected ==
8869 test->str_props[i-Uri_PROPERTY_STRING_START].expected2)
8870 *mask |= 1<<i;
8871 }
8872
8873 for(i=Uri_PROPERTY_DWORD_START; i <= Uri_PROPERTY_DWORD_LAST; i++) {
8874 if(test->dword_props[i-Uri_PROPERTY_DWORD_START].expected == S_OK)
8875 ret |= 1<<i;
8876 *mask |= 1<<i;
8877 }
8878
8879 return ret;
8880}
8881
8882static void test_IUri_GetProperties(void) {
8883 IUri *uri = NULL;
8884 HRESULT hr;
8885 DWORD i;
8886
8887 hr = pCreateUri(http_urlW, 0, 0, &uri);
8888 ok(hr == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
8889 if(SUCCEEDED(hr)) {
8890 hr = IUri_GetProperties(uri, NULL);
8891 ok(hr == E_INVALIDARG, "Error: GetProperties returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8892 }
8893 if(uri) IUri_Release(uri);
8894
8895 for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
8897 LPWSTR uriW;
8898 uri = NULL;
8899
8900 if (test.flags) continue;
8901
8902 uriW = a2w(test.uri);
8903 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
8904 todo_wine_if(test.create_todo)
8905 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, test.create_expected);
8906
8907 if(SUCCEEDED(hr)) {
8908 DWORD received = 0, expected_props, mask;
8909 DWORD j;
8910
8911 hr = IUri_GetProperties(uri, &received);
8912 ok(hr == S_OK, "Error: GetProperties returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
8913
8914 expected_props = compute_expected_props(&test, &mask);
8915
8916 for(j = 0; j <= Uri_PROPERTY_DWORD_LAST; ++j) {
8917 /* (1 << j) converts a Uri_PROPERTY to its corresponding Uri_HAS_* flag mask. */
8918 if(mask & (1 << j)) {
8919 if(expected_props & (1 << j))
8920 ok(received & (1 << j), "Error: Expected flag for property %ld on uri_tests[%ld].\n", j, i);
8921 else
8922 ok(!(received & (1 << j)), "Error: Received flag for property %ld when not expected on uri_tests[%ld].\n", j, i);
8923 }
8924 }
8925 }
8926
8927 if(uri) IUri_Release(uri);
8928
8929 free(uriW);
8930 }
8931}
8932
8933static void test_IUri_HasProperty(void) {
8934 IUri *uri = NULL;
8935 HRESULT hr;
8936 DWORD i;
8937
8938 hr = pCreateUri(http_urlW, 0, 0, &uri);
8939 ok(hr == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
8940 if(SUCCEEDED(hr)) {
8941 hr = IUri_HasProperty(uri, Uri_PROPERTY_RAW_URI, NULL);
8942 ok(hr == E_INVALIDARG, "Error: HasProperty returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
8943 }
8944 if(uri) IUri_Release(uri);
8945
8946 for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
8948 LPWSTR uriW;
8949 uri = NULL;
8950
8951 if (test.flags) continue;
8952
8953 uriW = a2w(test.uri);
8954
8955 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
8956 todo_wine_if(test.create_todo)
8957 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, test.create_expected);
8958
8959 if(SUCCEEDED(hr)) {
8960 DWORD expected_props, j, mask;
8961
8962 expected_props = compute_expected_props(&test, &mask);
8963
8964 for(j = 0; j <= Uri_PROPERTY_DWORD_LAST; ++j) {
8965 /* Assign -1, then explicitly test for TRUE or FALSE later. */
8966 BOOL received = -1;
8967
8968 hr = IUri_HasProperty(uri, j, &received);
8969 ok(hr == S_OK, "Error: HasProperty returned 0x%08lx, expected 0x%08lx for property %ld on uri_tests[%ld].\n",
8970 hr, S_OK, j, i);
8971
8972 if(mask & (1 << j)) {
8973 if(expected_props & (1 << j)) {
8974 ok(received == TRUE, "Error: Expected to have property %ld on uri_tests[%ld].\n", j, i);
8975 } else {
8976 ok(received == FALSE, "Error: Wasn't expecting to have property %ld on uri_tests[%ld].\n", j, i);
8977 }
8978 }
8979 }
8980 }
8981
8982 if(uri) IUri_Release(uri);
8983
8984 free(uriW);
8985 }
8986}
8987
8991};
8992
8993static inline struct custom_uri* impl_from_IUri(IUri *iface)
8994{
8995 return CONTAINING_RECORD(iface, struct custom_uri, IUri_iface);
8996}
8997
8999{
9000 if (IsEqualIID(iid, &IID_IUri) || IsEqualIID(iid, &IID_IUnknown))
9001 {
9002 *out = iface;
9003 IUri_AddRef(iface);
9004 return S_OK;
9005 }
9006
9007 *out = NULL;
9008 return E_NOINTERFACE;
9009}
9010
9012{
9013 struct custom_uri *uri = impl_from_IUri(iface);
9014 return IUri_AddRef(uri->uri);
9015}
9016
9018{
9019 struct custom_uri *uri = impl_from_IUri(iface);
9020 return IUri_Release(uri->uri);
9021}
9022
9024{
9025 struct custom_uri *uri = impl_from_IUri(iface);
9026 return IUri_GetPropertyBSTR(uri->uri, property, value, flags);
9027}
9028
9030{
9031 struct custom_uri *uri = impl_from_IUri(iface);
9032 return IUri_GetPropertyLength(uri->uri, property, length, flags);
9033}
9034
9036{
9037 struct custom_uri *uri = impl_from_IUri(iface);
9038 return IUri_GetPropertyDWORD(uri->uri, property, value, flags);
9039}
9040
9041static HRESULT WINAPI custom_uri_HasProperty(IUri *iface, Uri_PROPERTY property, BOOL *has_property)
9042{
9043 struct custom_uri *uri = impl_from_IUri(iface);
9044 return IUri_HasProperty(uri->uri, property, has_property);
9045}
9046
9048{
9049 struct custom_uri *uri = impl_from_IUri(iface);
9050 return IUri_GetAbsoluteUri(uri->uri, value);
9051}
9052
9054{
9055 struct custom_uri *uri = impl_from_IUri(iface);
9056 return IUri_GetAbsoluteUri(uri->uri, value);
9057}
9058
9060{
9061 struct custom_uri *uri = impl_from_IUri(iface);
9062 return IUri_GetAbsoluteUri(uri->uri, value);
9063}
9064
9066{
9067 struct custom_uri *uri = impl_from_IUri(iface);
9068 return IUri_GetAbsoluteUri(uri->uri, value);
9069}
9070
9072{
9073 struct custom_uri *uri = impl_from_IUri(iface);
9074 return IUri_GetAbsoluteUri(uri->uri, value);
9075}
9076
9078{
9079 struct custom_uri *uri = impl_from_IUri(iface);
9080 return IUri_GetAbsoluteUri(uri->uri, value);
9081}
9082
9084{
9085 struct custom_uri *uri = impl_from_IUri(iface);
9086 return IUri_GetAbsoluteUri(uri->uri, value);
9087}
9088
9090{
9091 struct custom_uri *uri = impl_from_IUri(iface);
9092 return IUri_GetAbsoluteUri(uri->uri, value);
9093}
9094
9096{
9097 struct custom_uri *uri = impl_from_IUri(iface);
9098 return IUri_GetAbsoluteUri(uri->uri, value);
9099}
9100
9102{
9103 struct custom_uri *uri = impl_from_IUri(iface);
9104 return IUri_GetAbsoluteUri(uri->uri, value);
9105}
9106
9108{
9109 struct custom_uri *uri = impl_from_IUri(iface);
9110 return IUri_GetAbsoluteUri(uri->uri, value);
9111}
9112
9114{
9115 struct custom_uri *uri = impl_from_IUri(iface);
9116 return IUri_GetAbsoluteUri(uri->uri, value);
9117}
9118
9120{
9121 struct custom_uri *uri = impl_from_IUri(iface);
9122 return IUri_GetSchemeName(uri->uri, value);
9123}
9124
9126{
9127 struct custom_uri *uri = impl_from_IUri(iface);
9128 return IUri_GetUserInfo(uri->uri, value);
9129}
9130
9132{
9133 struct custom_uri *uri = impl_from_IUri(iface);
9134 return IUri_GetUserName(uri->uri, value);
9135}
9136
9138{
9139 struct custom_uri *uri = impl_from_IUri(iface);
9140 return IUri_GetHostType(uri->uri, value);
9141}
9142
9144{
9145 struct custom_uri *uri = impl_from_IUri(iface);
9146 return IUri_GetPort(uri->uri, value);
9147}
9148
9150{
9151 struct custom_uri *uri = impl_from_IUri(iface);
9152 return IUri_GetScheme(uri->uri, value);
9153}
9154
9156{
9157 struct custom_uri *uri = impl_from_IUri(iface);
9158 return IUri_GetZone(uri->uri, value);
9159}
9160
9162{
9163 struct custom_uri *uri = impl_from_IUri(iface);
9164 return IUri_GetProperties(uri->uri, flags);
9165}
9166
9167static HRESULT WINAPI custom_uri_IsEqual(IUri *iface, IUri *pUri, BOOL *is_equal)
9168{
9169 struct custom_uri *uri = impl_from_IUri(iface);
9170 return IUri_IsEqual(uri->uri, pUri, is_equal);
9171}
9172
9173static const IUriVtbl custom_uri_vtbl =
9174{
9203};
9204
9205static void test_IUri_IsEqual(void) {
9206 struct custom_uri custom_uri;
9207 IUri *uriA, *uriB;
9208 BOOL equal;
9209 HRESULT hres;
9210 DWORD i;
9211
9212 uriA = uriB = NULL;
9213
9214 /* Make sure IsEqual handles invalid args correctly. */
9215 hres = pCreateUri(http_urlW, 0, 0, &uriA);
9216 ok(hres == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hres, S_OK);
9217 hres = pCreateUri(http_urlW, 0, 0, &uriB);
9218 ok(hres == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hres, S_OK);
9219
9220 equal = -1;
9221 hres = IUri_IsEqual(uriA, NULL, &equal);
9222 ok(hres == S_OK, "Error: IsEqual returned 0x%08lx, expected 0x%08lx.\n", hres, S_OK);
9223 ok(!equal, "Error: Expected equal to be FALSE, but was %d instead.\n", equal);
9224
9225 hres = IUri_IsEqual(uriA, uriB, NULL);
9226 ok(hres == E_POINTER, "Error: IsEqual returned 0x%08lx, expected 0x%08lx.\n", hres, E_POINTER);
9227
9228 equal = FALSE;
9229 hres = IUri_IsEqual(uriA, uriA, &equal);
9230 ok(hres == S_OK, "Error: IsEqual returned 0x%08lx, expected 0x%08lx.\n", hres, S_OK);
9231 ok(equal, "Error: Expected equal URIs.\n");
9232
9233 equal = FALSE;
9234 hres = IUri_IsEqual(uriA, uriB, &equal);
9235 ok(hres == S_OK, "Error: IsEqual returned 0x%08lx, expected 0x%08lx.\n", hres, S_OK);
9236 ok(equal, "Error: Expected equal URIs.\n");
9237
9238 IUri_Release(uriA);
9239 IUri_Release(uriB);
9240
9242
9243 for(i = 0; i < ARRAY_SIZE(equality_tests); ++i) {
9245 LPWSTR uriA_W, uriB_W;
9246
9247 uriA = uriB = NULL;
9248
9249 uriA_W = a2w(test.a);
9250 uriB_W = a2w(test.b);
9251
9252 hres = pCreateUri(uriA_W, test.create_flags_a, 0, &uriA);
9253 ok(hres == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on equality_tests[%ld].a\n", hres, S_OK, i);
9254
9255 hres = pCreateUri(uriB_W, test.create_flags_b, 0, &uriB);
9256 ok(hres == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on equality_tests[%ld].b\n", hres, S_OK, i);
9257
9258 equal = -1;
9259 hres = IUri_IsEqual(uriA, uriB, &equal);
9260 todo_wine_if(test.todo) {
9261 ok(hres == S_OK, "Error: IsEqual returned 0x%08lx, expected 0x%08lx on equality_tests[%ld].\n", hres, S_OK, i);
9262 ok(equal == test.equal, "Error: Expected the comparison to be %d on equality_tests[%ld].\n", test.equal, i);
9263 }
9264
9265 custom_uri.uri = uriB;
9266
9267 equal = -1;
9268 hres = IUri_IsEqual(uriA, &custom_uri.IUri_iface, &equal);
9269 todo_wine {
9270 ok(hres == S_OK, "Error: IsEqual returned 0x%08lx, expected 0x%08lx on equality_tests[%ld].\n", hres, S_OK, i);
9271 ok(equal == test.equal, "Error: Expected the comparison to be %d on equality_tests[%ld].\n", test.equal, i);
9272 }
9273
9274 if(uriA) IUri_Release(uriA);
9275 if(uriB) IUri_Release(uriB);
9276
9277 free(uriA_W);
9278 free(uriB_W);
9279 }
9280}
9281
9283 HRESULT hr;
9284 IUri *uri = (void*) 0xdeadbeef;
9285 const WCHAR fragmentW[] = {'#','f','r','a','g','m','e','n','t',0};
9286
9287 hr = pCreateUriWithFragment(NULL, fragmentW, 0, 0, &uri);
9288 ok(hr == E_INVALIDARG, "Error: CreateUriWithFragment returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
9289 ok(uri == NULL, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
9290
9291 hr = pCreateUriWithFragment(http_urlW, fragmentW, 0, 0, NULL);
9292 ok(hr == E_INVALIDARG, "Error: CreateUriWithFragment returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
9293
9294 /* Original URI can't already contain a fragment component. */
9295 uri = (void*) 0xdeadbeef;
9296 hr = pCreateUriWithFragment(http_url_fragW, fragmentW, 0, 0, &uri);
9297 ok(hr == E_INVALIDARG, "Error: CreateUriWithFragment returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
9298 ok(uri == NULL, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
9299}
9300
9301/* CreateUriWithFragment has the same invalid flag combinations as CreateUri. */
9303 DWORD i;
9304
9305 for(i = 0; i < ARRAY_SIZE(invalid_flag_tests); ++i) {
9306 HRESULT hr;
9307 IUri *uri = (void*) 0xdeadbeef;
9308
9309 hr = pCreateUriWithFragment(http_urlW, NULL, invalid_flag_tests[i].flags, 0, &uri);
9310 ok(hr == invalid_flag_tests[i].expected, "Error: CreateUriWithFragment returned 0x%08lx, expected 0x%08lx. flags=0x%08lx.\n",
9312 ok(uri == NULL, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
9313 }
9314}
9315
9317 DWORD i;
9318
9319 for(i = 0; i < ARRAY_SIZE(uri_fragment_tests); ++i) {
9320 HRESULT hr;
9321 IUri *uri = NULL;
9322 LPWSTR uriW, fragW;
9324
9325 uriW = a2w(test.uri);
9326 fragW = a2w(test.fragment);
9327
9328 hr = pCreateUriWithFragment(uriW, fragW, test.create_flags, 0, &uri);
9329 todo_wine_if(test.expected_todo)
9330 ok(hr == test.create_expected,
9331 "Error: CreateUriWithFragment returned 0x%08lx, expected 0x%08lx on uri_fragment_tests[%ld].\n",
9332 hr, test.create_expected, i);
9333
9334 if(SUCCEEDED(hr)) {
9335 BSTR received = NULL;
9336
9337 hr = IUri_GetAbsoluteUri(uri, &received);
9338 todo_wine_if(test.expected_todo) {
9339 ok(hr == S_OK, "Error: GetAbsoluteUri returned 0x%08lx, expected 0x%08lx on uri_fragment_tests[%ld].\n",
9340 hr, S_OK, i);
9341 ok(!strcmp_aw(test.expected_uri, received), "Error: Expected %s but got %s on uri_fragment_tests[%ld].\n",
9342 test.expected_uri, wine_dbgstr_w(received), i);
9343 }
9344
9346 }
9347
9348 if(uri) IUri_Release(uri);
9349 free(uriW);
9350 free(fragW);
9351 }
9352}
9353
9354static void test_CreateIUriBuilder(void) {
9355 HRESULT hr;
9356 IUriBuilder *builder = NULL;
9357 IUri *uri;
9358
9359 hr = pCreateIUriBuilder(NULL, 0, 0, NULL);
9360 ok(hr == E_POINTER, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx\n",
9361 hr, E_POINTER);
9362
9363 /* CreateIUriBuilder increases the ref count of the IUri it receives. */
9364 hr = pCreateUri(http_urlW, 0, 0, &uri);
9365 ok(hr == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
9366 if(SUCCEEDED(hr)) {
9367 ULONG cur_count, orig_count;
9368
9369 orig_count = get_refcnt(uri);
9370 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
9371 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
9372 ok(builder != NULL, "Error: Expecting builder not to be NULL\n");
9373
9374 cur_count = get_refcnt(uri);
9375 ok(cur_count == orig_count+1, "Error: Expected the ref count to be %lu, but was %lu instead.\n", orig_count+1, cur_count);
9376
9377 if(builder) IUriBuilder_Release(builder);
9378 cur_count = get_refcnt(uri);
9379 ok(cur_count == orig_count, "Error: Expected the ref count to be %lu, but was %lu instead.\n", orig_count, cur_count);
9380 }
9381 if(uri) IUri_Release(uri);
9382}
9383
9385 DWORD test_index) {
9386 HRESULT hr;
9387 IUri *uri = NULL;
9388
9389 hr = IUriBuilder_CreateUri(builder, test->uri_flags, 0, 0, &uri);
9390 todo_wine_if(test->uri_todo)
9391 ok(hr == test->uri_hres,
9392 "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9393 hr, test->uri_hres, test_index);
9394
9395 if(SUCCEEDED(hr)) {
9396 DWORD i;
9397
9398 for(i = 0; i < ARRAY_SIZE(test->expected_str_props); ++i) {
9399 uri_builder_str_property prop = test->expected_str_props[i];
9400 BSTR received = NULL;
9401
9402 hr = IUri_GetPropertyBSTR(uri, i, &received, 0);
9403 todo_wine_if(prop.todo)
9404 ok(hr == prop.result,
9405 "Error: IUri_GetPropertyBSTR returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_str_props[%ld].\n",
9406 hr, prop.result, test_index, i);
9407 if(SUCCEEDED(hr)) {
9408 todo_wine_if(prop.todo)
9409 ok(!strcmp_aw(prop.expected, received),
9410 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].expected_str_props[%ld].\n",
9411 prop.expected, wine_dbgstr_w(received), test_index, i);
9412 }
9414 }
9415
9416 for(i = 0; i < ARRAY_SIZE(test->expected_dword_props); ++i) {
9417 uri_builder_dword_property prop = test->expected_dword_props[i];
9418 DWORD received = -2;
9419
9420 hr = IUri_GetPropertyDWORD(uri, i+Uri_PROPERTY_DWORD_START, &received, 0);
9421 todo_wine_if(prop.todo)
9422 ok(hr == prop.result,
9423 "Error: IUri_GetPropertyDWORD returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9424 hr, prop.result, test_index, i);
9425 if(SUCCEEDED(hr)) {
9426 todo_wine_if(prop.todo)
9427 ok(received == prop.expected,
9428 "Error: Expected %ld but got %ld instead on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9429 prop.expected, received, test_index, i);
9430 }
9431 }
9432 }
9433 if(uri) IUri_Release(uri);
9434}
9435
9437 DWORD test_index) {
9438 HRESULT hr;
9439 IUri *uri = NULL;
9440
9441 hr = IUriBuilder_CreateUriSimple(builder, test->uri_simple_encode_flags, 0, &uri);
9442 todo_wine_if(test->uri_simple_todo)
9443 ok(hr == test->uri_simple_hres,
9444 "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9445 hr, test->uri_simple_hres, test_index);
9446
9447 if(SUCCEEDED(hr)) {
9448 DWORD i;
9449
9450 for(i = 0; i < ARRAY_SIZE(test->expected_str_props); ++i) {
9451 uri_builder_str_property prop = test->expected_str_props[i];
9452 BSTR received = NULL;
9453
9454 hr = IUri_GetPropertyBSTR(uri, i, &received, 0);
9455 todo_wine_if(prop.todo)
9456 ok(hr == prop.result,
9457 "Error: IUri_GetPropertyBSTR returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_str_props[%ld].\n",
9458 hr, prop.result, test_index, i);
9459 if(SUCCEEDED(hr)) {
9460 todo_wine_if(prop.todo)
9461 ok(!strcmp_aw(prop.expected, received),
9462 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].expected_str_props[%ld].\n",
9463 prop.expected, wine_dbgstr_w(received), test_index, i);
9464 }
9466 }
9467
9468 for(i = 0; i < ARRAY_SIZE(test->expected_dword_props); ++i) {
9469 uri_builder_dword_property prop = test->expected_dword_props[i];
9470 DWORD received = -2;
9471
9472 hr = IUri_GetPropertyDWORD(uri, i+Uri_PROPERTY_DWORD_START, &received, 0);
9473 todo_wine_if(prop.todo)
9474 ok(hr == prop.result,
9475 "Error: IUri_GetPropertyDWORD returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9476 hr, prop.result, test_index, i);
9477 if(SUCCEEDED(hr)) {
9478 todo_wine_if(prop.todo)
9479 ok(received == prop.expected,
9480 "Error: Expected %ld but got %ld instead on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9481 prop.expected, received, test_index, i);
9482 }
9483 }
9484 }
9485 if(uri) IUri_Release(uri);
9486}
9487
9489 DWORD test_index) {
9490 HRESULT hr;
9491 IUri *uri = NULL;
9492
9493 hr = IUriBuilder_CreateUriWithFlags(builder, test->uri_with_flags, test->uri_with_builder_flags,
9494 test->uri_with_encode_flags, 0, &uri);
9495 todo_wine_if(test->uri_with_todo)
9496 ok(hr == test->uri_with_hres,
9497 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9498 hr, test->uri_with_hres, test_index);
9499
9500 if(SUCCEEDED(hr)) {
9501 DWORD i;
9502
9503 for(i = 0; i < ARRAY_SIZE(test->expected_str_props); ++i) {
9504 uri_builder_str_property prop = test->expected_str_props[i];
9505 BSTR received = NULL;
9506
9507 hr = IUri_GetPropertyBSTR(uri, i, &received, 0);
9508 todo_wine_if(prop.todo)
9509 ok(hr == prop.result,
9510 "Error: IUri_GetPropertyBSTR returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_str_props[%ld].\n",
9511 hr, prop.result, test_index, i);
9512 if(SUCCEEDED(hr)) {
9513 todo_wine_if(prop.todo)
9514 ok(!strcmp_aw(prop.expected, received),
9515 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].expected_str_props[%ld].\n",
9516 prop.expected, wine_dbgstr_w(received), test_index, i);
9517 }
9519 }
9520
9521 for(i = 0; i < ARRAY_SIZE(test->expected_dword_props); ++i) {
9522 uri_builder_dword_property prop = test->expected_dword_props[i];
9523 DWORD received = -2;
9524
9525 hr = IUri_GetPropertyDWORD(uri, i+Uri_PROPERTY_DWORD_START, &received, 0);
9526 todo_wine_if(prop.todo)
9527 ok(hr == prop.result,
9528 "Error: IUri_GetPropertyDWORD returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9529 hr, prop.result, test_index, i);
9530 if(SUCCEEDED(hr)) {
9531 todo_wine_if(prop.todo)
9532 ok(received == prop.expected,
9533 "Error: Expected %ld but got %ld instead on uri_builder_tests[%ld].expected_dword_props[%ld].\n",
9534 prop.expected, received, test_index, i);
9535 }
9536 }
9537 }
9538 if(uri) IUri_Release(uri);
9539}
9540
9542 IUriBuilder *builder;
9543 HRESULT hr;
9544
9545 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
9546 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
9547 if(SUCCEEDED(hr)) {
9548 IUri *test = NULL, *uri = (void*) 0xdeadbeef;
9549
9550 /* Test what happens if the IUriBuilder doesn't have a IUri set. */
9551 hr = IUriBuilder_CreateUri(builder, 0, 0, 0, NULL);
9552 ok(hr == E_POINTER, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, E_POINTER);
9553
9554 uri = (void*) 0xdeadbeef;
9555 hr = IUriBuilder_CreateUri(builder, 0, Uri_HAS_USER_NAME, 0, &uri);
9556 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, E_NOTIMPL);
9557 ok(uri == NULL, "Error: expected uri to be NULL, but was %p instead.\n", uri);
9558
9559 hr = IUriBuilder_CreateUriSimple(builder, 0, 0, NULL);
9560 ok(hr == E_POINTER, "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx.\n",
9561 hr, E_POINTER);
9562
9563 uri = (void*) 0xdeadbeef;
9564 hr = IUriBuilder_CreateUriSimple(builder, Uri_HAS_USER_NAME, 0, &uri);
9565 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx.\n",
9566 hr, E_NOTIMPL);
9567 ok(!uri, "Error: Expected uri to NULL, but was %p instead.\n", uri);
9568
9569 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, 0, 0, NULL);
9570 ok(hr == E_POINTER, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n",
9571 hr, E_POINTER);
9572
9573 uri = (void*) 0xdeadbeef;
9574 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, Uri_HAS_USER_NAME, 0, &uri);
9575 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n",
9576 hr, E_NOTIMPL);
9577 ok(!uri, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
9578
9579 hr = pCreateUri(http_urlW, 0, 0, &test);
9580 ok(hr == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
9581 if(SUCCEEDED(hr)) {
9582 hr = IUriBuilder_SetIUri(builder, test);
9583 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
9584
9585 /* No longer returns E_NOTIMPL, since a IUri has been set and hasn't been modified. */
9586 uri = NULL;
9587 hr = IUriBuilder_CreateUri(builder, 0, Uri_HAS_USER_NAME, 0, &uri);
9588 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
9589 ok(uri != NULL, "Error: The uri was NULL.\n");
9590 if(uri) IUri_Release(uri);
9591
9592 uri = NULL;
9593 hr = IUriBuilder_CreateUriSimple(builder, Uri_HAS_USER_NAME, 0, &uri);
9594 ok(hr == S_OK, "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx.\n",
9595 hr, S_OK);
9596 ok(uri != NULL, "Error: uri was NULL.\n");
9597 if(uri) IUri_Release(uri);
9598
9599 uri = NULL;
9600 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, 0, 0, &uri);
9601 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n",
9602 hr, S_OK);
9603 ok(uri != NULL, "Error: uri was NULL.\n");
9604 if(uri) IUri_Release(uri);
9605
9606 hr = IUriBuilder_SetFragment(builder, NULL);
9607 ok(hr == S_OK, "Error: IUriBuilder_SetFragment returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
9608
9609 /* The IUriBuilder is changed, so it returns E_NOTIMPL again. */
9610 uri = (void*) 0xdeadbeef;
9611 hr = IUriBuilder_CreateUri(builder, 0, Uri_HAS_USER_NAME, 0, &uri);
9612 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
9613 ok(!uri, "Error: Expected uri to be NULL but was %p instead.\n", uri);
9614
9615 uri = (void*) 0xdeadbeef;
9616 hr = IUriBuilder_CreateUriSimple(builder, Uri_HAS_USER_NAME, 0, &uri);
9617 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx.\n",
9618 hr, S_OK);
9619 ok(!uri, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
9620
9621 uri = (void*) 0xdeadbeef;
9622 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, Uri_HAS_USER_NAME, 0, &uri);
9623 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n",
9624 hr, E_NOTIMPL);
9625 ok(!uri, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
9626 }
9627 if(test) IUri_Release(test);
9628 }
9629 if(builder) IUriBuilder_Release(builder);
9630}
9631
9632/* Tests invalid args to the "Get*" functions. */
9634 IUriBuilder *builder = NULL;
9635 HRESULT hr;
9636
9637 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
9638 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
9639 if(SUCCEEDED(hr)) {
9640 LPCWSTR received = (void*) 0xdeadbeef;
9641 DWORD len = -1, port = -1;
9642 BOOL set = -1;
9643
9644 hr = IUriBuilder_GetFragment(builder, NULL, NULL);
9645 ok(hr == E_POINTER, "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx.\n",
9646 hr, E_POINTER);
9647 hr = IUriBuilder_GetFragment(builder, NULL, &received);
9648 ok(hr == E_POINTER, "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx.\n",
9649 hr, E_POINTER);
9650 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
9651 hr = IUriBuilder_GetFragment(builder, &len, NULL);
9652 ok(hr == E_POINTER, "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx.\n",
9653 hr, E_POINTER);
9654 ok(!len, "Error: Expected len to be 0, but was %ld instead.\n", len);
9655
9656 hr = IUriBuilder_GetHost(builder, NULL, NULL);
9657 ok(hr == E_POINTER, "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx.\n",
9658 hr, E_POINTER);
9659 received = (void*) 0xdeadbeef;
9660 hr = IUriBuilder_GetHost(builder, NULL, &received);
9661 ok(hr == E_POINTER, "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx.\n",
9662 hr, E_POINTER);
9663 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
9664 len = -1;
9665 hr = IUriBuilder_GetHost(builder, &len, NULL);
9666 ok(hr == E_POINTER, "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx.\n",
9667 hr, E_POINTER);
9668 ok(!len, "Error: Expected len to be 0, but was %ld instead.\n", len);
9669
9670 hr = IUriBuilder_GetPassword(builder, NULL, NULL);
9671 ok(hr == E_POINTER, "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx.\n",
9672 hr, E_POINTER);
9673 received = (void*) 0xdeadbeef;
9674 hr = IUriBuilder_GetPassword(builder, NULL, &received);
9675 ok(hr == E_POINTER, "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx.\n",
9676 hr, E_POINTER);
9677 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
9678 len = -1;
9679 hr = IUriBuilder_GetPassword(builder, &len, NULL);
9680 ok(hr == E_POINTER, "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx.\n",
9681 hr, E_POINTER);
9682 ok(!len, "Error: Expected len to be 0, but was %ld instead.\n", len);
9683
9684 hr = IUriBuilder_GetPath(builder, NULL, NULL);
9685 ok(hr == E_POINTER, "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx.\n",
9686 hr, E_POINTER);
9687 received = (void*) 0xdeadbeef;
9688 hr = IUriBuilder_GetPath(builder, NULL, &received);
9689 ok(hr == E_POINTER, "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx.\n",
9690 hr, E_POINTER);
9691 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
9692 len = -1;
9693 hr = IUriBuilder_GetPath(builder, &len, NULL);
9694 ok(hr == E_POINTER, "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx.\n",
9695 hr, E_POINTER);
9696 ok(!len, "Error: Expected len to be 0, but was %ld instead.\n", len);
9697
9698 hr = IUriBuilder_GetPort(builder, NULL, NULL);
9699 ok(hr == E_POINTER, "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx.\n",
9700 hr, E_POINTER);
9701 hr = IUriBuilder_GetPort(builder, NULL, &port);
9702 ok(hr == E_POINTER, "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx.\n",
9703 hr, E_POINTER);
9704 ok(!port, "Error: Expected port to be 0, but was %ld instead.\n", port);
9705 hr = IUriBuilder_GetPort(builder, &set, NULL);
9706 ok(hr == E_POINTER, "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx.\n",
9707 hr, E_POINTER);
9708 ok(!set, "Error: Expected set to be FALSE, but was %d instead.\n", set);
9709
9710 hr = IUriBuilder_GetQuery(builder, NULL, NULL);
9711 ok(hr == E_POINTER, "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx.\n",
9712 hr, E_POINTER);
9713 received = (void*) 0xdeadbeef;
9714 hr = IUriBuilder_GetQuery(builder, NULL, &received);
9715 ok(hr == E_POINTER, "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx.\n",
9716 hr, E_POINTER);
9717 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
9718 len = -1;
9719 hr = IUriBuilder_GetQuery(builder, &len, NULL);
9720 ok(hr == E_POINTER, "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx.\n",
9721 hr, E_POINTER);
9722 ok(!len, "Error: Expected len to be 0, but was %ld instead.\n", len);
9723
9724 hr = IUriBuilder_GetSchemeName(builder, NULL, NULL);
9725 ok(hr == E_POINTER, "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx.\n",
9726 hr, E_POINTER);
9727 received = (void*) 0xdeadbeef;
9728 hr = IUriBuilder_GetSchemeName(builder, NULL, &received);
9729 ok(hr == E_POINTER, "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx.\n",
9730 hr, E_POINTER);
9731 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
9732 len = -1;
9733 hr = IUriBuilder_GetSchemeName(builder, &len, NULL);
9734 ok(hr == E_POINTER, "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx.\n",
9735 hr, E_POINTER);
9736 ok(!len, "Error: Expected len to be 0, but was %ld instead.\n", len);
9737
9738 hr = IUriBuilder_GetUserName(builder, NULL, NULL);
9739 ok(hr == E_POINTER, "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx.\n",
9740 hr, E_POINTER);
9741 received = (void*) 0xdeadbeef;
9742 hr = IUriBuilder_GetUserName(builder, NULL, &received);
9743 ok(hr == E_POINTER, "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx.\n",
9744 hr, E_POINTER);
9745 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
9746 len = -1;
9747 hr = IUriBuilder_GetUserName(builder, &len, NULL);
9748 ok(hr == E_POINTER, "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx.\n",
9749 hr, E_POINTER);
9750 ok(!len, "Error: Expected len to be 0, but was %ld instead.\n", len);
9751 }
9752 if(builder) IUriBuilder_Release(builder);
9753}
9754
9756 DWORD test_index) {
9757 HRESULT hr;
9758 DWORD i;
9760 DWORD len = -1;
9761 const uri_builder_property *prop = NULL;
9762
9763 /* Check if the property was set earlier. */
9764 for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
9765 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_FRAGMENT)
9766 prop = &(test->properties[i]);
9767 }
9768
9769 if(prop) {
9770 /* Use expected_value unless it's NULL, then use value. */
9771 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
9772 DWORD expected_len = expected ? strlen(expected) : 0;
9773 hr = IUriBuilder_GetFragment(builder, &len, &received);
9774 todo_wine_if(prop->todo) {
9775 ok(hr == (expected ? S_OK : S_FALSE),
9776 "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9777 hr, (expected ? S_OK : S_FALSE), test_index);
9778 if(SUCCEEDED(hr)) {
9779 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
9780 expected, wine_dbgstr_w(received), test_index);
9781 ok(expected_len == len,
9782 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
9783 expected_len, len, test_index);
9784 }
9785 }
9786 } else {
9787 /* The property wasn't set earlier, so it should return whatever
9788 * the base IUri contains (if anything).
9789 */
9790 IUri *uri = NULL;
9791 hr = IUriBuilder_GetIUri(builder, &uri);
9792 ok(hr == S_OK,
9793 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9794 hr, S_OK, test_index);
9795 if(SUCCEEDED(hr)) {
9796 if(!uri) {
9797 received = (void*) 0xdeadbeef;
9798 len = -1;
9799
9800 hr = IUriBuilder_GetFragment(builder, &len, &received);
9801 ok(hr == S_FALSE,
9802 "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9803 hr, S_FALSE, test_index);
9804 if(SUCCEEDED(hr)) {
9805 ok(!len, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9806 len, test_index);
9807 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
9808 received, test_index);
9809 }
9810 } else {
9811 BOOL has_prop = FALSE;
9812 BSTR expected = NULL;
9813
9814 hr = IUri_GetFragment(uri, &expected);
9815 ok(SUCCEEDED(hr),
9816 "Error: Expected IUri_GetFragment to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
9817 hr, test_index);
9818 has_prop = hr == S_OK;
9819
9820 hr = IUriBuilder_GetFragment(builder, &len, &received);
9821 if(has_prop) {
9822 ok(hr == S_OK,
9823 "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9824 hr, S_OK, test_index);
9825 if(SUCCEEDED(hr)) {
9827 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
9829 ok(lstrlenW(expected) == len,
9830 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
9831 lstrlenW(expected), len, test_index);
9832 }
9833 } else {
9834 ok(hr == S_FALSE,
9835 "Error: IUriBuilder_GetFragment returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9836 hr, S_FALSE, test_index);
9837 if(SUCCEEDED(hr)) {
9838 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index);
9839 ok(!len, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9840 len, test_index);
9841 }
9842 }
9844 }
9845 }
9846 if(uri) IUri_Release(uri);
9847 }
9848}
9849
9851 DWORD test_index) {
9852 HRESULT hr;
9853 DWORD i;
9855 DWORD len = -1;
9856 const uri_builder_property *prop = NULL;
9857
9858 /* Check if the property was set earlier. */
9859 for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
9860 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_HOST)
9861 prop = &(test->properties[i]);
9862 }
9863
9864 if(prop) {
9865 /* Use expected_value unless it's NULL, then use value. */
9866 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
9867 DWORD expected_len = expected ? strlen(expected) : 0;
9868 hr = IUriBuilder_GetHost(builder, &len, &received);
9869 todo_wine_if(prop->todo) {
9870 ok(hr == (expected ? S_OK : S_FALSE),
9871 "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9872 hr, (expected ? S_OK : S_FALSE), test_index);
9873 if(SUCCEEDED(hr)) {
9874 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
9875 expected, wine_dbgstr_w(received), test_index);
9876 ok(expected_len == len,
9877 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
9878 expected_len, len, test_index);
9879 }
9880 }
9881 } else {
9882 /* The property wasn't set earlier, so it should return whatever
9883 * the base IUri contains (if anything).
9884 */
9885 IUri *uri = NULL;
9886 hr = IUriBuilder_GetIUri(builder, &uri);
9887 ok(hr == S_OK,
9888 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9889 hr, S_OK, test_index);
9890 if(SUCCEEDED(hr)) {
9891 if(!uri) {
9892 received = (void*) 0xdeadbeef;
9893 len = -1;
9894
9895 hr = IUriBuilder_GetHost(builder, &len, &received);
9896 ok(hr == S_FALSE,
9897 "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9898 hr, S_FALSE, test_index);
9899 if(SUCCEEDED(hr)) {
9900 ok(!len, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9901 len, test_index);
9902 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
9903 received, test_index);
9904 }
9905 } else {
9906 BOOL has_prop = FALSE;
9907 BSTR expected = NULL;
9908
9909 hr = IUri_GetHost(uri, &expected);
9910 ok(SUCCEEDED(hr),
9911 "Error: Expected IUri_GetHost to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
9912 hr, test_index);
9913 has_prop = hr == S_OK;
9914
9915 hr = IUriBuilder_GetHost(builder, &len, &received);
9916 if(has_prop) {
9917 ok(hr == S_OK,
9918 "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9919 hr, S_OK, test_index);
9920 if(SUCCEEDED(hr)) {
9922 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
9924 ok(lstrlenW(expected) == len,
9925 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
9926 lstrlenW(expected), len, test_index);
9927 }
9928 } else {
9929 ok(hr == S_FALSE,
9930 "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9931 hr, S_FALSE, test_index);
9932 if(SUCCEEDED(hr)) {
9933 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index);
9934 ok(!len, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9935 len, test_index);
9936 }
9937 }
9939 }
9940 }
9941 if(uri) IUri_Release(uri);
9942 }
9943}
9944
9946 DWORD test_index) {
9947 HRESULT hr;
9948 DWORD i;
9950 DWORD len = -1;
9951 const uri_builder_property *prop = NULL;
9952
9953 /* Check if the property was set earlier. */
9954 for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
9955 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_PASSWORD)
9956 prop = &(test->properties[i]);
9957 }
9958
9959 if(prop) {
9960 /* Use expected_value unless it's NULL, then use value. */
9961 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
9962 DWORD expected_len = expected ? strlen(expected) : 0;
9963 hr = IUriBuilder_GetPassword(builder, &len, &received);
9964 todo_wine_if(prop->todo) {
9965 ok(hr == (expected ? S_OK : S_FALSE),
9966 "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9967 hr, (expected ? S_OK : S_FALSE), test_index);
9968 if(SUCCEEDED(hr)) {
9969 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
9970 expected, wine_dbgstr_w(received), test_index);
9971 ok(expected_len == len,
9972 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
9973 expected_len, len, test_index);
9974 }
9975 }
9976 } else {
9977 /* The property wasn't set earlier, so it should return whatever
9978 * the base IUri contains (if anything).
9979 */
9980 IUri *uri = NULL;
9981 hr = IUriBuilder_GetIUri(builder, &uri);
9982 ok(hr == S_OK,
9983 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9984 hr, S_OK, test_index);
9985 if(SUCCEEDED(hr)) {
9986 if(!uri) {
9987 received = (void*) 0xdeadbeef;
9988 len = -1;
9989
9990 hr = IUriBuilder_GetPassword(builder, &len, &received);
9991 ok(hr == S_FALSE,
9992 "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
9993 hr, S_FALSE, test_index);
9994 if(SUCCEEDED(hr)) {
9995 ok(!len, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
9996 len, test_index);
9997 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
9998 received, test_index);
9999 }
10000 } else {
10001 BOOL has_prop = FALSE;
10002 BSTR expected = NULL;
10003
10004 hr = IUri_GetPassword(uri, &expected);
10005 ok(SUCCEEDED(hr),
10006 "Error: Expected IUri_GetPassword to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
10007 hr, test_index);
10008 has_prop = hr == S_OK;
10009
10010 hr = IUriBuilder_GetPassword(builder, &len, &received);
10011 if(has_prop) {
10012 ok(hr == S_OK,
10013 "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10014 hr, S_OK, test_index);
10015 if(SUCCEEDED(hr)) {
10017 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
10019 ok(lstrlenW(expected) == len,
10020 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
10021 lstrlenW(expected), len, test_index);
10022 }
10023 } else {
10024 ok(hr == S_FALSE,
10025 "Error: IUriBuilder_GetPassword returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10026 hr, S_FALSE, test_index);
10027 if(SUCCEEDED(hr)) {
10028 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index);
10029 ok(!len, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10030 len, test_index);
10031 }
10032 }
10034 }
10035 }
10036 if(uri) IUri_Release(uri);
10037 }
10038}
10039
10041 DWORD test_index) {
10042 HRESULT hr;
10043 DWORD i;
10045 DWORD len = -1;
10046 const uri_builder_property *prop = NULL;
10047
10048 /* Check if the property was set earlier. */
10049 for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
10050 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_PATH)
10051 prop = &(test->properties[i]);
10052 }
10053
10054 if(prop) {
10055 /* Use expected_value unless it's NULL, then use value. */
10056 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
10057 DWORD expected_len = expected ? strlen(expected) : 0;
10058 hr = IUriBuilder_GetPath(builder, &len, &received);
10059 todo_wine_if(prop->todo) {
10060 ok(hr == (expected ? S_OK : S_FALSE),
10061 "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10062 hr, (expected ? S_OK : S_FALSE), test_index);
10063 if(SUCCEEDED(hr)) {
10064 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
10065 expected, wine_dbgstr_w(received), test_index);
10066 ok(expected_len == len,
10067 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
10068 expected_len, len, test_index);
10069 }
10070 }
10071 } else {
10072 /* The property wasn't set earlier, so it should return whatever
10073 * the base IUri contains (if anything).
10074 */
10075 IUri *uri = NULL;
10076 hr = IUriBuilder_GetIUri(builder, &uri);
10077 ok(hr == S_OK,
10078 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10079 hr, S_OK, test_index);
10080 if(SUCCEEDED(hr)) {
10081 if(!uri) {
10082 received = (void*) 0xdeadbeef;
10083 len = -1;
10084
10085 hr = IUriBuilder_GetPath(builder, &len, &received);
10086 ok(hr == S_FALSE,
10087 "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10088 hr, S_FALSE, test_index);
10089 if(SUCCEEDED(hr)) {
10090 ok(!len, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10091 len, test_index);
10092 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
10093 received, test_index);
10094 }
10095 } else {
10096 BOOL has_prop = FALSE;
10097 BSTR expected = NULL;
10098
10099 hr = IUri_GetPath(uri, &expected);
10100 ok(SUCCEEDED(hr),
10101 "Error: Expected IUri_GetPath to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
10102 hr, test_index);
10103 has_prop = hr == S_OK;
10104
10105 hr = IUriBuilder_GetPath(builder, &len, &received);
10106 if(has_prop) {
10107 ok(hr == S_OK,
10108 "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10109 hr, S_OK, test_index);
10110 if(SUCCEEDED(hr)) {
10112 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
10114 ok(lstrlenW(expected) == len,
10115 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
10116 lstrlenW(expected), len, test_index);
10117 }
10118 } else {
10119 ok(hr == S_FALSE,
10120 "Error: IUriBuilder_GetPath returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10121 hr, S_FALSE, test_index);
10122 if(SUCCEEDED(hr)) {
10123 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index);
10124 ok(!len, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10125 len, test_index);
10126 }
10127 }
10129 }
10130 }
10131 if(uri) IUri_Release(uri);
10132 }
10133}
10134
10136 DWORD test_index) {
10137 HRESULT hr;
10138 BOOL has_port = FALSE;
10139 DWORD received = -1;
10140
10141 if(test->port_prop.change) {
10142 hr = IUriBuilder_GetPort(builder, &has_port, &received);
10143 todo_wine_if(test->port_prop.todo) {
10144 ok(hr == S_OK,
10145 "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10146 hr, S_OK, test_index);
10147 if(SUCCEEDED(hr)) {
10148 ok(has_port == test->port_prop.set,
10149 "Error: Expected has_port to be %d, but was %d instead on uri_builder_tests[%ld].\n",
10150 test->port_prop.set, has_port, test_index);
10151 ok(received == test->port_prop.value,
10152 "Error: Expected port to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
10153 test->port_prop.value, received, test_index);
10154 }
10155 }
10156 } else {
10157 IUri *uri = NULL;
10158
10159 hr = IUriBuilder_GetIUri(builder, &uri);
10160 ok(hr == S_OK,
10161 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10162 hr, S_OK, test_index);
10163 if(SUCCEEDED(hr)) {
10164 if(!uri) {
10165 hr = IUriBuilder_GetPort(builder, &has_port, &received);
10166 ok(hr == S_OK,
10167 "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10168 hr, S_OK, test_index);
10169 if(SUCCEEDED(hr)) {
10170 ok(has_port == FALSE,
10171 "Error: Expected has_port to be FALSE, but was %d instead on uri_builder_tests[%ld].\n",
10172 has_port, test_index);
10173 ok(!received, "Error: Expected received to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10174 received, test_index);
10175 }
10176 } else {
10178
10179 hr = IUri_GetPort(uri, &expected);
10180 ok(SUCCEEDED(hr),
10181 "Error: Expected IUri_Port to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
10182 hr, test_index);
10183
10184 hr = IUriBuilder_GetPort(builder, &has_port, &received);
10185 ok(hr == S_OK,
10186 "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10187 hr, S_OK, test_index);
10188 if(SUCCEEDED(hr)) {
10189 ok(!has_port,
10190 "Error: Expected has_port to be FALSE but was TRUE instead on uri_builder_tests[%ld].\n",
10191 test_index);
10192 ok(received == expected,
10193 "Error: Expected received to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
10194 expected, received, test_index);
10195 }
10196 }
10197 }
10198 if(uri) IUri_Release(uri);
10199 }
10200}
10201
10203 DWORD test_index) {
10204 HRESULT hr;
10205 DWORD i;
10207 DWORD len = -1;
10208 const uri_builder_property *prop = NULL;
10209
10210 /* Check if the property was set earlier. */
10211 for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
10212 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_QUERY)
10213 prop = &(test->properties[i]);
10214 }
10215
10216 if(prop) {
10217 /* Use expected_value unless it's NULL, then use value. */
10218 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
10219 DWORD expected_len = expected ? strlen(expected) : 0;
10220 hr = IUriBuilder_GetQuery(builder, &len, &received);
10221 todo_wine_if(prop->todo) {
10222 ok(hr == (expected ? S_OK : S_FALSE),
10223 "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10224 hr, (expected ? S_OK : S_FALSE), test_index);
10225 if(SUCCEEDED(hr)) {
10226 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
10227 expected, wine_dbgstr_w(received), test_index);
10228 ok(expected_len == len,
10229 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
10230 expected_len, len, test_index);
10231 }
10232 }
10233 } else {
10234 /* The property wasn't set earlier, so it should return whatever
10235 * the base IUri contains (if anything).
10236 */
10237 IUri *uri = NULL;
10238 hr = IUriBuilder_GetIUri(builder, &uri);
10239 ok(hr == S_OK,
10240 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10241 hr, S_OK, test_index);
10242 if(SUCCEEDED(hr)) {
10243 if(!uri) {
10244 received = (void*) 0xdeadbeef;
10245 len = -1;
10246
10247 hr = IUriBuilder_GetQuery(builder, &len, &received);
10248 ok(hr == S_FALSE,
10249 "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10250 hr, S_FALSE, test_index);
10251 if(SUCCEEDED(hr)) {
10252 ok(!len, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10253 len, test_index);
10254 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
10255 received, test_index);
10256 }
10257 } else {
10258 BOOL has_prop = FALSE;
10259 BSTR expected = NULL;
10260
10261 hr = IUri_GetQuery(uri, &expected);
10262 ok(SUCCEEDED(hr),
10263 "Error: Expected IUri_GetQuery to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
10264 hr, test_index);
10265 has_prop = hr == S_OK;
10266
10267 hr = IUriBuilder_GetQuery(builder, &len, &received);
10268 if(has_prop) {
10269 ok(hr == S_OK,
10270 "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10271 hr, S_OK, test_index);
10272 if(SUCCEEDED(hr)) {
10274 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
10276 ok(lstrlenW(expected) == len,
10277 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
10278 lstrlenW(expected), len, test_index);
10279 }
10280 } else {
10281 ok(hr == S_FALSE,
10282 "Error: IUriBuilder_GetQuery returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10283 hr, S_FALSE, test_index);
10284 if(SUCCEEDED(hr)) {
10285 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index);
10286 ok(!len, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10287 len, test_index);
10288 }
10289 }
10291 }
10292 }
10293 if(uri) IUri_Release(uri);
10294 }
10295}
10296
10298 DWORD test_index) {
10299 HRESULT hr;
10300 DWORD i;
10302 DWORD len = -1;
10303 const uri_builder_property *prop = NULL;
10304
10305 /* Check if the property was set earlier. */
10306 for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
10307 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_SCHEME_NAME)
10308 prop = &(test->properties[i]);
10309 }
10310
10311 if(prop) {
10312 /* Use expected_value unless it's NULL, then use value. */
10313 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
10314 DWORD expected_len = expected ? strlen(expected) : 0;
10315 hr = IUriBuilder_GetSchemeName(builder, &len, &received);
10316 todo_wine_if(prop->todo) {
10317 ok(hr == (expected ? S_OK : S_FALSE),
10318 "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10319 hr, (expected ? S_OK : S_FALSE), test_index);
10320 if(SUCCEEDED(hr)) {
10321 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
10322 expected, wine_dbgstr_w(received), test_index);
10323 ok(expected_len == len,
10324 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
10325 expected_len, len, test_index);
10326 }
10327 }
10328 } else {
10329 /* The property wasn't set earlier, so it should return whatever
10330 * the base IUri contains (if anything).
10331 */
10332 IUri *uri = NULL;
10333 hr = IUriBuilder_GetIUri(builder, &uri);
10334 ok(hr == S_OK,
10335 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10336 hr, S_OK, test_index);
10337 if(SUCCEEDED(hr)) {
10338 if(!uri) {
10339 received = (void*) 0xdeadbeef;
10340 len = -1;
10341
10342 hr = IUriBuilder_GetSchemeName(builder, &len, &received);
10343 ok(hr == S_FALSE,
10344 "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10345 hr, S_FALSE, test_index);
10346 if(SUCCEEDED(hr)) {
10347 ok(!len, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10348 len, test_index);
10349 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
10350 received, test_index);
10351 }
10352 } else {
10353 BOOL has_prop = FALSE;
10354 BSTR expected = NULL;
10355
10356 hr = IUri_GetSchemeName(uri, &expected);
10357 ok(SUCCEEDED(hr),
10358 "Error: Expected IUri_GetSchemeName to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
10359 hr, test_index);
10360 has_prop = hr == S_OK;
10361
10362 hr = IUriBuilder_GetSchemeName(builder, &len, &received);
10363 if(has_prop) {
10364 ok(hr == S_OK,
10365 "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10366 hr, S_OK, test_index);
10367 if(SUCCEEDED(hr)) {
10369 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
10371 ok(lstrlenW(expected) == len,
10372 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
10373 lstrlenW(expected), len, test_index);
10374 }
10375 } else {
10376 ok(hr == S_FALSE,
10377 "Error: IUriBuilder_GetSchemeName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10378 hr, S_FALSE, test_index);
10379 if(SUCCEEDED(hr)) {
10380 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index);
10381 ok(!len, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10382 len, test_index);
10383 }
10384 }
10386 }
10387 }
10388 if(uri) IUri_Release(uri);
10389 }
10390}
10391
10393 DWORD test_index) {
10394 HRESULT hr;
10395 DWORD i;
10397 DWORD len = -1;
10398 const uri_builder_property *prop = NULL;
10399
10400 /* Check if the property was set earlier. */
10401 for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
10402 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_USER_NAME)
10403 prop = &(test->properties[i]);
10404 }
10405
10406 if(prop && prop->value && *prop->value) {
10407 /* Use expected_value unless it's NULL, then use value. */
10408 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
10409 DWORD expected_len = expected ? strlen(expected) : 0;
10410 hr = IUriBuilder_GetUserName(builder, &len, &received);
10411 todo_wine_if(prop->todo) {
10412 ok(hr == (expected ? S_OK : S_FALSE),
10413 "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10414 hr, (expected ? S_OK : S_FALSE), test_index);
10415 if(SUCCEEDED(hr)) {
10416 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%ld].\n",
10417 expected, wine_dbgstr_w(received), test_index);
10418 ok(expected_len == len,
10419 "Error: Expected the length to be %ld, but was %ld instead on uri_builder_tests[%ld].\n",
10420 expected_len, len, test_index);
10421 }
10422 }
10423 } else {
10424 /* The property wasn't set earlier, so it should return whatever
10425 * the base IUri contains (if anything).
10426 */
10427 IUri *uri = NULL;
10428 hr = IUriBuilder_GetIUri(builder, &uri);
10429 ok(hr == S_OK,
10430 "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10431 hr, S_OK, test_index);
10432 if(SUCCEEDED(hr)) {
10433 if(!uri) {
10434 received = (void*) 0xdeadbeef;
10435 len = -1;
10436
10437 hr = IUriBuilder_GetUserName(builder, &len, &received);
10438 ok(hr == S_FALSE,
10439 "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10440 hr, S_FALSE, test_index);
10441 if(SUCCEEDED(hr)) {
10442 ok(!len, "Error: Expected len to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10443 len, test_index);
10444 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%ld].\n",
10445 received, test_index);
10446 }
10447 } else {
10448 BSTR expected = NULL;
10449 BOOL has_prop = FALSE;
10450
10451 hr = IUri_GetUserName(uri, &expected);
10452 ok(SUCCEEDED(hr),
10453 "Error: Expected IUri_GetUserName to succeed, but got 0x%08lx instead on uri_builder_tests[%ld].\n",
10454 hr, test_index);
10455 has_prop = hr == S_OK;
10456
10457 hr = IUriBuilder_GetUserName(builder, &len, &received);
10458 if(has_prop) {
10459 ok(hr == S_OK,
10460 "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10461 hr, S_OK, test_index);
10462 if(SUCCEEDED(hr)) {
10464 "Error: Expected %s but got %s instead on uri_builder_tests[%ld].\n",
10466 ok(lstrlenW(expected) == len,
10467 "Error: Expected the length to be %d, but was %ld instead on uri_builder_tests[%ld].\n",
10468 lstrlenW(expected), len, test_index);
10469 }
10470 } else {
10471 ok(hr == S_FALSE,
10472 "Error: IUriBuilder_GetUserName returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10473 hr, S_FALSE, test_index);
10474 if(SUCCEEDED(hr)) {
10475 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%ld].\n", test_index);
10476 ok(!len, "Error: Expected the length to be 0, but was %ld instead on uri_builder_tests[%ld].\n",
10477 len, test_index);
10478 }
10479 }
10481 }
10482 }
10483 if(uri) IUri_Release(uri);
10484 }
10485}
10486
10487/* Tests IUriBuilder functions. */
10488static void test_IUriBuilder(void) {
10489 HRESULT hr;
10490 IUriBuilder *builder;
10491 DWORD i;
10492
10493 for(i = 0; i < ARRAY_SIZE(uri_builder_tests); ++i) {
10494 IUri *uri = NULL;
10496 LPWSTR uriW = NULL;
10497
10498 if(test.uri) {
10499 uriW = a2w(test.uri);
10500 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
10501 ok(hr == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10502 hr, S_OK, i);
10503 if(FAILED(hr)) continue;
10504 }
10505 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
10506 todo_wine_if(test.create_builder_todo)
10507 ok(hr == test.create_builder_expected,
10508 "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10509 hr, test.create_builder_expected, i);
10510 if(SUCCEEDED(hr)) {
10511 DWORD j;
10512 BOOL modified = FALSE, received = FALSE;
10513
10514 /* Perform all the string property changes. */
10515 for(j = 0; j < URI_BUILDER_STR_PROPERTY_COUNT; ++j) {
10516 uri_builder_property prop = test.properties[j];
10517 if(prop.change) {
10518 change_property(builder, &prop, i);
10519 if(prop.property != Uri_PROPERTY_SCHEME_NAME &&
10520 prop.property != Uri_PROPERTY_HOST)
10521 modified = TRUE;
10522 else if(prop.value && *prop.value)
10523 modified = TRUE;
10524 else if(prop.value && !*prop.value && prop.property == Uri_PROPERTY_HOST)
10525 /* Host name property can't be NULL, but it can be empty. */
10526 modified = TRUE;
10527 }
10528 }
10529
10530 if(test.port_prop.change) {
10531 hr = IUriBuilder_SetPort(builder, test.port_prop.set, test.port_prop.value);
10532 modified = TRUE;
10533 todo_wine_if(test.port_prop.todo)
10534 ok(hr == test.port_prop.expected,
10535 "Error: IUriBuilder_SetPort returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10536 hr, test.port_prop.expected, i);
10537 }
10538
10539 hr = IUriBuilder_HasBeenModified(builder, &received);
10540 ok(hr == S_OK,
10541 "Error IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx on uri_builder_tests[%ld].\n",
10542 hr, S_OK, i);
10543 if(SUCCEEDED(hr))
10544 ok(received == modified,
10545 "Error: Expected received to be %d but was %d instead on uri_builder_tests[%ld].\n",
10546 modified, received, i);
10547
10548 /* Test the "Get*" functions. */
10550 test_IUriBuilder_GetHost(builder, &test, i);
10552 test_IUriBuilder_GetPath(builder, &test, i);
10553 test_IUriBuilder_GetPort(builder, &test, i);
10554 test_IUriBuilder_GetQuery(builder, &test, i);
10557
10558 test_IUriBuilder_CreateUri(builder, &test, i);
10561 }
10562 if(builder) IUriBuilder_Release(builder);
10563 if(uri) IUri_Release(uri);
10564 free(uriW);
10565 }
10566}
10567
10569 HRESULT hr;
10570 IUriBuilder *builder = NULL;
10571
10572 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
10573 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10574 if(SUCCEEDED(hr)) {
10575 static const WCHAR hostW[] = {'g','o','o','g','l','e','.','c','o','m',0};
10576 IUri *uri = NULL;
10577 BOOL received;
10578
10579 hr = IUriBuilder_HasBeenModified(builder, NULL);
10580 ok(hr == E_POINTER, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10581 hr, E_POINTER);
10582
10583 hr = IUriBuilder_SetHost(builder, hostW);
10584 ok(hr == S_OK, "Error: IUriBuilder_SetHost returned 0x%08lx, expected 0x%08lx.\n",
10585 hr, S_OK);
10586
10587 hr = IUriBuilder_HasBeenModified(builder, &received);
10588 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10589 hr, S_OK);
10590 if(SUCCEEDED(hr))
10591 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
10592
10593 hr = pCreateUri(http_urlW, 0, 0, &uri);
10594 ok(hr == S_OK, "Error: CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10595 if(SUCCEEDED(hr)) {
10596 LPCWSTR prop;
10597 DWORD len = -1;
10598
10599 hr = IUriBuilder_SetIUri(builder, uri);
10600 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%08lx.\n",
10601 hr, S_OK);
10602
10603 hr = IUriBuilder_HasBeenModified(builder, &received);
10604 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10605 hr, S_OK);
10606 if(SUCCEEDED(hr))
10607 ok(received == FALSE, "Error: Expected received to be FALSE.\n");
10608
10609 /* Test what happens with you call SetIUri with the same IUri again. */
10610 hr = IUriBuilder_SetHost(builder, hostW);
10611 ok(hr == S_OK, "Error: IUriBuilder_SetHost returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10612
10613 hr = IUriBuilder_HasBeenModified(builder, &received);
10614 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10615 hr, S_OK);
10616 if(SUCCEEDED(hr))
10617 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
10618
10619 hr = IUriBuilder_SetIUri(builder, uri);
10620 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10621
10622 /* IUriBuilder already had 'uri' as its IUri property and so Windows doesn't
10623 * reset any of the changes that were made to the IUriBuilder.
10624 */
10625 hr = IUriBuilder_HasBeenModified(builder, &received);
10626 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10627 if(SUCCEEDED(hr))
10628 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
10629
10630 hr = IUriBuilder_GetHost(builder, &len, &prop);
10631 ok(hr == S_OK, "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10632 if(SUCCEEDED(hr)) {
10633 ok(!lstrcmpW(prop, hostW), "Error: Expected %s but got %s instead.\n",
10635 ok(len == lstrlenW(hostW), "Error: Expected len to be %d, but was %ld instead.\n",
10636 lstrlenW(hostW), len);
10637 }
10638
10639 hr = IUriBuilder_SetIUri(builder, NULL);
10640 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10641
10642 hr = IUriBuilder_SetHost(builder, hostW);
10643 ok(hr == S_OK, "Error: IUriBuilder_SetHost returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10644 hr = IUriBuilder_HasBeenModified(builder, &received);
10645 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10646 hr, S_OK);
10647 if(SUCCEEDED(hr))
10648 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
10649
10650 hr = IUriBuilder_SetIUri(builder, NULL);
10651 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%09lx.\n", hr, S_OK);
10652
10653 hr = IUriBuilder_HasBeenModified(builder, &received);
10654 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08lx, expected 0x%08lx.\n",
10655 hr, S_OK);
10656 if(SUCCEEDED(hr))
10657 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
10658
10659 hr = IUriBuilder_GetHost(builder, &len, &prop);
10660 ok(hr == S_OK, "Error: IUriBuilder_GetHost returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10661 if(SUCCEEDED(hr)) {
10662 ok(!lstrcmpW(prop, hostW), "Error: Expected %s but got %s instead.\n",
10664 ok(len == lstrlenW(hostW), "Error: Expected len to %d, but was %ld instead.\n",
10665 lstrlenW(hostW), len);
10666 }
10667 }
10668 if(uri) IUri_Release(uri);
10669 }
10670 if(builder) IUriBuilder_Release(builder);
10671}
10672
10673/* Test IUriBuilder {Get,Set}IUri functions. */
10675 IUriBuilder *builder = NULL;
10676 HRESULT hr;
10677
10678 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
10679 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10680 if(SUCCEEDED(hr)) {
10681 IUri *uri = NULL;
10682
10683 hr = IUriBuilder_GetIUri(builder, NULL);
10684 ok(hr == E_POINTER, "Error: IUriBuilder_GetIUri returned 0x%08lx, expected 0x%08lx.\n",
10685 hr, E_POINTER);
10686
10687 hr = pCreateUri(http_urlW, 0, 0, &uri);
10688 if(SUCCEEDED(hr)) {
10689 IUri *test = NULL;
10690 ULONG cur_count, orig_count;
10691
10692 /* IUriBuilder doesn't clone the IUri, it use the same IUri. */
10693 orig_count = get_refcnt(uri);
10694 hr = IUriBuilder_SetIUri(builder, uri);
10695 cur_count = get_refcnt(uri);
10696 if(SUCCEEDED(hr))
10697 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10698 orig_count+1, cur_count);
10699
10700 hr = IUriBuilder_SetIUri(builder, NULL);
10701 cur_count = get_refcnt(uri);
10702 if(SUCCEEDED(hr))
10703 ok(cur_count == orig_count, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10704 orig_count, cur_count);
10705
10706 /* CreateUri* functions will return back the same IUri if nothing has changed. */
10707 hr = IUriBuilder_SetIUri(builder, uri);
10708 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10709 orig_count = get_refcnt(uri);
10710
10711 hr = IUriBuilder_CreateUri(builder, 0, 0, 0, &test);
10712 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10713 if(SUCCEEDED(hr)) {
10714 cur_count = get_refcnt(uri);
10715 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10716 orig_count+1, cur_count);
10717 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n",
10718 uri, test);
10719 }
10720 if(test) IUri_Release(test);
10721
10722 test = NULL;
10723 hr = IUriBuilder_CreateUri(builder, -1, 0, 0, &test);
10724 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10725 if(SUCCEEDED(hr)) {
10726 cur_count = get_refcnt(uri);
10727 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10728 orig_count+1, cur_count);
10729 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n", uri, test);
10730 }
10731 if(test) IUri_Release(test);
10732
10733 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10734 * the base IUri.
10735 */
10736 test = NULL;
10737 hr = IUriBuilder_CreateUri(builder, Uri_CREATE_ALLOW_RELATIVE, 0, 0, &test);
10738 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10739 if(SUCCEEDED(hr))
10740 ok(test != uri, "Error: Wasn't expecting 'test' to be 'uri'\n");
10741
10742 if(test) IUri_Release(test);
10743
10744 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10745 * explicitly set (because it's a default flag).
10746 */
10747 test = NULL;
10748 hr = IUriBuilder_CreateUri(builder, Uri_CREATE_CANONICALIZE, 0, 0, &test);
10749 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10750 if(SUCCEEDED(hr)) {
10751 cur_count = get_refcnt(uri);
10752 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10753 orig_count+1, cur_count);
10754 ok(test == uri, "Error: Expected 'test' to be %p, but was %p instead.\n", uri, test);
10755 }
10756 if(test) IUri_Release(test);
10757
10758 test = NULL;
10759 hr = IUriBuilder_CreateUriSimple(builder, 0, 0, &test);
10760 ok(hr == S_OK, "Error: IUriBuilder_CreateUriSimple returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10761 if(SUCCEEDED(hr)) {
10762 cur_count = get_refcnt(uri);
10763 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10764 orig_count+1, cur_count);
10765 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n", uri, test);
10766 }
10767 if(test) IUri_Release(test);
10768
10769 test = NULL;
10770 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, 0, 0, &test);
10771 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n",
10772 hr, S_OK);
10773 if(SUCCEEDED(hr)) {
10774 cur_count = get_refcnt(uri);
10775 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10776 orig_count+1, cur_count);
10777 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n", uri, test);
10778 }
10779 if(test) IUri_Release(test);
10780
10781 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10782 * the base IUri.
10783 */
10784 test = NULL;
10785 hr = IUriBuilder_CreateUriWithFlags(builder, Uri_CREATE_ALLOW_RELATIVE, 0, 0, 0, &test);
10786 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10787 if(SUCCEEDED(hr))
10788 ok(test != uri, "Error: Wasn't expecting 'test' to be 'uri'\n");
10789
10790 if(test) IUri_Release(test);
10791
10792 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10793 * explicitly set (because it's a default flag).
10794 */
10795 test = NULL;
10796 hr = IUriBuilder_CreateUriWithFlags(builder, Uri_CREATE_CANONICALIZE, 0, 0, 0, &test);
10797 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10798 if(SUCCEEDED(hr)) {
10799 cur_count = get_refcnt(uri);
10800 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %ld, but was %ld instead.\n",
10801 orig_count+1, cur_count);
10802 ok(test == uri, "Error: Expected 'test' to be %p, but was %p instead.\n", uri, test);
10803 }
10804 if(test) IUri_Release(test);
10805 }
10806 if(uri) IUri_Release(uri);
10807 }
10808 if(builder) IUriBuilder_Release(builder);
10809}
10810
10812 IUriBuilder *builder = NULL;
10813 HRESULT hr;
10814 DWORD i;
10815
10816 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
10817 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10818 if(SUCCEEDED(hr)) {
10819 /* Properties that can't be removed. */
10820 const DWORD invalid = Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_RAW_URI|Uri_HAS_HOST_TYPE|
10821 Uri_HAS_SCHEME|Uri_HAS_ZONE;
10822
10823 for(i = Uri_PROPERTY_STRING_START; i <= Uri_PROPERTY_DWORD_LAST; ++i) {
10824 hr = IUriBuilder_RemoveProperties(builder, i << 1);
10825 if((i << 1) & invalid) {
10826 ok(hr == E_INVALIDARG,
10827 "Error: IUriBuilder_RemoveProperties returned 0x%08lx, expected 0x%08lx with prop=%ld.\n",
10828 hr, E_INVALIDARG, i);
10829 } else {
10830 ok(hr == S_OK,
10831 "Error: IUriBuilder_RemoveProperties returned 0x%08lx, expected 0x%08lx with prop=%ld.\n",
10832 hr, S_OK, i);
10833 }
10834 }
10835
10836 /* Also doesn't accept anything that's outside the range of the
10837 * Uri_HAS flags.
10838 */
10839 hr = IUriBuilder_RemoveProperties(builder, (Uri_PROPERTY_DWORD_LAST+1) << 1);
10840 ok(hr == E_INVALIDARG, "Error: IUriBuilder_RemoveProperties returned 0x%08lx, expected 0x%08lx.\n",
10841 hr, E_INVALIDARG);
10842 }
10843 if(builder) IUriBuilder_Release(builder);
10844
10845 for(i = 0; i < ARRAY_SIZE(uri_builder_remove_tests); ++i) {
10847 IUri *uri = NULL;
10848 LPWSTR uriW;
10849
10850 uriW = a2w(test.uri);
10851 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
10852 if(SUCCEEDED(hr)) {
10853 builder = NULL;
10854
10855 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
10856 todo_wine_if(test.create_builder_todo)
10857 ok(hr == test.create_builder_expected,
10858 "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx on test %ld.\n",
10859 hr, test.create_builder_expected, i);
10860
10861 if(SUCCEEDED(hr)) {
10862 hr = IUriBuilder_RemoveProperties(builder, test.remove_properties);
10863 todo_wine_if(test.remove_todo)
10864 ok(hr == test.remove_expected,
10865 "Error: IUriBuilder returned 0x%08lx, expected 0x%08lx on test %ld.\n",
10866 hr, test.remove_expected, i);
10867 if(SUCCEEDED(hr)) {
10868 IUri *result = NULL;
10869
10870 hr = IUriBuilder_CreateUri(builder, test.expected_flags, 0, 0, &result);
10871 todo_wine_if(test.expected_todo)
10872 ok(hr == test.expected_hres,
10873 "Error: IUriBuilder_CreateUri returned 0x%08lx, expected 0x%08lx on test %ld.\n",
10874 hr, test.expected_hres, i);
10875 if(SUCCEEDED(hr)) {
10876 BSTR received = NULL;
10877
10878 hr = IUri_GetAbsoluteUri(result, &received);
10879 ok(hr == S_OK, "Error: Expected S_OK, but got 0x%08lx instead.\n", hr);
10880 ok(!strcmp_aw(test.expected_uri, received),
10881 "Error: Expected %s but got %s instead on test %ld.\n",
10882 test.expected_uri, wine_dbgstr_w(received), i);
10884 }
10885 if(result) IUri_Release(result);
10886 }
10887 }
10888 if(builder) IUriBuilder_Release(builder);
10889 }
10890 if(uri) IUri_Release(uri);
10891 free(uriW);
10892 }
10893}
10894
10895static void test_IUriBuilder_Misc(void) {
10896 HRESULT hr;
10897 IUri *uri;
10898
10899 hr = pCreateUri(http_urlW, 0, 0, &uri);
10900 if(SUCCEEDED(hr)) {
10901 IUriBuilder *builder;
10902
10903 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
10904 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10905 if(SUCCEEDED(hr)) {
10906 BOOL has = -1;
10907 DWORD port = -1;
10908
10909 hr = IUriBuilder_GetPort(builder, &has, &port);
10910 ok(hr == S_OK, "Error: IUriBuilder_GetPort returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
10911 if(SUCCEEDED(hr)) {
10912 /* 'has' will be set to FALSE, even though uri had a port. */
10913 ok(has == FALSE, "Error: Expected 'has' to be FALSE, was %d instead.\n", has);
10914 /* Still sets 'port' to 80. */
10915 ok(port == 80, "Error: Expected the port to be 80, but, was %ld instead.\n", port);
10916 }
10917 }
10918 if(builder) IUriBuilder_Release(builder);
10919 }
10920 if(uri) IUri_Release(uri);
10921}
10922
10923static void test_IUriBuilderFactory(void) {
10924 HRESULT hr;
10925 IUri *uri;
10927 IUriBuilder *builder;
10928
10929 hr = pCreateUri(http_urlW, 0, 0, &uri);
10930 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08lx.\n", hr);
10931 if(SUCCEEDED(hr)) {
10932 factory = NULL;
10933 hr = IUri_QueryInterface(uri, &IID_IUriBuilderFactory, (void**)&factory);
10934 ok(hr == S_OK, "Error: Expected S_OK, but got 0x%08lx.\n", hr);
10935 ok(factory != NULL, "Error: Expected 'factory' to not be NULL.\n");
10936
10937 if(SUCCEEDED(hr)) {
10938 builder = (void*) 0xdeadbeef;
10939 hr = IUriBuilderFactory_CreateIUriBuilder(factory, 10, 0, &builder);
10940 ok(hr == E_INVALIDARG, "Error: CreateInitializedIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10941 hr, E_INVALIDARG);
10942 ok(!builder, "Error: Expected 'builder' to be NULL, but was %p.\n", builder);
10943
10944 builder = (void*) 0xdeadbeef;
10945 hr = IUriBuilderFactory_CreateIUriBuilder(factory, 0, 10, &builder);
10946 ok(hr == E_INVALIDARG, "Error: CreateInitializedIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10947 hr, E_INVALIDARG);
10948 ok(!builder, "Error: Expected 'builder' to be NULL, but was %p.\n", builder);
10949
10950 hr = IUriBuilderFactory_CreateIUriBuilder(factory, 0, 0, NULL);
10951 ok(hr == E_POINTER, "Error: CreateInitializedIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10952 hr, E_POINTER);
10953
10954 builder = NULL;
10955 hr = IUriBuilderFactory_CreateIUriBuilder(factory, 0, 0, &builder);
10956 ok(hr == S_OK, "Error: CreateInitializedIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10957 hr, S_OK);
10958 if(SUCCEEDED(hr)) {
10959 IUri *tmp = (void*) 0xdeadbeef;
10961 DWORD result_len;
10962
10963 hr = IUriBuilder_GetIUri(builder, &tmp);
10964 ok(hr == S_OK, "Error: GetIUri returned 0x%08lx, expected 0x%08lx.\n",
10965 hr, S_OK);
10966 ok(!tmp, "Error: Expected 'tmp' to be NULL, but was %p instead.\n", tmp);
10967
10968 hr = IUriBuilder_GetHost(builder, &result_len, &result);
10969 ok(hr == S_FALSE, "Error: GetHost returned 0x%08lx, expected 0x%08lx.\n",
10970 hr, S_FALSE);
10971 }
10972 if(builder) IUriBuilder_Release(builder);
10973
10974 builder = (void*) 0xdeadbeef;
10975 hr = IUriBuilderFactory_CreateInitializedIUriBuilder(factory, 10, 0, &builder);
10976 ok(hr == E_INVALIDARG, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10977 hr, E_INVALIDARG);
10978 ok(!builder, "Error: Expected 'builder' to be NULL, but was %p.\n", builder);
10979
10980 builder = (void*) 0xdeadbeef;
10981 hr = IUriBuilderFactory_CreateInitializedIUriBuilder(factory, 0, 10, &builder);
10982 ok(hr == E_INVALIDARG, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10983 hr, E_INVALIDARG);
10984 ok(!builder, "Error: Expected 'builder' to be NULL, but was %p.\n", builder);
10985
10986 hr = IUriBuilderFactory_CreateInitializedIUriBuilder(factory, 0, 0, NULL);
10987 ok(hr == E_POINTER, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10988 hr, E_POINTER);
10989
10990 builder = NULL;
10991 hr = IUriBuilderFactory_CreateInitializedIUriBuilder(factory, 0, 0, &builder);
10992 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08lx, expected 0x%08lx.\n",
10993 hr, S_OK);
10994 if(SUCCEEDED(hr)) {
10995 IUri *tmp = NULL;
10996
10997 hr = IUriBuilder_GetIUri(builder, &tmp);
10998 ok(hr == S_OK, "Error: GetIUri return 0x%08lx, expected 0x%08lx.\n",
10999 hr, S_OK);
11000 ok(tmp == uri, "Error: Expected tmp to be %p, but was %p.\n", uri, tmp);
11001 if(tmp) IUri_Release(tmp);
11002 }
11003 if(builder) IUriBuilder_Release(builder);
11004 }
11005 if(factory) IUriBuilderFactory_Release(factory);
11006 }
11007 if(uri) IUri_Release(uri);
11008}
11009
11011 HRESULT hr;
11012 IUri *base, *relative, *result;
11013 DWORD i;
11014
11015 base = NULL;
11016 hr = pCreateUri(http_urlW, 0, 0, &base);
11017 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08lx.\n", hr);
11018 if(SUCCEEDED(hr)) {
11019 result = (void*) 0xdeadbeef;
11020 hr = pCoInternetCombineIUri(base, NULL, 0, &result, 0);
11021 ok(hr == E_INVALIDARG, "Error: CoInternetCombineIUri returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
11022 ok(!result, "Error: Expected 'result' to be NULL, was %p.\n", result);
11023 }
11024
11025 relative = NULL;
11026 hr = pCreateUri(http_urlW, 0, 0, &relative);
11027 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08lx.\n", hr);
11028 if(SUCCEEDED(hr)) {
11029 result = (void*) 0xdeadbeef;
11030 hr = pCoInternetCombineIUri(NULL, relative, 0, &result, 0);
11031 ok(hr == E_INVALIDARG, "Error: CoInternetCombineIUri returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
11032 ok(!result, "Error: Expected 'result' to be NULL, was %p.\n", result);
11033 }
11034
11035 hr = pCoInternetCombineIUri(base, relative, 0, NULL, 0);
11036 ok(hr == E_INVALIDARG, "Error: CoInternetCombineIUri returned 0x%08lx, expected 0x%08lx.\n", hr, E_INVALIDARG);
11037
11038 if(base) IUri_Release(base);
11039 if(relative) IUri_Release(relative);
11040
11041 for(i = 0; i < ARRAY_SIZE(uri_combine_tests); ++i) {
11042 LPWSTR baseW = a2w(uri_combine_tests[i].base_uri);
11043
11044 hr = pCreateUri(baseW, uri_combine_tests[i].base_create_flags, 0, &base);
11045 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08lx on uri_combine_tests[%ld].\n", hr, i);
11046 if(SUCCEEDED(hr)) {
11047 LPWSTR relativeW = a2w(uri_combine_tests[i].relative_uri);
11048
11049 hr = pCreateUri(relativeW, uri_combine_tests[i].relative_create_flags, 0, &relative);
11050 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08lx on uri_combine_tests[%ld].\n", hr, i);
11051 if(SUCCEEDED(hr)) {
11052 result = NULL;
11053
11054 hr = pCoInternetCombineIUri(base, relative, uri_combine_tests[i].combine_flags, &result, 0);
11057 broken(hr == S_OK && uri_combine_tests[i].expected == E_INVALIDARG) /* win10 1607 to 1709 */,
11058 "Error: CoInternetCombineIUri returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].\n",
11061 DWORD j;
11062
11063 for(j = 0; j < ARRAY_SIZE(uri_combine_tests[i].str_props); ++j) {
11065 BSTR received;
11066
11067 hr = IUri_GetPropertyBSTR(result, j, &received, 0);
11068 todo_wine_if(prop.todo) {
11069 ok(hr == prop.expected,
11070 "Error: IUri_GetPropertyBSTR returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].str_props[%ld].\n",
11071 hr, prop.expected, i, j);
11072 ok(!strcmp_aw(prop.value, received) ||
11074 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%ld].str_props[%ld].\n",
11075 prop.value, wine_dbgstr_w(received), i, j);
11076 }
11078 }
11079
11080 for(j = 0; j < ARRAY_SIZE(uri_combine_tests[i].dword_props); ++j) {
11083
11084 hr = IUri_GetPropertyDWORD(result, j+Uri_PROPERTY_DWORD_START, &received, 0);
11085 todo_wine_if(prop.todo) {
11086 ok(hr == prop.expected || broken(prop.broken_combine_hres && hr == S_FALSE),
11087 "Error: IUri_GetPropertyDWORD returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].dword_props[%ld].\n",
11088 hr, prop.expected, i, j);
11089 if(!prop.broken_combine_hres || hr != S_FALSE)
11090 ok(prop.value == received, "Error: Expected %ld, but got %ld instead on uri_combine_tests[%ld].dword_props[%ld].\n",
11091 prop.value, received, i, j);
11092 }
11093 }
11094 }
11095 if(result) IUri_Release(result);
11096 }
11097 if(relative) IUri_Release(relative);
11098 free(relativeW);
11099 }
11100 if(base) IUri_Release(base);
11101 free(baseW);
11102 }
11103}
11104
11106 REFIID riid, void **ppv)
11107{
11108 ok(0, "unexpected call\n");
11109 return E_NOINTERFACE;
11110}
11111
11113{
11114 return 2;
11115}
11116
11118{
11119 return 1;
11120}
11121
11123 PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult,
11124 DWORD *pcchResult, DWORD dwReserved)
11125{
11126 CHECK_EXPECT(ParseUrl);
11127 ok(!lstrcmpW(pwzUrl, parse_urlW), "Error: Expected %s, but got %s instead.\n",
11129 ok(ParseAction == parse_action, "Error: Expected %d, but got %d.\n", parse_action, ParseAction);
11130 ok(dwParseFlags == parse_flags, "Error: Expected 0x%08lx, but got 0x%08lx.\n", parse_flags, dwParseFlags);
11131 ok(cchResult == 200, "Error: Got %ld.\n", cchResult);
11132
11133 memcpy(pwzResult, parse_resultW, sizeof(parse_resultW));
11134 *pcchResult = lstrlenW(parse_resultW);
11135
11136 return S_OK;
11137}
11138
11140 LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags,
11141 LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
11142{
11143 CHECK_EXPECT(CombineUrl);
11144 ok(!lstrcmpW(pwzBaseUrl, combine_baseW), "Error: Expected %s, but got %s instead.\n",
11146 ok(!lstrcmpW(pwzRelativeUrl, combine_relativeW), "Error: Expected %s, but got %s instead.\n",
11149 "Error: Expected 0, but got 0x%08lx.\n", dwCombineFlags);
11150 ok(cchResult == INTERNET_MAX_URL_LENGTH+1, "Error: Got %ld.\n", cchResult);
11151
11152 memcpy(pwzResult, combine_resultW, sizeof(combine_resultW));
11153 *pcchResult = lstrlenW(combine_resultW);
11154
11155 return S_OK;
11156}
11157
11159 LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
11160{
11161 ok(0, "unexpected call\n");
11162 return E_NOTIMPL;
11163}
11164
11166 LPCWSTR pwzUrl, QUERYOPTION OueryOption, DWORD dwQueryFlags, LPVOID pBuffer,
11167 DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
11168{
11169 ok(0, "unexpected call\n");
11170 return E_NOTIMPL;
11171}
11172
11173static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl = {
11181};
11182
11184
11186{
11187 if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) {
11188 *ppv = &protocol_info;
11189 return S_OK;
11190 }
11191
11192 ok(0, "unexpected call\n");
11193 return E_NOINTERFACE;
11194}
11195
11197{
11198 return 2;
11199}
11200
11202{
11203 return 1;
11204}
11205
11207 REFIID riid, void **ppv)
11208{
11209 ok(0, "unexpected call\n");
11210 return E_NOTIMPL;
11211}
11212
11214{
11215 ok(0, "unexpected call\n");
11216 return S_OK;
11217}
11218
11219static const IClassFactoryVtbl ClassFactoryVtbl = {
11225};
11226
11228
11229static void register_protocols(void)
11230{
11232 HRESULT hres;
11233
11234 hres = pCoInternetGetSession(0, &session, 0);
11235 ok(hres == S_OK, "CoInternetGetSession failed: %08lx\n", hres);
11236 if(FAILED(hres))
11237 return;
11238
11239 hres = IInternetSession_RegisterNameSpace(session, &protocol_cf, &IID_NULL,
11240 winetestW, 0, NULL, 0);
11241 ok(hres == S_OK, "RegisterNameSpace failed: %08lx\n", hres);
11242
11243 IInternetSession_Release(session);
11244}
11245
11246static void unregister_protocols(void) {
11248 HRESULT hr;
11249
11250 hr = pCoInternetGetSession(0, &session, 0);
11251 ok(hr == S_OK, "CoInternetGetSession failed: 0x%08lx\n", hr);
11252 if(FAILED(hr))
11253 return;
11254
11255 hr = IInternetSession_UnregisterNameSpace(session, &protocol_cf, winetestW);
11256 ok(hr == S_OK, "UnregisterNameSpace failed: 0x%08lx\n", hr);
11257
11258 IInternetSession_Release(session);
11259}
11260
11262 HRESULT hr;
11263 IUri *base = NULL;
11264
11265 hr = pCreateUri(combine_baseW, 0, 0, &base);
11266 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08lx.\n", hr);
11267 if(SUCCEEDED(hr)) {
11268 IUri *relative = NULL;
11269
11270 hr = pCreateUri(combine_relativeW, Uri_CREATE_ALLOW_RELATIVE, 0, &relative);
11271 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08lx.\n", hr);
11272 if(SUCCEEDED(hr)) {
11273 IUri *result = NULL;
11274
11275 SET_EXPECT(CombineUrl);
11276
11278 &result, 0);
11279 ok(hr == S_OK, "Error: CoInternetCombineIUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
11280
11281 CHECK_CALLED(CombineUrl);
11282
11283 if(SUCCEEDED(hr)) {
11284 BSTR received = NULL;
11285 hr = IUri_GetAbsoluteUri(result, &received);
11286 ok(hr == S_OK, "Error: Expected S_OK, but got 0x%08lx instead.\n", hr);
11287 if(SUCCEEDED(hr)) {
11288 ok(!lstrcmpW(combine_resultW, received), "Error: Expected %s, but got %s.\n",
11290 }
11292 }
11293 if(result) IUri_Release(result);
11294 }
11295 if(relative) IUri_Release(relative);
11296 }
11297 if(base) IUri_Release(base);
11298}
11299
11301 HRESULT hr;
11302 IUri *base, *result;
11303 DWORD i;
11304
11305 base = NULL;
11306 hr = pCreateUri(http_urlW, 0, 0, &base);
11307 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08lx.\n", hr);
11308 if(SUCCEEDED(hr)) {
11309 result = (void*) 0xdeadbeef;
11310 hr = pCoInternetCombineUrlEx(base, NULL, 0, &result, 0);
11311 ok(hr == E_UNEXPECTED, "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx.\n",
11312 hr, E_UNEXPECTED);
11313 ok(!result, "Error: Expected 'result' to be NULL was %p instead.\n", result);
11314 }
11315
11316 result = (void*) 0xdeadbeef;
11317 hr = pCoInternetCombineUrlEx(NULL, http_urlW, 0, &result, 0);
11318 ok(hr == E_INVALIDARG, "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx.\n",
11319 hr, E_INVALIDARG);
11320 ok(!result, "Error: Expected 'result' to be NULL, but was %p instead.\n", result);
11321
11322 result = (void*) 0xdeadbeef;
11323 hr = pCoInternetCombineUrlEx(NULL, NULL, 0, &result, 0);
11324 ok(hr == E_UNEXPECTED, "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx.\n",
11325 hr, E_UNEXPECTED);
11326 ok(!result, "Error: Expected 'result' to be NULL, but was %p instead.\n", result);
11327
11328 hr = pCoInternetCombineUrlEx(base, http_urlW, 0, NULL, 0);
11329 ok(hr == E_POINTER, "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx.\n",
11330 hr, E_POINTER);
11331 if(base) IUri_Release(base);
11332
11333 for(i = 0; i < ARRAY_SIZE(uri_combine_tests); ++i) {
11334 LPWSTR baseW = a2w(uri_combine_tests[i].base_uri);
11335
11336 hr = pCreateUri(baseW, uri_combine_tests[i].base_create_flags, 0, &base);
11337 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08lx on uri_combine_tests[%ld].\n", hr, i);
11338 if(SUCCEEDED(hr)) {
11339 LPWSTR relativeW = a2w(uri_combine_tests[i].relative_uri);
11340
11341 hr = pCoInternetCombineUrlEx(base, relativeW, uri_combine_tests[i].combine_flags,
11342 &result, 0);
11345 broken(hr == S_OK && uri_combine_tests[i].expected == E_INVALIDARG) /* win10 1607 to 1709 */,
11346 "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].\n",
11349 DWORD j;
11350
11351 for(j = 0; j < ARRAY_SIZE(uri_combine_tests[i].str_props); ++j) {
11353 BSTR received;
11354 LPCSTR value = (prop.value_ex) ? prop.value_ex : prop.value;
11355
11356 hr = IUri_GetPropertyBSTR(result, j, &received, 0);
11357 todo_wine_if(prop.todo) {
11358 ok(hr == prop.expected,
11359 "Error: IUri_GetPropertyBSTR returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].str_props[%ld].\n",
11360 hr, prop.expected, i, j);
11363 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%ld].str_props[%ld].\n",
11365 }
11367 }
11368
11369 for(j = 0; j < ARRAY_SIZE(uri_combine_tests[i].dword_props); ++j) {
11372
11373 hr = IUri_GetPropertyDWORD(result, j+Uri_PROPERTY_DWORD_START, &received, 0);
11374 todo_wine_if(prop.todo) {
11375 ok(hr == prop.expected || broken(prop.broken_combine_hres && hr == S_FALSE),
11376 "Error: IUri_GetPropertyDWORD returned 0x%08lx, expected 0x%08lx on uri_combine_tests[%ld].dword_props[%ld].\n",
11377 hr, prop.expected, i, j);
11378 if(!prop.broken_combine_hres || hr != S_FALSE)
11379 ok(prop.value == received, "Error: Expected %ld, but got %ld instead on uri_combine_tests[%ld].dword_props[%ld].\n",
11380 prop.value, received, i, j);
11381 }
11382 }
11383 }
11384 if(result) IUri_Release(result);
11385 free(relativeW);
11386 }
11387 if(base) IUri_Release(base);
11388 free(baseW);
11389 }
11390}
11391
11393 HRESULT hr;
11394 IUri *base = NULL;
11395
11396 hr = pCreateUri(combine_baseW, 0, 0, &base);
11397 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08lx.\n", hr);
11398 if(SUCCEEDED(hr)) {
11399 IUri *result = NULL;
11400
11401 SET_EXPECT(CombineUrl);
11402
11404 &result, 0);
11405 ok(hr == S_OK, "Error: CoInternetCombineUrlEx returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
11406
11407 CHECK_CALLED(CombineUrl);
11408
11409 if(SUCCEEDED(hr)) {
11410 BSTR received = NULL;
11411 hr = IUri_GetAbsoluteUri(result, &received);
11412 ok(hr == S_OK, "Error: Expected S_OK, but got 0x%08lx instead.\n", hr);
11413 if(SUCCEEDED(hr)) {
11414 ok(!lstrcmpW(combine_resultW, received), "Error: Expected %s, but got %s.\n",
11416 }
11418 }
11419 if(result) IUri_Release(result);
11420 }
11421 if(base) IUri_Release(base);
11422}
11423
11425 HRESULT hr;
11426 IUri *uri = NULL;
11427 WCHAR tmp[3];
11428 WCHAR *longurl, *copy;
11429 DWORD result = -1;
11430 DWORD i, len;
11431
11432 hr = pCoInternetParseIUri(NULL, PARSE_CANONICALIZE, 0, tmp, 3, &result, 0);
11433 ok(hr == E_INVALIDARG, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11434 hr, E_INVALIDARG);
11435 ok(!result, "Error: Expected 'result' to be 0, but was %ld.\n", result);
11436
11437 hr = pCreateUri(http_urlW, 0, 0, &uri);
11438 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08lx.\n", hr);
11439 if(SUCCEEDED(hr)) {
11440 DWORD expected_len;
11441
11442 result = -1;
11443 hr = pCoInternetParseIUri(uri, PARSE_CANONICALIZE, 0, NULL, 0, &result, 0);
11444 ok(hr == E_INVALIDARG, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11445 hr, E_INVALIDARG);
11446 ok(!result, "Error: Expected 'result' to be 0, but was %ld.\n", result);
11447
11448 hr = pCoInternetParseIUri(uri, PARSE_CANONICALIZE, 0, tmp, 3, NULL, 0);
11449 ok(hr == E_POINTER, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11450 hr, E_POINTER);
11451
11452 result = -1;
11453 hr = pCoInternetParseIUri(uri, PARSE_SECURITY_URL, 0, tmp, 3, &result, 0);
11454 ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08lx expected 0x%08lx.\n",
11455 hr, E_FAIL);
11456 ok(!result, "Error: Expected 'result' to be 0, but was %ld.\n", result);
11457
11458 result = -1;
11459 hr = pCoInternetParseIUri(uri, PARSE_MIME, 0, tmp, 3, &result, 0);
11460 ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11461 hr, E_FAIL);
11462 ok(!result, "Error: Expected 'result' to be 0, but was %ld.\n", result);
11463
11464 result = -1;
11465 hr = pCoInternetParseIUri(uri, PARSE_SERVER, 0, tmp, 3, &result, 0);
11466 ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11467 hr, E_FAIL);
11468 ok(!result, "Error: Expected 'result' to be 0, but was %ld.\n", result);
11469
11470 result = -1;
11471 hr = pCoInternetParseIUri(uri, PARSE_SECURITY_DOMAIN, 0, tmp, 3, &result, 0);
11472 ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11473 hr, E_FAIL);
11474 ok(!result, "Error: Expected 'result' to be 0, but was %ld.\n", result);
11475
11476 expected_len = lstrlenW(http_urlW);
11477 result = -1;
11478 hr = pCoInternetParseIUri(uri, PARSE_CANONICALIZE, 0, tmp, 3, &result, 0);
11480 "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n",
11482 ok(result == expected_len, "Error: Expected 'result' to be %ld, but was %ld instead.\n",
11483 expected_len, result);
11484 }
11485 if(uri) IUri_Release(uri);
11486
11487 /* a long url that causes a crash on Wine */
11489 longurl = malloc((len + 1) * sizeof(WCHAR));
11490 memcpy(longurl, http_urlW, sizeof(http_urlW));
11491 for(i = ARRAY_SIZE(http_urlW)-1; i < len; i++)
11492 longurl[i] = 'x';
11493 longurl[len] = 0;
11494
11495 copy = malloc((len + 1) * sizeof(WCHAR));
11496 memcpy(copy, longurl, (len+1)*sizeof(WCHAR));
11497
11498 hr = pCreateUri(longurl, 0, 0, &uri);
11499 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08lx.\n", hr);
11500 if(SUCCEEDED(hr)) {
11501 result = -1;
11502 memset(longurl, 0xcc, len*sizeof(WCHAR));
11503 hr = pCoInternetParseIUri(uri, PARSE_CANONICALIZE, 0, longurl, len+1, &result, 0);
11504 ok(SUCCEEDED(hr), "Error: CoInternetParseIUri returned 0x%08lx.\n", hr);
11505 ok(!lstrcmpW(longurl, copy), "Error: expected long url '%s' but was '%s'.\n",
11506 wine_dbgstr_w(copy), wine_dbgstr_w(longurl));
11507 ok(result == len, "Error: Expected 'result' to be %ld, but was %ld instead.\n",
11508 len, result);
11509 }
11510 free(longurl);
11511 free(copy);
11512 if(uri) IUri_Release(uri);
11513}
11514
11515static void test_CoInternetParseIUri(void) {
11516 DWORD i;
11517
11518 for(i = 0; i < ARRAY_SIZE(uri_parse_tests); ++i) {
11519 HRESULT hr;
11520 IUri *uri;
11521 LPWSTR uriW;
11523
11524 uriW = a2w(test.uri);
11525 hr = pCreateUri(uriW, test.uri_flags, 0, &uri);
11526 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08lx on uri_parse_tests[%ld].\n", hr, i);
11527 if(SUCCEEDED(hr)) {
11529 DWORD result_len = -1;
11530
11531 hr = pCoInternetParseIUri(uri, test.action, test.flags, result, INTERNET_MAX_URL_LENGTH+1, &result_len, 0);
11532 todo_wine_if(test.todo)
11533 ok(hr == test.expected,
11534 "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx on uri_parse_tests[%ld].\n",
11535 hr, test.expected, i);
11536 if(SUCCEEDED(hr)) {
11537 DWORD len = lstrlenA(test.property);
11538 ok(!strcmp_aw(test.property, result) || (test.property2 && !strcmp_aw(test.property2, result)),
11539 "Error: Expected %s but got %s instead on uri_parse_tests[%ld] - %s.\n",
11540 test.property, wine_dbgstr_w(result), i, wine_dbgstr_w(uriW));
11541 ok(len == result_len || (test.property2 && lstrlenA(test.property2) == result_len),
11542 "Error: Expected %ld, but got %ld instead on uri_parse_tests[%ld] - %s.\n",
11543 len, result_len, i, wine_dbgstr_w(uriW));
11544 } else {
11545 ok(!result_len,
11546 "Error: Expected 'result_len' to be 0, but was %ld on uri_parse_tests[%ld].\n",
11547 result_len, i);
11548 }
11549 }
11550 if(uri) IUri_Release(uri);
11551 free(uriW);
11552 }
11553}
11554
11556 HRESULT hr;
11557 IUri *uri = NULL;
11558
11559 hr = pCreateUri(parse_urlW, 0, 0, &uri);
11560 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, but got 0x%08lx.\n", hr);
11561 if(SUCCEEDED(hr)) {
11562 WCHAR result[200];
11563 DWORD result_len;
11564
11565 SET_EXPECT(ParseUrl);
11566
11567 parse_action = PARSE_CANONICALIZE;
11569
11570 hr = pCoInternetParseIUri(uri, parse_action, parse_flags, result, 200, &result_len, 0);
11571 ok(hr == S_OK, "Error: CoInternetParseIUri returned 0x%08lx, expected 0x%08lx.\n", hr, S_OK);
11572
11573 CHECK_CALLED(ParseUrl);
11574
11575 if(SUCCEEDED(hr)) {
11576 ok(result_len == lstrlenW(parse_resultW), "Error: Expected %d, but got %ld.\n",
11577 lstrlenW(parse_resultW), result_len);
11578 ok(!lstrcmpW(result, parse_resultW), "Error: Expected %s, but got %s.\n",
11580 }
11581 }
11582 if(uri) IUri_Release(uri);
11583}
11584
11585typedef struct {
11586 const char *url;
11588 const char *base_url;
11590 const char *legacy_url;
11591 const char *uniform_url;
11592 const char *no_canon_url;
11593 const char *uri_url;
11595
11597 {
11598 "http://www.winehq.org",Uri_CREATE_NO_CANONICALIZE,
11599 NULL,0,
11600 "http://www.winehq.org/",
11601 "http://www.winehq.org/",
11602 "http://www.winehq.org",
11603 "http://www.winehq.org"
11604 },
11605 {
11606 "file://c:\\dir\\file.txt",Uri_CREATE_NO_CANONICALIZE,
11607 NULL,0,
11608 "file://c:\\dir\\file.txt",
11609 "file:///c:/dir/file.txt",
11610 "file:///c:/dir/file.txt",
11611 "file:///c:/dir/file.txt"
11612 },
11613 {
11614 "file://c:\\dir\\file.txt",Uri_CREATE_FILE_USE_DOS_PATH,
11615 NULL,0,
11616 "file://c:\\dir\\file.txt",
11617 "file:///c:/dir/file.txt",
11618 "file:///c:/dir/file.txt",
11619 "file://c:\\dir\\file.txt"
11620 },
11621 {
11622 "dat%61",Uri_CREATE_ALLOW_RELATIVE,
11623 "http://www.winehq.org",0,
11624 "http://www.winehq.org/data",
11625 "http://www.winehq.org/data",
11626 "http://www.winehq.org:80/data",
11627 },
11628 {
11629 "file.txt",Uri_CREATE_ALLOW_RELATIVE,
11630 "file://c:\\dir\\x.txt",Uri_CREATE_NO_CANONICALIZE,
11631 "file://c:\\dir\\file.txt",
11632 "file:///c:/dir/file.txt",
11633 "file:///c:/dir/file.txt",
11634 },
11635 {
11636 "",Uri_CREATE_ALLOW_RELATIVE,
11637 NULL,0,
11638 "",
11639 "",
11640 "",
11641 ""
11642 },
11643 {
11644 "test",Uri_CREATE_ALLOW_RELATIVE,
11645 NULL,0,
11646 "test",
11647 "test",
11648 "test",
11649 "test"
11650 },
11651 {
11652 "c:\\dir\\file.txt",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME,
11653 NULL,0,
11654 "file://c:\\dir\\file.txt",
11655 "file:///c:/dir/file.txt",
11656 "file:///c:/dir/file.txt",
11657 "file:///c:/dir/file.txt",
11658 },
11659 {
11660 "c:\\dir\\file.txt#frag|part",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME,
11661 NULL,0,
11662 "file://c:\\dir\\file.txt#frag|part",
11663 "file:///c:/dir/file.txt#frag%7Cpart",
11664 "file:///c:/dir/file.txt#frag%7Cpart",
11665 "file:///c:/dir/file.txt#frag%7Cpart",
11666 }
11667};
11668
11669#define test_urlmon_display_name(a,b) _test_urlmon_display_name(__LINE__,a,b)
11670static void _test_urlmon_display_name(unsigned line, IMoniker *mon, const char *exurl)
11671{
11672 WCHAR *display_name;
11673 HRESULT hres;
11674
11675 hres = IMoniker_GetDisplayName(mon, NULL, NULL, &display_name);
11676 ok_(__FILE__,line)(hres == S_OK, "GetDisplayName failed: %08lx\n", hres);
11677 ok_(__FILE__,line)(!strcmp_aw(exurl, display_name), "unexpected display name: %s, expected %s\n",
11678 wine_dbgstr_w(display_name), exurl);
11679
11680 CoTaskMemFree(display_name);
11681}
11682
11683#define test_display_uri(a,b) _test_display_uri(__LINE__,a,b)
11684static void _test_display_uri(unsigned line, IMoniker *mon, const char *exurl)
11685{
11686 IUriContainer *uri_container;
11687 IUri *uri;
11688 BSTR display_uri;
11689 HRESULT hres;
11690
11691 hres = IMoniker_QueryInterface(mon, &IID_IUriContainer, (void**)&uri_container);
11692 ok(hres == S_OK, "Could not get IUriContainer iface: %08lx\n", hres);
11693
11694 uri = NULL;
11695 hres = IUriContainer_GetIUri(uri_container, &uri);
11696 IUriContainer_Release(uri_container);
11697 ok(hres == S_OK, "GetIUri failed: %08lx\n", hres);
11698 ok(uri != NULL, "uri == NULL\n");
11699
11700 hres = IUri_GetDisplayUri(uri, &display_uri);
11701 IUri_Release(uri);
11702 ok(hres == S_OK, "GetDisplayUri failed: %08lx\n", hres);
11703 ok_(__FILE__,line)(!strcmp_aw(exurl, display_uri), "unexpected display uri: %s, expected %s\n",
11704 wine_dbgstr_w(display_uri), exurl);
11705 SysFreeString(display_uri);
11706}
11707
11708static void test_CreateURLMoniker(void)
11709{
11711 IMoniker *mon, *base_mon;
11712 WCHAR *url, *base_url;
11713 IUri *uri, *base_uri;
11714 HRESULT hres;
11715
11717 url = a2w(test->url);
11718 base_url = a2w(test->base_url);
11719
11720 if(base_url) {
11721 hres = pCreateUri(base_url, test->base_uri_flags, 0, &base_uri);
11722 ok(hres == S_OK, "CreateUri failed: %08lx\n", hres);
11723
11724 hres = pCreateURLMonikerEx2(NULL, base_uri, &base_mon, URL_MK_NO_CANONICALIZE);
11725 ok(hres == S_OK, "CreateURLMonikerEx2 failed: %08lx\n", hres);
11726 }else {
11727 base_uri = NULL;
11728 base_mon = NULL;
11729 }
11730
11731 hres = CreateURLMoniker(base_mon, url, &mon);
11732 ok(hres == S_OK, "CreateURLMoniker failed: %08lx\n", hres);
11733 test_urlmon_display_name(mon, test->legacy_url);
11734 test_display_uri(mon, test->legacy_url);
11735 IMoniker_Release(mon);
11736
11737 hres = pCreateURLMonikerEx(base_mon, url, &mon, URL_MK_LEGACY);
11738 ok(hres == S_OK, "CreateURLMoniker failed: %08lx\n", hres);
11739 test_urlmon_display_name(mon, test->legacy_url);
11740 test_display_uri(mon, test->legacy_url);
11741 IMoniker_Release(mon);
11742
11743 hres = pCreateURLMonikerEx(base_mon, url, &mon, URL_MK_UNIFORM);
11744 ok(hres == S_OK, "CreateURLMoniker failed: %08lx\n", hres);
11745 test_urlmon_display_name(mon, test->uniform_url);
11746 test_display_uri(mon, test->uniform_url);
11747 IMoniker_Release(mon);
11748
11749 hres = pCreateURLMonikerEx(base_mon, url, &mon, URL_MK_NO_CANONICALIZE);
11750 ok(hres == S_OK, "CreateURLMoniker failed: %08lx\n", hres);
11751 test_urlmon_display_name(mon, test->no_canon_url);
11752 test_display_uri(mon, test->no_canon_url);
11753 IMoniker_Release(mon);
11754
11755 hres = pCreateUri(url, test->uri_flags, 0, &uri);
11756 ok(hres == S_OK, "CreateUri failed: %08lx\n", hres);
11757
11758 hres = pCreateURLMonikerEx2(base_mon, uri, &mon, URL_MK_LEGACY);
11759 ok(hres == S_OK, "CreateURLMonikerEx2 failed: %08lx\n", hres);
11760 test_urlmon_display_name(mon, base_url ? test->legacy_url : test->uri_url);
11761 test_display_uri(mon, base_url ? test->legacy_url : test->uri_url);
11762 IMoniker_Release(mon);
11763
11764 hres = pCreateURLMonikerEx2(base_mon, uri, &mon, URL_MK_UNIFORM);
11765 ok(hres == S_OK, "CreateURLMonikerEx2 failed: %08lx\n", hres);
11766 test_urlmon_display_name(mon, base_url ? test->uniform_url : test->uri_url);
11767 test_display_uri(mon, base_url ? test->uniform_url : test->uri_url);
11768 IMoniker_Release(mon);
11769
11770 hres = pCreateURLMonikerEx2(base_mon, uri, &mon, URL_MK_NO_CANONICALIZE);
11771 ok(hres == S_OK, "CreateURLMonikerEx2 failed: %08lx\n", hres);
11772 test_urlmon_display_name(mon, base_url ? test->no_canon_url : test->uri_url);
11773 test_display_uri(mon, base_url ? test->no_canon_url : test->uri_url);
11774 IMoniker_Release(mon);
11775
11776 IUri_Release(uri);
11777 free(url);
11778 free(base_url);
11779 if(base_uri)
11780 IUri_Release(base_uri);
11781 if(base_mon)
11782 IMoniker_Release(base_mon);
11783 }
11784}
11785
11787 if(!(flags & Uri_CREATE_NO_CANONICALIZE))
11788 flags |= Uri_CREATE_CANONICALIZE;
11789 if(!(flags & Uri_CREATE_NO_DECODE_EXTRA_INFO))
11790 flags |= Uri_CREATE_DECODE_EXTRA_INFO;
11791 if(!(flags & Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES))
11792 flags |= Uri_CREATE_CRACK_UNKNOWN_SCHEMES;
11793 if(!(flags & Uri_CREATE_NO_PRE_PROCESS_HTML_URI))
11794 flags |= Uri_CREATE_PRE_PROCESS_HTML_URI;
11795 if(!(flags & Uri_CREATE_IE_SETTINGS))
11796 flags |= Uri_CREATE_NO_IE_SETTINGS;
11797
11798 return flags;
11799}
11800
11801static void test_IPersistStream(void)
11802{
11803 int i, props_order[Uri_PROPERTY_DWORD_LAST+1] = { 0 };
11804
11805 props_order[Uri_PROPERTY_RAW_URI] = 1;
11806 props_order[Uri_PROPERTY_FRAGMENT] = 2;
11807 props_order[Uri_PROPERTY_HOST] = 3;
11808 props_order[Uri_PROPERTY_PASSWORD] = 4;
11809 props_order[Uri_PROPERTY_PATH] = 5;
11810 props_order[Uri_PROPERTY_PORT] = 6;
11811 props_order[Uri_PROPERTY_QUERY] = 7;
11812 props_order[Uri_PROPERTY_SCHEME_NAME] = 8;
11813 props_order[Uri_PROPERTY_USER_NAME] = 9;
11814
11815 for(i = 0; i < ARRAY_SIZE(uri_tests); i++) {
11816 const uri_properties *test = uri_tests+i;
11817 LPWSTR uriW;
11818 IUri *uri;
11819 IPersistStream *persist_stream;
11820 IStream *stream;
11821 IMarshal *marshal;
11822 DWORD props, props_no, dw_data[6];
11823 WCHAR str_data[1024];
11825 LARGE_INTEGER no_off;
11826 CLSID curi;
11827 BSTR raw_uri;
11828 HRESULT hr;
11829
11830 if(test->create_todo || test->create_expected!=S_OK || test->flags)
11831 continue;
11832
11833 uriW = a2w(test->uri);
11834 hr = pCreateUri(uriW, test->create_flags, 0, &uri);
11835 ok(hr == S_OK, "%d) CreateUri failed 0x%08lx, expected S_OK..\n", i, hr);
11836
11837 hr = IUri_QueryInterface(uri, &IID_IPersistStream, (void**)&persist_stream);
11838 ok(hr == S_OK, "%d) QueryInterface failed 0x%08lx, expected S_OK.\n", i, hr);
11839
11841 ok(hr == S_OK, "CreateStreamOnHGlobal failed 0x%08lx.\n", hr);
11842 hr = IPersistStream_IsDirty(persist_stream);
11843 ok(hr == S_FALSE, "%d) IsDirty returned 0x%08lx, expected S_FALSE.\n", i, hr);
11844 hr = IPersistStream_Save(persist_stream, stream, FALSE);
11845 ok(hr == S_OK, "%d) Save failed 0x%08lx, expected S_OK.\n", i, hr);
11846 hr = IPersistStream_IsDirty(persist_stream);
11847 ok(hr == S_FALSE, "%d) IsDirty returned 0x%08lx, expected S_FALSE.\n", i, hr);
11848 no_off.QuadPart = 0;
11849 hr = IStream_Seek(stream, no_off, STREAM_SEEK_CUR, &size);
11850 ok(hr == S_OK, "%d) Seek failed 0x%08lx, expected S_OK.\n", i, hr);
11851 hr = IStream_Seek(stream, no_off, STREAM_SEEK_SET, NULL);
11852 ok(hr == S_OK, "%d) Seek failed 0x%08lx, expected S_OK.\n", i, hr);
11853 hr = IPersistStream_GetSizeMax(persist_stream, &max_size);
11854 ok(hr == S_OK, "%d) GetSizeMax failed 0x%08lx, expected S_OK.\n", i, hr);
11855 ok(size.LowPart+2 == max_size.LowPart,
11856 "%d) Written data size is %ld, max_size %ld.\n",
11857 i, size.LowPart, max_size.LowPart);
11858
11859 hr = IStream_Read(stream, (void*)dw_data, sizeof(DWORD), NULL);
11860 ok(hr == S_OK, "%d) Read failed 0x%08lx, expected S_OK.\n", i, hr);
11861 ok(dw_data[0]-2 == size.LowPart, "%d) Structure size is %ld, expected %ld\n",
11862 i, dw_data[0]-2, size.LowPart);
11863 hr = IStream_Read(stream, (void*)dw_data, 6*sizeof(DWORD), NULL);
11864 ok(hr == S_OK, "%d) Read failed 0x%08lx, expected S_OK.\n", i, hr);
11865 ok(dw_data[0] == 0, "%d) Incorrect value %lx, expected 0 (unknown).\n", i, dw_data[0]);
11866 ok(dw_data[1] == 0, "%d) Incorrect value %lx, expected 0 (unknown).\n", i, dw_data[1]);
11867 ok(dw_data[2] == add_default_flags(test->create_flags),
11868 "%d) Incorrect value %lx, expected %x (creation flags).\n",
11869 i, dw_data[2], add_default_flags(test->create_flags));
11870 ok(dw_data[3] == 0, "%d) Incorrect value %lx, expected 0 (unknown).\n", i, dw_data[3]);
11871 ok(dw_data[4] == 0, "%d) Incorrect value %lx, expected 0 (unknown).\n", i, dw_data[4]);
11872 ok(dw_data[5] == 0, "%d) Incorrect value %lx, expected 0 (unknown).\n", i, dw_data[5]);
11873
11874 props_no = 0;
11875 for(props=0; props<=Uri_PROPERTY_DWORD_LAST; props++) {
11876 if(!props_order[props])
11877 continue;
11878
11879 if(props <= Uri_PROPERTY_STRING_LAST) {
11880 if(test->str_props[props].expected == S_OK)
11881 props_no++;
11882 } else {
11883 if(test->dword_props[props-Uri_PROPERTY_DWORD_START].expected == S_OK)
11884 props_no++;
11885 }
11886 }
11887 if(test->dword_props[Uri_PROPERTY_SCHEME-Uri_PROPERTY_DWORD_START].value != URL_SCHEME_HTTP
11888 && test->dword_props[Uri_PROPERTY_SCHEME-Uri_PROPERTY_DWORD_START].value != URL_SCHEME_FTP
11889 && test->dword_props[Uri_PROPERTY_SCHEME-Uri_PROPERTY_DWORD_START].value != URL_SCHEME_HTTPS)
11890 props_no = 1;
11891
11892 hr = IStream_Read(stream, (void*)&props, sizeof(DWORD), NULL);
11893 ok(hr == S_OK, "%d) Read failed 0x%08lx, expected S_OK.\n", i, hr);
11894 ok(props == props_no, "%d) Properties no is %ld, expected %ld.\n", i, props, props_no);
11895
11896 dw_data[2] = 0;
11897 dw_data[3] = -1;
11898 while(props) {
11899 hr = IStream_Read(stream, (void*)dw_data, 2*sizeof(DWORD), NULL);
11900 ok(hr == S_OK, "%d) Read failed 0x%08lx, expected S_OK.\n", i, hr);
11901 props--;
11902 ok(dw_data[2]<props_order[dw_data[0]],
11903 "%d) Incorrect properties order (%ld, %ld)\n",
11904 i, dw_data[0], dw_data[3]);
11905 dw_data[2] = props_order[dw_data[0]];
11906 dw_data[3] = dw_data[0];
11907
11908 if(dw_data[0]<=Uri_PROPERTY_STRING_LAST) {
11909 const uri_str_property *prop = test->str_props+dw_data[0];
11910 hr = IStream_Read(stream, (void*)str_data, dw_data[1], NULL);
11911 ok(hr == S_OK, "%d) Read failed 0x%08lx, expected S_OK.\n", i, hr);
11912 ok(!strcmp_aw(prop->value, str_data) || broken(prop->broken_value && !strcmp_aw(prop->broken_value, str_data)),
11913 "%d) Expected %s but got %s (%ld).\n", i, prop->value, wine_dbgstr_w(str_data), dw_data[0]);
11914 } else if(dw_data[0]>=Uri_PROPERTY_DWORD_START && dw_data[0]<=Uri_PROPERTY_DWORD_LAST) {
11915 const uri_dword_property *prop = test->dword_props+dw_data[0]-Uri_PROPERTY_DWORD_START;
11916 ok(dw_data[1] == sizeof(DWORD), "%d) Size of dword property is %ld (%ld)\n", i, dw_data[1], dw_data[0]);
11917 hr = IStream_Read(stream, (void*)&dw_data[1], sizeof(DWORD), NULL);
11918 ok(hr == S_OK, "%d) Read failed 0x%08lx, expected S_OK.\n", i, hr);
11919 ok(prop->value == dw_data[1], "%d) Expected %ld but got %ld (%ld).\n", i, prop->value, dw_data[1], dw_data[0]);
11920 } else {
11921 ok(FALSE, "%d) Incorrect property type (%ld)\n", i, dw_data[0]);
11922 break;
11923 }
11924 }
11925 ok(props == 0, "%d) Not all properties were processed %ld. Next property type: %ld\n",
11926 i, props, dw_data[0]);
11927
11928 IUri_Release(uri);
11929
11930 hr = IStream_Seek(stream, no_off, STREAM_SEEK_SET, NULL);
11931 ok(hr == S_OK, "%d) Seek failed 0x%08lx, expected S_OK.\n", i, hr);
11932 hr = IPersistStream_GetClassID(persist_stream, &curi);
11933 ok(hr == S_OK, "%d) GetClassID failed 0x%08lx, expected S_OK.\n", i, hr);
11934 ok(IsEqualCLSID(&curi, &CLSID_CUri), "%d) GetClassID returned incorrect CLSID.\n", i);
11935 IPersistStream_Release(persist_stream);
11936
11937 hr = CoCreateInstance(&curi, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
11938 &IID_IUri, (void**)&uri);
11939 ok(hr == S_OK, "%d) Error creating uninitialized Uri: 0x%08lx.\n", i, hr);
11940 hr = IUri_QueryInterface(uri, &IID_IPersistStream, (void**)&persist_stream);
11941 ok(hr == S_OK, "%d) QueryInterface failed 0x%08lx, expected S_OK.\n", i, hr);
11942 hr = IPersistStream_Load(persist_stream, stream);
11943 ok(hr == S_OK, "%d) Load failed 0x%08lx, expected S_OK.\n", i, hr);
11944 hr = IUri_GetRawUri(uri, &raw_uri);
11945 ok(hr == S_OK, "%d) GetRawUri failed 0x%08lx, expected S_OK.\n", i, hr);
11946 ok(!strcmp_aw(test->str_props[Uri_PROPERTY_RAW_URI].value, raw_uri)
11947 || broken(test->str_props[Uri_PROPERTY_RAW_URI].broken_value
11948 && !strcmp_aw(test->str_props[Uri_PROPERTY_RAW_URI].broken_value, raw_uri)),
11949 "%d) Expected %s but got %s.\n", i, test->str_props[Uri_PROPERTY_RAW_URI].value,
11950 wine_dbgstr_w(raw_uri));
11951 SysFreeString(raw_uri);
11952 IPersistStream_Release(persist_stream);
11953
11954 hr = IUri_QueryInterface(uri, &IID_IMarshal, (void**)&marshal);
11955 ok(hr == S_OK, "%d) QueryInterface(IID_IMarshal) failed 0x%08lx, expected S_OK.\n", i, hr);
11956 hr = IStream_Seek(stream, no_off, STREAM_SEEK_SET, NULL);
11957 ok(hr == S_OK, "%d) Seek failed 0x%08lx, expected S_OK.\n", i, hr);
11958 hr = IMarshal_MarshalInterface(marshal, stream, &IID_IUri, (void*)uri,
11959 MSHCTX_DIFFERENTMACHINE, NULL, MSHLFLAGS_NORMAL);
11960 ok(hr == E_INVALIDARG, "%d) MarshalInterface returned 0x%08lx, expected E_INVALIDARG.\n", i, hr);
11961 hr = IMarshal_MarshalInterface(marshal, stream, &IID_IUri, (void*)uri,
11962 MSHCTX_CROSSCTX, NULL, MSHLFLAGS_NORMAL);
11963 ok(hr == E_INVALIDARG, "%d) MarshalInterface returned 0x%08lx, expected E_INVALIDARG.\n", i, hr);
11964 hr = IMarshal_MarshalInterface(marshal, stream, &IID_IUri, (void*)uri,
11965 MSHCTX_LOCAL, NULL, MSHLFLAGS_TABLESTRONG);
11966 ok(hr == E_INVALIDARG, "%d) MarshalInterface returned 0x%08lx, expected E_INVALIDARG.\n", i, hr);
11967 hr = IMarshal_MarshalInterface(marshal, stream, &IID_IUri, (void*)uri,
11968 MSHCTX_LOCAL, NULL, MSHLFLAGS_TABLEWEAK);
11969 ok(hr == E_INVALIDARG, "%d) MarshalInterface returned 0x%08lx, expected E_INVALIDARG.\n", i, hr);
11970 hr = IMarshal_MarshalInterface(marshal, stream, &IID_IUri, (void*)uri,
11971 MSHCTX_LOCAL, NULL, MSHLFLAGS_NOPING);
11972 ok(hr == E_INVALIDARG, "%d) MarshalInterface returned 0x%08lx, expected E_INVALIDARG.\n", i, hr);
11973 hr = IMarshal_MarshalInterface(marshal, stream, &IID_IUri, (void*)uri,
11974 MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL);
11975 ok(hr == S_OK, "%d) MarshalInterface failed 0x%08lx, expected S_OK.\n", i, hr);
11976 hr = IMarshal_GetUnmarshalClass(marshal, &IID_IUri, (void*)uri,
11977 MSHCTX_CROSSCTX, NULL, MSHLFLAGS_NORMAL, &curi);
11978 ok(hr == E_INVALIDARG, "%d) GetUnmarshalClass returned 0x%08lx, expected E_INVALIDARG.\n", i, hr);
11979 hr = IMarshal_GetUnmarshalClass(marshal, &IID_IUri, (void*)uri,
11980 MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL, &curi);
11981 ok(hr == S_OK, "%d) GetUnmarshalClass failed 0x%08lx, expected S_OK.\n", i, hr);
11982 ok(IsEqualCLSID(&curi, &CLSID_CUri), "%d) GetUnmarshalClass returned incorrect CLSID.\n", i);
11983
11984 hr = IStream_Seek(stream, no_off, STREAM_SEEK_CUR, &size);
11985 ok(hr == S_OK, "%d) Seek failed 0x%08lx, expected S_OK.\n", i, hr);
11986 hr = IStream_Seek(stream, no_off, STREAM_SEEK_SET, NULL);
11987 ok(hr == S_OK, "%d) Seek failed 0x%08lx, expected S_OK.\n", i, hr);
11988 hr = IStream_Read(stream, (void*)dw_data, 3*sizeof(DWORD), NULL);
11989 ok(hr == S_OK, "%d) Read failed 0x%08lx, expected S_OK.\n", i, hr);
11990 ok(dw_data[0]-2 == size.LowPart, "%d) Structure size is %ld, expected %ld\n",
11991 i, dw_data[0]-2, size.LowPart);
11992 ok(dw_data[1] == MSHCTX_LOCAL, "%d) Incorrect value %ld, expected MSHCTX_LOCAL.\n",
11993 i, dw_data[1]);
11994 ok(dw_data[2] == dw_data[0]-8, "%d) Incorrect value %ld, expected %ld (PersistStream size).\n",
11995 i, dw_data[2], dw_data[0]-8);
11996 if(!test->str_props[Uri_PROPERTY_PATH].value[0] &&
11997 (test->dword_props[Uri_PROPERTY_SCHEME-Uri_PROPERTY_DWORD_START].value == URL_SCHEME_HTTP
11998 || test->dword_props[Uri_PROPERTY_SCHEME-Uri_PROPERTY_DWORD_START].value == URL_SCHEME_FTP
11999 || test->dword_props[Uri_PROPERTY_SCHEME-Uri_PROPERTY_DWORD_START].value == URL_SCHEME_HTTPS))
12000 max_size.LowPart += 3*sizeof(DWORD);
12001 ok(dw_data[2] == max_size.LowPart, "%d) Incorrect value %ld, expected %ld (PersistStream size).\n",
12002 i, dw_data[2], max_size.LowPart);
12003 IMarshal_Release(marshal);
12004 IUri_Release(uri);
12005
12006 hr = IStream_Seek(stream, no_off, STREAM_SEEK_SET, NULL);
12007 ok(hr == S_OK, "%d) Seek failed 0x%08lx, expected S_OK.\n", i, hr);
12008 hr = CoCreateInstance(&curi, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
12009 &IID_IUri, (void**)&uri);
12010 ok(hr == S_OK, "%d) Error creating uninitialized Uri: 0x%08lx.\n", i, hr);
12011 hr = IUri_QueryInterface(uri, &IID_IMarshal, (void**)&marshal);
12012 ok(hr == S_OK, "%d) QueryInterface failed 0x%08lx, expected S_OK.\n", i, hr);
12013 IUri_Release(uri);
12014 hr = IMarshal_UnmarshalInterface(marshal, stream, &IID_IUri, (void**)&uri);
12015 ok(hr == S_OK, "%d) UnmarshalInterface failed 0x%08lx, expected S_OK.\n", i, hr);
12016 hr = IUri_GetRawUri(uri, &raw_uri);
12017 ok(hr == S_OK, "%d) GetRawUri failed 0x%08lx, expected S_OK.\n", i, hr);
12018 ok(!strcmp_aw(test->str_props[Uri_PROPERTY_RAW_URI].value, raw_uri)
12019 || broken(test->str_props[Uri_PROPERTY_RAW_URI].broken_value
12020 && !strcmp_aw(test->str_props[Uri_PROPERTY_RAW_URI].broken_value, raw_uri)),
12021 "%d) Expected %s but got %s.\n", i, test->str_props[Uri_PROPERTY_RAW_URI].value,
12022 wine_dbgstr_w(raw_uri));
12023 SysFreeString(raw_uri);
12024
12025 IMarshal_Release(marshal);
12026 IStream_Release(stream);
12027 IUri_Release(uri);
12028 free(uriW);
12029 }
12030}
12031
12032static void test_UninitializedUri(void)
12033{
12034 IUri *uri;
12035 IUriBuilderFactory *ubf;
12036 IPersistStream *ps;
12037 IUriBuilder *ub;
12038 BSTR bstr;
12039 DWORD dword;
12040 BOOL eq;
12042 HRESULT hr;
12043
12044 hr = CoCreateInstance(&CLSID_CUri, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
12045 &IID_IUri, (void**)&uri);
12046 if(FAILED(hr)) {
12047 win_skip("Skipping uninitialized Uri tests.\n");
12048 return;
12049 }
12050
12051 hr = IUri_QueryInterface(uri, &IID_IUriBuilderFactory, (void**)&ubf);
12052 ok(hr == S_OK, "QueryInterface(IID_IUriBuillderFactory) failed: %lx.\n", hr);
12053 hr = IUri_QueryInterface(uri, &IID_IPersistStream, (void**)&ps);
12054 ok(hr == S_OK, "QueryInterface(IID_IPersistStream) failed: %lx.\n", hr);
12055
12056 hr = IUri_GetAbsoluteUri(uri, NULL);
12057 ok(hr == E_UNEXPECTED, "GetAbsoluteUri returned %lx, expected E_UNEXPECTED.\n", hr);
12058 hr = IUri_GetAbsoluteUri(uri, &bstr);
12059 ok(hr == E_UNEXPECTED, "GetAbsoluteUri returned %lx, expected E_UNEXPECTED.\n", hr);
12060 hr = IUri_GetAuthority(uri, &bstr);
12061 ok(hr == E_UNEXPECTED, "GetAuthority returned %lx, expected E_UNEXPECTED.\n", hr);
12062 hr = IUri_GetDisplayUri(uri, &bstr);
12063 ok(hr == E_UNEXPECTED, "GetDisplayUri returned %lx, expected E_UNEXPECTED.\n", hr);
12064 hr = IUri_GetDomain(uri, &bstr);
12065 ok(hr == E_UNEXPECTED, "GetDomain returned %lx, expected E_UNEXPECTED.\n", hr);
12066 hr = IUri_GetExtension(uri, &bstr);
12067 ok(hr == E_UNEXPECTED, "GetExtension returned %lx, expected E_UNEXPECTED.\n", hr);
12068 hr = IUri_GetFragment(uri, &bstr);
12069 ok(hr == E_UNEXPECTED, "GetFragment returned %lx, expected E_UNEXPECTED.\n", hr);
12070 hr = IUri_GetHost(uri, &bstr);
12071 ok(hr == E_UNEXPECTED, "GetHost returned %lx, expected E_UNEXPECTED.\n", hr);
12072 hr = IUri_GetHostType(uri, &dword);
12073 ok(hr == E_UNEXPECTED, "GetHostType returned %lx, expected E_UNEXPECTED.\n", hr);
12074 hr = IUri_GetPassword(uri, &bstr);
12075 ok(hr == E_UNEXPECTED, "GetPassword returned %lx, expected E_UNEXPECTED.\n", hr);
12076 hr = IUri_GetPassword(uri, &bstr);
12077 ok(hr == E_UNEXPECTED, "GetPassword returned %lx, expected E_UNEXPECTED.\n", hr);
12078 hr = IUri_GetPathAndQuery(uri, &bstr);
12079 ok(hr == E_UNEXPECTED, "GetPathAndQuery returned %lx, expected E_UNEXPECTED.\n", hr);
12080 hr = IUri_GetPort(uri, &dword);
12081 ok(hr == E_UNEXPECTED, "GetPort returned %lx, expected E_UNEXPECTED.\n", hr);
12082 hr = IUri_GetProperties(uri, &dword);
12083 ok(hr == E_UNEXPECTED, "GetProperties returned %lx, expected E_UNEXPECTED.\n", hr);
12084 hr = IUri_GetPropertyBSTR(uri, Uri_PROPERTY_RAW_URI, &bstr, 0);
12085 ok(hr == E_UNEXPECTED, "GetPropertyBSTR returned %lx, expected E_UNEXPECTED.\n", hr);
12086 hr = IUri_GetPropertyDWORD(uri, Uri_PROPERTY_PORT, &dword, 0);
12087 ok(hr == E_UNEXPECTED, "GetPropertyDWORD returned %lx, expected E_UNEXPECTED.\n", hr);
12088 hr = IUri_GetPropertyLength(uri, Uri_PROPERTY_RAW_URI, &dword, 0);
12089 ok(hr == E_UNEXPECTED, "GetPropertyLength returned %lx, expected E_UNEXPECTED.\n", hr);
12090 hr = IUri_GetQuery(uri, &bstr);
12091 ok(hr == E_UNEXPECTED, "GetQuery returned %lx, expected E_UNEXPECTED.\n", hr);
12092 hr = IUri_GetRawUri(uri, &bstr);
12093 ok(hr == E_UNEXPECTED, "GetRawUri returned %lx, expected E_UNEXPECTED.\n", hr);
12094 hr = IUri_GetScheme(uri, &dword);
12095 ok(hr == E_UNEXPECTED, "GetScheme returned %lx, expected E_UNEXPECTED.\n", hr);
12096 hr = IUri_GetSchemeName(uri, &bstr);
12097 ok(hr == E_UNEXPECTED, "GetSchemeName returned %lx, expected E_UNEXPECTED.\n", hr);
12098 hr = IUri_GetUserInfo(uri, &bstr);
12099 ok(hr == E_UNEXPECTED, "GetUserInfo returned %lx, expected E_UNEXPECTED.\n", hr);
12100 hr = IUri_GetUserName(uri, &bstr);
12101 ok(hr == E_UNEXPECTED, "GetUserName returned %lx, expected E_UNEXPECTED.\n", hr);
12102 hr = IUri_GetZone(uri, &dword);
12103 ok(hr == E_UNEXPECTED, "GetZone returned %lx, expected E_UNEXPECTED.\n", hr);
12104 hr = IUri_IsEqual(uri, uri, &eq);
12105 ok(hr == E_UNEXPECTED, "IsEqual returned %lx, expected E_UNEXPECTED.\n", hr);
12106
12107 hr = IUriBuilderFactory_CreateInitializedIUriBuilder(ubf, 0, 0, &ub);
12108 ok(hr == E_UNEXPECTED, "CreateInitializedIUriBuilder returned %lx, expected E_UNEXPECTED.\n", hr);
12109 hr = IUriBuilderFactory_CreateIUriBuilder(ubf, 0, 0, &ub);
12110 ok(hr == S_OK, "CreateIUriBuilder returned %lx, expected S_OK.\n", hr);
12111 IUriBuilder_Release(ub);
12112
12113 hr = IPersistStream_GetSizeMax(ps, &ui);
12114 ok(hr == S_OK, "GetSizeMax returned %lx, expected S_OK.\n", hr);
12115 ok(ui.u.LowPart == 34, "ui.LowPart = %ld, expected 34.\n", ui.u.LowPart);
12116 hr = IPersistStream_IsDirty(ps);
12117 ok(hr == S_FALSE, "IsDirty returned %lx, expected S_FALSE.\n", hr);
12118
12119 IPersistStream_Release(ps);
12120 IUriBuilderFactory_Release(ubf);
12121 IUri_Release(uri);
12122}
12123
12125 HMODULE hurlmon;
12126
12127 hurlmon = GetModuleHandleA("urlmon.dll");
12128 pCoInternetGetSession = (void*) GetProcAddress(hurlmon, "CoInternetGetSession");
12129 pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
12130 pCreateUriWithFragment = (void*) GetProcAddress(hurlmon, "CreateUriWithFragment");
12131 pCreateIUriBuilder = (void*) GetProcAddress(hurlmon, "CreateIUriBuilder");
12132 pCoInternetCombineIUri = (void*) GetProcAddress(hurlmon, "CoInternetCombineIUri");
12133 pCoInternetCombineUrlEx = (void*) GetProcAddress(hurlmon, "CoInternetCombineUrlEx");
12134 pCoInternetParseIUri = (void*) GetProcAddress(hurlmon, "CoInternetParseIUri");
12135 pCreateURLMonikerEx = (void*) GetProcAddress(hurlmon, "CreateURLMonikerEx");
12136 pCreateURLMonikerEx2 = (void*) GetProcAddress(hurlmon, "CreateURLMonikerEx2");
12137
12138 if(!pCreateUri) {
12139 win_skip("CreateUri is not present, skipping tests.\n");
12140 return;
12141 }
12142
12143 trace("test CreateUri invalid flags...\n");
12145
12146 trace("test CreateUri invalid args...\n");
12148
12149 trace("test CreateUri invalid URIs...\n");
12151
12152 trace("test IUri_GetPropertyBSTR...\n");
12154
12155 trace("test IUri_GetPropertyDWORD...\n");
12157
12158 trace("test IUri_GetStrProperties...\n");
12160
12161 trace("test IUri_GetDwordProperties...\n");
12163
12164 trace("test IUri_GetPropertyLength...\n");
12166
12167 trace("test IUri_GetProperties...\n");
12169
12170 trace("test IUri_HasProperty...\n");
12172
12173 trace("test IUri_IsEqual...\n");
12175
12176 trace("test CreateUriWithFragment invalid args...\n");
12178
12179 trace("test CreateUriWithFragment invalid flags...\n");
12181
12182 trace("test CreateUriWithFragment...\n");
12184
12185 trace("test CreateIUriBuilder...\n");
12187
12188 trace("test IUriBuilder_CreateInvalidArgs...\n");
12190
12191 trace("test IUriBuilder...\n");
12193
12194 trace("test IUriBuilder_GetInvalidArgs...\n");
12196
12197 trace("test IUriBuilder_HasBeenModified...\n");
12199
12200 trace("test IUriBuilder_IUriProperty...\n");
12202
12203 trace("test IUriBuilder_RemoveProperties...\n");
12205
12206 trace("test IUriBuilder miscellaneous...\n");
12208
12209 trace("test IUriBuilderFactory...\n");
12211
12212 trace("test CoInternetCombineIUri...\n");
12214
12215 trace("test CoInternetCombineUrlEx...\n");
12217
12218 trace("test CoInternetParseIUri Invalid Args...\n");
12220
12221 trace("test CoInternetParseIUri...\n");
12223
12225
12226 trace("test CoInternetCombineIUri pluggable...\n");
12228
12229 trace("test CoInternetCombineUrlEx Pluggable...\n");
12231
12232 trace("test CoInternetParseIUri pluggable...\n");
12234
12235 trace("test CreateURLMoniker...\n");
12237
12239
12240 trace("test IPersistStream...\n");
12242
12243 trace("test uninitialized Uri...\n");
12245
12248}
static WCHAR baseW[MAX_PATH]
Definition: FindFiles.c:24
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define ok_(x1, x2)
Definition: atltest.h:61
#define ARRAY_SIZE(A)
Definition: main.h:20
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
static INT max_size
Definition: history.c:51
const GUID IID_IUnknown
Definition: _set.h:50
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL delete_on_release, IStream **stream)
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
#define GetProcAddress(x, y)
Definition: compat.h:753
OLECHAR * BSTR
Definition: compat.h:2293
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrlenW
Definition: compat.h:750
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
static Uri * impl_from_IUri(IUri *iface)
Definition: uri.c:4206
USHORT port
Definition: uri.c:228
return ret
Definition: mutex.c:146
r received
Definition: btrfs.c:3005
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLenum GLint GLuint mask
Definition: glext.h:6028
GLbitfield flags
Definition: glext.h:7161
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static const WCHAR emptyW[]
Definition: navigate.c:40
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define wine_dbgstr_w
Definition: kernel32.h:34
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define win_skip
Definition: minitest.h:67
#define todo_wine_if(is_todo)
Definition: minitest.h:81
#define todo_wine
Definition: minitest.h:80
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOL todo
Definition: filedlg.c:313
static const WCHAR url[]
Definition: encode.c:1384
BOOL expected
Definition: store.c:2000
const WCHAR * base_url
Definition: mimeole.c:1439
HRESULT hres
Definition: protocol.c:465
#define eq(received, expected, label, type)
Definition: locale.c:179
static const WCHAR invalidW[]
Definition: locale.c:52
static WCHAR valueW[]
Definition: reg.c:1394
static PARSEACTION
Definition: misc.c:71
static QUERYOPTION
Definition: misc.c:72
static const WCHAR hostW[]
Definition: protocol.c:142
const WCHAR * uri
Definition: sec_mgr.c:1564
#define URI_BUILDER_STR_PROPERTY_COUNT
Definition: uri.c:41
#define SET_EXPECT(func)
Definition: uri.c:46
static void test_IUriBuilder_CreateInvalidArgs(void)
Definition: uri.c:9541
static void test_CreateIUriBuilder(void)
Definition: uri.c:9354
static HRESULT WINAPI custom_uri_GetPath(IUri *iface, BSTR *value)
Definition: uri.c:9095
static HRESULT WINAPI custom_uri_IsEqual(IUri *iface, IUri *pUri, BOOL *is_equal)
Definition: uri.c:9167
struct _uri_combine_str_property uri_combine_str_property
static HRESULT WINAPI custom_uri_GetPropertyLength(IUri *iface, Uri_PROPERTY property, DWORD *length, DWORD flags)
Definition: uri.c:9029
static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder *builder, const uri_builder_test *test, DWORD test_index)
Definition: uri.c:9488
static IInternetProtocolInfo protocol_info
Definition: uri.c:11183
static const invalid_uri invalid_uri_tests[]
Definition: uri.c:5487
static void test_CoInternetCombineUrlEx_Pluggable(void)
Definition: uri.c:11392
static void test_CreateUri_InvalidUri(void)
Definition: uri.c:8266
static const WCHAR parse_resultW[]
Definition: uri.c:94
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
Definition: uri.c:11213
static const uri_combine_test uri_combine_tests[]
Definition: uri.c:6855
static HRESULT WINAPI custom_uri_GetRawUri(IUri *iface, BSTR *value)
Definition: uri.c:9113
struct _uri_combine_test uri_combine_test
static HRESULT WINAPI custom_uri_GetZone(IUri *iface, DWORD *value)
Definition: uri.c:9155
static ULONG get_refcnt(IUri *uri)
Definition: uri.c:8148
static HRESULT WINAPI custom_uri_GetPort(IUri *iface, DWORD *value)
Definition: uri.c:9143
static PARSEACTION parse_action
Definition: uri.c:96
static void test_IUriBuilder_CreateUri(IUriBuilder *builder, const uri_builder_test *test, DWORD test_index)
Definition: uri.c:9384
static DWORD compute_expected_props(uri_properties *test, DWORD *mask)
Definition: uri.c:8858
static void change_property(IUriBuilder *builder, const uri_builder_property *prop, DWORD test_index)
Definition: uri.c:8153
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
Definition: uri.c:11206
static void test_IUriBuilder_GetUserName(IUriBuilder *builder, const uri_builder_test *test, DWORD test_index)
Definition: uri.c:10392
static HRESULT WINAPI custom_uri_GetHost(IUri *iface, BSTR *value)
Definition: uri.c:9083
static void test_IUriBuilder_HasBeenModified(void)
Definition: uri.c:10568
static void test_IUri_HasProperty(void)
Definition: uri.c:8933
static HRESULT WINAPI InternetProtocolInfo_QueryInfo(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, QUERYOPTION OueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
Definition: uri.c:11165
static const IClassFactoryVtbl ClassFactoryVtbl
Definition: uri.c:11219
static void test_IUriBuilder_RemoveProperties(void)
Definition: uri.c:10811
static void test_CoInternetParseIUri_Pluggable(void)
Definition: uri.c:11555
#define test_urlmon_display_name(a, b)
Definition: uri.c:11669
static void unregister_protocols(void)
Definition: uri.c:11246
static HRESULT WINAPI custom_uri_GetFragment(IUri *iface, BSTR *value)
Definition: uri.c:9077
struct _uri_builder_dword_property uri_builder_dword_property
static HRESULT WINAPI custom_uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY property, BSTR *value, DWORD flags)
Definition: uri.c:9023
static HRESULT WINAPI custom_uri_GetAuthority(IUri *iface, BSTR *value)
Definition: uri.c:9053
#define test_display_uri(a, b)
Definition: uri.c:11683
static HRESULT WINAPI custom_uri_GetUserName(IUri *iface, BSTR *value)
Definition: uri.c:9131
static const uri_builder_remove_test uri_builder_remove_tests[]
Definition: uri.c:6792
static void test_IUri_GetProperties(void)
Definition: uri.c:8882
static void test_CoInternetParseIUri(void)
Definition: uri.c:11515
static void test_IUriBuilder_GetPort(IUriBuilder *builder, const uri_builder_test *test, DWORD test_index)
Definition: uri.c:10135
static void test_IUriBuilder_GetHost(IUriBuilder *builder, const uri_builder_test *test, DWORD test_index)
Definition: uri.c:9850
static void test_IUriBuilder_GetPassword(IUriBuilder *builder, const uri_builder_test *test, DWORD test_index)
Definition: uri.c:9945
static void test_CreateURLMoniker(void)
Definition: uri.c:11708
static void test_CreateUriWithFragment_InvalidArgs(void)
Definition: uri.c:9282
static const WCHAR combine_relativeW[]
Definition: uri.c:88
static void test_CoInternetCombineIUri_Pluggable(void)
Definition: uri.c:11261
#define CHECK_EXPECT(func)
Definition: uri.c:49
static HRESULT WINAPI custom_uri_GetAbsoluteUri(IUri *iface, BSTR *value)
Definition: uri.c:9047
static void _test_urlmon_display_name(unsigned line, IMoniker *mon, const char *exurl)
Definition: uri.c:11670
#define URI_DWORD_PROPERTY_COUNT
Definition: uri.c:40
struct _invalid_uri invalid_uri
struct _uri_create_flag_test uri_create_flag_test
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: uri.c:11201
#define DEFINE_EXPECT(func)
Definition: uri.c:43
static LPWSTR a2w(LPCSTR str)
Definition: uri.c:8129
static HRESULT WINAPI custom_uri_QueryInterface(IUri *iface, REFIID iid, void **out)
Definition: uri.c:8998
struct _uri_dword_property uri_dword_property
static void test_IUriBuilder_Misc(void)
Definition: uri.c:10895
static LPWSTR
Definition: uri.c:77
static HRESULT WINAPI custom_uri_GetExtension(IUri *iface, BSTR *value)
Definition: uri.c:9071
static void test_CoInternetCombineIUri(void)
Definition: uri.c:11010
struct _uri_str_property uri_str_property
static DWORD strcmp_aw(LPCSTR strA, LPCWSTR strB)
Definition: uri.c:8141
static HRESULT WINAPI custom_uri_GetDisplayUri(IUri *iface, BSTR *value)
Definition: uri.c:9059
struct _uri_builder_str_property uri_builder_str_property
static HRESULT WINAPI InternetProtocolInfo_CompareUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
Definition: uri.c:11158
static void test_CreateUri_InvalidFlags(void)
Definition: uri.c:8227
static void test_IUri_GetPropertyBSTR(void)
Definition: uri.c:8286
static void test_IUri_GetDwordProperties(void)
Definition: uri.c:8682
static void test_IUri_GetPropertyDWORD(void)
Definition: uri.c:8362
static const uri_equality equality_tests[]
Definition: uri.c:5557
static HRESULT WINAPI InternetProtocolInfo_CombineUrl(IInternetProtocolInfo *iface, LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
Definition: uri.c:11139
static void test_CoInternetParseIUri_InvalidArgs(void)
Definition: uri.c:11424
static void test_IUriBuilder_GetPath(IUriBuilder *builder, const uri_builder_test *test, DWORD test_index)
Definition: uri.c:10040
static void test_IUriBuilder_IUriProperty(void)
Definition: uri.c:10674
static const create_urlmon_test_t create_urlmon_tests[]
Definition: uri.c:11596
static void register_protocols(void)
Definition: uri.c:11229
struct _uri_parse_test uri_parse_test
static void test_UninitializedUri(void)
Definition: uri.c:12032
static ULONG WINAPI InternetProtocolInfo_AddRef(IInternetProtocolInfo *iface)
Definition: uri.c:11112
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: uri.c:11185
static void test_IUri_GetStrProperties(void)
Definition: uri.c:8417
static void test_IUriBuilder_GetInvalidArgs(void)
Definition: uri.c:9633
static void test_IUriBuilder_GetQuery(IUriBuilder *builder, const uri_builder_test *test, DWORD test_index)
Definition: uri.c:10202
static void test_CreateUriWithFragment(void)
Definition: uri.c:9316
static HRESULT WINAPI custom_uri_GetSchemeName(IUri *iface, BSTR *value)
Definition: uri.c:9119
static const WCHAR combine_resultW[]
Definition: uri.c:89
static void _test_display_uri(unsigned line, IMoniker *mon, const char *exurl)
Definition: uri.c:11684
static HRESULT WINAPI custom_uri_GetPathAndQuery(IUri *iface, BSTR *value)
Definition: uri.c:9101
static HRESULT WINAPI custom_uri_GetScheme(IUri *iface, DWORD *value)
Definition: uri.c:9149
static const WCHAR http_url_fragW[]
Definition: uri.c:83
static HRESULT WINAPI custom_uri_HasProperty(IUri *iface, Uri_PROPERTY property, BOOL *has_property)
Definition: uri.c:9041
static HRESULT WINAPI custom_uri_GetUserInfo(IUri *iface, BSTR *value)
Definition: uri.c:9125
static const uri_properties uri_tests[]
Definition: uri.c:140
static const WCHAR winetestW[]
Definition: uri.c:91
static IUri **static LPCWSTR
Definition: uri.c:72
#define CHECK_CALLED(func)
Definition: uri.c:62
static ULONG WINAPI custom_uri_AddRef(IUri *iface)
Definition: uri.c:9011
static const uri_parse_test uri_parse_tests[]
Definition: uri.c:8053
static PARSEACTION
Definition: uri.c:77
static void test_IUriBuilder_GetSchemeName(IUriBuilder *builder, const uri_builder_test *test, DWORD test_index)
Definition: uri.c:10297
static int add_default_flags(DWORD flags)
Definition: uri.c:11786
struct _uri_builder_remove_test uri_builder_remove_test
static void test_IUriBuilderFactory(void)
Definition: uri.c:10923
struct _uri_equality uri_equality
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: uri.c:11196
static void test_IPersistStream(void)
Definition: uri.c:11801
static const uri_with_fragment uri_fragment_tests[]
Definition: uri.c:5699
static ULONG WINAPI InternetProtocolInfo_Release(IInternetProtocolInfo *iface)
Definition: uri.c:11117
static void test_IUri_IsEqual(void)
Definition: uri.c:9205
static void test_IUri_GetPropertyLength(void)
Definition: uri.c:8771
static ULONG WINAPI custom_uri_Release(IUri *iface)
Definition: uri.c:9017
static HRESULT WINAPI InternetProtocolInfo_QueryInterface(IInternetProtocolInfo *iface, REFIID riid, void **ppv)
Definition: uri.c:11105
#define URI_STR_PROPERTY_COUNT
Definition: uri.c:39
static void test_IUriBuilder(void)
Definition: uri.c:10488
static const WCHAR combine_baseW[]
Definition: uri.c:86
static HRESULT WINAPI InternetProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
Definition: uri.c:11122
static const WCHAR parse_urlW[]
Definition: uri.c:93
static HRESULT WINAPI custom_uri_GetQuery(IUri *iface, BSTR *value)
Definition: uri.c:9107
struct _uri_builder_port uri_builder_port
static DWORD_PTR
Definition: uri.c:71
static HRESULT WINAPI custom_uri_GetPassword(IUri *iface, BSTR *value)
Definition: uri.c:9089
static void test_CreateUriWithFragment_InvalidFlags(void)
Definition: uri.c:9302
static IClassFactory protocol_cf
Definition: uri.c:11227
struct _uri_builder_property uri_builder_property
static HRESULT WINAPI custom_uri_GetHostType(IUri *iface, DWORD *value)
Definition: uri.c:9137
struct _uri_builder_test uri_builder_test
static HRESULT WINAPI custom_uri_GetPropertyDWORD(IUri *iface, Uri_PROPERTY property, DWORD *value, DWORD flags)
Definition: uri.c:9035
static const uri_create_flag_test invalid_flag_tests[]
Definition: uri.c:104
static void test_IUriBuilder_GetFragment(IUriBuilder *builder, const uri_builder_test *test, DWORD test_index)
Definition: uri.c:9755
static const IUriVtbl custom_uri_vtbl
Definition: uri.c:9173
static void test_IUriBuilder_CreateUriSimple(IUriBuilder *builder, const uri_builder_test *test, DWORD test_index)
Definition: uri.c:9436
static const uri_builder_test uri_builder_tests[]
Definition: uri.c:5776
static void test_CreateUri_InvalidArgs(void)
Definition: uri.c:8241
static DWORD parse_flags
Definition: uri.c:97
static void test_CoInternetCombineUrlEx(void)
Definition: uri.c:11300
static HRESULT WINAPI custom_uri_GetDomain(IUri *iface, BSTR *value)
Definition: uri.c:9065
struct _uri_with_fragment uri_with_fragment
static HRESULT WINAPI custom_uri_GetProperties(IUri *iface, DWORD *flags)
Definition: uri.c:9161
static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
Definition: uri.c:11173
struct _uri_properties uri_properties
static const WCHAR http_urlW[]
Definition: uri.c:81
char strA[12]
Definition: clipboard.c:2215
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
#define DWORD
Definition: nt_native.h:44
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
UINT ui
Definition: oleauto.h:49
short WCHAR
Definition: pedump.c:58
const GUID IID_IPersistStream
Definition: proxy.cpp:13
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define IID_NULL
Definition: guiddef.h:98
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
#define URL_ESCAPE_UNSAFE
Definition: shlwapi.h:533
#define URL_NO_META
Definition: shlwapi.h:538
@ URL_SCHEME_MAILTO
Definition: shlwapi.h:548
@ URL_SCHEME_MK
Definition: shlwapi.h:554
@ URL_SCHEME_UNKNOWN
Definition: shlwapi.h:544
@ URL_SCHEME_HTTPS
Definition: shlwapi.h:555
@ URL_SCHEME_FTP
Definition: shlwapi.h:545
@ URL_SCHEME_RES
Definition: shlwapi.h:562
@ URL_SCHEME_NEWS
Definition: shlwapi.h:549
@ URL_SCHEME_HTTP
Definition: shlwapi.h:546
@ URL_SCHEME_FILE
Definition: shlwapi.h:553
@ URL_SCHEME_WILDCARD
Definition: shlwapi.h:570
@ URL_SCHEME_ABOUT
Definition: shlwapi.h:561
@ URL_SCHEME_GOPHER
Definition: shlwapi.h:547
@ URL_SCHEME_JAVASCRIPT
Definition: shlwapi.h:559
#define URL_UNESCAPE
Definition: shlwapi.h:532
#define URL_ESCAPE_SPACES_ONLY
Definition: shlwapi.h:530
#define URL_DONT_SIMPLIFY
Definition: shlwapi.h:531
#define URL_FILE_USE_PATHURL
Definition: shlwapi.h:523
#define URL_DONT_UNESCAPE_EXTRA_INFO
Definition: shlwapi.h:539
#define URL_ESCAPE_PERCENT
Definition: shlwapi.h:521
PVOID pBuffer
#define equal(x, y)
Definition: reader.cc:56
#define test
Definition: rosglue.h:37
const WCHAR * str
#define CP_UTF8
Definition: nls.h:20
#define memset(x, y, z)
Definition: compat.h:39
#define STRSAFE_E_INSUFFICIENT_BUFFER
Definition: strsafe.h:103
const char * uri
Definition: uri.c:5482
DWORD flags
Definition: uri.c:5483
BOOL todo
Definition: uri.c:5484
DWORD value
Definition: uri.c:5731
HRESULT expected
Definition: uri.c:5732
const char * value
Definition: uri.c:5721
Uri_PROPERTY property
Definition: uri.c:5723
const char * expected_value
Definition: uri.c:5722
HRESULT expected
Definition: uri.c:5724
const char * expected_uri
Definition: uri.c:6786
const char * uri
Definition: uri.c:6777
HRESULT expected_hres
Definition: uri.c:6788
HRESULT create_builder_expected
Definition: uri.c:6779
HRESULT remove_expected
Definition: uri.c:6783
const char * expected
Definition: uri.c:5737
BOOL uri_todo
Definition: uri.c:5760
BOOL create_builder_todo
Definition: uri.c:5752
DWORD uri_simple_encode_flags
Definition: uri.c:5762
uri_builder_property properties[URI_BUILDER_STR_PROPERTY_COUNT]
Definition: uri.c:5754
DWORD uri_with_flags
Definition: uri.c:5766
DWORD create_flags
Definition: uri.c:5750
DWORD uri_with_encode_flags
Definition: uri.c:5768
uri_builder_str_property expected_str_props[URI_STR_PROPERTY_COUNT]
Definition: uri.c:5772
uri_builder_dword_property expected_dword_props[URI_DWORD_PROPERTY_COUNT]
Definition: uri.c:5773
HRESULT uri_with_hres
Definition: uri.c:5769
BOOL uri_with_todo
Definition: uri.c:5770
const char * uri
Definition: uri.c:5749
DWORD uri_flags
Definition: uri.c:5758
HRESULT uri_simple_hres
Definition: uri.c:5763
DWORD uri_with_builder_flags
Definition: uri.c:5767
HRESULT uri_hres
Definition: uri.c:5759
BOOL uri_simple_todo
Definition: uri.c:5764
uri_builder_port port_prop
Definition: uri.c:5756
HRESULT create_builder_expected
Definition: uri.c:5751
const char * broken_value
Definition: uri.c:6838
const char * value_ex
Definition: uri.c:6839
const char * value
Definition: uri.c:6835
DWORD combine_flags
Definition: uri.c:6847
const char * relative_uri
Definition: uri.c:6845
uri_combine_str_property str_props[URI_STR_PROPERTY_COUNT]
Definition: uri.c:6851
HRESULT expected
Definition: uri.c:6848
DWORD base_create_flags
Definition: uri.c:6844
DWORD relative_create_flags
Definition: uri.c:6846
uri_dword_property dword_props[URI_DWORD_PROPERTY_COUNT]
Definition: uri.c:6852
const char * base_uri
Definition: uri.c:6843
HRESULT expected
Definition: uri.c:101
HRESULT expected
Definition: uri.c:124
BOOL broken_combine_hres
Definition: uri.c:126
BOOL todo
Definition: uri.c:5554
BOOL equal
Definition: uri.c:5553
const char * a
Definition: uri.c:5549
const char * b
Definition: uri.c:5551
DWORD create_flags_a
Definition: uri.c:5550
DWORD create_flags_b
Definition: uri.c:5552
DWORD flags
Definition: uri.c:8046
BOOL todo
Definition: uri.c:8049
const char * property
Definition: uri.c:8047
const char * property2
Definition: uri.c:8050
HRESULT expected
Definition: uri.c:8048
DWORD uri_flags
Definition: uri.c:8044
PARSEACTION action
Definition: uri.c:8045
const char * uri
Definition: uri.c:8043
DWORD create_flags
Definition: uri.c:131
DWORD flags
Definition: uri.c:134
uri_str_property str_props[URI_STR_PROPERTY_COUNT]
Definition: uri.c:136
uri_dword_property dword_props[URI_DWORD_PROPERTY_COUNT]
Definition: uri.c:137
HRESULT create_expected
Definition: uri.c:132
BOOL create_todo
Definition: uri.c:133
const char * uri
Definition: uri.c:130
HRESULT expected2
Definition: uri.c:119
const char * value
Definition: uri.c:114
const char * value2
Definition: uri.c:118
HRESULT expected
Definition: uri.c:115
const char * broken_value
Definition: uri.c:117
DWORD create_flags
Definition: uri.c:5691
HRESULT create_expected
Definition: uri.c:5692
BOOL expected_todo
Definition: uri.c:5696
BOOL create_todo
Definition: uri.c:5693
const char * fragment
Definition: uri.c:5690
const char * expected_uri
Definition: uri.c:5695
const char * uri
Definition: uri.c:5689
const char * base_url
Definition: uri.c:11588
const char * uri_url
Definition: uri.c:11593
const char * no_canon_url
Definition: uri.c:11592
DWORD base_uri_flags
Definition: uri.c:11589
const char * uniform_url
Definition: uri.c:11591
const char * legacy_url
Definition: uri.c:11590
const char * url
Definition: uri.c:11586
IUri IUri_iface
Definition: uri.c:8989
IUri * uri
Definition: uri.c:8990
char * value
Definition: compiler.c:67
Definition: main.c:439
Definition: parser.c:49
Definition: parse.h:23
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint16_t * LPWSTR
Definition: typedefs.h:56
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
Definition: umon.c:732
LONGLONG QuadPart
Definition: typedefs.h:114
Definition: pdh_main.c:96
static const WCHAR props[]
Definition: wbemdisp.c:288
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
#define INET_E_INVALID_URL
Definition: winerror.h:4652
#define E_UNEXPECTED
Definition: winerror.h:3528
#define E_POINTER
Definition: winerror.h:3480
#define INTERNET_MAX_URL_LENGTH
Definition: wininet.h:51