4 * Copyright 2010 Thomas Mullaly
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <wine/test.h>
27 #define WIN32_LEAN_AND_MEAN
36 #include <wine/heap.h>
38 DEFINE_GUID(CLSID_CUri
, 0xDF2FCE13, 0x25EC, 0x45BB, 0x9D,0x4C, 0xCE,0xCD,0x47,0xC2,0x43,0x0C);
40 #define URI_STR_PROPERTY_COUNT Uri_PROPERTY_STRING_LAST+1
41 #define URI_DWORD_PROPERTY_COUNT (Uri_PROPERTY_DWORD_LAST - Uri_PROPERTY_DWORD_START)+1
42 #define URI_BUILDER_STR_PROPERTY_COUNT 7
44 #define DEFINE_EXPECT(func) \
45 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
47 #define SET_EXPECT(func) \
48 expect_ ## func = TRUE
50 #define CHECK_EXPECT(func) \
52 ok(expect_ ##func, "unexpected call " #func "\n"); \
53 expect_ ## func = FALSE; \
54 called_ ## func = TRUE; \
57 #define CHECK_EXPECT2(func) \
59 ok(expect_ ##func, "unexpected call " #func "\n"); \
60 called_ ## func = TRUE; \
63 #define CHECK_CALLED(func) \
65 ok(called_ ## func, "expected " #func "\n"); \
66 expect_ ## func = called_ ## func = FALSE; \
69 DEFINE_EXPECT(CombineUrl
);
70 DEFINE_EXPECT(ParseUrl
);
72 static HRESULT (WINAPI
*pCreateUri
)(LPCWSTR
, DWORD
, DWORD_PTR
, IUri
**);
73 static HRESULT (WINAPI
*pCreateUriWithFragment
)(LPCWSTR
, LPCWSTR
, DWORD
, DWORD_PTR
, IUri
**);
74 static HRESULT (WINAPI
*pCreateIUriBuilder
)(IUri
*, DWORD
, DWORD_PTR
, IUriBuilder
**);
75 static HRESULT (WINAPI
*pCoInternetCombineIUri
)(IUri
*,IUri
*,DWORD
,IUri
**,DWORD_PTR
);
76 static HRESULT (WINAPI
*pCoInternetGetSession
)(DWORD
,IInternetSession
**,DWORD
);
77 static HRESULT (WINAPI
*pCoInternetCombineUrlEx
)(IUri
*,LPCWSTR
,DWORD
,IUri
**,DWORD_PTR
);
78 static HRESULT (WINAPI
*pCoInternetParseIUri
)(IUri
*,PARSEACTION
,DWORD
,LPWSTR
,DWORD
,DWORD
*,DWORD_PTR
);
79 static HRESULT (WINAPI
*pCreateURLMonikerEx
)(IMoniker
*,LPCWSTR
,IMoniker
**,DWORD
);
80 static HRESULT (WINAPI
*pCreateURLMonikerEx2
)(IMoniker
*,IUri
*,IMoniker
**,DWORD
);
82 static const WCHAR http_urlW
[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
83 '.','o','r','g','/',0};
84 static const WCHAR http_url_fragW
[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
85 '.','o','r','g','/','#','F','r','a','g',0};
87 static const WCHAR combine_baseW
[] = {'w','i','n','e','t','e','s','t',':','?','t',
88 'e','s','t','i','n','g',0};
89 static const WCHAR combine_relativeW
[] = {'?','t','e','s','t',0};
90 static const WCHAR combine_resultW
[] = {'z','i','p',':','t','e','s','t',0};
92 static const WCHAR winetestW
[] = {'w','i','n','e','t','e','s','t',0};
94 static const WCHAR parse_urlW
[] = {'w','i','n','e','t','e','s','t',':','t','e','s','t',0};
95 static const WCHAR parse_resultW
[] = {'z','i','p',':','t','e','s','t',0};
97 static PARSEACTION parse_action
;
98 static DWORD parse_flags
;
100 typedef struct _uri_create_flag_test
{
103 } uri_create_flag_test
;
105 static const uri_create_flag_test invalid_flag_tests
[] = {
106 /* Set of invalid flag combinations to test for. */
107 {Uri_CREATE_DECODE_EXTRA_INFO
| Uri_CREATE_NO_DECODE_EXTRA_INFO
, E_INVALIDARG
},
108 {Uri_CREATE_CANONICALIZE
| Uri_CREATE_NO_CANONICALIZE
, E_INVALIDARG
},
109 {Uri_CREATE_CRACK_UNKNOWN_SCHEMES
| Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
, E_INVALIDARG
},
110 {Uri_CREATE_PRE_PROCESS_HTML_URI
| Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, E_INVALIDARG
},
111 {Uri_CREATE_IE_SETTINGS
| Uri_CREATE_NO_IE_SETTINGS
, E_INVALIDARG
}
114 typedef struct _uri_str_property
{
118 const char* broken_value
;
123 typedef struct _uri_dword_property
{
127 BOOL broken_combine_hres
;
128 } uri_dword_property
;
130 typedef struct _uri_properties
{
133 HRESULT create_expected
;
136 uri_str_property str_props
[URI_STR_PROPERTY_COUNT
];
137 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
140 static const uri_properties uri_tests
[] = {
141 { "http://www.winehq.org/tests/../tests/../..", 0, S_OK
, FALSE
,
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 */
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 */
166 { "http://winehq.org/tests/.././tests", 0, S_OK
, FALSE
,
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
},
174 {"winehq.org",S_OK
,FALSE
},
176 {"/tests",S_OK
,FALSE
},
177 {"/tests",S_OK
,FALSE
},
179 {"http://winehq.org/tests/.././tests",S_OK
,FALSE
},
185 {Uri_HOST_DNS
,S_OK
,FALSE
},
187 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
188 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
191 { "HtTp://www.winehq.org/tests/..?query=x&return=y", 0, S_OK
, FALSE
,
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
},
199 {"www.winehq.org",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
},
210 {Uri_HOST_DNS
,S_OK
,FALSE
},
212 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
213 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
216 { "HtTpS://www.winehq.org/tests/..?query=x&return=y", 0, S_OK
, FALSE
,
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
},
224 {"www.winehq.org",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
},
235 {Uri_HOST_DNS
,S_OK
,FALSE
},
237 {URL_SCHEME_HTTPS
,S_OK
,FALSE
},
238 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
241 { "hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters", 0, S_OK
, FALSE
,
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
},
249 {"example.com",S_OK
,FALSE
},
251 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
252 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
254 {"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters",S_OK
,FALSE
},
256 {"usEr%3Ainfo",S_OK
,FALSE
},
257 {"usEr%3Ainfo",S_OK
,FALSE
}
260 {Uri_HOST_DNS
,S_OK
,FALSE
},
262 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
263 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
266 { "ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt", 0, S_OK
, FALSE
,
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
},
274 {"ftp.winehq.org",S_OK
,FALSE
},
276 {"/dir/foo%20bar.txt",S_OK
,FALSE
},
277 {"/dir/foo%20bar.txt",S_OK
,FALSE
},
279 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt",S_OK
,FALSE
},
281 {"winepass:wine",S_OK
,FALSE
},
282 {"winepass",S_OK
,FALSE
}
285 {Uri_HOST_DNS
,S_OK
,FALSE
},
287 {URL_SCHEME_FTP
,S_OK
,FALSE
},
288 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
291 { "file://c:\\tests\\../tests/foo%20bar.mp3", 0, S_OK
, FALSE
,
293 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
295 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
301 {"/c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
302 {"/c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
304 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK
,FALSE
},
310 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
312 {URL_SCHEME_FILE
,S_OK
,FALSE
},
313 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
316 { "file://c:\\tests\\../tests/foo%20bar.mp3", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
318 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
320 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
326 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
327 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
329 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK
,FALSE
},
335 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
337 {URL_SCHEME_FILE
,S_OK
,FALSE
},
338 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
341 { "FILE://localhost/test dir\\../tests/test%20file.README.txt", 0, S_OK
, FALSE
,
343 {"file:///tests/test%20file.README.txt",S_OK
,FALSE
},
345 {"file:///tests/test%20file.README.txt",S_OK
,FALSE
},
351 {"/tests/test%20file.README.txt",S_OK
,FALSE
},
352 {"/tests/test%20file.README.txt",S_OK
,FALSE
},
354 {"FILE://localhost/test dir\\../tests/test%20file.README.txt",S_OK
,FALSE
},
360 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
362 {URL_SCHEME_FILE
,S_OK
,FALSE
},
363 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
366 { "file:///z:/test dir/README.txt", 0, S_OK
, FALSE
,
368 {"file:///z:/test%20dir/README.txt",S_OK
},
370 {"file:///z:/test%20dir/README.txt",S_OK
},
376 {"/z:/test%20dir/README.txt",S_OK
},
377 {"/z:/test%20dir/README.txt",S_OK
},
379 {"file:///z:/test dir/README.txt",S_OK
},
385 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
387 {URL_SCHEME_FILE
,S_OK
,FALSE
},
388 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
391 { "file:///z:/test dir/README.txt#hash part", 0, S_OK
, FALSE
,
393 {"file:///z:/test%20dir/README.txt#hash%20part",S_OK
},
395 {"file:///z:/test%20dir/README.txt#hash%20part",S_OK
},
397 {".txt#hash%20part",S_OK
},
401 {"/z:/test%20dir/README.txt#hash%20part",S_OK
},
402 {"/z:/test%20dir/README.txt#hash%20part",S_OK
},
404 {"file:///z:/test dir/README.txt#hash part",S_OK
},
410 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
412 {URL_SCHEME_FILE
,S_OK
,FALSE
},
413 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
416 { "urn:nothing:should:happen here", 0, S_OK
, FALSE
,
418 {"urn:nothing:should:happen here",S_OK
,FALSE
},
420 {"urn:nothing:should:happen here",S_OK
,FALSE
},
426 {"nothing:should:happen here",S_OK
,FALSE
},
427 {"nothing:should:happen here",S_OK
,FALSE
},
429 {"urn:nothing:should:happen here",S_OK
,FALSE
},
435 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
437 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
438 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
441 { "http://127.0.0.1/tests/../test dir/./test.txt", 0, S_OK
, FALSE
,
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
},
449 {"127.0.0.1",S_OK
,FALSE
},
451 {"/test%20dir/test.txt",S_OK
,FALSE
},
452 {"/test%20dir/test.txt",S_OK
,FALSE
},
454 {"http://127.0.0.1/tests/../test dir/./test.txt",S_OK
,FALSE
},
460 {Uri_HOST_IPV4
,S_OK
,FALSE
},
462 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
463 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
466 { "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", 0, S_OK
, FALSE
,
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
},
474 {"fedc:ba98:7654:3210:fedc:ba98:7654:3210",S_OK
,FALSE
},
479 {"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]",S_OK
,FALSE
},
485 {Uri_HOST_IPV6
,S_OK
,FALSE
},
487 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
488 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
491 { "ftp://[::13.1.68.3]", 0, S_OK
, FALSE
,
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
},
499 {"::13.1.68.3",S_OK
,FALSE
},
504 {"ftp://[::13.1.68.3]",S_OK
,FALSE
},
510 {Uri_HOST_IPV6
,S_OK
,FALSE
},
512 {URL_SCHEME_FTP
,S_OK
,FALSE
},
513 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
516 { "http://[FEDC:BA98:0:0:0:0:0:3210]", 0, S_OK
, FALSE
,
518 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
519 {"[fedc:ba98::3210]",S_OK
,FALSE
},
520 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
524 {"fedc:ba98::3210",S_OK
,FALSE
},
529 {"http://[FEDC:BA98:0:0:0:0:0:3210]",S_OK
,FALSE
},
535 {Uri_HOST_IPV6
,S_OK
,FALSE
},
537 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
538 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
541 { "1234://www.winehq.org", 0, S_OK
, FALSE
,
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
},
549 {"www.winehq.org",S_OK
,FALSE
},
554 {"1234://www.winehq.org",S_OK
,FALSE
},
560 {Uri_HOST_DNS
,S_OK
,FALSE
},
562 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
563 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
569 {"file:///C:/test/test.mp3",S_OK
,FALSE
},
571 {"file:///C:/test/test.mp3",S_OK
,FALSE
},
577 {"/C:/test/test.mp3",S_OK
,FALSE
},
578 {"/C:/test/test.mp3",S_OK
,FALSE
},
580 {"C:/test/test.mp3",S_OK
,FALSE
},
586 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
588 {URL_SCHEME_FILE
,S_OK
,FALSE
},
589 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
595 {"file://server/test.mp3",S_OK
,FALSE
},
596 {"server",S_OK
,FALSE
},
597 {"file://server/test.mp3",S_OK
,FALSE
},
601 {"server",S_OK
,FALSE
},
603 {"/test.mp3",S_OK
,FALSE
},
604 {"/test.mp3",S_OK
,FALSE
},
606 {"\\\\Server/test.mp3",S_OK
,FALSE
},
612 {Uri_HOST_DNS
,S_OK
,FALSE
},
614 {URL_SCHEME_FILE
,S_OK
,FALSE
},
615 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
620 {"file://C:\\test\\test.mp3#fragment|part",S_OK
,FALSE
},
622 {"file://C:\\test\\test.mp3#fragment|part",S_OK
,FALSE
},
624 {".mp3#fragment|part",S_OK
,FALSE
},
628 {"C:\\test\\test.mp3#fragment|part",S_OK
,FALSE
},
629 {"C:\\test\\test.mp3#fragment|part",S_OK
,FALSE
},
631 {"C:/test/test.mp3#fragment|part",S_OK
,FALSE
},
637 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
639 {URL_SCHEME_FILE
,S_OK
,FALSE
},
640 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
645 {"file://C:\\test\\test.mp3?query|part",S_OK
,FALSE
},
647 {"file://C:\\test\\test.mp3?query|part",S_OK
,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
},
662 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
664 {URL_SCHEME_FILE
,S_OK
,FALSE
},
665 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
670 {"file://C:\\test\\test.mp3?query|part#hash|part",S_OK
,FALSE
},
672 {"file://C:\\test\\test.mp3?query|part#hash|part",S_OK
,FALSE
},
675 {"#hash|part",S_OK
,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
},
687 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
689 {URL_SCHEME_FILE
,S_OK
,FALSE
},
690 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
693 { "www.winehq.org/test", Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
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
},
701 {"www.winehq.org",S_OK
,FALSE
},
703 {"/test",S_OK
,FALSE
},
704 {"/test",S_OK
,FALSE
},
706 {"www.winehq.org/test",S_OK
,FALSE
},
712 {Uri_HOST_DNS
,S_OK
,FALSE
},
714 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
715 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
718 /* Valid since the '*' is the only character in the scheme name. */
719 { "*:www.winehq.org/test", 0, S_OK
, FALSE
,
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
},
727 {"www.winehq.org",S_OK
,FALSE
},
729 {"/test",S_OK
,FALSE
},
730 {"/test",S_OK
,FALSE
},
732 {"*:www.winehq.org/test",S_OK
,FALSE
},
738 {Uri_HOST_DNS
,S_OK
,FALSE
},
740 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
741 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
744 { "/../some dir/test.ext", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
746 {"/../some dir/test.ext",S_OK
,FALSE
},
748 {"/../some dir/test.ext",S_OK
,FALSE
},
754 {"/../some dir/test.ext",S_OK
,FALSE
},
755 {"/../some dir/test.ext",S_OK
,FALSE
},
757 {"/../some dir/test.ext",S_OK
,FALSE
},
763 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
765 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
766 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
769 { "//implicit/wildcard/uri scheme", Uri_CREATE_ALLOW_RELATIVE
|Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
771 {"*://implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
773 {"*://implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
779 {"//implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
780 {"//implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
782 {"//implicit/wildcard/uri scheme",S_OK
,FALSE
},
788 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
790 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
791 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
797 {"zip:/.//google.com",S_OK
,FALSE
},
799 {"zip:/.//google.com",S_OK
,FALSE
},
805 {"/.//google.com",S_OK
,FALSE
},
806 {"/.//google.com",S_OK
,FALSE
},
808 {"zip://google.com",S_OK
,FALSE
},
814 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
816 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
817 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
820 /* Windows uses the first occurrence of ':' to delimit the userinfo. */
821 { "ftp://user:pass:word@winehq.org/", 0, S_OK
, FALSE
,
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
},
829 {"winehq.org",S_OK
,FALSE
},
830 {"pass:word",S_OK
,FALSE
},
834 {"ftp://user:pass:word@winehq.org/",S_OK
,FALSE
},
836 {"user:pass:word",S_OK
,FALSE
},
840 {Uri_HOST_DNS
,S_OK
,FALSE
},
842 {URL_SCHEME_FTP
,S_OK
,FALSE
},
843 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
846 /* Make sure % encoded unreserved characters are decoded. */
847 { "ftp://w%49%4Ee:PA%53%53@ftp.google.com/", 0, S_OK
, FALSE
,
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
},
855 {"ftp.google.com",S_OK
,FALSE
},
860 {"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK
,FALSE
},
862 {"wINe:PASS",S_OK
,FALSE
},
866 {Uri_HOST_DNS
,S_OK
,FALSE
},
868 {URL_SCHEME_FTP
,S_OK
,FALSE
},
869 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
881 {"ftp.google.com",S_OK
,FALSE
},
882 {"PA%7B%7D",S_OK
,FALSE
},
886 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK
,FALSE
},
888 {"w%5D%5Be:PA%7B%7D",S_OK
,FALSE
},
889 {"w%5D%5Be",S_OK
,FALSE
}
892 {Uri_HOST_DNS
,S_OK
,FALSE
},
894 {URL_SCHEME_FTP
,S_OK
,FALSE
},
895 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
898 /* You're allowed to have an empty password portion in the userinfo section. */
899 { "ftp://empty:@ftp.google.com/", 0, S_OK
, FALSE
,
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
},
907 {"ftp.google.com",S_OK
,FALSE
},
912 {"ftp://empty:@ftp.google.com/",S_OK
,FALSE
},
914 {"empty:",S_OK
,FALSE
},
918 {Uri_HOST_DNS
,S_OK
,FALSE
},
920 {URL_SCHEME_FTP
,S_OK
,FALSE
},
921 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
924 /* Make sure forbidden characters in "userinfo" get encoded. */
925 { "ftp://\" \"weird@ftp.google.com/", 0, S_OK
, FALSE
,
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
},
933 {"ftp.google.com",S_OK
,FALSE
},
938 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
940 {"%22%20%22weird",S_OK
,FALSE
},
941 {"%22%20%22weird",S_OK
,FALSE
}
944 {Uri_HOST_DNS
,S_OK
,FALSE
},
946 {URL_SCHEME_FTP
,S_OK
,FALSE
},
947 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
959 {"ftp.google.com",S_OK
,FALSE
},
964 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
966 {"\" \"weird",S_OK
,FALSE
},
967 {"\" \"weird",S_OK
,FALSE
}
970 {Uri_HOST_DNS
,S_OK
,FALSE
},
972 {URL_SCHEME_FTP
,S_OK
,FALSE
},
973 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
985 {"ftp.google.com",S_OK
,FALSE
},
987 {"/\"%20\"weird",S_OK
,FALSE
},
988 {"/\"%20\"weird",S_OK
,FALSE
},
990 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK
,FALSE
},
992 {"\"%20\"weird",S_OK
,FALSE
},
993 {"\"%20\"weird",S_OK
,FALSE
}
996 {Uri_HOST_DNS
,S_OK
,FALSE
},
998 {URL_SCHEME_FTP
,S_OK
,FALSE
},
999 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1002 /* Allowed to have invalid % encoded because it's an unknown scheme type. */
1003 { "zip://%xy:word@winehq.org/", 0, S_OK
, FALSE
,
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
},
1011 {"winehq.org",S_OK
,FALSE
},
1012 {"word",S_OK
,FALSE
},
1016 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
1018 {"%xy:word",S_OK
,FALSE
},
1022 {Uri_HOST_DNS
,S_OK
,FALSE
},
1024 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1025 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1028 /* Unreserved, percent encoded characters aren't decoded in the userinfo because the scheme
1031 { "zip://%2E:%52%53ord@winehq.org/", 0, S_OK
, FALSE
,
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
},
1039 {"winehq.org",S_OK
,FALSE
},
1040 {"%52%53ord",S_OK
,FALSE
},
1044 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
1046 {"%2E:%52%53ord",S_OK
,FALSE
},
1050 {Uri_HOST_DNS
,S_OK
,FALSE
},
1052 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1053 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1056 { "ftp://[](),'test':word@winehq.org/", 0, S_OK
, FALSE
,
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
},
1064 {"winehq.org",S_OK
,FALSE
},
1065 {"word",S_OK
,FALSE
},
1069 {"ftp://[](),'test':word@winehq.org/",S_OK
,FALSE
},
1071 {"[](),'test':word",S_OK
,FALSE
},
1072 {"[](),'test'",S_OK
,FALSE
}
1075 {Uri_HOST_DNS
,S_OK
,FALSE
},
1077 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1078 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1081 { "ftp://test?:word@winehq.org/", 0, S_OK
, FALSE
,
1083 {"ftp://test/?:word@winehq.org/",S_OK
,FALSE
},
1084 {"test",S_OK
,FALSE
},
1085 {"ftp://test/?:word@winehq.org/",S_OK
,FALSE
},
1089 {"test",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
},
1100 {Uri_HOST_DNS
,S_OK
,FALSE
},
1102 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1103 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1106 { "ftp://test#:word@winehq.org/", 0, S_OK
, FALSE
,
1108 {"ftp://test/#:word@winehq.org/",S_OK
,FALSE
},
1109 {"test",S_OK
,FALSE
},
1110 {"ftp://test/#:word@winehq.org/",S_OK
,FALSE
},
1113 {"#:word@winehq.org/",S_OK
,FALSE
},
1114 {"test",S_OK
,FALSE
},
1119 {"ftp://test#:word@winehq.org/",S_OK
,FALSE
},
1125 {Uri_HOST_DNS
,S_OK
,FALSE
},
1127 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1128 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
1140 {"winehq.org",S_OK
,FALSE
},
1141 {"word",S_OK
,FALSE
},
1145 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1147 {"test\\:word",S_OK
,FALSE
},
1148 {"test\\",S_OK
,FALSE
}
1151 {Uri_HOST_DNS
,S_OK
,FALSE
},
1153 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1154 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1157 /* It normalizes IPv4 addresses correctly. */
1158 { "http://127.000.000.100/", 0, S_OK
, FALSE
,
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
},
1166 {"127.0.0.100",S_OK
,FALSE
},
1171 {"http://127.000.000.100/",S_OK
,FALSE
},
1172 {"http",S_OK
,FALSE
},
1177 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1179 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1180 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1183 { "http://127.0.0.1:8000", 0, S_OK
, FALSE
,
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
},
1196 {"http://127.0.0.1:8000",S_OK
},
1202 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1204 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1205 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1208 /* Make sure it normalizes partial IPv4 addresses correctly. */
1209 { "http://127.0/", 0, S_OK
, FALSE
,
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
},
1217 {"127.0.0.0",S_OK
,FALSE
},
1222 {"http://127.0/",S_OK
,FALSE
},
1223 {"http",S_OK
,FALSE
},
1228 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1230 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1231 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1234 /* Make sure it converts implicit IPv4's correctly. */
1235 { "http://123456/", 0, S_OK
, FALSE
,
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
},
1243 {"0.1.226.64",S_OK
,FALSE
},
1248 {"http://123456/",S_OK
,FALSE
},
1249 {"http",S_OK
,FALSE
},
1254 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1256 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1257 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1261 { "http://4294967295/", 0, S_OK
, FALSE
,
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
},
1269 {"255.255.255.255",S_OK
,FALSE
},
1274 {"http://4294967295/",S_OK
,FALSE
},
1275 {"http",S_OK
,FALSE
},
1280 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1282 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1283 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1287 { "http://4294967296/", 0, S_OK
, FALSE
,
1289 {"http://4294967296/",S_OK
,FALSE
},
1290 {"4294967296",S_OK
,FALSE
},
1291 {"http://4294967296/",S_OK
,FALSE
},
1295 {"4294967296",S_OK
,FALSE
},
1300 {"http://4294967296/",S_OK
,FALSE
},
1301 {"http",S_OK
,FALSE
},
1306 {Uri_HOST_DNS
,S_OK
,FALSE
},
1308 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1309 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1312 /* Window's doesn't normalize IP address for unknown schemes. */
1313 { "1234://4294967295/", 0, S_OK
, FALSE
,
1315 {"1234://4294967295/",S_OK
,FALSE
},
1316 {"4294967295",S_OK
,FALSE
},
1317 {"1234://4294967295/",S_OK
,FALSE
},
1321 {"4294967295",S_OK
,FALSE
},
1326 {"1234://4294967295/",S_OK
,FALSE
},
1327 {"1234",S_OK
,FALSE
},
1332 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1334 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1335 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1338 /* Window's doesn't normalize IP address for unknown schemes. */
1339 { "1234://127.001/", 0, S_OK
, FALSE
,
1341 {"1234://127.001/",S_OK
,FALSE
},
1342 {"127.001",S_OK
,FALSE
},
1343 {"1234://127.001/",S_OK
,FALSE
},
1347 {"127.001",S_OK
,FALSE
},
1352 {"1234://127.001/",S_OK
,FALSE
},
1353 {"1234",S_OK
,FALSE
},
1358 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1360 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1361 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1364 { "http://[FEDC:BA98::3210]", 0, S_OK
, FALSE
,
1366 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
1367 {"[fedc:ba98::3210]",S_OK
,FALSE
},
1368 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
1372 {"fedc:ba98::3210",S_OK
,FALSE
},
1377 {"http://[FEDC:BA98::3210]",S_OK
,FALSE
},
1378 {"http",S_OK
,FALSE
},
1383 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1385 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1386 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1389 { "http://[::]", 0, S_OK
, FALSE
,
1391 {"http://[::]/",S_OK
,FALSE
},
1392 {"[::]",S_OK
,FALSE
},
1393 {"http://[::]/",S_OK
,FALSE
},
1402 {"http://[::]",S_OK
,FALSE
},
1403 {"http",S_OK
,FALSE
},
1408 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1410 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1411 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1414 { "http://[FEDC:BA98::]", 0, S_OK
, FALSE
,
1416 {"http://[fedc:ba98::]/",S_OK
,FALSE
},
1417 {"[fedc:ba98::]",S_OK
,FALSE
},
1418 {"http://[fedc:ba98::]/",S_OK
,FALSE
},
1422 {"fedc:ba98::",S_OK
,FALSE
},
1427 {"http://[FEDC:BA98::]",S_OK
,FALSE
},
1428 {"http",S_OK
,FALSE
},
1433 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1435 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1436 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
1448 {"1:0:3:4:5:6:7:8",S_OK
,FALSE
},
1453 {"http://[1::3:4:5:6:7:8]",S_OK
,FALSE
},
1454 {"http",S_OK
,FALSE
},
1459 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1461 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1462 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1465 { "http://[v2.34]/", 0, S_OK
, FALSE
,
1467 {"http://[v2.34]/",S_OK
,FALSE
},
1468 {"[v2.34]",S_OK
,FALSE
},
1469 {"http://[v2.34]/",S_OK
,FALSE
},
1473 {"[v2.34]",S_OK
,FALSE
},
1478 {"http://[v2.34]/",S_OK
,FALSE
},
1479 {"http",S_OK
,FALSE
},
1484 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
1486 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1487 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1490 /* Windows ignores ':' if they appear after a '[' on a non-IPLiteral host. */
1491 { "http://[xyz:12345.com/test", 0, S_OK
, FALSE
,
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
},
1499 {"[xyz:12345.com",S_OK
,FALSE
},
1501 {"/test",S_OK
,FALSE
},
1502 {"/test",S_OK
,FALSE
},
1504 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1505 {"http",S_OK
,FALSE
},
1510 {Uri_HOST_DNS
,S_OK
,FALSE
},
1512 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1513 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1516 /* Valid URI since the '[' and ']' don't appear at the beginning and end
1517 * of the host name (respectively).
1519 { "ftp://www.[works].com/", 0, S_OK
, FALSE
,
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
},
1527 {"www.[works].com",S_OK
,FALSE
},
1532 {"ftp://www.[works].com/",S_OK
,FALSE
},
1538 {Uri_HOST_DNS
,S_OK
,FALSE
},
1540 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1541 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1544 /* Considers ':' a delimiter since it appears after the ']'. */
1545 { "http://www.google.com]:12345/", 0, S_OK
, FALSE
,
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
},
1553 {"www.google.com]",S_OK
,FALSE
},
1558 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1559 {"http",S_OK
,FALSE
},
1564 {Uri_HOST_DNS
,S_OK
,FALSE
},
1566 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1567 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1570 /* Unknown scheme types can have invalid % encoded data in the hostname. */
1571 { "zip://w%XXw%GEw.google.com/", 0, S_OK
, FALSE
,
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
},
1579 {"w%XXw%GEw.google.com",S_OK
,FALSE
},
1584 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1590 {Uri_HOST_DNS
,S_OK
,FALSE
},
1592 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1593 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1596 /* Unknown scheme types hostname doesn't get lower cased. */
1597 { "zip://GOOGLE.com/", 0, S_OK
, FALSE
,
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
},
1605 {"GOOGLE.com",S_OK
,FALSE
},
1610 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1616 {Uri_HOST_DNS
,S_OK
,FALSE
},
1618 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1619 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1622 /* Hostname gets lower-cased for known scheme types. */
1623 { "http://WWW.GOOGLE.com/", 0, S_OK
, FALSE
,
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
},
1631 {"www.google.com",S_OK
,FALSE
},
1636 {"http://WWW.GOOGLE.com/",S_OK
,FALSE
},
1637 {"http",S_OK
,FALSE
},
1642 {Uri_HOST_DNS
,S_OK
,FALSE
},
1644 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1645 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1648 /* Characters that get % encoded in the hostname also have their percent
1649 * encoded forms lower cased.
1651 { "http://www.%7Cgoogle|.com/", 0, S_OK
, FALSE
,
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
},
1659 {"www.%7cgoogle%7c.com",S_OK
,FALSE
},
1664 {"http://www.%7Cgoogle|.com/",S_OK
,FALSE
},
1665 {"http",S_OK
,FALSE
},
1670 {Uri_HOST_DNS
,S_OK
,FALSE
},
1672 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1673 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
1685 {"1:2:3:4:5:6::",S_OK
,FALSE
},
1690 {"http://[1:2:3:4:5:6:0.0.0.0]",S_OK
,FALSE
},
1691 {"http",S_OK
,FALSE
},
1696 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1698 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1699 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1702 /* IPv4 addresses get normalized. */
1703 { "http://[::001.002.003.000]", 0, S_OK
, FALSE
,
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
},
1711 {"::1.2.3.0",S_OK
,FALSE
},
1716 {"http://[::001.002.003.000]",S_OK
,FALSE
},
1717 {"http",S_OK
,FALSE
},
1722 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1724 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1725 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1728 { "http://[::5efe:1.2.3.4]", 0, S_OK
, FALSE
,
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
},
1736 {"::5efe:1.2.3.4",S_OK
,FALSE
},
1741 {"http://[::5efe:1.2.3.4]",S_OK
,FALSE
},
1742 {"http",S_OK
,FALSE
},
1747 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1749 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1750 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
1762 {"0001:0:000:0004:0005:0006:001.002.003.000",S_OK
,FALSE
},
1767 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK
,FALSE
},
1773 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1775 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1776 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1779 /* IPv4 address is converted into 2 h16 components. */
1780 { "http://[ffff::192.222.111.32]", 0, S_OK
, FALSE
,
1782 {"http://[ffff::c0de:6f20]/",S_OK
,FALSE
},
1783 {"[ffff::c0de:6f20]",S_OK
,FALSE
},
1784 {"http://[ffff::c0de:6f20]/",S_OK
,FALSE
},
1788 {"ffff::c0de:6f20",S_OK
,FALSE
},
1793 {"http://[ffff::192.222.111.32]",S_OK
,FALSE
},
1794 {"http",S_OK
,FALSE
},
1799 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1801 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1802 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1805 /* Max value for a port. */
1806 { "http://google.com:65535", 0, S_OK
, FALSE
,
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
},
1814 {"google.com",S_OK
,FALSE
},
1819 {"http://google.com:65535",S_OK
,FALSE
},
1820 {"http",S_OK
,FALSE
},
1825 {Uri_HOST_DNS
,S_OK
,FALSE
},
1827 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1828 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1831 { "zip://google.com:65536", 0, S_OK
, FALSE
,
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
},
1839 {"google.com:65536",S_OK
,FALSE
},
1844 {"zip://google.com:65536",S_OK
,FALSE
},
1850 {Uri_HOST_DNS
,S_OK
,FALSE
},
1852 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1853 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1856 { "zip://google.com:65536:25", 0, S_OK
, FALSE
,
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
},
1864 {"google.com:65536:25",S_OK
,FALSE
},
1869 {"zip://google.com:65536:25",S_OK
,FALSE
},
1875 {Uri_HOST_DNS
,S_OK
,FALSE
},
1877 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1878 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1881 { "zip://[::ffff]:abcd", 0, S_OK
, FALSE
,
1883 {"zip://[::ffff]:abcd/",S_OK
,FALSE
},
1884 {"[::ffff]:abcd",S_OK
,FALSE
},
1885 {"zip://[::ffff]:abcd/",S_OK
,FALSE
},
1889 {"[::ffff]:abcd",S_OK
,FALSE
},
1894 {"zip://[::ffff]:abcd",S_OK
,FALSE
},
1900 {Uri_HOST_DNS
,S_OK
,FALSE
},
1902 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1903 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1906 { "zip://127.0.0.1:abcd", 0, S_OK
, FALSE
,
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
},
1914 {"127.0.0.1:abcd",S_OK
,FALSE
},
1919 {"zip://127.0.0.1:abcd",S_OK
,FALSE
},
1925 {Uri_HOST_DNS
,S_OK
,FALSE
},
1927 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1928 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1931 /* Port is just copied over. */
1932 { "http://google.com:00035", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
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
},
1940 {"google.com",S_OK
,FALSE
},
1945 {"http://google.com:00035",S_OK
,FALSE
},
1946 {"http",S_OK
,FALSE
},
1951 {Uri_HOST_DNS
,S_OK
,FALSE
},
1953 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1954 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1957 /* Default port is copied over. */
1958 { "http://google.com:80", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
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
},
1966 {"google.com",S_OK
,FALSE
},
1971 {"http://google.com:80",S_OK
,FALSE
},
1972 {"http",S_OK
,FALSE
},
1977 {Uri_HOST_DNS
,S_OK
,FALSE
},
1979 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1980 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1983 { "http://google.com.uk", 0, S_OK
, FALSE
,
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 */
1991 {"google.com.uk",S_OK
,FALSE
},
1996 {"http://google.com.uk",S_OK
,FALSE
},
1997 {"http",S_OK
,FALSE
},
2002 {Uri_HOST_DNS
,S_OK
,FALSE
},
2004 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2005 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2008 { "http://google.co.uk", 0, S_OK
, FALSE
,
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
},
2016 {"google.co.uk",S_OK
,FALSE
},
2021 {"http://google.co.uk",S_OK
,FALSE
},
2022 {"http",S_OK
,FALSE
},
2027 {Uri_HOST_DNS
,S_OK
,FALSE
},
2029 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2030 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2033 { "http://google.com.com", 0, S_OK
, FALSE
,
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
},
2041 {"google.com.com",S_OK
,FALSE
},
2046 {"http://google.com.com",S_OK
,FALSE
},
2047 {"http",S_OK
,FALSE
},
2052 {Uri_HOST_DNS
,S_OK
,FALSE
},
2054 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2055 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2058 { "http://google.uk.1", 0, S_OK
, FALSE
,
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
},
2066 {"google.uk.1",S_OK
,FALSE
},
2071 {"http://google.uk.1",S_OK
,FALSE
},
2072 {"http",S_OK
,FALSE
},
2077 {Uri_HOST_DNS
,S_OK
,FALSE
},
2079 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2080 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
2092 {"google.foo.uk",S_OK
,FALSE
},
2097 {"http://google.foo.uk",S_OK
,FALSE
},
2098 {"http",S_OK
,FALSE
},
2103 {Uri_HOST_DNS
,S_OK
,FALSE
},
2105 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2106 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2109 { "http://.com", 0, S_OK
, FALSE
,
2111 {"http://.com/",S_OK
,FALSE
},
2112 {".com",S_OK
,FALSE
},
2113 {"http://.com/",S_OK
,FALSE
},
2114 {".com",S_OK
,FALSE
},
2117 {".com",S_OK
,FALSE
},
2122 {"http://.com",S_OK
,FALSE
},
2123 {"http",S_OK
,FALSE
},
2128 {Uri_HOST_DNS
,S_OK
,FALSE
},
2130 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2131 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2134 { "http://.uk", 0, S_OK
, FALSE
,
2136 {"http://.uk/",S_OK
,FALSE
},
2138 {"http://.uk/",S_OK
,FALSE
},
2139 {"",S_FALSE
,FALSE
,NULL
,".uk",S_OK
},
2147 {"http://.uk",S_OK
,FALSE
},
2148 {"http",S_OK
,FALSE
},
2153 {Uri_HOST_DNS
,S_OK
,FALSE
},
2155 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2156 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2159 { "http://www.co.google.com.[]", 0, S_OK
, FALSE
,
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
},
2167 {"www.co.google.com.[]",S_OK
,FALSE
},
2172 {"http://www.co.google.com.[]",S_OK
,FALSE
},
2173 {"http",S_OK
,FALSE
},
2178 {Uri_HOST_DNS
,S_OK
,FALSE
},
2180 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2181 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2184 { "http://co.uk", 0, S_OK
, FALSE
,
2186 {"http://co.uk/",S_OK
,FALSE
},
2187 {"co.uk",S_OK
,FALSE
},
2188 {"http://co.uk/",S_OK
,FALSE
},
2192 {"co.uk",S_OK
,FALSE
},
2197 {"http://co.uk",S_OK
,FALSE
},
2198 {"http",S_OK
,FALSE
},
2203 {Uri_HOST_DNS
,S_OK
,FALSE
},
2205 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2206 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2209 { "http://www.co.google.us.test", 0, S_OK
, FALSE
,
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
},
2217 {"www.co.google.us.test",S_OK
,FALSE
},
2222 {"http://www.co.google.us.test",S_OK
,FALSE
},
2223 {"http",S_OK
,FALSE
},
2228 {Uri_HOST_DNS
,S_OK
,FALSE
},
2230 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2231 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2234 { "http://gov.uk", 0, S_OK
, FALSE
,
2236 {"http://gov.uk/",S_OK
,FALSE
},
2237 {"gov.uk",S_OK
,FALSE
},
2238 {"http://gov.uk/",S_OK
,FALSE
},
2242 {"gov.uk",S_OK
,FALSE
},
2247 {"http://gov.uk",S_OK
,FALSE
},
2248 {"http",S_OK
,FALSE
},
2253 {Uri_HOST_DNS
,S_OK
,FALSE
},
2255 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2256 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2259 { "zip://www.google.com\\test", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
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
},
2267 {"www.google.com\\test",S_OK
,FALSE
},
2272 {"zip://www.google.com\\test",S_OK
,FALSE
},
2278 {Uri_HOST_DNS
,S_OK
,FALSE
},
2280 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2281 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2284 { "urn:excepts:bad:%XY:encoded", 0, S_OK
, FALSE
,
2286 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2288 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2294 {"excepts:bad:%XY:encoded",S_OK
,FALSE
},
2295 {"excepts:bad:%XY:encoded",S_OK
,FALSE
},
2297 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2303 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2305 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2306 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2309 /* Since the original URI doesn't contain an extra '/' before the path no % encoded values
2310 * are decoded and all '%' are encoded.
2312 { "file://C:/te%3Es%2Et/tes%t.mp3", 0, S_OK
, FALSE
,
2314 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2316 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2318 {".mp3",S_OK
,FALSE
},
2322 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2323 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2325 {"file://C:/te%3Es%2Et/tes%t.mp3",S_OK
,FALSE
},
2326 {"file",S_OK
,FALSE
},
2331 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2333 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2334 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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.
2340 { "file:///C:/te%3Es%2Et/t%23es%t.mp3", 0, S_OK
, FALSE
,
2342 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2344 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2346 {".mp3",S_OK
,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
},
2353 {"file:///C:/te%3Es%2Et/t%23es%t.mp3",S_OK
,FALSE
},
2354 {"file",S_OK
,FALSE
},
2359 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2361 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2362 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
2374 {"::1.2.3.0",S_OK
,FALSE
},
2376 {"/%3F%23.T/test",S_OK
,FALSE
},
2377 {"/%3F%23.T/test",S_OK
,FALSE
},
2379 {"http://[::001.002.003.000]/%3F%23%2E%54/test",S_OK
,FALSE
},
2380 {"http",S_OK
,FALSE
},
2385 {Uri_HOST_IPV6
,S_OK
,FALSE
},
2387 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2388 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2391 /* Forbidden characters are always encoded for file URIs. */
2392 { "file:///C:/\"test\"/test.mp3", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2394 {"file:///C:/%22test%22/test.mp3",S_OK
,FALSE
},
2396 {"file:///C:/%22test%22/test.mp3",S_OK
,FALSE
},
2398 {".mp3",S_OK
,FALSE
},
2402 {"/C:/%22test%22/test.mp3",S_OK
,FALSE
},
2403 {"/C:/%22test%22/test.mp3",S_OK
,FALSE
},
2405 {"file:///C:/\"test\"/test.mp3",S_OK
,FALSE
},
2406 {"file",S_OK
,FALSE
},
2411 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2413 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2414 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2417 /* Forbidden characters are never encoded for unknown scheme types. */
2418 { "1234://4294967295/<|>\" test<|>", 0, S_OK
, FALSE
,
2420 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2421 {"4294967295",S_OK
,FALSE
},
2422 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2426 {"4294967295",S_OK
,FALSE
},
2428 {"/<|>\" test<|>",S_OK
,FALSE
},
2429 {"/<|>\" test<|>",S_OK
,FALSE
},
2431 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2432 {"1234",S_OK
,FALSE
},
2437 {Uri_HOST_IPV4
,S_OK
,FALSE
},
2439 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2440 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2443 /* Make sure forbidden characters are percent encoded. */
2444 { "http://gov.uk/<|> test<|>", 0, S_OK
, FALSE
,
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
},
2452 {"gov.uk",S_OK
,FALSE
},
2454 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2455 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2457 {"http://gov.uk/<|> test<|>",S_OK
,FALSE
},
2458 {"http",S_OK
,FALSE
},
2463 {Uri_HOST_DNS
,S_OK
,FALSE
},
2465 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2466 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2469 { "http://gov.uk/test/../test2/././../test3/.././././", 0, S_OK
, FALSE
,
2471 {"http://gov.uk/",S_OK
,FALSE
},
2472 {"gov.uk",S_OK
,FALSE
},
2473 {"http://gov.uk/",S_OK
,FALSE
},
2477 {"gov.uk",S_OK
,FALSE
},
2482 {"http://gov.uk/test/../test2/././../test3/.././././",S_OK
,FALSE
},
2483 {"http",S_OK
,FALSE
},
2488 {Uri_HOST_DNS
,S_OK
,FALSE
},
2490 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2491 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2494 { "http://gov.uk/test/test2/../../..", 0, S_OK
, FALSE
,
2496 {"http://gov.uk/",S_OK
,FALSE
},
2497 {"gov.uk",S_OK
,FALSE
},
2498 {"http://gov.uk/",S_OK
,FALSE
},
2502 {"gov.uk",S_OK
,FALSE
},
2507 {"http://gov.uk/test/test2/../../..",S_OK
,FALSE
},
2508 {"http",S_OK
,FALSE
},
2513 {Uri_HOST_DNS
,S_OK
,FALSE
},
2515 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2516 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2519 { "http://gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2521 {"http://gov.uk/",S_OK
,FALSE
},
2522 {"gov.uk",S_OK
,FALSE
},
2523 {"http://gov.uk/",S_OK
,FALSE
},
2527 {"gov.uk",S_OK
,FALSE
},
2532 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2533 {"http",S_OK
,FALSE
},
2538 {Uri_HOST_DNS
,S_OK
,FALSE
},
2540 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2541 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2544 { "file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3", 0, S_OK
, FALSE
,
2546 {"file:///c:/foo%2520bar.mp3",S_OK
,FALSE
},
2548 {"file:///c:/foo%2520bar.mp3",S_OK
,FALSE
},
2550 {".mp3",S_OK
,FALSE
},
2554 {"/c:/foo%2520bar.mp3",S_OK
,FALSE
},
2555 {"/c:/foo%2520bar.mp3",S_OK
,FALSE
},
2557 {"file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3",S_OK
,FALSE
},
2558 {"file",S_OK
,FALSE
},
2563 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2565 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2566 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2569 /* Dot removal happens for unknown scheme types. */
2570 { "zip://gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2572 {"zip://gov.uk/",S_OK
,FALSE
},
2573 {"gov.uk",S_OK
,FALSE
},
2574 {"zip://gov.uk/",S_OK
,FALSE
},
2578 {"gov.uk",S_OK
,FALSE
},
2583 {"zip://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2589 {Uri_HOST_DNS
,S_OK
,FALSE
},
2591 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2592 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2595 /* Dot removal doesn't happen if NO_CANONICALIZE is set. */
2596 { "http://gov.uk/test/test2/../../.", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2598 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2599 {"gov.uk",S_OK
,FALSE
},
2600 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2604 {"gov.uk",S_OK
,FALSE
},
2606 {"/test/test2/../../.",S_OK
,FALSE
},
2607 {"/test/test2/../../.",S_OK
,FALSE
},
2609 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2610 {"http",S_OK
,FALSE
},
2615 {Uri_HOST_DNS
,S_OK
,FALSE
},
2617 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2618 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2621 /* Dot removal doesn't happen for wildcard scheme types. */
2622 { "*:gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2624 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2625 {"gov.uk",S_OK
,FALSE
},
2626 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2630 {"gov.uk",S_OK
,FALSE
},
2632 {"/test/test2/../../.",S_OK
,FALSE
},
2633 {"/test/test2/../../.",S_OK
,FALSE
},
2635 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2641 {Uri_HOST_DNS
,S_OK
,FALSE
},
2643 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
2644 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2647 /* Forbidden characters are encoded for opaque known scheme types. */
2648 { "mailto:\"acco<|>unt@example.com\"", 0, S_OK
, FALSE
,
2650 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2652 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2654 {".com%22",S_OK
,FALSE
},
2658 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2659 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2661 {"mailto:\"acco<|>unt@example.com\"",S_OK
,FALSE
},
2662 {"mailto",S_OK
,FALSE
},
2667 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2669 {URL_SCHEME_MAILTO
,S_OK
,FALSE
},
2670 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2673 { "news:test.tes<|>t.com", 0, S_OK
, FALSE
,
2675 {"news:test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2677 {"news:test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2679 {".com",S_OK
,FALSE
},
2683 {"test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2684 {"test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2686 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2687 {"news",S_OK
,FALSE
},
2692 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2694 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2695 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2698 /* Don't encode forbidden characters. */
2699 { "news:test.tes<|>t.com", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2701 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2703 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2705 {".com",S_OK
,FALSE
},
2709 {"test.tes<|>t.com",S_OK
,FALSE
},
2710 {"test.tes<|>t.com",S_OK
,FALSE
},
2712 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2713 {"news",S_OK
,FALSE
},
2718 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2720 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2721 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2724 /* Forbidden characters aren't encoded for unknown, opaque URIs. */
2725 { "urn:test.tes<|>t.com", 0, S_OK
, FALSE
,
2727 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2729 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2731 {".com",S_OK
,FALSE
},
2735 {"test.tes<|>t.com",S_OK
,FALSE
},
2736 {"test.tes<|>t.com",S_OK
,FALSE
},
2738 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2744 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2746 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2747 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2750 /* Percent encoded unreserved characters are decoded for known opaque URIs. */
2751 { "news:test.%74%65%73%74.com", 0, S_OK
, FALSE
,
2753 {"news:test.test.com",S_OK
,FALSE
},
2755 {"news:test.test.com",S_OK
,FALSE
},
2757 {".com",S_OK
,FALSE
},
2761 {"test.test.com",S_OK
,FALSE
},
2762 {"test.test.com",S_OK
,FALSE
},
2764 {"news:test.%74%65%73%74.com",S_OK
,FALSE
},
2765 {"news",S_OK
,FALSE
},
2770 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2772 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2773 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
2779 {"news:test.test.com",S_OK
,FALSE
},
2781 {"news:test.test.com",S_OK
,FALSE
},
2783 {".com",S_OK
,FALSE
},
2787 {"test.test.com",S_OK
,FALSE
},
2788 {"test.test.com",S_OK
,FALSE
},
2790 {"news:test.%74%65%73%74.com",S_OK
,FALSE
},
2791 {"news",S_OK
,FALSE
},
2796 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2798 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2799 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2802 /* Percent encoded characters aren't decoded for unknown scheme types. */
2803 { "urn:test.%74%65%73%74.com", 0, S_OK
, FALSE
,
2805 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2807 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2809 {".com",S_OK
,FALSE
},
2813 {"test.%74%65%73%74.com",S_OK
,FALSE
},
2814 {"test.%74%65%73%74.com",S_OK
,FALSE
},
2816 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2822 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2824 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2825 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
2837 {"www.winehq.org",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
},
2848 {Uri_HOST_DNS
,S_OK
,FALSE
},
2850 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2851 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
2863 {"www.winehq.org",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
},
2874 {Uri_HOST_DNS
,S_OK
,FALSE
},
2876 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2877 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
2889 {"www.winehq.org",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
},
2900 {Uri_HOST_DNS
,S_OK
,FALSE
},
2902 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2903 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
2915 {"www.winehq.org",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
},
2926 {Uri_HOST_DNS
,S_OK
,FALSE
},
2928 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2929 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2932 /* Forbidden characters are encoded for known scheme types. */
2933 { "http://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK
, FALSE
,
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
},
2941 {"www.winehq.org",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
},
2952 {Uri_HOST_DNS
,S_OK
,FALSE
},
2954 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2955 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2958 /* Forbidden characters are not encoded for unknown scheme types. */
2959 { "zip://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK
, FALSE
,
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
},
2967 {"www.winehq.org",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
},
2978 {Uri_HOST_DNS
,S_OK
,FALSE
},
2980 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2981 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
2993 {"www.winehq.org",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
},
3004 {Uri_HOST_DNS
,S_OK
,FALSE
},
3006 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3007 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
3019 {"www.winehq.org",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
},
3030 {Uri_HOST_DNS
,S_OK
,FALSE
},
3032 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3033 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
3045 {"www.winehq.org",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
},
3056 {Uri_HOST_DNS
,S_OK
,FALSE
},
3058 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3059 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3062 { "http://www.winehq.org?query=12&return=y", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
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
},
3070 {"www.winehq.org",S_OK
,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
},
3081 {Uri_HOST_DNS
,S_OK
,FALSE
},
3083 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3084 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3087 /* Unknown scheme types can have invalid % encoded data in fragments. */
3088 { "zip://www.winehq.org/tests/#Te%xx", 0, S_OK
, FALSE
,
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
},
3095 {"#Te%xx",S_OK
,FALSE
},
3096 {"www.winehq.org",S_OK
,FALSE
},
3098 {"/tests/",S_OK
,FALSE
},
3099 {"/tests/",S_OK
,FALSE
},
3101 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
3107 {Uri_HOST_DNS
,S_OK
,FALSE
},
3109 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3110 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3113 /* Forbidden characters in fragment aren't encoded for unknown schemes. */
3114 { "zip://www.winehq.org/tests/#Te<|>", 0, S_OK
, FALSE
,
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
},
3121 {"#Te<|>",S_OK
,FALSE
},
3122 {"www.winehq.org",S_OK
,FALSE
},
3124 {"/tests/",S_OK
,FALSE
},
3125 {"/tests/",S_OK
,FALSE
},
3127 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3133 {Uri_HOST_DNS
,S_OK
,FALSE
},
3135 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3136 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3139 /* Forbidden characters in the fragment are percent encoded for known schemes. */
3140 { "http://www.winehq.org/tests/#Te<|>", 0, S_OK
, FALSE
,
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
},
3147 {"#Te%3C%7C%3E",S_OK
,FALSE
},
3148 {"www.winehq.org",S_OK
,FALSE
},
3150 {"/tests/",S_OK
,FALSE
},
3151 {"/tests/",S_OK
,FALSE
},
3153 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3154 {"http",S_OK
,FALSE
},
3159 {Uri_HOST_DNS
,S_OK
,FALSE
},
3161 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3162 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
3173 {"#Te<|>",S_OK
,FALSE
},
3174 {"www.winehq.org",S_OK
,FALSE
},
3176 {"/tests/",S_OK
,FALSE
},
3177 {"/tests/",S_OK
,FALSE
},
3179 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3180 {"http",S_OK
,FALSE
},
3185 {Uri_HOST_DNS
,S_OK
,FALSE
},
3187 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3188 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
3199 {"#Te<|>",S_OK
,FALSE
},
3200 {"www.winehq.org",S_OK
,FALSE
},
3202 {"/tests/",S_OK
,FALSE
},
3203 {"/tests/",S_OK
,FALSE
},
3205 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3206 {"http",S_OK
,FALSE
},
3211 {Uri_HOST_DNS
,S_OK
,FALSE
},
3213 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3214 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
3225 {"#Te%30%31%32",S_OK
,FALSE
},
3226 {"www.winehq.org",S_OK
,FALSE
},
3228 {"/tests/",S_OK
,FALSE
},
3229 {"/tests/",S_OK
,FALSE
},
3231 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3237 {Uri_HOST_DNS
,S_OK
,FALSE
},
3239 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3240 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3243 /* Percent encoded, unreserved characters are decoded for known schemes. */
3244 { "http://www.winehq.org/tests/#Te%30%31%32", 0, S_OK
, FALSE
,
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
},
3251 {"#Te012",S_OK
,FALSE
},
3252 {"www.winehq.org",S_OK
,FALSE
},
3254 {"/tests/",S_OK
,FALSE
},
3255 {"/tests/",S_OK
,FALSE
},
3257 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3258 {"http",S_OK
,FALSE
},
3263 {Uri_HOST_DNS
,S_OK
,FALSE
},
3265 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3266 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
3277 {"#Te012",S_OK
,FALSE
},
3278 {"www.winehq.org",S_OK
,FALSE
},
3280 {"/tests/",S_OK
,FALSE
},
3281 {"/tests/",S_OK
,FALSE
},
3283 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3284 {"http",S_OK
,FALSE
},
3289 {Uri_HOST_DNS
,S_OK
,FALSE
},
3291 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3292 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
3303 {"#Te%30%31%32",S_OK
,FALSE
},
3304 {"www.winehq.org",S_OK
,FALSE
},
3306 {"/tests/",S_OK
,FALSE
},
3307 {"/tests/",S_OK
,FALSE
},
3309 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3310 {"http",S_OK
,FALSE
},
3315 {Uri_HOST_DNS
,S_OK
,FALSE
},
3317 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3318 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3321 /* Leading/Trailing whitespace is removed. */
3322 { " http://google.com/ ", 0, S_OK
, FALSE
,
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
},
3330 {"google.com",S_OK
,FALSE
},
3335 {"http://google.com/",S_OK
,FALSE
},
3336 {"http",S_OK
,FALSE
},
3341 {Uri_HOST_DNS
,S_OK
,FALSE
},
3343 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3344 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3347 { "\t\t\r\nhttp\n://g\noogle.co\rm/\n\n\n", 0, S_OK
, FALSE
,
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
},
3355 {"google.com",S_OK
,FALSE
},
3360 {"http://google.com/",S_OK
,FALSE
},
3361 {"http",S_OK
,FALSE
},
3366 {Uri_HOST_DNS
,S_OK
,FALSE
},
3368 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3369 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3372 { "http://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
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
},
3380 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3382 {"/%0A%0A%0A",S_OK
,FALSE
},
3383 {"/%0A%0A%0A",S_OK
,FALSE
},
3385 {"http://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3386 {"http",S_OK
,FALSE
},
3391 {Uri_HOST_DNS
,S_OK
,FALSE
},
3393 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3394 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3397 { "zip://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
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
},
3405 {"g\noogle.co\rm",S_OK
,FALSE
},
3407 {"/\n\n\n",S_OK
,FALSE
},
3408 {"/\n\n\n",S_OK
,FALSE
},
3410 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3416 {Uri_HOST_DNS
,S_OK
,FALSE
},
3418 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3419 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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.
3425 { "file:index.html", 0, S_OK
, FALSE
,
3429 {"file:index.html",S_OK
,FALSE
},
3431 {".html",S_OK
,FALSE
},
3435 {"index.html",S_OK
,FALSE
},
3436 {"index.html",S_OK
,FALSE
},
3438 {"file:index.html",S_OK
,FALSE
},
3439 {"file",S_OK
,FALSE
},
3444 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3446 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3447 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
3455 {"http:test.com/index.html",S_OK
,FALSE
},
3457 {".html",S_OK
,FALSE
},
3461 {"test.com/index.html",S_OK
,FALSE
},
3462 {"test.com/index.html",S_OK
,FALSE
},
3464 {"http:test.com/index.html",S_OK
,FALSE
},
3465 {"http",S_OK
,FALSE
},
3470 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3472 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3473 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3476 { "ftp:test.com/index.html", 0, S_OK
, FALSE
,
3480 {"ftp:test.com/index.html",S_OK
,FALSE
},
3482 {".html",S_OK
,FALSE
},
3486 {"test.com/index.html",S_OK
,FALSE
},
3487 {"test.com/index.html",S_OK
,FALSE
},
3489 {"ftp:test.com/index.html",S_OK
,FALSE
},
3495 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3497 {URL_SCHEME_FTP
,S_OK
,FALSE
},
3498 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3501 { "file://C|/test.mp3", 0, S_OK
, FALSE
,
3503 {"file:///C:/test.mp3",S_OK
,FALSE
},
3505 {"file:///C:/test.mp3",S_OK
,FALSE
},
3507 {".mp3",S_OK
,FALSE
},
3511 {"/C:/test.mp3",S_OK
,FALSE
},
3512 {"/C:/test.mp3",S_OK
,FALSE
},
3514 {"file://C|/test.mp3",S_OK
,FALSE
},
3515 {"file",S_OK
,FALSE
},
3520 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3522 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3523 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3526 { "file:///C|/test.mp3", 0, S_OK
, FALSE
,
3528 {"file:///C:/test.mp3",S_OK
,FALSE
},
3530 {"file:///C:/test.mp3",S_OK
,FALSE
},
3532 {".mp3",S_OK
,FALSE
},
3536 {"/C:/test.mp3",S_OK
,FALSE
},
3537 {"/C:/test.mp3",S_OK
,FALSE
},
3539 {"file:///C|/test.mp3",S_OK
,FALSE
},
3540 {"file",S_OK
,FALSE
},
3545 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3547 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3548 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3551 /* Extra '/' isn't added before "c:" since USE_DOS_PATH is set and '/' are converted
3554 { "file://c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3556 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3558 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3560 {".html",S_OK
,FALSE
},
3564 {"c:\\dir\\index.html",S_OK
,FALSE
},
3565 {"c:\\dir\\index.html",S_OK
,FALSE
},
3567 {"file://c:/dir/index.html",S_OK
,FALSE
},
3568 {"file",S_OK
,FALSE
},
3573 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3575 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3576 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3579 /* Extra '/' after "file://" is removed. */
3580 { "file:///c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3582 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3584 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3586 {".html",S_OK
,FALSE
},
3590 {"c:\\dir\\index.html",S_OK
,FALSE
},
3591 {"c:\\dir\\index.html",S_OK
,FALSE
},
3593 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3594 {"file",S_OK
,FALSE
},
3599 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3601 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3602 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
3608 {"file://c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3610 {"file://c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3612 {".html",S_OK
,FALSE
},
3616 {"c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3617 {"c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3619 {"file:///c:/dir\\%%61%20%5Fname/file%2A.html",S_OK
,FALSE
},
3620 {"file",S_OK
,FALSE
},
3625 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3627 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3628 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3631 { "file://c|/dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3633 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3635 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3637 {".html",S_OK
,FALSE
},
3641 {"c:\\dir\\index.html",S_OK
,FALSE
},
3642 {"c:\\dir\\index.html",S_OK
,FALSE
},
3644 {"file://c|/dir\\index.html",S_OK
,FALSE
},
3645 {"file",S_OK
,FALSE
},
3650 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3652 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3653 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
3659 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3661 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3663 {".html",S_OK
,FALSE
},
3667 {"c:\\dir\\index.html",S_OK
,FALSE
},
3668 {"c:\\dir\\index.html",S_OK
,FALSE
},
3670 {"file:\\\\c:\\dir\\index.html",S_OK
,FALSE
},
3671 {"file",S_OK
,FALSE
},
3676 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3678 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3679 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3682 { "file:\\\\c:/dir/index.html", 0, S_OK
, FALSE
,
3684 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3686 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3688 {".html",S_OK
,FALSE
},
3692 {"/c:/dir/index.html",S_OK
,FALSE
},
3693 {"/c:/dir/index.html",S_OK
,FALSE
},
3695 {"file:\\\\c:/dir/index.html",S_OK
,FALSE
},
3696 {"file",S_OK
,FALSE
},
3701 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3703 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3704 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3707 { "http:\\\\google.com", 0, S_OK
, FALSE
,
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
},
3715 {"google.com",S_OK
,FALSE
},
3720 {"http:\\\\google.com",S_OK
,FALSE
},
3721 {"http",S_OK
,FALSE
},
3726 {Uri_HOST_DNS
,S_OK
,FALSE
},
3728 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3729 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3732 /* the "\\\\" aren't converted to "//" for unknown scheme types and it's considered opaque. */
3733 { "zip:\\\\google.com", 0, S_OK
, FALSE
,
3735 {"zip:\\\\google.com",S_OK
,FALSE
},
3737 {"zip:\\\\google.com",S_OK
,FALSE
},
3739 {".com",S_OK
,FALSE
},
3743 {"\\\\google.com",S_OK
,FALSE
},
3744 {"\\\\google.com",S_OK
,FALSE
},
3746 {"zip:\\\\google.com",S_OK
,FALSE
},
3752 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3754 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3755 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3758 /* Dot segments aren't removed. */
3759 { "file://c:\\dir\\../..\\./index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3761 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3763 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3765 {".html",S_OK
,FALSE
},
3769 {"c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3770 {"c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3772 {"file://c:\\dir\\../..\\./index.html",S_OK
,FALSE
},
3773 {"file",S_OK
,FALSE
},
3778 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3780 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3781 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3784 /* Forbidden characters aren't percent encoded. */
3785 { "file://c:\\dir\\i^|ndex.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3787 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3789 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3791 {".html",S_OK
,FALSE
},
3795 {"c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3796 {"c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3798 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3799 {"file",S_OK
,FALSE
},
3804 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3806 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3807 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3810 /* The '\' are still converted to '/' even though it's an opaque file URI. */
3811 { "file:c:\\dir\\../..\\index.html", 0, S_OK
, FALSE
,
3815 {"file:c:/dir/../../index.html",S_OK
,FALSE
},
3817 {".html",S_OK
,FALSE
},
3821 {"c:/dir/../../index.html",S_OK
,FALSE
},
3822 {"c:/dir/../../index.html",S_OK
,FALSE
},
3824 {"file:c:\\dir\\../..\\index.html",S_OK
,FALSE
},
3825 {"file",S_OK
,FALSE
},
3830 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3832 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3833 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
3841 {"file:c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3843 {".html",S_OK
,FALSE
},
3847 {"c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3848 {"c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3850 {"file:c:/dir\\../..\\index.html",S_OK
,FALSE
},
3851 {"file",S_OK
,FALSE
},
3856 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3858 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3859 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3862 /* Forbidden characters aren't percent encoded. */
3863 { "file:c:\\in^|dex.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3867 {"file:c:\\in^|dex.html",S_OK
,FALSE
},
3869 {".html",S_OK
,FALSE
},
3873 {"c:\\in^|dex.html",S_OK
,FALSE
},
3874 {"c:\\in^|dex.html",S_OK
,FALSE
},
3876 {"file:c:\\in^|dex.html",S_OK
,FALSE
},
3877 {"file",S_OK
,FALSE
},
3882 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3884 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3885 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3888 /* Doesn't have a UserName since the ':' appears at the beginning of the
3891 { "http://:password@gov.uk", 0, S_OK
, FALSE
,
3893 {"http://:password@gov.uk/",S_OK
,FALSE
},
3894 {":password@gov.uk",S_OK
,FALSE
},
3895 {"http://gov.uk/",S_OK
,FALSE
},
3899 {"gov.uk",S_OK
,FALSE
},
3900 {"password",S_OK
,FALSE
},
3904 {"http://:password@gov.uk",S_OK
,FALSE
},
3905 {"http",S_OK
,FALSE
},
3906 {":password",S_OK
,FALSE
},
3910 {Uri_HOST_DNS
,S_OK
,FALSE
},
3912 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3913 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3916 /* Has a UserName since the userinfo section doesn't contain a password. */
3917 { "http://@gov.uk", 0, S_OK
, FALSE
,
3919 {"http://gov.uk/",S_OK
,FALSE
,"http://@gov.uk/"},
3920 {"@gov.uk",S_OK
,FALSE
},
3921 {"http://gov.uk/",S_OK
,FALSE
},
3925 {"gov.uk",S_OK
,FALSE
},
3930 {"http://@gov.uk",S_OK
,FALSE
},
3931 {"http",S_OK
,FALSE
},
3936 {Uri_HOST_DNS
,S_OK
,FALSE
},
3938 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3939 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3942 /* ":@" not included in the absolute URI. */
3943 { "http://:@gov.uk", 0, S_OK
, FALSE
,
3945 {"http://gov.uk/",S_OK
,FALSE
,"http://:@gov.uk/"},
3946 {":@gov.uk",S_OK
,FALSE
},
3947 {"http://gov.uk/",S_OK
,FALSE
},
3951 {"gov.uk",S_OK
,FALSE
},
3956 {"http://:@gov.uk",S_OK
,FALSE
},
3957 {"http",S_OK
,FALSE
},
3962 {Uri_HOST_DNS
,S_OK
,FALSE
},
3964 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3965 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3968 /* '@' is included because it's an unknown scheme type. */
3969 { "zip://@gov.uk", 0, S_OK
, FALSE
,
3971 {"zip://@gov.uk/",S_OK
,FALSE
},
3972 {"@gov.uk",S_OK
,FALSE
},
3973 {"zip://@gov.uk/",S_OK
,FALSE
},
3977 {"gov.uk",S_OK
,FALSE
},
3982 {"zip://@gov.uk",S_OK
,FALSE
},
3988 {Uri_HOST_DNS
,S_OK
,FALSE
},
3990 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3991 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3994 /* ":@" are included because it's an unknown scheme type. */
3995 { "zip://:@gov.uk", 0, S_OK
, FALSE
,
3997 {"zip://:@gov.uk/",S_OK
,FALSE
},
3998 {":@gov.uk",S_OK
,FALSE
},
3999 {"zip://:@gov.uk/",S_OK
,FALSE
},
4003 {"gov.uk",S_OK
,FALSE
},
4008 {"zip://:@gov.uk",S_OK
,FALSE
},
4014 {Uri_HOST_DNS
,S_OK
,FALSE
},
4016 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4017 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4020 { "about:blank", 0, S_OK
, FALSE
,
4022 {"about:blank",S_OK
,FALSE
},
4024 {"about:blank",S_OK
,FALSE
},
4030 {"blank",S_OK
,FALSE
},
4031 {"blank",S_OK
,FALSE
},
4033 {"about:blank",S_OK
,FALSE
},
4034 {"about",S_OK
,FALSE
},
4039 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4041 {URL_SCHEME_ABOUT
,S_OK
,FALSE
},
4042 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4045 { "mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",0,S_OK
,FALSE
,
4047 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
4049 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
4051 {".htm",S_OK
,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
},
4058 {"mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
4064 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4066 {URL_SCHEME_MK
,S_OK
,FALSE
},
4067 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4070 { "mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",0,S_OK
,FALSE
,
4072 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
4074 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
4076 {".htm",S_OK
,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
},
4083 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
4089 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4091 {URL_SCHEME_MK
,S_OK
,FALSE
},
4092 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
4098 {"file://\\\\server\\dir\\index.html",S_OK
,FALSE
},
4099 {"server",S_OK
,FALSE
},
4100 {"file://\\\\server\\dir\\index.html",S_OK
,FALSE
},
4102 {".html",S_OK
,FALSE
},
4104 {"server",S_OK
,FALSE
},
4106 {"\\dir\\index.html",S_OK
,FALSE
},
4107 {"\\dir\\index.html",S_OK
,FALSE
},
4109 {"file://server/dir/index.html",S_OK
,FALSE
},
4110 {"file",S_OK
,FALSE
},
4115 {Uri_HOST_DNS
,S_OK
,FALSE
},
4117 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4118 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4121 /* When CreateUri generates an IUri, it still displays the default port in the
4124 { "http://google.com:80/", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
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
},
4132 {"google.com",S_OK
,FALSE
},
4137 {"http://google.com:80/",S_OK
,FALSE
},
4138 {"http",S_OK
,FALSE
},
4143 {Uri_HOST_DNS
,S_OK
,FALSE
},
4145 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
4146 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
4156 {".html",S_OK
,FALSE
},
4158 {"C:\\dir\\file.exe",S_OK
,FALSE
},
4160 {"/DATA/test.html",S_OK
,FALSE
},
4161 {"/DATA/test.html",S_OK
,FALSE
},
4163 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK
,FALSE
},
4169 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4171 {URL_SCHEME_RES
,S_OK
,FALSE
},
4172 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4175 /* Res URI can contain a '|' in the host name. */
4176 { "res://c:\\di|r\\file.exe/test", 0, S_OK
, FALSE
,
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
},
4184 {"c:\\di|r\\file.exe",S_OK
,FALSE
},
4186 {"/test",S_OK
,FALSE
},
4187 {"/test",S_OK
,FALSE
},
4189 {"res://c:\\di|r\\file.exe/test",S_OK
,FALSE
},
4195 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4197 {URL_SCHEME_RES
,S_OK
,FALSE
},
4198 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
4201 /* Res URIs can have invalid percent encoded values. */
4202 { "res://c:\\dir%xx\\file.exe/test", 0, S_OK
, FALSE
,
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
},
4210 {"c:\\dir%xx\\file.exe",S_OK
,FALSE
},
4212 {"/test",S_OK
,FALSE
},
4213 {"/test",S_OK
,FALSE
},
4215 {"res://c:\\dir%xx\\file.exe/test",S_OK
,FALSE
},
4221 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4223 {URL_SCHEME_RES
,S_OK
,FALSE
},
4224 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4227 /* Res doesn't get forbidden characters percent encoded in its path. */
4228 { "res://c:\\test/tes<|>t", 0, S_OK
, FALSE
,
4230 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4231 {"c:\\test",S_OK
,FALSE
},
4232 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4236 {"c:\\test",S_OK
,FALSE
},
4238 {"/tes<|>t",S_OK
,FALSE
},
4239 {"/tes<|>t",S_OK
,FALSE
},
4241 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4247 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4249 {URL_SCHEME_RES
,S_OK
,FALSE
},
4250 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4253 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK
, FALSE
,
4255 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4257 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4259 {".jpg",S_OK
,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
},
4266 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4272 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4274 {URL_SCHEME_MK
,S_OK
,FALSE
},
4275 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4278 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4280 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4282 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4284 {".jpg",S_OK
,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
},
4291 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4297 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4299 {URL_SCHEME_MK
,S_OK
,FALSE
},
4300 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4303 { "xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK
, FALSE
,
4305 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4307 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4309 {".jpg",S_OK
,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
},
4316 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4322 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4324 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4325 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4328 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg", 0, S_OK
, FALSE
,
4330 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4332 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4334 {".jpg",S_OK
,FALSE
},
4338 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4339 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4341 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg",S_OK
,FALSE
},
4347 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4349 {URL_SCHEME_MK
,S_OK
,FALSE
},
4350 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4353 { "mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg", 0, S_OK
, FALSE
,
4355 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4357 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4359 {".jpg",S_OK
,FALSE
},
4363 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4364 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4366 {"mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg",S_OK
,FALSE
},
4372 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4374 {URL_SCHEME_MK
,S_OK
,FALSE
},
4375 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4378 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg", 0, S_OK
, FALSE
,
4380 {"mk:images/xxx.jpg",S_OK
,FALSE
},
4382 {"mk:images/xxx.jpg",S_OK
,FALSE
},
4384 {".jpg",S_OK
,FALSE
},
4388 {"images/xxx.jpg",S_OK
,FALSE
},
4389 {"images/xxx.jpg",S_OK
,FALSE
},
4391 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg",S_OK
,FALSE
},
4397 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4399 {URL_SCHEME_MK
,S_OK
,FALSE
},
4400 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4403 { "", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4422 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4424 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4425 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4428 { " \t ", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4447 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4449 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4450 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4453 { "javascript:void", 0, S_OK
, FALSE
,
4455 {"javascript:void",S_OK
},
4457 {"javascript:void",S_OK
},
4466 {"javascript:void",S_OK
},
4467 {"javascript",S_OK
},
4472 {Uri_HOST_UNKNOWN
,S_OK
},
4474 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4475 {URLZONE_INVALID
,E_NOTIMPL
}
4478 { "javascript://undefined", 0, S_OK
, FALSE
,
4480 {"javascript://undefined",S_OK
},
4482 {"javascript://undefined",S_OK
},
4488 {"//undefined",S_OK
},
4489 {"//undefined",S_OK
},
4491 {"javascript://undefined",S_OK
},
4492 {"javascript",S_OK
},
4497 {Uri_HOST_UNKNOWN
,S_OK
},
4499 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4500 {URLZONE_INVALID
,E_NOTIMPL
}
4503 { "JavaSCript:escape('/\\?#?')", 0, S_OK
, FALSE
,
4505 {"javascript:escape('/\\?#?')",S_OK
},
4507 {"javascript:escape('/\\?#?')",S_OK
},
4513 {"escape('/\\?#?')",S_OK
},
4514 {"escape('/\\?#?')",S_OK
},
4516 {"JavaSCript:escape('/\\?#?')",S_OK
},
4517 {"javascript",S_OK
},
4522 {Uri_HOST_UNKNOWN
,S_OK
},
4524 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4525 {URLZONE_INVALID
,E_NOTIMPL
}
4528 { "*://google.com", 0, S_OK
, FALSE
,
4530 {"*:google.com/",S_OK
,FALSE
},
4531 {"google.com",S_OK
},
4532 {"*:google.com/",S_OK
,FALSE
},
4533 {"google.com",S_OK
,FALSE
},
4536 {"google.com",S_OK
,FALSE
},
4541 {"*://google.com",S_OK
,FALSE
},
4547 {Uri_HOST_DNS
,S_OK
,FALSE
},
4549 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
4550 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4553 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",0,S_OK
,FALSE
,
4555 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4557 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4563 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4564 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4566 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4572 {Uri_HOST_UNKNOWN
,S_OK
},
4574 {URL_SCHEME_MK
,S_OK
},
4575 {URLZONE_INVALID
,E_NOTIMPL
}
4578 { "gopher://test.winehq.org:151/file.txt",0,S_OK
,FALSE
,
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
},
4586 {"test.winehq.org",S_OK
},
4591 {"gopher://test.winehq.org:151/file.txt",S_OK
},
4597 {Uri_HOST_DNS
,S_OK
},
4599 {URL_SCHEME_GOPHER
,S_OK
},
4600 {URLZONE_INVALID
,E_NOTIMPL
}
4603 { "//host.com/path/file.txt?query", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4605 {"//host.com/path/file.txt?query",S_OK
},
4607 {"//host.com/path/file.txt?query",S_OK
},
4613 {"/path/file.txt",S_OK
},
4614 {"/path/file.txt?query",S_OK
},
4616 {"//host.com/path/file.txt?query",S_OK
},
4622 {Uri_HOST_DNS
,S_OK
},
4624 {URL_SCHEME_UNKNOWN
,S_OK
},
4625 {URLZONE_INVALID
,E_NOTIMPL
}
4628 { "//host/path/file.txt?query", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4630 {"//host/path/file.txt?query",S_OK
},
4632 {"//host/path/file.txt?query",S_OK
},
4638 {"/path/file.txt",S_OK
},
4639 {"/path/file.txt?query",S_OK
},
4641 {"//host/path/file.txt?query",S_OK
},
4647 {Uri_HOST_DNS
,S_OK
},
4649 {URL_SCHEME_UNKNOWN
,S_OK
},
4650 {URLZONE_INVALID
,E_NOTIMPL
}
4653 { "//host", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4672 {Uri_HOST_DNS
,S_OK
},
4674 {URL_SCHEME_UNKNOWN
,S_OK
},
4675 {URLZONE_INVALID
,E_NOTIMPL
}
4678 { "mailto://", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4691 {"mailto://",S_OK
,FALSE
,"mailto:"},
4697 {Uri_HOST_UNKNOWN
,S_OK
},
4699 {URL_SCHEME_MAILTO
,S_OK
},
4700 {URLZONE_INVALID
,E_NOTIMPL
}
4703 { "mailto://a@b.com", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4705 {"mailto:a@b.com",S_OK
},
4707 {"mailto:a@b.com",S_OK
},
4716 {"mailto://a@b.com",S_OK
,FALSE
,"mailto:a@b.com"},
4722 {Uri_HOST_UNKNOWN
,S_OK
},
4724 {URL_SCHEME_MAILTO
,S_OK
},
4725 {URLZONE_INVALID
,E_NOTIMPL
}
4728 { "c:\\test file.html", Uri_CREATE_FILE_USE_DOS_PATH
|Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4730 {"file://c:\\test file.html",S_OK
,FALSE
},
4732 {"file://c:\\test file.html",S_OK
,FALSE
},
4734 {".html",S_OK
,FALSE
},
4738 {"c:\\test file.html",S_OK
,FALSE
},
4739 {"c:\\test file.html",S_OK
,FALSE
},
4741 {"c:\\test file.html",S_OK
,FALSE
},
4742 {"file",S_OK
,FALSE
},
4747 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4749 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4750 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4753 { "c:\\test%20file.html", Uri_CREATE_FILE_USE_DOS_PATH
|Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4755 {"file://c:\\test%20file.html",S_OK
,FALSE
},
4757 {"file://c:\\test%20file.html",S_OK
,FALSE
},
4759 {".html",S_OK
,FALSE
},
4763 {"c:\\test%20file.html",S_OK
,FALSE
},
4764 {"c:\\test%20file.html",S_OK
,FALSE
},
4766 {"c:\\test%20file.html",S_OK
,FALSE
},
4767 {"file",S_OK
,FALSE
},
4772 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4774 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4775 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4778 { "c:\\test file.html", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4780 {"file:///c:/test%20file.html",S_OK
,FALSE
},
4782 {"file:///c:/test%20file.html",S_OK
,FALSE
},
4784 {".html",S_OK
,FALSE
},
4788 {"/c:/test%20file.html",S_OK
,FALSE
},
4789 {"/c:/test%20file.html",S_OK
,FALSE
},
4791 {"c:\\test file.html",S_OK
,FALSE
},
4792 {"file",S_OK
,FALSE
},
4797 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4799 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4800 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4803 { "c:\\test%20file.html", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4805 {"file:///c:/test%2520file.html",S_OK
,FALSE
},
4807 {"file:///c:/test%2520file.html",S_OK
,FALSE
},
4809 {".html",S_OK
,FALSE
},
4813 {"/c:/test%2520file.html",S_OK
,FALSE
},
4814 {"/c:/test%2520file.html",S_OK
,FALSE
},
4816 {"c:\\test%20file.html",S_OK
,FALSE
},
4817 {"file",S_OK
,FALSE
},
4822 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4824 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4825 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
4836 {".txt",S_OK
,FALSE
},
4838 {"127.0.0.1",S_OK
,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
},
4843 {"http://127.0.0.1/\xE6\xB5\x8B\xE8\xAF\x95/test.txt",S_OK
,FALSE
},
4844 {"http",S_OK
,FALSE
},
4849 {Uri_HOST_IPV4
,S_OK
,FALSE
},
4851 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
4852 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4855 { "file:\xE6\xB5\x8B\xE8\xAF\x95.html", 0, S_OK
, FALSE
,
4859 {"file:\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK
,FALSE
},
4861 {".html",S_OK
,FALSE
},
4865 {"\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK
,FALSE
},
4866 {"\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK
,FALSE
},
4868 {"file:\xE6\xB5\x8B\xE8\xAF\x95.html",S_OK
,FALSE
},
4869 {"file",S_OK
,FALSE
},
4874 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4876 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4877 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
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
},
4894 {"ftp://\xE6\xB5\x8B\xE8\xAF\x95:wine@ftp.winehq.org:9999/dir/foobar.txt",S_OK
,FALSE
},
4896 {"\xE6\xB5\x8B\xE8\xAF\x95:wine",S_OK
,FALSE
},
4897 {"\xE6\xB5\x8B\xE8\xAF\x95",S_OK
,FALSE
}
4900 {Uri_HOST_DNS
,S_OK
,FALSE
},
4902 {URL_SCHEME_FTP
,S_OK
,FALSE
},
4903 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
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
},
4920 {"ftp://winepass:\xE6\xB5\x8B\xE8\xAF\x95@ftp.winehq.org:9999/dir/foobar.txt",S_OK
,FALSE
},
4922 {"winepass:\xE6\xB5\x8B\xE8\xAF\x95",S_OK
,FALSE
},
4923 {"winepass",S_OK
,FALSE
}
4926 {Uri_HOST_DNS
,S_OK
,FALSE
},
4928 {URL_SCHEME_FTP
,S_OK
,FALSE
},
4929 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
4941 {"www.winehq.org",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
},
4952 {Uri_HOST_DNS
,S_OK
,FALSE
},
4954 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
4955 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
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
},
4966 {"#\xE6\xB5\x8B\xE8\xAF\x95",S_OK
,FALSE
},
4967 {"www.winehq.org",S_OK
,FALSE
},
4969 {"/tests/",S_OK
,FALSE
},
4970 {"/tests/",S_OK
,FALSE
},
4972 {"http://www.winehq.org/tests/#\xE6\xB5\x8B\xE8\xAF\x95",S_OK
,FALSE
},
4973 {"http",S_OK
,FALSE
},
4978 {Uri_HOST_DNS
,S_OK
,FALSE
},
4980 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
4981 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
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
,
4989 {"file:a\xE2\x80\x8D.html",S_OK
,FALSE
},
4991 {".html",S_OK
,FALSE
},
4995 {"a\xE2\x80\x8D.html",S_OK
,FALSE
},
4996 {"a\xE2\x80\x8D.html",S_OK
,FALSE
},
4998 {"file:a\xE2\x80\x8D.html",S_OK
,FALSE
},
4999 {"file",S_OK
,FALSE
},
5004 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
5006 {URL_SCHEME_FILE
,S_OK
,FALSE
},
5007 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
5015 {"file:ab\xE2\x80\x8D.html",S_OK
,FALSE
},
5017 {".html",S_OK
,FALSE
},
5021 {"ab\xE2\x80\x8D.html",S_OK
,FALSE
},
5022 {"ab\xE2\x80\x8D.html",S_OK
,FALSE
},
5024 {"file:ab\xE2\x80\x8D.html",S_OK
,FALSE
},
5025 {"file",S_OK
,FALSE
},
5030 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
5032 {URL_SCHEME_FILE
,S_OK
,FALSE
},
5033 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
5036 /* Invalid Unicode characters should not be filtered */
5037 { "file:ab\xc3\x28.html", 0, S_OK
, FALSE
,
5041 {"file:ab\xc3\x28.html",S_OK
,FALSE
},
5043 {".html",S_OK
,FALSE
},
5047 {"ab\xc3\x28.html",S_OK
,FALSE
},
5048 {"ab\xc3\x28.html",S_OK
,FALSE
},
5050 {"file:ab\xc3\x28.html",S_OK
,FALSE
},
5051 {"file",S_OK
,FALSE
},
5056 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
5058 {URL_SCHEME_FILE
,S_OK
,FALSE
},
5059 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
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
,
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
},
5071 {"ftp.google.com",S_OK
,FALSE
},
5072 {"%E6%B5%8B%E8%AF%95",S_OK
,FALSE
},
5076 {"ftp://%E6%B5%8B%E8%AF%95:%E6%B5%8B%E8%AF%95@ftp.google.com/",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
}
5082 {Uri_HOST_DNS
,S_OK
,FALSE
},
5084 {URL_SCHEME_FTP
,S_OK
,FALSE
},
5085 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
5090 typedef struct _invalid_uri
{
5096 static const invalid_uri invalid_uri_tests
[] = {
5097 /* Has to have a scheme name. */
5098 {"://www.winehq.org",0,FALSE
},
5099 /* Windows doesn't like URIs which are implicitly file paths without the
5100 * ALLOW_IMPLICIT_FILE_SCHEME flag set.
5102 {"C:/test/test.mp3",0,FALSE
},
5103 {"\\\\Server/test/test.mp3",0,FALSE
},
5104 {"C:/test/test.mp3",Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
,FALSE
},
5105 {"\\\\Server/test/test.mp3",Uri_CREATE_ALLOW_RELATIVE
,FALSE
},
5106 /* Invalid schemes. */
5107 {"*abcd://not.valid.com",0,FALSE
},
5108 {"*a*b*c*d://not.valid.com",0,FALSE
},
5109 /* Not allowed to have invalid % encoded data. */
5110 {"ftp://google.co%XX/",0,FALSE
},
5111 /* Too many h16 components. */
5112 {"http://[1:2:3:4:5:6:7:8:9]",0,FALSE
},
5113 /* Not enough room for IPv4 address. */
5114 {"http://[1:2:3:4:5:6:7:192.0.1.0]",0,FALSE
},
5115 /* Not enough h16 components. */
5116 {"http://[1:2:3:4]",0,FALSE
},
5117 /* Not enough components including IPv4. */
5118 {"http://[1:192.0.1.0]",0,FALSE
},
5119 /* Not allowed to have partial IPv4 in IPv6. */
5120 {"http://[::192.0]",0,FALSE
},
5121 /* Can't have elision of 1 h16 at beginning of address. */
5122 {"http://[::2:3:4:5:6:7:8]",0,FALSE
},
5123 /* Expects a valid IP Literal. */
5124 {"ftp://[not.valid.uri]/",0,FALSE
},
5125 /* Expects valid port for a known scheme type. */
5126 {"ftp://www.winehq.org:123fgh",0,FALSE
},
5127 /* Port exceeds USHORT_MAX for known scheme type. */
5128 {"ftp://www.winehq.org:65536",0,FALSE
},
5129 /* Invalid port with IPv4 address. */
5130 {"http://www.winehq.org:1abcd",0,FALSE
},
5131 /* Invalid port with IPv6 address. */
5132 {"http://[::ffff]:32xy",0,FALSE
},
5133 /* Not allowed to have backslashes with NO_CANONICALIZE. */
5134 {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE
,FALSE
},
5135 /* Not allowed to have invalid % encoded data in opaque URI path. */
5136 {"news:test%XX",0,FALSE
},
5137 {"mailto:wine@winehq%G8.com",0,FALSE
},
5138 /* Known scheme types can't have invalid % encoded data in query string. */
5139 {"http://google.com/?query=te%xx",0,FALSE
},
5140 /* Invalid % encoded data in fragment of know scheme type. */
5141 {"ftp://google.com/#Test%xx",0,FALSE
},
5142 {" http://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
5143 {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
5144 {"file://c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5145 {"file://c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5146 {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5147 {"file:c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5148 {"file:c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5149 {"file:c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
5150 /* res URIs aren't allowed to have forbidden dos path characters in the
5153 {"res://c:\\te<st\\test/test",0,FALSE
},
5154 {"res://c:\\te>st\\test/test",0,FALSE
},
5155 {"res://c:\\te\"st\\test/test",0,FALSE
},
5156 {"res://c:\\test/te%xxst",0,FALSE
}
5159 typedef struct _uri_equality
{
5161 DWORD create_flags_a
;
5163 DWORD create_flags_b
;
5168 static const uri_equality equality_tests
[] = {
5170 "HTTP://www.winehq.org/test dir/./",0,
5171 "http://www.winehq.org/test dir/../test dir/",0,
5175 /* http://www.winehq.org/test%20dir */
5176 "http://%77%77%77%2E%77%69%6E%65%68%71%2E%6F%72%67/%74%65%73%74%20%64%69%72",0,
5177 "http://www.winehq.org/test dir",0,
5181 "c:\\test.mp3",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
5182 "file:///c:/test.mp3",0,
5186 "ftp://ftp.winehq.org/",0,
5187 "ftp://ftp.winehq.org",0,
5191 "ftp://ftp.winehq.org/test/test2/../../testB/",0,
5192 "ftp://ftp.winehq.org/t%45stB/",0,
5196 "http://google.com/TEST",0,
5197 "http://google.com/test",0,
5201 "http://GOOGLE.com/",0,
5202 "http://google.com/",0,
5205 /* Performs case insensitive compare of host names (for known scheme types). */
5207 "ftp://GOOGLE.com/",Uri_CREATE_NO_CANONICALIZE
,
5208 "ftp://google.com/",0,
5212 "zip://GOOGLE.com/",0,
5213 "zip://google.com/",0,
5217 "file:///c:/TEST/TeST/",0,
5218 "file:///c:/test/test/",0,
5222 "file:///server/TEST",0,
5223 "file:///SERVER/TEST",0,
5227 "http://google.com",Uri_CREATE_NO_CANONICALIZE
,
5228 "http://google.com/",0,
5232 "ftp://google.com:21/",0,
5233 "ftp://google.com/",0,
5237 "http://google.com:80/",Uri_CREATE_NO_CANONICALIZE
,
5238 "http://google.com/",0,
5242 "http://google.com:70/",0,
5243 "http://google.com:71/",0,
5247 "file:///c:/dir/file.txt", 0,
5248 "file:///c:/dir/file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
5252 "file:///c:/dir/file.txt", 0,
5253 "file:///c:\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
5257 "file:///c:/dir/file.txt", 0,
5258 "file:///c:\\dir2\\..\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
5262 "file:///c:\\dir2\\..\\ dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
5263 "file:///c:/%20dir/file.txt", 0,
5267 "file:///c:/Dir/file.txt", 0,
5268 "file:///C:/dir/file.TXT", Uri_CREATE_FILE_USE_DOS_PATH
,
5272 "file:///c:/dir/file.txt", 0,
5273 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
5277 "file:///c:/dir/file.txt#a", 0,
5278 "file:///c:\\dir\\file.txt#b", Uri_CREATE_FILE_USE_DOS_PATH
,
5281 /* Tests of an empty hash/fragment part */
5283 "http://google.com/test",0,
5284 "http://google.com/test#",0,
5288 "ftp://ftp.winehq.org/",0,
5289 "ftp://ftp.winehq.org/#",0,
5293 "file:///c:/dir/file.txt#", 0,
5294 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
5299 typedef struct _uri_with_fragment
{
5301 const char* fragment
;
5303 HRESULT create_expected
;
5306 const char* expected_uri
;
5308 } uri_with_fragment
;
5310 static const uri_with_fragment uri_fragment_tests
[] = {
5312 "http://google.com/","#fragment",0,S_OK
,FALSE
,
5313 "http://google.com/#fragment",FALSE
5316 "http://google.com/","fragment",0,S_OK
,FALSE
,
5317 "http://google.com/#fragment",FALSE
5320 "zip://test.com/","?test",0,S_OK
,FALSE
,
5321 "zip://test.com/#?test",FALSE
5323 /* The fragment can be empty. */
5325 "ftp://ftp.google.com/","",0,S_OK
,FALSE
,
5326 "ftp://ftp.google.com/#",FALSE
5330 typedef struct _uri_builder_property
{
5333 const char *expected_value
;
5334 Uri_PROPERTY property
;
5337 } uri_builder_property
;
5339 typedef struct _uri_builder_port
{
5347 typedef struct _uri_builder_str_property
{
5348 const char* expected
;
5351 } uri_builder_str_property
;
5353 typedef struct _uri_builder_dword_property
{
5357 } uri_builder_dword_property
;
5359 typedef struct _uri_builder_test
{
5362 HRESULT create_builder_expected
;
5363 BOOL create_builder_todo
;
5365 uri_builder_property properties
[URI_BUILDER_STR_PROPERTY_COUNT
];
5367 uri_builder_port port_prop
;
5373 DWORD uri_simple_encode_flags
;
5374 HRESULT uri_simple_hres
;
5375 BOOL uri_simple_todo
;
5377 DWORD uri_with_flags
;
5378 DWORD uri_with_builder_flags
;
5379 DWORD uri_with_encode_flags
;
5380 HRESULT uri_with_hres
;
5383 uri_builder_str_property expected_str_props
[URI_STR_PROPERTY_COUNT
];
5384 uri_builder_dword_property expected_dword_props
[URI_DWORD_PROPERTY_COUNT
];
5387 static const uri_builder_test uri_builder_tests
[] = {
5388 { "http://google.com/",0,S_OK
,FALSE
,
5390 {TRUE
,"#fragment",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
5391 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
},
5392 {TRUE
,"?query=x",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
5393 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5400 {"http://username:password@google.com/?query=x#fragment",S_OK
},
5401 {"username:password@google.com",S_OK
},
5402 {"http://google.com/?query=x#fragment",S_OK
},
5403 {"google.com",S_OK
},
5406 {"google.com",S_OK
},
5411 {"http://username:password@google.com/?query=x#fragment",S_OK
},
5413 {"username:password",S_OK
},
5417 {Uri_HOST_DNS
,S_OK
},
5419 {URL_SCHEME_HTTP
,S_OK
},
5420 {URLZONE_INVALID
,E_NOTIMPL
}
5423 { "http://google.com/",0,S_OK
,FALSE
,
5425 {TRUE
,"test",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
5427 {TRUE
,TRUE
,120,S_OK
,FALSE
},
5432 {"test://google.com:120/",S_OK
},
5433 {"google.com:120",S_OK
},
5434 {"test://google.com:120/",S_OK
},
5435 {"google.com",S_OK
},
5438 {"google.com",S_OK
},
5443 {"test://google.com:120/",S_OK
},
5449 {Uri_HOST_DNS
,S_OK
},
5451 {URL_SCHEME_UNKNOWN
,S_OK
},
5452 {URLZONE_INVALID
,E_NOTIMPL
}
5455 { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5457 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
5458 {TRUE
,"::192.2.3.4",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
5459 {TRUE
,NULL
,NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
5466 {"http://[::192.2.3.4]/",S_OK
},
5467 {"[::192.2.3.4]",S_OK
},
5468 {"http://[::192.2.3.4]/",S_OK
},
5472 {"::192.2.3.4",S_OK
},
5477 {"http://[::192.2.3.4]/",S_OK
},
5483 {Uri_HOST_IPV6
,S_OK
},
5485 {URL_SCHEME_HTTP
,S_OK
},
5486 {URLZONE_INVALID
,E_NOTIMPL
}
5489 { "http://google.com/",0,S_OK
,FALSE
,
5491 {TRUE
,"Frag","#Frag",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5498 {"http://google.com/#Frag",S_OK
},
5499 {"google.com",S_OK
},
5500 {"http://google.com/#Frag",S_OK
},
5501 {"google.com",S_OK
},
5504 {"google.com",S_OK
},
5509 {"http://google.com/#Frag",S_OK
},
5515 {Uri_HOST_DNS
,S_OK
},
5517 {URL_SCHEME_HTTP
,S_OK
},
5518 {URLZONE_INVALID
,E_NOTIMPL
}
5521 { "http://google.com/",0,S_OK
,FALSE
,
5523 {TRUE
,"","#",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
5530 {"http://google.com/#",S_OK
},
5531 {"google.com",S_OK
},
5532 {"http://google.com/#",S_OK
},
5533 {"google.com",S_OK
},
5536 {"google.com",S_OK
},
5541 {"http://google.com/#",S_OK
},
5547 {Uri_HOST_DNS
,S_OK
},
5549 {URL_SCHEME_HTTP
,S_OK
},
5550 {URLZONE_INVALID
,E_NOTIMPL
}
5553 { "http://google.com/",0,S_OK
,FALSE
,
5555 {TRUE
,":password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5562 {"http://::password@google.com/",S_OK
},
5563 {"::password@google.com",S_OK
},
5564 {"http://google.com/",S_OK
},
5565 {"google.com",S_OK
},
5568 {"google.com",S_OK
},
5573 {"http://::password@google.com/",S_OK
},
5575 {"::password",S_OK
},
5579 {Uri_HOST_DNS
,S_OK
},
5581 {URL_SCHEME_HTTP
,S_OK
},
5582 {URLZONE_INVALID
,E_NOTIMPL
}
5585 { "test/test",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5587 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5590 Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5592 Uri_CREATE_ALLOW_RELATIVE
,0,0,S_OK
,FALSE
,
5594 {":password@test/test",S_OK
},
5595 {":password@",S_OK
},
5596 {":password@test/test",S_OK
},
5605 {":password@test/test",S_OK
},
5611 {Uri_HOST_UNKNOWN
,S_OK
},
5613 {URL_SCHEME_UNKNOWN
,S_OK
},
5614 {URLZONE_INVALID
,E_NOTIMPL
}
5617 { "http://google.com/",0,S_OK
,FALSE
,
5619 {TRUE
,"test/test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5626 {"http://google.com/test/test",S_OK
},
5627 {"google.com",S_OK
},
5628 {"http://google.com/test/test",S_OK
},
5629 {"google.com",S_OK
},
5632 {"google.com",S_OK
},
5634 {"/test/test",S_OK
},
5635 {"/test/test",S_OK
},
5637 {"http://google.com/test/test",S_OK
},
5643 {Uri_HOST_DNS
,S_OK
},
5645 {URL_SCHEME_HTTP
,S_OK
},
5646 {URLZONE_INVALID
,E_NOTIMPL
}
5649 { "zip:testing/test",0,S_OK
,FALSE
,
5651 {TRUE
,"test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5675 {Uri_HOST_UNKNOWN
,S_OK
},
5677 {URL_SCHEME_UNKNOWN
,S_OK
},
5678 {URLZONE_INVALID
,E_NOTIMPL
}
5681 { "http://google.com/",0,S_OK
,FALSE
,
5685 /* 555 will be returned from GetPort even though FALSE was passed as the hasPort parameter. */
5686 {TRUE
,FALSE
,555,S_OK
,FALSE
},
5691 {"http://google.com/",S_OK
},
5692 {"google.com",S_OK
},
5693 {"http://google.com/",S_OK
},
5694 {"google.com",S_OK
},
5697 {"google.com",S_OK
},
5702 {"http://google.com/",S_OK
},
5708 {Uri_HOST_DNS
,S_OK
},
5709 /* Still returns 80, even though earlier the port was disabled. */
5711 {URL_SCHEME_HTTP
,S_OK
},
5712 {URLZONE_INVALID
,E_NOTIMPL
}
5715 { "http://google.com/",0,S_OK
,FALSE
,
5719 /* Instead of getting "TRUE" back as the "hasPort" parameter in GetPort,
5720 * you'll get 122345 instead.
5722 {TRUE
,122345,222,S_OK
,FALSE
},
5727 {"http://google.com:222/",S_OK
},
5728 {"google.com:222",S_OK
},
5729 {"http://google.com:222/",S_OK
},
5730 {"google.com",S_OK
},
5733 {"google.com",S_OK
},
5738 {"http://google.com:222/",S_OK
},
5744 {Uri_HOST_DNS
,S_OK
},
5746 {URL_SCHEME_HTTP
,S_OK
},
5747 {URLZONE_INVALID
,E_NOTIMPL
}
5750 /* IUri's created with the IUriBuilder can have ports that exceed USHORT_MAX. */
5751 { "http://google.com/",0,S_OK
,FALSE
,
5755 {TRUE
,TRUE
,999999,S_OK
,FALSE
},
5760 {"http://google.com:999999/",S_OK
},
5761 {"google.com:999999",S_OK
},
5762 {"http://google.com:999999/",S_OK
},
5763 {"google.com",S_OK
},
5766 {"google.com",S_OK
},
5771 {"http://google.com:999999/",S_OK
},
5777 {Uri_HOST_DNS
,S_OK
},
5779 {URL_SCHEME_HTTP
,S_OK
},
5780 {URLZONE_INVALID
,E_NOTIMPL
}
5783 { "http://google.com/",0,S_OK
,FALSE
,
5785 {TRUE
,"test","?test",Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
5793 {"http://google.com/?test",S_OK
},
5794 {"google.com",S_OK
},
5795 {"http://google.com/?test",S_OK
},
5796 {"google.com",S_OK
},
5799 {"google.com",S_OK
},
5804 {"http://google.com/?test",S_OK
},
5810 {Uri_HOST_DNS
,S_OK
},
5812 {URL_SCHEME_HTTP
,S_OK
},
5813 {URLZONE_INVALID
,E_NOTIMPL
}
5816 { "http://:password@google.com/",0,S_OK
,FALSE
,
5825 {"http://:password@google.com/",S_OK
},
5826 {":password@google.com",S_OK
},
5827 {"http://google.com/",S_OK
},
5828 {"google.com",S_OK
},
5831 {"google.com",S_OK
},
5836 {"http://:password@google.com/",S_OK
},
5842 {Uri_HOST_DNS
,S_OK
},
5844 {URL_SCHEME_HTTP
,S_OK
},
5845 {URLZONE_INVALID
,E_NOTIMPL
}
5848 /* IUriBuilder doesn't need a base IUri to build a IUri. */
5849 { NULL
,0,S_OK
,FALSE
,
5851 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
5852 {TRUE
,"google.com",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5859 {"http://google.com/",S_OK
},
5860 {"google.com",S_OK
},
5861 {"http://google.com/",S_OK
},
5862 {"google.com",S_OK
},
5865 {"google.com",S_OK
},
5870 {"http://google.com/",S_OK
},
5876 {Uri_HOST_DNS
,S_OK
},
5878 {URL_SCHEME_HTTP
,S_OK
},
5879 {URLZONE_INVALID
,E_NOTIMPL
}
5882 /* Can't set the scheme name to NULL. */
5883 { "zip://google.com/",0,S_OK
,FALSE
,
5885 {TRUE
,NULL
,"zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5892 {"zip://google.com/",S_OK
},
5893 {"google.com",S_OK
},
5894 {"zip://google.com/",S_OK
},
5895 {"google.com",S_OK
},
5898 {"google.com",S_OK
},
5903 {"zip://google.com/",S_OK
},
5909 {Uri_HOST_DNS
,S_OK
},
5911 {URL_SCHEME_UNKNOWN
,S_OK
},
5912 {URLZONE_INVALID
,E_NOTIMPL
}
5915 /* Can't set the scheme name to an empty string. */
5916 { "zip://google.com/",0,S_OK
,FALSE
,
5918 {TRUE
,"","zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5925 {"zip://google.com/",S_OK
},
5926 {"google.com",S_OK
},
5927 {"zip://google.com/",S_OK
},
5928 {"google.com",S_OK
},
5931 {"google.com",S_OK
},
5936 {"zip://google.com/",S_OK
},
5942 {Uri_HOST_DNS
,S_OK
},
5944 {URL_SCHEME_UNKNOWN
,S_OK
},
5945 {URLZONE_INVALID
,E_NOTIMPL
}
5948 /* -1 to CreateUri makes it use the same flags as the base IUri was created with.
5949 * CreateUriSimple always uses the flags the base IUri was created with (if any).
5951 { "http://google.com/../../",Uri_CREATE_NO_CANONICALIZE
,S_OK
,FALSE
,
5956 0,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5958 {"http://google.com/../../",S_OK
},
5959 {"google.com",S_OK
},
5960 {"http://google.com/../../",S_OK
},
5961 {"google.com",S_OK
},
5964 {"google.com",S_OK
},
5969 {"http://google.com/../../",S_OK
},
5975 {Uri_HOST_DNS
,S_OK
},
5977 {URL_SCHEME_HTTP
,S_OK
},
5978 {URLZONE_INVALID
,E_NOTIMPL
}
5981 { "http://google.com/",0,S_OK
,FALSE
,
5983 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5988 Uri_CREATE_NO_DECODE_EXTRA_INFO
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5990 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5991 {"google.com",S_OK
},
5992 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5993 {"google.com",S_OK
},
5995 {"#Fr%3C%7C%3Eg",S_OK
},
5996 {"google.com",S_OK
},
6001 {"http://google.com/#Fr<|>g",S_OK
},
6007 {Uri_HOST_DNS
,S_OK
},
6009 {URL_SCHEME_HTTP
,S_OK
},
6010 {URLZONE_INVALID
,E_NOTIMPL
}
6013 { "http://google.com/",0,S_OK
,FALSE
,
6015 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
6018 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,E_INVALIDARG
,FALSE
,
6020 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
6022 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
6023 {"google.com",S_OK
},
6024 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
6025 {"google.com",S_OK
},
6027 {"#Fr%3C%7C%3Eg",S_OK
},
6028 {"google.com",S_OK
},
6033 {"http://google.com/#Fr<|>g",S_OK
},
6039 {Uri_HOST_DNS
,S_OK
},
6041 {URL_SCHEME_HTTP
,S_OK
},
6042 {URLZONE_INVALID
,E_NOTIMPL
}
6045 { NULL
,0,S_OK
,FALSE
,
6047 {TRUE
,"/test/test/",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
6048 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
6051 0,INET_E_INVALID_URL
,FALSE
,
6052 0,INET_E_INVALID_URL
,FALSE
,
6053 0,0,0,INET_E_INVALID_URL
,FALSE
6055 { "http://google.com/",0,S_OK
,FALSE
,
6057 {TRUE
,"ht%xxtp",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
6060 0,INET_E_INVALID_URL
,FALSE
,
6061 0,INET_E_INVALID_URL
,FALSE
,
6062 0,0,0,INET_E_INVALID_URL
,FALSE
6064 /* File scheme's can't have a username set. */
6065 { "file://google.com/",0,S_OK
,FALSE
,
6067 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6070 0,INET_E_INVALID_URL
,FALSE
,
6071 0,INET_E_INVALID_URL
,FALSE
,
6072 0,0,0,INET_E_INVALID_URL
,FALSE
6074 /* File schemes can't have a password set. */
6075 { "file://google.com/",0,S_OK
,FALSE
,
6077 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
6080 0,INET_E_INVALID_URL
,FALSE
,
6081 0,INET_E_INVALID_URL
,FALSE
,
6082 0,0,0,INET_E_INVALID_URL
,FALSE
6084 /* UserName can't contain any character that is a delimiter for another
6085 * component that appears after it in a normal URI.
6087 { "http://google.com/",0,S_OK
,FALSE
,
6089 {TRUE
,"user:pass",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6092 0,INET_E_INVALID_URL
,FALSE
,
6093 0,INET_E_INVALID_URL
,FALSE
,
6094 0,0,0,INET_E_INVALID_URL
,FALSE
6096 { "http://google.com/",0,S_OK
,FALSE
,
6098 {TRUE
,"user@google.com",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6101 0,INET_E_INVALID_URL
,FALSE
,
6102 0,INET_E_INVALID_URL
,FALSE
,
6103 0,0,0,INET_E_INVALID_URL
,FALSE
6105 { "http://google.com/",0,S_OK
,FALSE
,
6107 {TRUE
,"user/path",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6110 0,INET_E_INVALID_URL
,FALSE
,
6111 0,INET_E_INVALID_URL
,FALSE
,
6112 0,0,0,INET_E_INVALID_URL
,FALSE
6114 { "http://google.com/",0,S_OK
,FALSE
,
6116 {TRUE
,"user?Query",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6119 0,INET_E_INVALID_URL
,FALSE
,
6120 0,INET_E_INVALID_URL
,FALSE
,
6121 0,0,0,INET_E_INVALID_URL
,FALSE
6123 { "http://google.com/",0,S_OK
,FALSE
,
6125 {TRUE
,"user#Frag",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
6128 0,INET_E_INVALID_URL
,FALSE
,
6129 0,INET_E_INVALID_URL
,FALSE
,
6130 0,0,0,INET_E_INVALID_URL
,FALSE
6132 { "http://google.com/",0,S_OK
,FALSE
,
6134 {TRUE
,"pass@google.com",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
6137 0,INET_E_INVALID_URL
,FALSE
,
6138 0,INET_E_INVALID_URL
,FALSE
,
6139 0,0,0,INET_E_INVALID_URL
,FALSE
6141 { "http://google.com/",0,S_OK
,FALSE
,
6143 {TRUE
,"pass/path",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
6146 0,INET_E_INVALID_URL
,FALSE
,
6147 0,INET_E_INVALID_URL
,FALSE
,
6148 0,0,0,INET_E_INVALID_URL
,FALSE
6150 { "http://google.com/",0,S_OK
,FALSE
,
6152 {TRUE
,"pass?query",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
6155 0,INET_E_INVALID_URL
,FALSE
,
6156 0,INET_E_INVALID_URL
,FALSE
,
6157 0,0,0,INET_E_INVALID_URL
,FALSE
6159 { "http://google.com/",0,S_OK
,FALSE
,
6161 {TRUE
,"pass#frag",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
6164 0,INET_E_INVALID_URL
,FALSE
,
6165 0,INET_E_INVALID_URL
,FALSE
,
6166 0,0,0,INET_E_INVALID_URL
,FALSE
6168 { "http://google.com/",0,S_OK
,FALSE
,
6170 {TRUE
,"winehq.org/test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
6173 0,INET_E_INVALID_URL
,FALSE
,
6174 0,INET_E_INVALID_URL
,FALSE
,
6175 0,0,0,INET_E_INVALID_URL
,FALSE
6177 { "http://google.com/",0,S_OK
,FALSE
,
6179 {TRUE
,"winehq.org?test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
6182 0,INET_E_INVALID_URL
,FALSE
,
6183 0,INET_E_INVALID_URL
,FALSE
,
6184 0,0,0,INET_E_INVALID_URL
,FALSE
6186 { "http://google.com/",0,S_OK
,FALSE
,
6188 {TRUE
,"winehq.org#test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
6191 0,INET_E_INVALID_URL
,FALSE
,
6192 0,INET_E_INVALID_URL
,FALSE
,
6193 0,0,0,INET_E_INVALID_URL
,FALSE
6195 /* Hostname is allowed to contain a ':' (even for known scheme types). */
6196 { "http://google.com/",0,S_OK
,FALSE
,
6198 {TRUE
,"winehq.org:test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
6205 {"http://winehq.org:test/",S_OK
},
6206 {"winehq.org:test",S_OK
},
6207 {"http://winehq.org:test/",S_OK
},
6208 {"winehq.org:test",S_OK
},
6211 {"winehq.org:test",S_OK
},
6216 {"http://winehq.org:test/",S_OK
},
6222 {Uri_HOST_DNS
,S_OK
},
6224 {URL_SCHEME_HTTP
,S_OK
},
6225 {URLZONE_INVALID
,E_NOTIMPL
}
6228 /* Can't set the host name to NULL. */
6229 { "http://google.com/",0,S_OK
,FALSE
,
6231 {TRUE
,NULL
,"google.com",Uri_PROPERTY_HOST
,E_INVALIDARG
,FALSE
}
6238 {"http://google.com/",S_OK
},
6239 {"google.com",S_OK
},
6240 {"http://google.com/",S_OK
},
6241 {"google.com",S_OK
},
6244 {"google.com",S_OK
},
6249 {"http://google.com/",S_OK
},
6255 {Uri_HOST_DNS
,S_OK
},
6257 {URL_SCHEME_HTTP
,S_OK
},
6258 {URLZONE_INVALID
,E_NOTIMPL
}
6261 /* Can set the host name to an empty string. */
6262 { "http://google.com/",0,S_OK
,FALSE
,
6264 {TRUE
,"",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
6288 {Uri_HOST_UNKNOWN
,S_OK
},
6290 {URL_SCHEME_HTTP
,S_OK
},
6291 {URLZONE_INVALID
,E_NOTIMPL
}
6294 { "http://google.com/",0,S_OK
,FALSE
,
6296 {TRUE
,"/path?query",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
6299 0,INET_E_INVALID_URL
,FALSE
,
6300 0,INET_E_INVALID_URL
,FALSE
,
6301 0,0,0,INET_E_INVALID_URL
,FALSE
6303 { "http://google.com/",0,S_OK
,FALSE
,
6305 {TRUE
,"/path#test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
6308 0,INET_E_INVALID_URL
,FALSE
,
6309 0,INET_E_INVALID_URL
,FALSE
,
6310 0,0,0,INET_E_INVALID_URL
,FALSE
6312 { "http://google.com/",0,S_OK
,FALSE
,
6314 {TRUE
,"?path#test",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
}
6317 0,INET_E_INVALID_URL
,FALSE
,
6318 0,INET_E_INVALID_URL
,FALSE
,
6319 0,0,0,INET_E_INVALID_URL
,FALSE
6321 { "file:///c:/dir/file.html",0,S_OK
,FALSE
,
6323 {TRUE
,NULL
,NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
},
6330 {"file:///c:/dir/file.html",S_OK
},
6332 {"file:///c:/dir/file.html",S_OK
},
6338 {"/c:/dir/file.html",S_OK
},
6339 {"/c:/dir/file.html",S_OK
},
6341 {"file:///c:/dir/file.html",S_OK
},
6347 {Uri_HOST_UNKNOWN
,S_OK
},
6349 {URL_SCHEME_FILE
,S_OK
},
6350 {URLZONE_INVALID
,E_NOTIMPL
}
6353 { "file:///c:/dir/file.html",0,S_OK
,FALSE
,
6355 {TRUE
,"#",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
},
6362 {"file:///c:/dir/file.html#",S_OK
},
6364 {"file:///c:/dir/file.html#",S_OK
},
6370 {"/c:/dir/file.html",S_OK
},
6371 {"/c:/dir/file.html",S_OK
},
6373 {"file:///c:/dir/file.html#",S_OK
},
6379 {Uri_HOST_UNKNOWN
,S_OK
},
6381 {URL_SCHEME_FILE
,S_OK
},
6382 {URLZONE_INVALID
,E_NOTIMPL
}
6387 typedef struct _uri_builder_remove_test
{
6390 HRESULT create_builder_expected
;
6391 BOOL create_builder_todo
;
6393 DWORD remove_properties
;
6394 HRESULT remove_expected
;
6397 const char *expected_uri
;
6398 DWORD expected_flags
;
6399 HRESULT expected_hres
;
6401 } uri_builder_remove_test
;
6403 static const uri_builder_remove_test uri_builder_remove_tests
[] = {
6404 { "http://google.com/test?test=y#Frag",0,S_OK
,FALSE
,
6405 Uri_HAS_FRAGMENT
|Uri_HAS_PATH
|Uri_HAS_QUERY
,S_OK
,FALSE
,
6406 "http://google.com/",0,S_OK
,FALSE
6408 { "http://user:pass@winehq.org/",0,S_OK
,FALSE
,
6409 Uri_HAS_USER_NAME
|Uri_HAS_PASSWORD
,S_OK
,FALSE
,
6410 "http://winehq.org/",0,S_OK
,FALSE
6412 { "zip://google.com?Test=x",0,S_OK
,FALSE
,
6413 Uri_HAS_HOST
,S_OK
,FALSE
,
6414 "zip:/?Test=x",0,S_OK
,FALSE
6416 /* Doesn't remove the whole userinfo component. */
6417 { "http://username:pass@google.com/",0,S_OK
,FALSE
,
6418 Uri_HAS_USER_INFO
,S_OK
,FALSE
,
6419 "http://username:pass@google.com/",0,S_OK
,FALSE
6421 /* Doesn't remove the domain. */
6422 { "http://google.com/",0,S_OK
,FALSE
,
6423 Uri_HAS_DOMAIN
,S_OK
,FALSE
,
6424 "http://google.com/",0,S_OK
,FALSE
6426 { "http://google.com:120/",0,S_OK
,FALSE
,
6427 Uri_HAS_AUTHORITY
,S_OK
,FALSE
,
6428 "http://google.com:120/",0,S_OK
,FALSE
6430 { "http://google.com/test.com/",0,S_OK
,FALSE
,
6431 Uri_HAS_EXTENSION
,S_OK
,FALSE
,
6432 "http://google.com/test.com/",0,S_OK
,FALSE
6434 { "http://google.com/?test=x",0,S_OK
,FALSE
,
6435 Uri_HAS_PATH_AND_QUERY
,S_OK
,FALSE
,
6436 "http://google.com/?test=x",0,S_OK
,FALSE
6438 /* Can't remove the scheme name. */
6439 { "http://google.com/?test=x",0,S_OK
,FALSE
,
6440 Uri_HAS_SCHEME_NAME
|Uri_HAS_QUERY
,E_INVALIDARG
,FALSE
,
6441 "http://google.com/?test=x",0,S_OK
,FALSE
6445 typedef struct _uri_combine_str_property
{
6449 const char *broken_value
;
6450 const char *value_ex
;
6451 } uri_combine_str_property
;
6453 typedef struct _uri_combine_test
{
6454 const char *base_uri
;
6455 DWORD base_create_flags
;
6456 const char *relative_uri
;
6457 DWORD relative_create_flags
;
6458 DWORD combine_flags
;
6462 uri_combine_str_property str_props
[URI_STR_PROPERTY_COUNT
];
6463 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
6466 static const uri_combine_test uri_combine_tests
[] = {
6467 { "http://google.com/fun/stuff",0,
6468 "../not/fun/stuff",Uri_CREATE_ALLOW_RELATIVE
,
6471 {"http://google.com/not/fun/stuff",S_OK
},
6472 {"google.com",S_OK
},
6473 {"http://google.com/not/fun/stuff",S_OK
},
6474 {"google.com",S_OK
},
6477 {"google.com",S_OK
},
6479 {"/not/fun/stuff",S_OK
},
6480 {"/not/fun/stuff",S_OK
},
6482 {"http://google.com/not/fun/stuff",S_OK
},
6488 {Uri_HOST_DNS
,S_OK
},
6490 {URL_SCHEME_HTTP
,S_OK
},
6491 {URLZONE_INVALID
,E_NOTIMPL
}
6494 { "http://google.com/test",0,
6495 "zip://test.com/cool",0,
6498 {"zip://test.com/cool",S_OK
},
6500 {"zip://test.com/cool",S_OK
},
6509 {"zip://test.com/cool",S_OK
},
6515 {Uri_HOST_DNS
,S_OK
},
6517 {URL_SCHEME_UNKNOWN
,S_OK
},
6518 {URLZONE_INVALID
,E_NOTIMPL
}
6521 { "http://google.com/use/base/path",0,
6522 "?relative",Uri_CREATE_ALLOW_RELATIVE
,
6525 {"http://google.com/use/base/path?relative",S_OK
},
6526 {"google.com",S_OK
},
6527 {"http://google.com/use/base/path?relative",S_OK
},
6528 {"google.com",S_OK
},
6531 {"google.com",S_OK
},
6533 {"/use/base/path",S_OK
},
6534 {"/use/base/path?relative",S_OK
},
6536 {"http://google.com/use/base/path?relative",S_OK
},
6542 {Uri_HOST_DNS
,S_OK
},
6544 {URL_SCHEME_HTTP
,S_OK
},
6545 {URLZONE_INVALID
,E_NOTIMPL
}
6548 { "http://google.com/path",0,
6549 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
6552 {"http://google.com/testing",S_OK
},
6553 {"google.com",S_OK
},
6554 {"http://google.com/testing",S_OK
},
6555 {"google.com",S_OK
},
6558 {"google.com",S_OK
},
6563 {"http://google.com/testing",S_OK
},
6569 {Uri_HOST_DNS
,S_OK
},
6571 {URL_SCHEME_HTTP
,S_OK
},
6572 {URLZONE_INVALID
,E_NOTIMPL
}
6575 { "http://google.com/path",0,
6576 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
6577 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6579 {"http://google.com:80/test/../test/.././testing",S_OK
},
6580 {"google.com",S_OK
},
6581 {"http://google.com:80/test/../test/.././testing",S_OK
},
6582 {"google.com",S_OK
},
6585 {"google.com",S_OK
},
6587 {"/test/../test/.././testing",S_OK
},
6588 {"/test/../test/.././testing",S_OK
},
6590 {"http://google.com:80/test/../test/.././testing",S_OK
},
6596 {Uri_HOST_DNS
,S_OK
},
6598 {URL_SCHEME_HTTP
,S_OK
},
6599 {URLZONE_INVALID
,E_NOTIMPL
}
6602 { "http://winehq.org/test/abc",0,
6603 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
6606 {"http://winehq.org/test/testing/test",S_OK
},
6607 {"winehq.org",S_OK
},
6608 {"http://winehq.org/test/testing/test",S_OK
},
6609 {"winehq.org",S_OK
},
6612 {"winehq.org",S_OK
},
6614 {"/test/testing/test",S_OK
},
6615 {"/test/testing/test",S_OK
},
6617 {"http://winehq.org/test/testing/test",S_OK
},
6623 {Uri_HOST_DNS
,S_OK
},
6625 {URL_SCHEME_HTTP
,S_OK
},
6626 {URLZONE_INVALID
,E_NOTIMPL
}
6629 { "http://winehq.org/test/abc",0,
6630 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
6631 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6633 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6634 /* Default port is hidden in the authority. */
6635 {"winehq.org",S_OK
},
6636 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6637 {"winehq.org",S_OK
},
6640 {"winehq.org",S_OK
},
6642 {"/test/testing/abc/../test",S_OK
},
6643 {"/test/testing/abc/../test",S_OK
},
6645 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6651 {Uri_HOST_DNS
,S_OK
},
6653 {URL_SCHEME_HTTP
,S_OK
},
6654 {URLZONE_INVALID
,E_NOTIMPL
}
6657 { "http://winehq.org/test?query",0,
6658 "testing",Uri_CREATE_ALLOW_RELATIVE
,
6661 {"http://winehq.org/testing",S_OK
},
6662 {"winehq.org",S_OK
},
6663 {"http://winehq.org/testing",S_OK
},
6664 {"winehq.org",S_OK
},
6667 {"winehq.org",S_OK
},
6672 {"http://winehq.org/testing",S_OK
},
6678 {Uri_HOST_DNS
,S_OK
},
6680 {URL_SCHEME_HTTP
,S_OK
},
6681 {URLZONE_INVALID
,E_NOTIMPL
}
6684 { "http://winehq.org/test#frag",0,
6685 "testing",Uri_CREATE_ALLOW_RELATIVE
,
6688 {"http://winehq.org/testing",S_OK
},
6689 {"winehq.org",S_OK
},
6690 {"http://winehq.org/testing",S_OK
},
6691 {"winehq.org",S_OK
},
6694 {"winehq.org",S_OK
},
6699 {"http://winehq.org/testing",S_OK
},
6705 {Uri_HOST_DNS
,S_OK
},
6707 {URL_SCHEME_HTTP
,S_OK
},
6708 {URLZONE_INVALID
,E_NOTIMPL
}
6711 { "testing?query#frag",Uri_CREATE_ALLOW_RELATIVE
,
6712 "test",Uri_CREATE_ALLOW_RELATIVE
,
6732 {Uri_HOST_UNKNOWN
,S_OK
},
6734 {URL_SCHEME_UNKNOWN
,S_OK
},
6735 {URLZONE_INVALID
,E_NOTIMPL
}
6738 { "file:///c:/test/test",0,
6739 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6740 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6742 {"file://c:\\testing.mp3",S_OK
},
6744 {"file://c:\\testing.mp3",S_OK
},
6750 {"c:\\testing.mp3",S_OK
},
6751 {"c:\\testing.mp3",S_OK
},
6753 {"file://c:\\testing.mp3",S_OK
},
6759 {Uri_HOST_UNKNOWN
,S_OK
},
6761 {URL_SCHEME_FILE
,S_OK
},
6762 {URLZONE_INVALID
,E_NOTIMPL
}
6765 { "file:///c:/test/test",0,
6766 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6769 {"file:///c:/testing.mp3",S_OK
},
6771 {"file:///c:/testing.mp3",S_OK
},
6777 {"/c:/testing.mp3",S_OK
},
6778 {"/c:/testing.mp3",S_OK
},
6780 {"file:///c:/testing.mp3",S_OK
},
6786 {Uri_HOST_UNKNOWN
,S_OK
},
6788 {URL_SCHEME_FILE
,S_OK
},
6789 {URLZONE_INVALID
,E_NOTIMPL
}
6792 { "file://test.com/test/test",0,
6793 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6794 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6796 {"file://\\\\test.com\\testing.mp3",S_OK
},
6798 {"file://\\\\test.com\\testing.mp3",S_OK
},
6804 {"\\testing.mp3",S_OK
},
6805 {"\\testing.mp3",S_OK
},
6807 {"file://\\\\test.com\\testing.mp3",S_OK
},
6813 {Uri_HOST_DNS
,S_OK
},
6815 {URL_SCHEME_FILE
,S_OK
},
6816 {URLZONE_INVALID
,E_NOTIMPL
}
6819 /* URL_DONT_SIMPLIFY has no effect. */
6820 { "http://google.com/test",0,
6821 "zip://test.com/cool/../cool/test",0,
6822 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6824 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
6826 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
6832 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
6833 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
6835 /* The resulting IUri has the same Raw URI as the relative URI (only IE 8).
6836 * On IE 7 it reduces the path in the Raw URI.
6838 {"zip://test.com/cool/../cool/test",S_OK
,FALSE
,"zip://test.com/cool/test"},
6844 {Uri_HOST_DNS
,S_OK
},
6846 {URL_SCHEME_UNKNOWN
,S_OK
},
6847 {URLZONE_INVALID
,E_NOTIMPL
}
6850 /* FILE_USE_PATHURL has no effect in IE 8, in IE 7 the
6851 * resulting URI is converted into a dos path.
6853 { "http://google.com/test",0,
6854 "file:///c:/test/",0,
6855 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6857 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6859 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6865 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
6866 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
6868 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6874 {Uri_HOST_UNKNOWN
,S_OK
},
6876 {URL_SCHEME_FILE
,S_OK
},
6877 {URLZONE_INVALID
,E_NOTIMPL
}
6880 { "http://google.com/test",0,
6881 "http://test.com/test#%30test",0,
6882 URL_DONT_UNESCAPE_EXTRA_INFO
,S_OK
,FALSE
,
6884 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
6886 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
6889 {"#0test",S_OK
,FALSE
,NULL
,"#%30test"},
6895 /* IE 7 decodes the %30 to a 0 in the Raw URI. */
6896 {"http://test.com/test#%30test",S_OK
,FALSE
,"http://test.com/test#0test"},
6902 {Uri_HOST_DNS
,S_OK
},
6904 {URL_SCHEME_HTTP
,S_OK
},
6905 {URLZONE_INVALID
,E_NOTIMPL
}
6908 /* Windows validates the path component from the relative Uri. */
6909 { "http://google.com/test",0,
6910 "/Te%XXst",Uri_CREATE_ALLOW_RELATIVE
,
6911 0,E_INVALIDARG
,FALSE
6913 /* Windows doesn't validate the query from the relative Uri. */
6914 { "http://google.com/test",0,
6915 "?Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6918 {"http://google.com/test?Tes%XXt",S_OK
},
6919 {"google.com",S_OK
},
6920 {"http://google.com/test?Tes%XXt",S_OK
},
6921 {"google.com",S_OK
},
6924 {"google.com",S_OK
},
6927 {"/test?Tes%XXt",S_OK
},
6929 {"http://google.com/test?Tes%XXt",S_OK
},
6935 {Uri_HOST_DNS
,S_OK
},
6937 {URL_SCHEME_HTTP
,S_OK
},
6938 {URLZONE_INVALID
,E_NOTIMPL
}
6941 /* Windows doesn't validate the fragment from the relative Uri. */
6942 { "http://google.com/test",0,
6943 "#Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6946 {"http://google.com/test#Tes%XXt",S_OK
},
6947 {"google.com",S_OK
},
6948 {"http://google.com/test#Tes%XXt",S_OK
},
6949 {"google.com",S_OK
},
6952 {"google.com",S_OK
},
6957 {"http://google.com/test#Tes%XXt",S_OK
},
6963 {Uri_HOST_DNS
,S_OK
},
6965 {URL_SCHEME_HTTP
,S_OK
},
6966 {URLZONE_INVALID
,E_NOTIMPL
}
6969 /* Creates an IUri which contains an invalid dos path char. */
6970 { "file:///c:/test",0,
6971 "/test<ing",Uri_CREATE_ALLOW_RELATIVE
,
6972 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6974 {"file://c:\\test<ing",S_OK
},
6976 {"file://c:\\test<ing",S_OK
},
6982 {"c:\\test<ing",S_OK
},
6983 {"c:\\test<ing",S_OK
},
6985 {"file://c:\\test<ing",S_OK
},
6991 {Uri_HOST_UNKNOWN
,S_OK
},
6993 {URL_SCHEME_FILE
,S_OK
},
6994 {URLZONE_INVALID
,E_NOTIMPL
}
6997 /* Appends the path after the drive letter (if any). */
6998 { "file:///c:/test",0,
6999 "/c:/testing",Uri_CREATE_ALLOW_RELATIVE
,
7002 {"file:///c:/c:/testing",S_OK
},
7004 {"file:///c:/c:/testing",S_OK
},
7010 {"/c:/c:/testing",S_OK
},
7011 {"/c:/c:/testing",S_OK
},
7013 {"file:///c:/c:/testing",S_OK
},
7019 {Uri_HOST_UNKNOWN
,S_OK
},
7021 {URL_SCHEME_FILE
,S_OK
},
7022 {URLZONE_INVALID
,E_NOTIMPL
}
7025 /* A '/' is added if the base URI doesn't have a path and the
7026 * relative URI doesn't contain a path (since the base URI is
7029 { "http://google.com",Uri_CREATE_NO_CANONICALIZE
,
7030 "?test",Uri_CREATE_ALLOW_RELATIVE
,
7033 {"http://google.com/?test",S_OK
},
7034 {"google.com",S_OK
},
7035 {"http://google.com/?test",S_OK
},
7036 {"google.com",S_OK
},
7039 {"google.com",S_OK
},
7044 {"http://google.com/?test",S_OK
},
7050 {Uri_HOST_DNS
,S_OK
},
7052 {URL_SCHEME_HTTP
,S_OK
},
7053 {URLZONE_INVALID
,E_NOTIMPL
}
7056 { "zip://google.com",Uri_CREATE_NO_CANONICALIZE
,
7057 "?test",Uri_CREATE_ALLOW_RELATIVE
,
7060 {"zip://google.com/?test",S_OK
},
7061 {"google.com",S_OK
},
7062 {"zip://google.com/?test",S_OK
},
7063 {"google.com",S_OK
},
7066 {"google.com",S_OK
},
7071 {"zip://google.com/?test",S_OK
},
7077 {Uri_HOST_DNS
,S_OK
},
7079 {URL_SCHEME_UNKNOWN
,S_OK
},
7080 {URLZONE_INVALID
,E_NOTIMPL
}
7083 /* No path is appended since the base URI is opaque. */
7085 "?test",Uri_CREATE_ALLOW_RELATIVE
,
7105 {Uri_HOST_UNKNOWN
,S_OK
},
7107 {URL_SCHEME_UNKNOWN
,S_OK
},
7108 {URLZONE_INVALID
,E_NOTIMPL
}
7112 "../testing/test",Uri_CREATE_ALLOW_RELATIVE
,
7115 {"file:///c:/testing/test",S_OK
},
7117 {"file:///c:/testing/test",S_OK
},
7123 {"/c:/testing/test",S_OK
},
7124 {"/c:/testing/test",S_OK
},
7126 {"file:///c:/testing/test",S_OK
},
7132 {Uri_HOST_UNKNOWN
,S_OK
},
7134 {URL_SCHEME_FILE
,S_OK
},
7135 {URLZONE_INVALID
,E_NOTIMPL
}
7138 { "http://winehq.org/dir/testfile",0,
7139 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
7142 {"http://winehq.org/dir/test?querystring",S_OK
},
7143 {"winehq.org",S_OK
},
7144 {"http://winehq.org/dir/test?querystring",S_OK
},
7145 {"winehq.org",S_OK
},
7148 {"winehq.org",S_OK
},
7151 {"/dir/test?querystring",S_OK
},
7152 {"?querystring",S_OK
},
7153 {"http://winehq.org/dir/test?querystring",S_OK
},
7159 {Uri_HOST_DNS
,S_OK
},
7161 {URL_SCHEME_HTTP
,S_OK
},
7162 {URLZONE_INVALID
,E_NOTIMPL
}
7165 { "http://winehq.org/dir/test",0,
7166 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
7169 {"http://winehq.org/dir/test?querystring",S_OK
},
7170 {"winehq.org",S_OK
},
7171 {"http://winehq.org/dir/test?querystring",S_OK
},
7172 {"winehq.org",S_OK
},
7175 {"winehq.org",S_OK
},
7178 {"/dir/test?querystring",S_OK
},
7179 {"?querystring",S_OK
},
7180 {"http://winehq.org/dir/test?querystring",S_OK
},
7186 {Uri_HOST_DNS
,S_OK
},
7188 {URL_SCHEME_HTTP
,S_OK
},
7189 {URLZONE_INVALID
,E_NOTIMPL
}
7192 { "http://winehq.org/dir/test?querystring",0,
7193 "#hash",Uri_CREATE_ALLOW_RELATIVE
,
7196 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
7197 {"winehq.org",S_OK
},
7198 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
7199 {"winehq.org",S_OK
},
7202 {"winehq.org",S_OK
},
7205 {"/dir/test?querystring",S_OK
},
7206 {"?querystring",S_OK
},
7207 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
7213 {Uri_HOST_DNS
,S_OK
},
7215 {URL_SCHEME_HTTP
,S_OK
},
7216 {URLZONE_INVALID
,E_NOTIMPL
}
7219 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir\\file.txt",0,
7220 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7223 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7225 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7231 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7232 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7234 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7240 {Uri_HOST_UNKNOWN
,S_OK
},
7242 {URL_SCHEME_MK
,S_OK
},
7243 {URLZONE_INVALID
,E_NOTIMPL
}
7246 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::\\subdir\\file.txt",0,
7247 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7250 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7252 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7258 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7259 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7261 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
7267 {Uri_HOST_UNKNOWN
,S_OK
},
7269 {URL_SCHEME_MK
,S_OK
},
7270 {URLZONE_INVALID
,E_NOTIMPL
}
7273 { "mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir\\file.txt",0,
7274 "relative\\path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7277 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
7279 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
7285 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
7286 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
7288 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
7294 {Uri_HOST_UNKNOWN
,S_OK
},
7296 {URL_SCHEME_MK
,S_OK
},
7297 {URLZONE_INVALID
,E_NOTIMPL
}
7300 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
7301 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7304 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7306 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7312 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7313 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7315 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7321 {Uri_HOST_UNKNOWN
,S_OK
},
7323 {URL_SCHEME_MK
,S_OK
},
7324 {URLZONE_INVALID
,E_NOTIMPL
}
7327 { "mk:MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
7328 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7331 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7333 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7339 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7340 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7342 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
7348 {Uri_HOST_UNKNOWN
,S_OK
},
7350 {URL_SCHEME_MK
,S_OK
},
7351 {URLZONE_INVALID
,E_NOTIMPL
}
7354 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/../../file.txt",0,
7355 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7358 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
7360 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
7366 {"@MSITSTORE:/relative/path.txt",S_OK
},
7367 {"@MSITSTORE:/relative/path.txt",S_OK
},
7369 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
7375 {Uri_HOST_UNKNOWN
,S_OK
},
7377 {URL_SCHEME_MK
,S_OK
},
7378 {URLZONE_INVALID
,E_NOTIMPL
}
7381 { "mk:@xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
7382 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7385 {"mk:@xxx:/relative/path.txt",S_OK
},
7387 {"mk:@xxx:/relative/path.txt",S_OK
},
7393 {"@xxx:/relative/path.txt",S_OK
},
7394 {"@xxx:/relative/path.txt",S_OK
},
7396 {"mk:@xxx:/relative/path.txt",S_OK
},
7402 {Uri_HOST_UNKNOWN
,S_OK
},
7404 {URL_SCHEME_MK
,S_OK
},
7405 {URLZONE_INVALID
,E_NOTIMPL
}
7408 { "mk:xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
7409 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7412 {"mk:/relative/path.txt",S_OK
},
7414 {"mk:/relative/path.txt",S_OK
},
7420 {"/relative/path.txt",S_OK
},
7421 {"/relative/path.txt",S_OK
},
7423 {"mk:/relative/path.txt",S_OK
},
7429 {Uri_HOST_UNKNOWN
,S_OK
},
7431 {URL_SCHEME_MK
,S_OK
},
7432 {URLZONE_INVALID
,E_NOTIMPL
}
7435 { "ml:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
7436 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7439 {"ml:/relative/path.txt",S_OK
},
7441 {"ml:/relative/path.txt",S_OK
},
7447 {"/relative/path.txt",S_OK
},
7448 {"/relative/path.txt",S_OK
},
7450 {"ml:/relative/path.txt",S_OK
},
7456 {Uri_HOST_UNKNOWN
,S_OK
},
7458 {URL_SCHEME_UNKNOWN
,S_OK
},
7459 {URLZONE_INVALID
,E_NOTIMPL
}
7462 { "http://winehq.org/dir/test?querystring",0,
7463 "//winehq.com/#hash",Uri_CREATE_ALLOW_RELATIVE
,
7466 {"http://winehq.com/#hash",S_OK
},
7467 {"winehq.com",S_OK
},
7468 {"http://winehq.com/#hash",S_OK
},
7469 {"winehq.com",S_OK
},
7472 {"winehq.com",S_OK
},
7477 {"http://winehq.com/#hash",S_OK
},
7483 {Uri_HOST_DNS
,S_OK
},
7484 {80,S_OK
,FALSE
,TRUE
},
7485 {URL_SCHEME_HTTP
,S_OK
},
7486 {URLZONE_INVALID
,E_NOTIMPL
}
7489 { "http://winehq.org/dir/test?querystring",0,
7490 "//winehq.com/dir2/../dir/file.txt?query#hash",Uri_CREATE_ALLOW_RELATIVE
,
7493 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
7494 {"winehq.com",S_OK
},
7495 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
7496 {"winehq.com",S_OK
},
7499 {"winehq.com",S_OK
},
7501 {"/dir/file.txt",S_OK
},
7502 {"/dir/file.txt?query",S_OK
},
7504 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
7510 {Uri_HOST_DNS
,S_OK
},
7511 {80,S_OK
,FALSE
,TRUE
},
7512 {URL_SCHEME_HTTP
,S_OK
},
7513 {URLZONE_INVALID
,E_NOTIMPL
}
7516 { "http://google.com/test",0,
7517 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
7520 {"file:///c:/test/",S_OK
},
7522 {"file:///c:/test/",S_OK
},
7531 {"c:\\test\\",S_OK
,FALSE
,"file:///c:/test/"},
7537 {Uri_HOST_UNKNOWN
,S_OK
},
7539 {URL_SCHEME_FILE
,S_OK
},
7540 {URLZONE_INVALID
,E_NOTIMPL
}
7543 { "http://google.com/test",0,
7544 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
7547 {"file:///c:/test/",S_OK
},
7549 {"file:///c:/test/",S_OK
},
7558 {"c:\\test\\",S_OK
,FALSE
,"file:///c:/test/"},
7564 {Uri_HOST_UNKNOWN
,S_OK
},
7566 {URL_SCHEME_FILE
,S_OK
},
7567 {URLZONE_INVALID
,E_NOTIMPL
}
7570 { "http://winehq.org",0,
7571 "mailto://",Uri_CREATE_NO_CANONICALIZE
,
7585 {"mailto://",S_OK
,FALSE
,"mailto:"},
7591 {Uri_HOST_UNKNOWN
,S_OK
},
7593 {URL_SCHEME_MAILTO
,S_OK
},
7594 {URLZONE_INVALID
,E_NOTIMPL
}
7597 { "http://winehq.org",0,
7598 "mailto://a@b.com",Uri_CREATE_NO_CANONICALIZE
,
7601 {"mailto:a@b.com",S_OK
},
7603 {"mailto:a@b.com",S_OK
},
7612 {"mailto://a@b.com",S_OK
,FALSE
,"mailto:a@b.com"},
7618 {Uri_HOST_UNKNOWN
,S_OK
},
7620 {URL_SCHEME_MAILTO
,S_OK
},
7621 {URLZONE_INVALID
,E_NOTIMPL
}
7625 "/",Uri_CREATE_ALLOW_RELATIVE
,
7628 {"http://[::1]/",S_OK
},
7630 {"http://[::1]/",S_OK
},
7639 {"http://[::1]/",S_OK
},
7645 {Uri_HOST_IPV6
,S_OK
},
7646 {80,S_OK
,FALSE
,TRUE
},
7647 {URL_SCHEME_HTTP
,S_OK
},
7648 {URLZONE_INVALID
,E_NOTIMPL
}
7653 typedef struct _uri_parse_test
{
7658 const char *property
;
7661 const char *property2
;
7664 static const uri_parse_test uri_parse_tests
[] = {
7665 /* PARSE_CANONICALIZE tests. */
7666 {"zip://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"zip://google.com/test<|>",S_OK
,FALSE
},
7667 {"http://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"http://google.com/test%3C%7C%3E",S_OK
,FALSE
},
7668 {"http://google.com/%30%23%3F",0,PARSE_CANONICALIZE
,URL_UNESCAPE
,"http://google.com/0#?",S_OK
,FALSE
},
7669 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_UNSAFE
,"test %3C%7C%3E",S_OK
,FALSE
},
7670 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_SPACES_ONLY
,"test%20<|>",S_OK
,FALSE
},
7671 {"test%20<|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_UNESCAPE
|URL_ESCAPE_UNSAFE
,"test%20%3C%7C%3E",S_OK
,FALSE
},
7672 {"http://google.com/%20",0,PARSE_CANONICALIZE
,URL_ESCAPE_PERCENT
,"http://google.com/%2520",S_OK
,FALSE
},
7673 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"http://google.com/test/../",S_OK
,FALSE
},
7674 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_NO_META
,"http://google.com/test/../",S_OK
,FALSE
},
7675 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"http://google.com/",S_OK
,FALSE
},
7676 {"zip://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"zip://google.com/",S_OK
,FALSE
},
7677 {"file:///c:/test/../test",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"file:///c:/test/../test",S_OK
,FALSE
},
7679 /* PARSE_FRIENDLY tests. */
7680 {"http://test@google.com/test#test",0,PARSE_FRIENDLY
,0,"http://google.com/test#test",S_OK
,FALSE
},
7681 {"zip://test@google.com/test",0,PARSE_FRIENDLY
,0,"zip://test@google.com/test",S_OK
,FALSE
},
7683 /* PARSE_ROOTDOCUMENT tests. */
7684 {"http://google.com:200/test/test",0,PARSE_ROOTDOCUMENT
,0,"http://google.com:200/",S_OK
,FALSE
},
7685 {"http://google.com",Uri_CREATE_NO_CANONICALIZE
,PARSE_ROOTDOCUMENT
,0,"http://google.com/",S_OK
,FALSE
},
7686 {"zip://google.com/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7687 {"file:///c:/testing/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7688 {"file://server/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7689 {"zip:test/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7691 /* PARSE_DOCUMENT tests. */
7692 {"http://test@google.com/test?query#frag",0,PARSE_DOCUMENT
,0,"http://test@google.com/test?query",S_OK
,FALSE
},
7693 {"http:testing#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7694 {"file:///c:/test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7695 {"zip://google.com/#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7696 {"zip:test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7697 {"testing#frag",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7699 /* PARSE_PATH_FROM_URL tests. */
7700 {"file:///c:/test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\test.mp3",S_OK
,FALSE
},
7701 {"file:///c:/t<|>est.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\t<|>est.mp3",S_OK
,FALSE
},
7702 {"file:///c:/te%XX t/",0,PARSE_PATH_FROM_URL
,0,"c:\\te%XX t\\",S_OK
,FALSE
},
7703 {"file://server/test",0,PARSE_PATH_FROM_URL
,0,"\\\\server\\test",S_OK
,FALSE
},
7704 {"http://google.com/",0,PARSE_PATH_FROM_URL
,0,"",E_INVALIDARG
,FALSE
},
7705 {"file:/c:/dir/test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\dir\\test.mp3",S_OK
},
7706 {"file:/c:/test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\test.mp3",S_OK
},
7707 {"file://c:\\test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\test.mp3",S_OK
},
7709 /* PARSE_URL_FROM_PATH tests. */
7710 /* This function almost seems to useless (just returns the absolute uri). */
7711 {"test.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"test.com",S_OK
,FALSE
},
7712 {"/test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"/test/test",S_OK
,FALSE
},
7713 {"file://c:\\test\\test",Uri_CREATE_FILE_USE_DOS_PATH
,PARSE_URL_FROM_PATH
,0,"file://c:\\test\\test",S_OK
,FALSE
},
7714 {"file:c:/test",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
7715 {"http:google.com/",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
7717 /* PARSE_SCHEMA tests. */
7718 {"http://google.com/test",0,PARSE_SCHEMA
,0,"http",S_OK
,FALSE
},
7719 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SCHEMA
,0,"",S_OK
,FALSE
},
7721 /* PARSE_SITE tests. */
7722 {"http://google.uk.com/",0,PARSE_SITE
,0,"google.uk.com",S_OK
,FALSE
},
7723 {"http://google.com.com/",0,PARSE_SITE
,0,"google.com.com",S_OK
,FALSE
},
7724 {"google.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SITE
,0,"",S_OK
,FALSE
},
7725 {"file://server/test",0,PARSE_SITE
,0,"server",S_OK
,FALSE
},
7727 /* PARSE_DOMAIN tests. */
7728 {"http://google.com.uk/",0,PARSE_DOMAIN
,0,"google.com.uk",S_OK
,FALSE
,"com.uk"},
7729 {"http://google.com.com/",0,PARSE_DOMAIN
,0,"com.com",S_OK
,FALSE
},
7730 {"test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
7731 {"file://server/test",0,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
7733 /* PARSE_LOCATION and PARSE_ANCHOR tests. */
7734 {"http://google.com/test#Test",0,PARSE_ANCHOR
,0,"#Test",S_OK
,FALSE
},
7735 {"http://google.com/test#Test",0,PARSE_LOCATION
,0,"#Test",S_OK
,FALSE
},
7736 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_ANCHOR
,0,"",S_OK
,FALSE
},
7737 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_LOCATION
,0,"",S_OK
,FALSE
}
7740 static inline LPWSTR
a2w(LPCSTR str
) {
7744 DWORD len
= MultiByteToWideChar(CP_UTF8
, 0, str
, -1, NULL
, 0);
7745 ret
= HeapAlloc(GetProcessHeap(), 0, len
*sizeof(WCHAR
));
7746 MultiByteToWideChar(CP_UTF8
, 0, str
, -1, ret
, len
);
7752 static inline DWORD
strcmp_aw(LPCSTR strA
, LPCWSTR strB
) {
7753 LPWSTR strAW
= a2w(strA
);
7754 DWORD ret
= lstrcmpW(strAW
, strB
);
7759 static inline ULONG
get_refcnt(IUri
*uri
) {
7761 return IUri_Release(uri
);
7764 static void change_property(IUriBuilder
*builder
, const uri_builder_property
*prop
,
7769 valueW
= a2w(prop
->value
);
7770 switch(prop
->property
) {
7771 case Uri_PROPERTY_FRAGMENT
:
7772 hr
= IUriBuilder_SetFragment(builder
, valueW
);
7773 todo_wine_if(prop
->todo
) {
7774 ok(hr
== prop
->expected
,
7775 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7776 hr
, prop
->expected
, test_index
);
7779 case Uri_PROPERTY_HOST
:
7780 hr
= IUriBuilder_SetHost(builder
, valueW
);
7781 todo_wine_if(prop
->todo
) {
7782 ok(hr
== prop
->expected
,
7783 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7784 hr
, prop
->expected
, test_index
);
7787 case Uri_PROPERTY_PASSWORD
:
7788 hr
= IUriBuilder_SetPassword(builder
, valueW
);
7789 todo_wine_if(prop
->todo
) {
7790 ok(hr
== prop
->expected
,
7791 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7792 hr
, prop
->expected
, test_index
);
7795 case Uri_PROPERTY_PATH
:
7796 hr
= IUriBuilder_SetPath(builder
, valueW
);
7797 todo_wine_if(prop
->todo
) {
7798 ok(hr
== prop
->expected
,
7799 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7800 hr
, prop
->expected
, test_index
);
7803 case Uri_PROPERTY_QUERY
:
7804 hr
= IUriBuilder_SetQuery(builder
, valueW
);
7805 todo_wine_if(prop
->todo
) {
7806 ok(hr
== prop
->expected
,
7807 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7808 hr
, prop
->expected
, test_index
);
7811 case Uri_PROPERTY_SCHEME_NAME
:
7812 hr
= IUriBuilder_SetSchemeName(builder
, valueW
);
7813 todo_wine_if(prop
->todo
) {
7814 ok(hr
== prop
->expected
,
7815 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7816 hr
, prop
->expected
, test_index
);
7819 case Uri_PROPERTY_USER_NAME
:
7820 hr
= IUriBuilder_SetUserName(builder
, valueW
);
7821 todo_wine_if(prop
->todo
) {
7822 ok(hr
== prop
->expected
,
7823 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7824 hr
, prop
->expected
, test_index
);
7828 trace("Unsupported operation for %d on uri_builder_tests[%d].\n", prop
->property
, test_index
);
7835 * Simple tests to make sure the CreateUri function handles invalid flag combinations
7838 static void test_CreateUri_InvalidFlags(void) {
7841 for(i
= 0; i
< ARRAY_SIZE(invalid_flag_tests
); ++i
) {
7843 IUri
*uri
= (void*) 0xdeadbeef;
7845 hr
= pCreateUri(http_urlW
, invalid_flag_tests
[i
].flags
, 0, &uri
);
7846 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x\n",
7847 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
7848 ok(uri
== NULL
, "Error: expected the IUri to be NULL, but it was %p instead\n", uri
);
7852 static void test_CreateUri_InvalidArgs(void) {
7854 IUri
*uri
= (void*) 0xdeadbeef;
7856 const WCHAR invalidW
[] = {'i','n','v','a','l','i','d',0};
7857 static const WCHAR emptyW
[] = {0};
7859 hr
= pCreateUri(http_urlW
, 0, 0, NULL
);
7860 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
7862 hr
= pCreateUri(NULL
, 0, 0, &uri
);
7863 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
7864 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7866 uri
= (void*) 0xdeadbeef;
7867 hr
= pCreateUri(invalidW
, 0, 0, &uri
);
7868 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7869 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7871 uri
= (void*) 0xdeadbeef;
7872 hr
= pCreateUri(emptyW
, 0, 0, &uri
);
7873 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7874 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7877 static void test_CreateUri_InvalidUri(void) {
7880 for(i
= 0; i
< ARRAY_SIZE(invalid_uri_tests
); ++i
) {
7881 invalid_uri test
= invalid_uri_tests
[i
];
7886 uriW
= a2w(test
.uri
);
7887 hr
= pCreateUri(uriW
, test
.flags
, 0, &uri
);
7888 todo_wine_if(test
.todo
)
7889 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
7890 hr
, E_INVALIDARG
, i
);
7891 if(uri
) IUri_Release(uri
);
7897 static void test_IUri_GetPropertyBSTR(void) {
7902 /* Make sure GetPropertyBSTR handles invalid args correctly. */
7903 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7904 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7906 BSTR received
= NULL
;
7908 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, NULL
, 0);
7909 ok(hr
== E_POINTER
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7911 /* Make sure it handles an invalid Uri_PROPERTY correctly. */
7912 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_PORT
, &received
, 0);
7913 ok(hr
== E_INVALIDARG
/* IE10 */ || broken(hr
== S_OK
), "Error: GetPropertyBSTR returned 0x%08x, expected E_INVALIDARG or S_OK.\n", hr
);
7915 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
7916 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
7917 SysFreeString(received
);
7919 ok(!received
, "received = %s\n", wine_dbgstr_w(received
));
7922 /* Make sure it handles the ZONE property correctly. */
7924 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_ZONE
, &received
, 0);
7925 ok(hr
== S_FALSE
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, S_FALSE
);
7926 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
7927 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
7928 SysFreeString(received
);
7930 if(uri
) IUri_Release(uri
);
7932 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
7933 uri_properties test
= uri_tests
[i
];
7937 uriW
= a2w(test
.uri
);
7938 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7939 todo_wine_if(test
.create_todo
)
7940 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7941 hr
, test
.create_expected
, i
);
7946 /* Checks all the string properties of the uri. */
7947 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
7948 BSTR received
= NULL
;
7949 uri_str_property prop
= test
.str_props
[j
];
7951 hr
= IUri_GetPropertyBSTR(uri
, j
, &received
, 0);
7952 todo_wine_if(prop
.todo
) {
7953 ok(hr
== prop
.expected
||
7954 (prop
.value2
&& hr
== prop
.expected2
),
7955 "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
7956 hr
, prop
.expected
, i
, j
);
7957 ok(!strcmp_aw(prop
.value
, received
) || (prop
.value2
&& !strcmp_aw(prop
.value2
, received
)) ||
7958 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7959 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
7960 prop
.value
, wine_dbgstr_w(received
), i
, j
);
7963 SysFreeString(received
);
7967 if(uri
) IUri_Release(uri
);
7973 static void test_IUri_GetPropertyDWORD(void) {
7978 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7979 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7981 DWORD received
= 0xdeadbeef;
7983 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_DWORD_START
, NULL
, 0);
7984 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7986 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_ABSOLUTE_URI
, &received
, 0);
7987 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7988 ok(received
== 0, "Error: Expected received=%d but instead received=%d.\n", 0, received
);
7990 if(uri
) IUri_Release(uri
);
7992 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
7993 uri_properties test
= uri_tests
[i
];
7997 uriW
= a2w(test
.uri
);
7998 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7999 todo_wine_if(test
.create_todo
)
8000 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
8001 hr
, test
.create_expected
, i
);
8006 /* Checks all the DWORD properties of the uri. */
8007 for(j
= 0; j
< ARRAY_SIZE(test
.dword_props
); ++j
) {
8009 uri_dword_property prop
= test
.dword_props
[j
];
8011 hr
= IUri_GetPropertyDWORD(uri
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
8012 todo_wine_if(prop
.todo
) {
8013 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
8014 hr
, prop
.expected
, i
, j
);
8015 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
8016 prop
.value
, received
, i
, j
);
8021 if(uri
) IUri_Release(uri
);
8027 /* Tests all the 'Get*' property functions which deal with strings. */
8028 static void test_IUri_GetStrProperties(void) {
8033 /* Make sure all the 'Get*' string property functions handle invalid args correctly. */
8034 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8035 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8037 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
8038 ok(hr
== E_POINTER
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8040 hr
= IUri_GetAuthority(uri
, NULL
);
8041 ok(hr
== E_POINTER
, "Error: GetAuthority returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8043 hr
= IUri_GetDisplayUri(uri
, NULL
);
8044 ok(hr
== E_POINTER
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8046 hr
= IUri_GetDomain(uri
, NULL
);
8047 ok(hr
== E_POINTER
, "Error: GetDomain returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8049 hr
= IUri_GetExtension(uri
, NULL
);
8050 ok(hr
== E_POINTER
, "Error: GetExtension returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8052 hr
= IUri_GetFragment(uri
, NULL
);
8053 ok(hr
== E_POINTER
, "Error: GetFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8055 hr
= IUri_GetHost(uri
, NULL
);
8056 ok(hr
== E_POINTER
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8058 hr
= IUri_GetPassword(uri
, NULL
);
8059 ok(hr
== E_POINTER
, "Error: GetPassword returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8061 hr
= IUri_GetPath(uri
, NULL
);
8062 ok(hr
== E_POINTER
, "Error: GetPath returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8064 hr
= IUri_GetPathAndQuery(uri
, NULL
);
8065 ok(hr
== E_POINTER
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8067 hr
= IUri_GetQuery(uri
, NULL
);
8068 ok(hr
== E_POINTER
, "Error: GetQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8070 hr
= IUri_GetRawUri(uri
, NULL
);
8071 ok(hr
== E_POINTER
, "Error: GetRawUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8073 hr
= IUri_GetSchemeName(uri
, NULL
);
8074 ok(hr
== E_POINTER
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8076 hr
= IUri_GetUserInfo(uri
, NULL
);
8077 ok(hr
== E_POINTER
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8079 hr
= IUri_GetUserName(uri
, NULL
);
8080 ok(hr
== E_POINTER
, "Error: GetUserName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8082 if(uri
) IUri_Release(uri
);
8084 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
8085 uri_properties test
= uri_tests
[i
];
8089 uriW
= a2w(test
.uri
);
8090 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8091 todo_wine_if(test
.create_todo
)
8092 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8093 hr
, test
.create_expected
, i
);
8096 uri_str_property prop
;
8097 BSTR received
= NULL
;
8099 /* GetAbsoluteUri() tests. */
8100 prop
= test
.str_props
[Uri_PROPERTY_ABSOLUTE_URI
];
8101 hr
= IUri_GetAbsoluteUri(uri
, &received
);
8102 todo_wine_if(prop
.todo
) {
8103 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8104 hr
, prop
.expected
, i
);
8105 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
8106 "Error: Expected %s but got %s on uri_tests[%d].\n",
8107 prop
.value
, wine_dbgstr_w(received
), i
);
8109 SysFreeString(received
);
8112 /* GetAuthority() tests. */
8113 prop
= test
.str_props
[Uri_PROPERTY_AUTHORITY
];
8114 hr
= IUri_GetAuthority(uri
, &received
);
8115 todo_wine_if(prop
.todo
) {
8116 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8117 hr
, prop
.expected
, i
);
8118 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8119 prop
.value
, wine_dbgstr_w(received
), i
);
8121 SysFreeString(received
);
8124 /* GetDisplayUri() tests. */
8125 prop
= test
.str_props
[Uri_PROPERTY_DISPLAY_URI
];
8126 hr
= IUri_GetDisplayUri(uri
, &received
);
8127 todo_wine_if(prop
.todo
) {
8128 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8129 hr
, prop
.expected
, i
);
8130 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
8131 "Error: Expected %s but got %s on uri_tests[%d].\n",
8132 prop
.value
, wine_dbgstr_w(received
), i
);
8134 SysFreeString(received
);
8137 /* GetDomain() tests. */
8138 prop
= test
.str_props
[Uri_PROPERTY_DOMAIN
];
8139 hr
= IUri_GetDomain(uri
, &received
);
8140 todo_wine_if(prop
.todo
) {
8141 ok(hr
== prop
.expected
|| (prop
.value2
&& hr
== prop
.expected2
),
8142 "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8143 hr
, prop
.expected
, i
);
8144 ok(!strcmp_aw(prop
.value
, received
) || (prop
.value2
&& !strcmp_aw(prop
.value2
, received
)),
8145 "Error: Expected %s but got %s on uri_tests[%d].\n",
8146 prop
.value
, wine_dbgstr_w(received
), i
);
8148 SysFreeString(received
);
8151 /* GetExtension() tests. */
8152 prop
= test
.str_props
[Uri_PROPERTY_EXTENSION
];
8153 hr
= IUri_GetExtension(uri
, &received
);
8154 todo_wine_if(prop
.todo
) {
8155 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8156 hr
, prop
.expected
, i
);
8157 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8158 prop
.value
, wine_dbgstr_w(received
), i
);
8160 SysFreeString(received
);
8163 /* GetFragment() tests. */
8164 prop
= test
.str_props
[Uri_PROPERTY_FRAGMENT
];
8165 hr
= IUri_GetFragment(uri
, &received
);
8166 todo_wine_if(prop
.todo
) {
8167 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8168 hr
, prop
.expected
, i
);
8169 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8170 prop
.value
, wine_dbgstr_w(received
), i
);
8172 SysFreeString(received
);
8175 /* GetHost() tests. */
8176 prop
= test
.str_props
[Uri_PROPERTY_HOST
];
8177 hr
= IUri_GetHost(uri
, &received
);
8178 todo_wine_if(prop
.todo
) {
8179 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8180 hr
, prop
.expected
, i
);
8181 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8182 prop
.value
, wine_dbgstr_w(received
), i
);
8184 SysFreeString(received
);
8187 /* GetPassword() tests. */
8188 prop
= test
.str_props
[Uri_PROPERTY_PASSWORD
];
8189 hr
= IUri_GetPassword(uri
, &received
);
8190 todo_wine_if(prop
.todo
) {
8191 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8192 hr
, prop
.expected
, i
);
8193 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8194 prop
.value
, wine_dbgstr_w(received
), i
);
8196 SysFreeString(received
);
8199 /* GetPath() tests. */
8200 prop
= test
.str_props
[Uri_PROPERTY_PATH
];
8201 hr
= IUri_GetPath(uri
, &received
);
8202 todo_wine_if(prop
.todo
) {
8203 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8204 hr
, prop
.expected
, i
);
8205 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8206 prop
.value
, wine_dbgstr_w(received
), i
);
8208 SysFreeString(received
);
8211 /* GetPathAndQuery() tests. */
8212 prop
= test
.str_props
[Uri_PROPERTY_PATH_AND_QUERY
];
8213 hr
= IUri_GetPathAndQuery(uri
, &received
);
8214 todo_wine_if(prop
.todo
) {
8215 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8216 hr
, prop
.expected
, i
);
8217 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8218 prop
.value
, wine_dbgstr_w(received
), i
);
8220 SysFreeString(received
);
8223 /* GetQuery() tests. */
8224 prop
= test
.str_props
[Uri_PROPERTY_QUERY
];
8225 hr
= IUri_GetQuery(uri
, &received
);
8226 todo_wine_if(prop
.todo
) {
8227 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8228 hr
, prop
.expected
, i
);
8229 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8230 prop
.value
, wine_dbgstr_w(received
), i
);
8232 SysFreeString(received
);
8235 /* GetRawUri() tests. */
8236 prop
= test
.str_props
[Uri_PROPERTY_RAW_URI
];
8237 hr
= IUri_GetRawUri(uri
, &received
);
8238 todo_wine_if(prop
.todo
) {
8239 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8240 hr
, prop
.expected
, i
);
8241 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8242 prop
.value
, wine_dbgstr_w(received
), i
);
8244 SysFreeString(received
);
8247 /* GetSchemeName() tests. */
8248 prop
= test
.str_props
[Uri_PROPERTY_SCHEME_NAME
];
8249 hr
= IUri_GetSchemeName(uri
, &received
);
8250 todo_wine_if(prop
.todo
) {
8251 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8252 hr
, prop
.expected
, i
);
8253 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8254 prop
.value
, wine_dbgstr_w(received
), i
);
8256 SysFreeString(received
);
8259 /* GetUserInfo() tests. */
8260 prop
= test
.str_props
[Uri_PROPERTY_USER_INFO
];
8261 hr
= IUri_GetUserInfo(uri
, &received
);
8262 todo_wine_if(prop
.todo
) {
8263 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8264 hr
, prop
.expected
, i
);
8265 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8266 prop
.value
, wine_dbgstr_w(received
), i
);
8268 SysFreeString(received
);
8271 /* GetUserName() tests. */
8272 prop
= test
.str_props
[Uri_PROPERTY_USER_NAME
];
8273 hr
= IUri_GetUserName(uri
, &received
);
8274 todo_wine_if(prop
.todo
) {
8275 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8276 hr
, prop
.expected
, i
);
8277 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8278 prop
.value
, wine_dbgstr_w(received
), i
);
8280 SysFreeString(received
);
8283 if(uri
) IUri_Release(uri
);
8289 static void test_IUri_GetDwordProperties(void) {
8294 /* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
8295 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8296 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8298 hr
= IUri_GetHostType(uri
, NULL
);
8299 ok(hr
== E_INVALIDARG
, "Error: GetHostType returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8301 hr
= IUri_GetPort(uri
, NULL
);
8302 ok(hr
== E_INVALIDARG
, "Error: GetPort returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8304 hr
= IUri_GetScheme(uri
, NULL
);
8305 ok(hr
== E_INVALIDARG
, "Error: GetScheme returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8307 hr
= IUri_GetZone(uri
, NULL
);
8308 ok(hr
== E_INVALIDARG
, "Error: GetZone returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8310 if(uri
) IUri_Release(uri
);
8312 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
8313 uri_properties test
= uri_tests
[i
];
8317 uriW
= a2w(test
.uri
);
8318 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8319 todo_wine_if(test
.create_todo
)
8320 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8321 hr
, test
.create_expected
, i
);
8324 uri_dword_property prop
;
8327 /* Assign an insane value so tests don't accidentally pass when
8330 received
= -9999999;
8332 /* GetHostType() tests. */
8333 prop
= test
.dword_props
[Uri_PROPERTY_HOST_TYPE
-Uri_PROPERTY_DWORD_START
];
8334 hr
= IUri_GetHostType(uri
, &received
);
8335 todo_wine_if(prop
.todo
) {
8336 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8337 hr
, prop
.expected
, i
);
8338 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8340 received
= -9999999;
8342 /* GetPort() tests. */
8343 prop
= test
.dword_props
[Uri_PROPERTY_PORT
-Uri_PROPERTY_DWORD_START
];
8344 hr
= IUri_GetPort(uri
, &received
);
8345 todo_wine_if(prop
.todo
) {
8346 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8347 hr
, prop
.expected
, i
);
8348 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8350 received
= -9999999;
8352 /* GetScheme() tests. */
8353 prop
= test
.dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
];
8354 hr
= IUri_GetScheme(uri
, &received
);
8355 todo_wine_if(prop
.todo
) {
8356 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8357 hr
, prop
.expected
, i
);
8358 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8360 received
= -9999999;
8362 /* GetZone() tests. */
8363 prop
= test
.dword_props
[Uri_PROPERTY_ZONE
-Uri_PROPERTY_DWORD_START
];
8364 hr
= IUri_GetZone(uri
, &received
);
8365 todo_wine_if(prop
.todo
) {
8366 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8367 hr
, prop
.expected
, i
);
8368 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8372 if(uri
) IUri_Release(uri
);
8378 static void test_IUri_GetPropertyLength(void) {
8383 /* Make sure it handles invalid args correctly. */
8384 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8385 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8387 DWORD received
= 0xdeadbeef;
8389 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_STRING_START
, NULL
, 0);
8390 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8392 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_DWORD_START
, &received
, 0);
8393 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength return 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8394 ok(received
== 0xdeadbeef, "Error: Expected 0xdeadbeef but got 0x%08x.\n", received
);
8396 if(uri
) IUri_Release(uri
);
8398 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
8399 uri_properties test
= uri_tests
[i
];
8403 uriW
= a2w(test
.uri
);
8404 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8405 todo_wine_if(test
.create_todo
)
8406 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_test[%d].\n",
8407 hr
, test
.create_expected
, i
);
8412 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
8413 DWORD expectedLen
, receivedLen
;
8414 uri_str_property prop
= test
.str_props
[j
];
8415 LPWSTR expectedValueW
;
8417 expectedLen
= lstrlenA(prop
.value
);
8418 /* Value may be unicode encoded */
8419 expectedValueW
= a2w(prop
.value
);
8420 expectedLen
= lstrlenW(expectedValueW
);
8421 heap_free(expectedValueW
);
8423 /* This won't be necessary once GetPropertyLength is implemented. */
8426 hr
= IUri_GetPropertyLength(uri
, j
, &receivedLen
, 0);
8427 todo_wine_if(prop
.todo
) {
8428 ok(hr
== prop
.expected
|| (prop
.value2
&& hr
== prop
.expected2
),
8429 "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
8430 hr
, prop
.expected
, i
, j
);
8431 ok(receivedLen
== expectedLen
|| (prop
.value2
&& receivedLen
== lstrlenA(prop
.value2
)) ||
8432 broken(prop
.broken_value
&& receivedLen
== lstrlenA(prop
.broken_value
)),
8433 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
8434 expectedLen
, receivedLen
, i
, j
);
8439 if(uri
) IUri_Release(uri
);
8445 static DWORD
compute_expected_props(uri_properties
*test
, DWORD
*mask
)
8451 for(i
=Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_STRING_LAST
; i
++) {
8452 if(test
->str_props
[i
-Uri_PROPERTY_STRING_START
].expected
== S_OK
)
8454 if(test
->str_props
[i
-Uri_PROPERTY_STRING_START
].value2
== NULL
||
8455 test
->str_props
[i
-Uri_PROPERTY_STRING_START
].expected
==
8456 test
->str_props
[i
-Uri_PROPERTY_STRING_START
].expected2
)
8460 for(i
=Uri_PROPERTY_DWORD_START
; i
<= Uri_PROPERTY_DWORD_LAST
; i
++) {
8461 if(test
->dword_props
[i
-Uri_PROPERTY_DWORD_START
].expected
== S_OK
)
8469 static void test_IUri_GetProperties(void) {
8474 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8475 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8477 hr
= IUri_GetProperties(uri
, NULL
);
8478 ok(hr
== E_INVALIDARG
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8480 if(uri
) IUri_Release(uri
);
8482 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
8483 uri_properties test
= uri_tests
[i
];
8487 uriW
= a2w(test
.uri
);
8488 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8489 todo_wine_if(test
.create_todo
)
8490 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8493 DWORD received
= 0, expected_props
, mask
;
8496 hr
= IUri_GetProperties(uri
, &received
);
8497 ok(hr
== S_OK
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8499 expected_props
= compute_expected_props(&test
, &mask
);
8501 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
8502 /* (1 << j) converts a Uri_PROPERTY to its corresponding Uri_HAS_* flag mask. */
8503 if(mask
& (1 << j
)) {
8504 if(expected_props
& (1 << j
))
8505 ok(received
& (1 << j
), "Error: Expected flag for property %d on uri_tests[%d].\n", j
, i
);
8507 ok(!(received
& (1 << j
)), "Error: Received flag for property %d when not expected on uri_tests[%d].\n", j
, i
);
8512 if(uri
) IUri_Release(uri
);
8518 static void test_IUri_HasProperty(void) {
8523 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8524 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8526 hr
= IUri_HasProperty(uri
, Uri_PROPERTY_RAW_URI
, NULL
);
8527 ok(hr
== E_INVALIDARG
, "Error: HasProperty returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8529 if(uri
) IUri_Release(uri
);
8531 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); ++i
) {
8532 uri_properties test
= uri_tests
[i
];
8536 uriW
= a2w(test
.uri
);
8538 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8539 todo_wine_if(test
.create_todo
)
8540 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8543 DWORD expected_props
, j
, mask
;
8545 expected_props
= compute_expected_props(&test
, &mask
);
8547 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
8548 /* Assign -1, then explicitly test for TRUE or FALSE later. */
8551 hr
= IUri_HasProperty(uri
, j
, &received
);
8552 ok(hr
== S_OK
, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
8555 if(mask
& (1 << j
)) {
8556 if(expected_props
& (1 << j
)) {
8557 ok(received
== TRUE
, "Error: Expected to have property %d on uri_tests[%d].\n", j
, i
);
8559 ok(received
== FALSE
, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j
, i
);
8565 if(uri
) IUri_Release(uri
);
8576 static inline struct custom_uri
* impl_from_IUri(IUri
*iface
)
8578 return CONTAINING_RECORD(iface
, struct custom_uri
, IUri_iface
);
8581 static HRESULT WINAPI
custom_uri_QueryInterface(IUri
*iface
, REFIID iid
, void **out
)
8583 if (IsEqualIID(iid
, &IID_IUri
) || IsEqualIID(iid
, &IID_IUnknown
))
8591 return E_NOINTERFACE
;
8594 static ULONG WINAPI
custom_uri_AddRef(IUri
*iface
)
8596 struct custom_uri
*uri
= impl_from_IUri(iface
);
8597 return IUri_AddRef(uri
->uri
);
8600 static ULONG WINAPI
custom_uri_Release(IUri
*iface
)
8602 struct custom_uri
*uri
= impl_from_IUri(iface
);
8603 return IUri_Release(uri
->uri
);
8606 static HRESULT WINAPI
custom_uri_GetPropertyBSTR(IUri
*iface
, Uri_PROPERTY property
, BSTR
*value
, DWORD flags
)
8608 struct custom_uri
*uri
= impl_from_IUri(iface
);
8609 return IUri_GetPropertyBSTR(uri
->uri
, property
, value
, flags
);
8612 static HRESULT WINAPI
custom_uri_GetPropertyLength(IUri
*iface
, Uri_PROPERTY property
, DWORD
*length
, DWORD flags
)
8614 struct custom_uri
*uri
= impl_from_IUri(iface
);
8615 return IUri_GetPropertyLength(uri
->uri
, property
, length
, flags
);
8618 static HRESULT WINAPI
custom_uri_GetPropertyDWORD(IUri
*iface
, Uri_PROPERTY property
, DWORD
*value
, DWORD flags
)
8620 struct custom_uri
*uri
= impl_from_IUri(iface
);
8621 return IUri_GetPropertyDWORD(uri
->uri
, property
, value
, flags
);
8624 static HRESULT WINAPI
custom_uri_HasProperty(IUri
*iface
, Uri_PROPERTY property
, BOOL
*has_property
)
8626 struct custom_uri
*uri
= impl_from_IUri(iface
);
8627 return IUri_HasProperty(uri
->uri
, property
, has_property
);
8630 static HRESULT WINAPI
custom_uri_GetAbsoluteUri(IUri
*iface
, BSTR
*value
)
8632 struct custom_uri
*uri
= impl_from_IUri(iface
);
8633 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8636 static HRESULT WINAPI
custom_uri_GetAuthority(IUri
*iface
, BSTR
*value
)
8638 struct custom_uri
*uri
= impl_from_IUri(iface
);
8639 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8642 static HRESULT WINAPI
custom_uri_GetDisplayUri(IUri
*iface
, BSTR
*value
)
8644 struct custom_uri
*uri
= impl_from_IUri(iface
);
8645 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8648 static HRESULT WINAPI
custom_uri_GetDomain(IUri
*iface
, BSTR
*value
)
8650 struct custom_uri
*uri
= impl_from_IUri(iface
);
8651 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8654 static HRESULT WINAPI
custom_uri_GetExtension(IUri
*iface
, BSTR
*value
)
8656 struct custom_uri
*uri
= impl_from_IUri(iface
);
8657 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8660 static HRESULT WINAPI
custom_uri_GetFragment(IUri
*iface
, BSTR
*value
)
8662 struct custom_uri
*uri
= impl_from_IUri(iface
);
8663 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8666 static HRESULT WINAPI
custom_uri_GetHost(IUri
*iface
, BSTR
*value
)
8668 struct custom_uri
*uri
= impl_from_IUri(iface
);
8669 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8672 static HRESULT WINAPI
custom_uri_GetPassword(IUri
*iface
, BSTR
*value
)
8674 struct custom_uri
*uri
= impl_from_IUri(iface
);
8675 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8678 static HRESULT WINAPI
custom_uri_GetPath(IUri
*iface
, BSTR
*value
)
8680 struct custom_uri
*uri
= impl_from_IUri(iface
);
8681 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8684 static HRESULT WINAPI
custom_uri_GetPathAndQuery(IUri
*iface
, BSTR
*value
)
8686 struct custom_uri
*uri
= impl_from_IUri(iface
);
8687 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8690 static HRESULT WINAPI
custom_uri_GetQuery(IUri
*iface
, BSTR
*value
)
8692 struct custom_uri
*uri
= impl_from_IUri(iface
);
8693 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8696 static HRESULT WINAPI
custom_uri_GetRawUri(IUri
*iface
, BSTR
*value
)
8698 struct custom_uri
*uri
= impl_from_IUri(iface
);
8699 return IUri_GetAbsoluteUri(uri
->uri
, value
);
8702 static HRESULT WINAPI
custom_uri_GetSchemeName(IUri
*iface
, BSTR
*value
)
8704 struct custom_uri
*uri
= impl_from_IUri(iface
);
8705 return IUri_GetSchemeName(uri
->uri
, value
);
8708 static HRESULT WINAPI
custom_uri_GetUserInfo(IUri
*iface
, BSTR
*value
)
8710 struct custom_uri
*uri
= impl_from_IUri(iface
);
8711 return IUri_GetUserInfo(uri
->uri
, value
);
8714 static HRESULT WINAPI
custom_uri_GetUserName(IUri
*iface
, BSTR
*value
)
8716 struct custom_uri
*uri
= impl_from_IUri(iface
);
8717 return IUri_GetUserName(uri
->uri
, value
);
8720 static HRESULT WINAPI
custom_uri_GetHostType(IUri
*iface
, DWORD
*value
)
8722 struct custom_uri
*uri
= impl_from_IUri(iface
);
8723 return IUri_GetHostType(uri
->uri
, value
);
8726 static HRESULT WINAPI
custom_uri_GetPort(IUri
*iface
, DWORD
*value
)
8728 struct custom_uri
*uri
= impl_from_IUri(iface
);
8729 return IUri_GetPort(uri
->uri
, value
);
8732 static HRESULT WINAPI
custom_uri_GetScheme(IUri
*iface
, DWORD
*value
)
8734 struct custom_uri
*uri
= impl_from_IUri(iface
);
8735 return IUri_GetScheme(uri
->uri
, value
);
8738 static HRESULT WINAPI
custom_uri_GetZone(IUri
*iface
, DWORD
*value
)
8740 struct custom_uri
*uri
= impl_from_IUri(iface
);
8741 return IUri_GetZone(uri
->uri
, value
);
8744 static HRESULT WINAPI
custom_uri_GetProperties(IUri
*iface
, DWORD
*flags
)
8746 struct custom_uri
*uri
= impl_from_IUri(iface
);
8747 return IUri_GetProperties(uri
->uri
, flags
);
8750 static HRESULT WINAPI
custom_uri_IsEqual(IUri
*iface
, IUri
*pUri
, BOOL
*is_equal
)
8752 struct custom_uri
*uri
= impl_from_IUri(iface
);
8753 return IUri_IsEqual(uri
->uri
, pUri
, is_equal
);
8756 static const IUriVtbl custom_uri_vtbl
=
8758 custom_uri_QueryInterface
,
8761 custom_uri_GetPropertyBSTR
,
8762 custom_uri_GetPropertyLength
,
8763 custom_uri_GetPropertyDWORD
,
8764 custom_uri_HasProperty
,
8765 custom_uri_GetAbsoluteUri
,
8766 custom_uri_GetAuthority
,
8767 custom_uri_GetDisplayUri
,
8768 custom_uri_GetDomain
,
8769 custom_uri_GetExtension
,
8770 custom_uri_GetFragment
,
8772 custom_uri_GetPassword
,
8774 custom_uri_GetPathAndQuery
,
8775 custom_uri_GetQuery
,
8776 custom_uri_GetRawUri
,
8777 custom_uri_GetSchemeName
,
8778 custom_uri_GetUserInfo
,
8779 custom_uri_GetUserName
,
8780 custom_uri_GetHostType
,
8782 custom_uri_GetScheme
,
8784 custom_uri_GetProperties
,
8788 static void test_IUri_IsEqual(void) {
8789 struct custom_uri custom_uri
;
8797 /* Make sure IsEqual handles invalid args correctly. */
8798 hres
= pCreateUri(http_urlW
, 0, 0, &uriA
);
8799 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8800 hres
= pCreateUri(http_urlW
, 0, 0, &uriB
);
8801 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8804 hres
= IUri_IsEqual(uriA
, NULL
, &equal
);
8805 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8806 ok(!equal
, "Error: Expected equal to be FALSE, but was %d instead.\n", equal
);
8808 hres
= IUri_IsEqual(uriA
, uriB
, NULL
);
8809 ok(hres
== E_POINTER
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hres
, E_POINTER
);
8812 hres
= IUri_IsEqual(uriA
, uriA
, &equal
);
8813 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8814 ok(equal
, "Error: Expected equal URIs.\n");
8817 hres
= IUri_IsEqual(uriA
, uriB
, &equal
);
8818 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8819 ok(equal
, "Error: Expected equal URIs.\n");
8824 custom_uri
.IUri_iface
.lpVtbl
= &custom_uri_vtbl
;
8826 for(i
= 0; i
< ARRAY_SIZE(equality_tests
); ++i
) {
8827 uri_equality test
= equality_tests
[i
];
8828 LPWSTR uriA_W
, uriB_W
;
8832 uriA_W
= a2w(test
.a
);
8833 uriB_W
= a2w(test
.b
);
8835 hres
= pCreateUri(uriA_W
, test
.create_flags_a
, 0, &uriA
);
8836 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n", hres
, S_OK
, i
);
8838 hres
= pCreateUri(uriB_W
, test
.create_flags_b
, 0, &uriB
);
8839 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n", hres
, S_OK
, i
);
8842 hres
= IUri_IsEqual(uriA
, uriB
, &equal
);
8843 todo_wine_if(test
.todo
) {
8844 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hres
, S_OK
, i
);
8845 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
8848 custom_uri
.uri
= uriB
;
8851 hres
= IUri_IsEqual(uriA
, &custom_uri
.IUri_iface
, &equal
);
8853 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hres
, S_OK
, i
);
8854 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
8857 if(uriA
) IUri_Release(uriA
);
8858 if(uriB
) IUri_Release(uriB
);
8865 static void test_CreateUriWithFragment_InvalidArgs(void) {
8867 IUri
*uri
= (void*) 0xdeadbeef;
8868 const WCHAR fragmentW
[] = {'#','f','r','a','g','m','e','n','t',0};
8870 hr
= pCreateUriWithFragment(NULL
, fragmentW
, 0, 0, &uri
);
8871 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8872 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8874 hr
= pCreateUriWithFragment(http_urlW
, fragmentW
, 0, 0, NULL
);
8875 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8877 /* Original URI can't already contain a fragment component. */
8878 uri
= (void*) 0xdeadbeef;
8879 hr
= pCreateUriWithFragment(http_url_fragW
, fragmentW
, 0, 0, &uri
);
8880 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8881 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8884 /* CreateUriWithFragment has the same invalid flag combinations as CreateUri. */
8885 static void test_CreateUriWithFragment_InvalidFlags(void) {
8888 for(i
= 0; i
< ARRAY_SIZE(invalid_flag_tests
); ++i
) {
8890 IUri
*uri
= (void*) 0xdeadbeef;
8892 hr
= pCreateUriWithFragment(http_urlW
, NULL
, invalid_flag_tests
[i
].flags
, 0, &uri
);
8893 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x. flags=0x%08x.\n",
8894 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
8895 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8899 static void test_CreateUriWithFragment(void) {
8902 for(i
= 0; i
< ARRAY_SIZE(uri_fragment_tests
); ++i
) {
8906 uri_with_fragment test
= uri_fragment_tests
[i
];
8908 uriW
= a2w(test
.uri
);
8909 fragW
= a2w(test
.fragment
);
8911 hr
= pCreateUriWithFragment(uriW
, fragW
, test
.create_flags
, 0, &uri
);
8912 todo_wine_if(test
.expected_todo
)
8913 ok(hr
== test
.create_expected
,
8914 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8915 hr
, test
.create_expected
, i
);
8918 BSTR received
= NULL
;
8920 hr
= IUri_GetAbsoluteUri(uri
, &received
);
8921 todo_wine_if(test
.expected_todo
) {
8922 ok(hr
== S_OK
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8924 ok(!strcmp_aw(test
.expected_uri
, received
), "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
8925 test
.expected_uri
, wine_dbgstr_w(received
), i
);
8928 SysFreeString(received
);
8931 if(uri
) IUri_Release(uri
);
8937 static void test_CreateIUriBuilder(void) {
8939 IUriBuilder
*builder
= NULL
;
8942 hr
= pCreateIUriBuilder(NULL
, 0, 0, NULL
);
8943 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x\n",
8946 /* CreateIUriBuilder increases the ref count of the IUri it receives. */
8947 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8948 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8950 ULONG cur_count
, orig_count
;
8952 orig_count
= get_refcnt(uri
);
8953 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
8954 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8955 ok(builder
!= NULL
, "Error: Expecting builder not to be NULL\n");
8957 cur_count
= get_refcnt(uri
);
8958 ok(cur_count
== orig_count
+1, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
+1, cur_count
);
8960 if(builder
) IUriBuilder_Release(builder
);
8961 cur_count
= get_refcnt(uri
);
8962 ok(cur_count
== orig_count
, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
, cur_count
);
8964 if(uri
) IUri_Release(uri
);
8967 static void test_IUriBuilder_CreateUri(IUriBuilder
*builder
, const uri_builder_test
*test
,
8972 hr
= IUriBuilder_CreateUri(builder
, test
->uri_flags
, 0, 0, &uri
);
8973 todo_wine_if(test
->uri_todo
)
8974 ok(hr
== test
->uri_hres
,
8975 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8976 hr
, test
->uri_hres
, test_index
);
8981 for(i
= 0; i
< ARRAY_SIZE(test
->expected_str_props
); ++i
) {
8982 uri_builder_str_property prop
= test
->expected_str_props
[i
];
8983 BSTR received
= NULL
;
8985 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
8986 todo_wine_if(prop
.todo
)
8987 ok(hr
== prop
.result
,
8988 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8989 hr
, prop
.result
, test_index
, i
);
8991 todo_wine_if(prop
.todo
)
8992 ok(!strcmp_aw(prop
.expected
, received
),
8993 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8994 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8996 SysFreeString(received
);
8999 for(i
= 0; i
< ARRAY_SIZE(test
->expected_dword_props
); ++i
) {
9000 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
9001 DWORD received
= -2;
9003 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
9004 todo_wine_if(prop
.todo
)
9005 ok(hr
== prop
.result
,
9006 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
9007 hr
, prop
.result
, test_index
, i
);
9009 todo_wine_if(prop
.todo
)
9010 ok(received
== prop
.expected
,
9011 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
9012 prop
.expected
, received
, test_index
, i
);
9016 if(uri
) IUri_Release(uri
);
9019 static void test_IUriBuilder_CreateUriSimple(IUriBuilder
*builder
, const uri_builder_test
*test
,
9024 hr
= IUriBuilder_CreateUriSimple(builder
, test
->uri_simple_encode_flags
, 0, &uri
);
9025 todo_wine_if(test
->uri_simple_todo
)
9026 ok(hr
== test
->uri_simple_hres
,
9027 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9028 hr
, test
->uri_simple_hres
, test_index
);
9033 for(i
= 0; i
< ARRAY_SIZE(test
->expected_str_props
); ++i
) {
9034 uri_builder_str_property prop
= test
->expected_str_props
[i
];
9035 BSTR received
= NULL
;
9037 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
9038 todo_wine_if(prop
.todo
)
9039 ok(hr
== prop
.result
,
9040 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
9041 hr
, prop
.result
, test_index
, i
);
9043 todo_wine_if(prop
.todo
)
9044 ok(!strcmp_aw(prop
.expected
, received
),
9045 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
9046 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
9048 SysFreeString(received
);
9051 for(i
= 0; i
< ARRAY_SIZE(test
->expected_dword_props
); ++i
) {
9052 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
9053 DWORD received
= -2;
9055 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
9056 todo_wine_if(prop
.todo
)
9057 ok(hr
== prop
.result
,
9058 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
9059 hr
, prop
.result
, test_index
, i
);
9061 todo_wine_if(prop
.todo
)
9062 ok(received
== prop
.expected
,
9063 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
9064 prop
.expected
, received
, test_index
, i
);
9068 if(uri
) IUri_Release(uri
);
9071 static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder
*builder
, const uri_builder_test
*test
,
9076 hr
= IUriBuilder_CreateUriWithFlags(builder
, test
->uri_with_flags
, test
->uri_with_builder_flags
,
9077 test
->uri_with_encode_flags
, 0, &uri
);
9078 todo_wine_if(test
->uri_with_todo
)
9079 ok(hr
== test
->uri_with_hres
,
9080 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9081 hr
, test
->uri_with_hres
, test_index
);
9086 for(i
= 0; i
< ARRAY_SIZE(test
->expected_str_props
); ++i
) {
9087 uri_builder_str_property prop
= test
->expected_str_props
[i
];
9088 BSTR received
= NULL
;
9090 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
9091 todo_wine_if(prop
.todo
)
9092 ok(hr
== prop
.result
,
9093 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
9094 hr
, prop
.result
, test_index
, i
);
9096 todo_wine_if(prop
.todo
)
9097 ok(!strcmp_aw(prop
.expected
, received
),
9098 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
9099 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
9101 SysFreeString(received
);
9104 for(i
= 0; i
< ARRAY_SIZE(test
->expected_dword_props
); ++i
) {
9105 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
9106 DWORD received
= -2;
9108 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
9109 todo_wine_if(prop
.todo
)
9110 ok(hr
== prop
.result
,
9111 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
9112 hr
, prop
.result
, test_index
, i
);
9114 todo_wine_if(prop
.todo
)
9115 ok(received
== prop
.expected
,
9116 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
9117 prop
.expected
, received
, test_index
, i
);
9121 if(uri
) IUri_Release(uri
);
9124 static void test_IUriBuilder_CreateInvalidArgs(void) {
9125 IUriBuilder
*builder
;
9128 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
9129 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9131 IUri
*test
= NULL
, *uri
= (void*) 0xdeadbeef;
9133 /* Test what happens if the IUriBuilder doesn't have a IUri set. */
9134 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, NULL
);
9135 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
9137 uri
= (void*) 0xdeadbeef;
9138 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
9139 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_NOTIMPL
);
9140 ok(uri
== NULL
, "Error: expected uri to be NULL, but was %p instead.\n", uri
);
9142 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, NULL
);
9143 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
9146 uri
= (void*) 0xdeadbeef;
9147 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
9148 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
9150 ok(!uri
, "Error: Expected uri to NULL, but was %p instead.\n", uri
);
9152 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, NULL
);
9153 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
9156 uri
= (void*) 0xdeadbeef;
9157 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
9158 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
9160 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
9162 hr
= pCreateUri(http_urlW
, 0, 0, &test
);
9163 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9165 hr
= IUriBuilder_SetIUri(builder
, test
);
9166 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9168 /* No longer returns E_NOTIMPL, since a IUri has been set and hasn't been modified. */
9170 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
9171 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9172 ok(uri
!= NULL
, "Error: The uri was NULL.\n");
9173 if(uri
) IUri_Release(uri
);
9176 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
9177 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
9179 ok(uri
!= NULL
, "Error: uri was NULL.\n");
9180 if(uri
) IUri_Release(uri
);
9183 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &uri
);
9184 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
9186 ok(uri
!= NULL
, "Error: uri was NULL.\n");
9187 if(uri
) IUri_Release(uri
);
9189 hr
= IUriBuilder_SetFragment(builder
, NULL
);
9190 ok(hr
== S_OK
, "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9192 /* The IUriBuilder is changed, so it returns E_NOTIMPL again. */
9193 uri
= (void*) 0xdeadbeef;
9194 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
9195 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9196 ok(!uri
, "Error: Expected uri to be NULL but was %p instead.\n", uri
);
9198 uri
= (void*) 0xdeadbeef;
9199 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
9200 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
9202 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
9204 uri
= (void*) 0xdeadbeef;
9205 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
9206 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
9208 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
9210 if(test
) IUri_Release(test
);
9212 if(builder
) IUriBuilder_Release(builder
);
9215 /* Tests invalid args to the "Get*" functions. */
9216 static void test_IUriBuilder_GetInvalidArgs(void) {
9217 IUriBuilder
*builder
= NULL
;
9220 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
9221 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9223 LPCWSTR received
= (void*) 0xdeadbeef;
9224 DWORD len
= -1, port
= -1;
9227 hr
= IUriBuilder_GetFragment(builder
, NULL
, NULL
);
9228 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
9230 hr
= IUriBuilder_GetFragment(builder
, NULL
, &received
);
9231 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
9233 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9234 hr
= IUriBuilder_GetFragment(builder
, &len
, NULL
);
9235 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
9237 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
9239 hr
= IUriBuilder_GetHost(builder
, NULL
, NULL
);
9240 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
9242 received
= (void*) 0xdeadbeef;
9243 hr
= IUriBuilder_GetHost(builder
, NULL
, &received
);
9244 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
9246 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9248 hr
= IUriBuilder_GetHost(builder
, &len
, NULL
);
9249 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
9251 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
9253 hr
= IUriBuilder_GetPassword(builder
, NULL
, NULL
);
9254 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
9256 received
= (void*) 0xdeadbeef;
9257 hr
= IUriBuilder_GetPassword(builder
, NULL
, &received
);
9258 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
9260 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9262 hr
= IUriBuilder_GetPassword(builder
, &len
, NULL
);
9263 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
9265 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
9267 hr
= IUriBuilder_GetPath(builder
, NULL
, NULL
);
9268 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
9270 received
= (void*) 0xdeadbeef;
9271 hr
= IUriBuilder_GetPath(builder
, NULL
, &received
);
9272 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
9274 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9276 hr
= IUriBuilder_GetPath(builder
, &len
, NULL
);
9277 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
9279 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
9281 hr
= IUriBuilder_GetPort(builder
, NULL
, NULL
);
9282 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
9284 hr
= IUriBuilder_GetPort(builder
, NULL
, &port
);
9285 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
9287 ok(!port
, "Error: Expected port to be 0, but was %d instead.\n", port
);
9288 hr
= IUriBuilder_GetPort(builder
, &set
, NULL
);
9289 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
9291 ok(!set
, "Error: Expected set to be FALSE, but was %d instead.\n", set
);
9293 hr
= IUriBuilder_GetQuery(builder
, NULL
, NULL
);
9294 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
9296 received
= (void*) 0xdeadbeef;
9297 hr
= IUriBuilder_GetQuery(builder
, NULL
, &received
);
9298 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
9300 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9302 hr
= IUriBuilder_GetQuery(builder
, &len
, NULL
);
9303 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
9305 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
9307 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, NULL
);
9308 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
9310 received
= (void*) 0xdeadbeef;
9311 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, &received
);
9312 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
9314 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9316 hr
= IUriBuilder_GetSchemeName(builder
, &len
, NULL
);
9317 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
9319 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
9321 hr
= IUriBuilder_GetUserName(builder
, NULL
, NULL
);
9322 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
9324 received
= (void*) 0xdeadbeef;
9325 hr
= IUriBuilder_GetUserName(builder
, NULL
, &received
);
9326 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
9328 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9330 hr
= IUriBuilder_GetUserName(builder
, &len
, NULL
);
9331 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
9333 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
9335 if(builder
) IUriBuilder_Release(builder
);
9338 static void test_IUriBuilder_GetFragment(IUriBuilder
*builder
, const uri_builder_test
*test
,
9342 LPCWSTR received
= NULL
;
9344 const uri_builder_property
*prop
= NULL
;
9346 /* Check if the property was set earlier. */
9347 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9348 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_FRAGMENT
)
9349 prop
= &(test
->properties
[i
]);
9353 /* Use expected_value unless it's NULL, then use value. */
9354 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9355 DWORD expected_len
= expected
? strlen(expected
) : 0;
9356 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9357 todo_wine_if(prop
->todo
) {
9358 ok(hr
== (expected
? S_OK
: S_FALSE
),
9359 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9360 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9362 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9363 expected
, wine_dbgstr_w(received
), test_index
);
9364 ok(expected_len
== len
,
9365 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9366 expected_len
, len
, test_index
);
9370 /* The property wasn't set earlier, so it should return whatever
9371 * the base IUri contains (if anything).
9374 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9376 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9377 hr
, S_OK
, test_index
);
9380 received
= (void*) 0xdeadbeef;
9383 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9385 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9386 hr
, S_FALSE
, test_index
);
9388 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9390 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9391 received
, test_index
);
9394 BOOL has_prop
= FALSE
;
9395 BSTR expected
= NULL
;
9397 hr
= IUri_GetFragment(uri
, &expected
);
9399 "Error: Expected IUri_GetFragment to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9401 has_prop
= hr
== S_OK
;
9403 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9406 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9407 hr
, S_OK
, test_index
);
9409 ok(!lstrcmpW(expected
, received
),
9410 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9411 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9412 ok(lstrlenW(expected
) == len
,
9413 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9414 lstrlenW(expected
), len
, test_index
);
9418 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9419 hr
, S_FALSE
, test_index
);
9421 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9422 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9426 SysFreeString(expected
);
9429 if(uri
) IUri_Release(uri
);
9433 static void test_IUriBuilder_GetHost(IUriBuilder
*builder
, const uri_builder_test
*test
,
9437 LPCWSTR received
= NULL
;
9439 const uri_builder_property
*prop
= NULL
;
9441 /* Check if the property was set earlier. */
9442 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9443 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_HOST
)
9444 prop
= &(test
->properties
[i
]);
9448 /* Use expected_value unless it's NULL, then use value. */
9449 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9450 DWORD expected_len
= expected
? strlen(expected
) : 0;
9451 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9452 todo_wine_if(prop
->todo
) {
9453 ok(hr
== (expected
? S_OK
: S_FALSE
),
9454 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9455 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9457 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9458 expected
, wine_dbgstr_w(received
), test_index
);
9459 ok(expected_len
== len
,
9460 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9461 expected_len
, len
, test_index
);
9465 /* The property wasn't set earlier, so it should return whatever
9466 * the base IUri contains (if anything).
9469 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9471 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9472 hr
, S_OK
, test_index
);
9475 received
= (void*) 0xdeadbeef;
9478 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9480 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9481 hr
, S_FALSE
, test_index
);
9483 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9485 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9486 received
, test_index
);
9489 BOOL has_prop
= FALSE
;
9490 BSTR expected
= NULL
;
9492 hr
= IUri_GetHost(uri
, &expected
);
9494 "Error: Expected IUri_GetHost to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9496 has_prop
= hr
== S_OK
;
9498 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9501 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9502 hr
, S_OK
, test_index
);
9504 ok(!lstrcmpW(expected
, received
),
9505 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9506 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9507 ok(lstrlenW(expected
) == len
,
9508 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9509 lstrlenW(expected
), len
, test_index
);
9513 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9514 hr
, S_FALSE
, test_index
);
9516 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9517 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9521 SysFreeString(expected
);
9524 if(uri
) IUri_Release(uri
);
9528 static void test_IUriBuilder_GetPassword(IUriBuilder
*builder
, const uri_builder_test
*test
,
9532 LPCWSTR received
= NULL
;
9534 const uri_builder_property
*prop
= NULL
;
9536 /* Check if the property was set earlier. */
9537 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9538 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PASSWORD
)
9539 prop
= &(test
->properties
[i
]);
9543 /* Use expected_value unless it's NULL, then use value. */
9544 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9545 DWORD expected_len
= expected
? strlen(expected
) : 0;
9546 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9547 todo_wine_if(prop
->todo
) {
9548 ok(hr
== (expected
? S_OK
: S_FALSE
),
9549 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9550 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9552 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9553 expected
, wine_dbgstr_w(received
), test_index
);
9554 ok(expected_len
== len
,
9555 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9556 expected_len
, len
, test_index
);
9560 /* The property wasn't set earlier, so it should return whatever
9561 * the base IUri contains (if anything).
9564 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9566 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9567 hr
, S_OK
, test_index
);
9570 received
= (void*) 0xdeadbeef;
9573 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9575 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9576 hr
, S_FALSE
, test_index
);
9578 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9580 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9581 received
, test_index
);
9584 BOOL has_prop
= FALSE
;
9585 BSTR expected
= NULL
;
9587 hr
= IUri_GetPassword(uri
, &expected
);
9589 "Error: Expected IUri_GetPassword to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9591 has_prop
= hr
== S_OK
;
9593 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9596 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9597 hr
, S_OK
, test_index
);
9599 ok(!lstrcmpW(expected
, received
),
9600 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9601 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9602 ok(lstrlenW(expected
) == len
,
9603 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9604 lstrlenW(expected
), len
, test_index
);
9608 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9609 hr
, S_FALSE
, test_index
);
9611 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9612 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9616 SysFreeString(expected
);
9619 if(uri
) IUri_Release(uri
);
9623 static void test_IUriBuilder_GetPath(IUriBuilder
*builder
, const uri_builder_test
*test
,
9627 LPCWSTR received
= NULL
;
9629 const uri_builder_property
*prop
= NULL
;
9631 /* Check if the property was set earlier. */
9632 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9633 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PATH
)
9634 prop
= &(test
->properties
[i
]);
9638 /* Use expected_value unless it's NULL, then use value. */
9639 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9640 DWORD expected_len
= expected
? strlen(expected
) : 0;
9641 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9642 todo_wine_if(prop
->todo
) {
9643 ok(hr
== (expected
? S_OK
: S_FALSE
),
9644 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9645 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9647 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9648 expected
, wine_dbgstr_w(received
), test_index
);
9649 ok(expected_len
== len
,
9650 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9651 expected_len
, len
, test_index
);
9655 /* The property wasn't set earlier, so it should return whatever
9656 * the base IUri contains (if anything).
9659 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9661 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9662 hr
, S_OK
, test_index
);
9665 received
= (void*) 0xdeadbeef;
9668 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9670 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9671 hr
, S_FALSE
, test_index
);
9673 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9675 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9676 received
, test_index
);
9679 BOOL has_prop
= FALSE
;
9680 BSTR expected
= NULL
;
9682 hr
= IUri_GetPath(uri
, &expected
);
9684 "Error: Expected IUri_GetPath to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9686 has_prop
= hr
== S_OK
;
9688 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9691 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9692 hr
, S_OK
, test_index
);
9694 ok(!lstrcmpW(expected
, received
),
9695 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9696 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9697 ok(lstrlenW(expected
) == len
,
9698 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9699 lstrlenW(expected
), len
, test_index
);
9703 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9704 hr
, S_FALSE
, test_index
);
9706 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9707 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9711 SysFreeString(expected
);
9714 if(uri
) IUri_Release(uri
);
9718 static void test_IUriBuilder_GetPort(IUriBuilder
*builder
, const uri_builder_test
*test
,
9721 BOOL has_port
= FALSE
;
9722 DWORD received
= -1;
9724 if(test
->port_prop
.change
) {
9725 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9726 todo_wine_if(test
->port_prop
.todo
) {
9728 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9729 hr
, S_OK
, test_index
);
9731 ok(has_port
== test
->port_prop
.set
,
9732 "Error: Expected has_port to be %d, but was %d instead on uri_builder_tests[%d].\n",
9733 test
->port_prop
.set
, has_port
, test_index
);
9734 ok(received
== test
->port_prop
.value
,
9735 "Error: Expected port to be %d, but was %d instead on uri_builder_tests[%d].\n",
9736 test
->port_prop
.value
, received
, test_index
);
9742 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9744 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9745 hr
, S_OK
, test_index
);
9748 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9750 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9751 hr
, S_OK
, test_index
);
9753 ok(has_port
== FALSE
,
9754 "Error: Expected has_port to be FALSE, but was %d instead on uri_builder_tests[%d].\n",
9755 has_port
, test_index
);
9756 ok(!received
, "Error: Expected received to be 0, but was %d instead on uri_builder_tests[%d].\n",
9757 received
, test_index
);
9762 hr
= IUri_GetPort(uri
, &expected
);
9764 "Error: Expected IUri_Port to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9767 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9769 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9770 hr
, S_OK
, test_index
);
9773 "Error: Expected has_port to be FALSE but was TRUE instead on uri_builder_tests[%d].\n",
9775 ok(received
== expected
,
9776 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
9777 expected
, received
, test_index
);
9781 if(uri
) IUri_Release(uri
);
9785 static void test_IUriBuilder_GetQuery(IUriBuilder
*builder
, const uri_builder_test
*test
,
9789 LPCWSTR received
= NULL
;
9791 const uri_builder_property
*prop
= NULL
;
9793 /* Check if the property was set earlier. */
9794 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9795 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_QUERY
)
9796 prop
= &(test
->properties
[i
]);
9800 /* Use expected_value unless it's NULL, then use value. */
9801 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9802 DWORD expected_len
= expected
? strlen(expected
) : 0;
9803 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9804 todo_wine_if(prop
->todo
) {
9805 ok(hr
== (expected
? S_OK
: S_FALSE
),
9806 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9807 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9809 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9810 expected
, wine_dbgstr_w(received
), test_index
);
9811 ok(expected_len
== len
,
9812 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9813 expected_len
, len
, test_index
);
9817 /* The property wasn't set earlier, so it should return whatever
9818 * the base IUri contains (if anything).
9821 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9823 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9824 hr
, S_OK
, test_index
);
9827 received
= (void*) 0xdeadbeef;
9830 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9832 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9833 hr
, S_FALSE
, test_index
);
9835 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9837 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9838 received
, test_index
);
9841 BOOL has_prop
= FALSE
;
9842 BSTR expected
= NULL
;
9844 hr
= IUri_GetQuery(uri
, &expected
);
9846 "Error: Expected IUri_GetQuery to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9848 has_prop
= hr
== S_OK
;
9850 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9853 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9854 hr
, S_OK
, test_index
);
9856 ok(!lstrcmpW(expected
, received
),
9857 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9858 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9859 ok(lstrlenW(expected
) == len
,
9860 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9861 lstrlenW(expected
), len
, test_index
);
9865 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9866 hr
, S_FALSE
, test_index
);
9868 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9869 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9873 SysFreeString(expected
);
9876 if(uri
) IUri_Release(uri
);
9880 static void test_IUriBuilder_GetSchemeName(IUriBuilder
*builder
, const uri_builder_test
*test
,
9884 LPCWSTR received
= NULL
;
9886 const uri_builder_property
*prop
= NULL
;
9888 /* Check if the property was set earlier. */
9889 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9890 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_SCHEME_NAME
)
9891 prop
= &(test
->properties
[i
]);
9895 /* Use expected_value unless it's NULL, then use value. */
9896 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9897 DWORD expected_len
= expected
? strlen(expected
) : 0;
9898 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9899 todo_wine_if(prop
->todo
) {
9900 ok(hr
== (expected
? S_OK
: S_FALSE
),
9901 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9902 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9904 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9905 expected
, wine_dbgstr_w(received
), test_index
);
9906 ok(expected_len
== len
,
9907 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9908 expected_len
, len
, test_index
);
9912 /* The property wasn't set earlier, so it should return whatever
9913 * the base IUri contains (if anything).
9916 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9918 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9919 hr
, S_OK
, test_index
);
9922 received
= (void*) 0xdeadbeef;
9925 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9927 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9928 hr
, S_FALSE
, test_index
);
9930 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9932 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9933 received
, test_index
);
9936 BOOL has_prop
= FALSE
;
9937 BSTR expected
= NULL
;
9939 hr
= IUri_GetSchemeName(uri
, &expected
);
9941 "Error: Expected IUri_GetSchemeName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9943 has_prop
= hr
== S_OK
;
9945 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9948 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9949 hr
, S_OK
, test_index
);
9951 ok(!lstrcmpW(expected
, received
),
9952 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9953 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9954 ok(lstrlenW(expected
) == len
,
9955 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9956 lstrlenW(expected
), len
, test_index
);
9960 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9961 hr
, S_FALSE
, test_index
);
9963 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9964 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9968 SysFreeString(expected
);
9971 if(uri
) IUri_Release(uri
);
9975 static void test_IUriBuilder_GetUserName(IUriBuilder
*builder
, const uri_builder_test
*test
,
9979 LPCWSTR received
= NULL
;
9981 const uri_builder_property
*prop
= NULL
;
9983 /* Check if the property was set earlier. */
9984 for(i
= 0; i
< ARRAY_SIZE(test
->properties
); ++i
) {
9985 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_USER_NAME
)
9986 prop
= &(test
->properties
[i
]);
9989 if(prop
&& prop
->value
&& *prop
->value
) {
9990 /* Use expected_value unless it's NULL, then use value. */
9991 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9992 DWORD expected_len
= expected
? strlen(expected
) : 0;
9993 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
9994 todo_wine_if(prop
->todo
) {
9995 ok(hr
== (expected
? S_OK
: S_FALSE
),
9996 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9997 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9999 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
10000 expected
, wine_dbgstr_w(received
), test_index
);
10001 ok(expected_len
== len
,
10002 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
10003 expected_len
, len
, test_index
);
10007 /* The property wasn't set earlier, so it should return whatever
10008 * the base IUri contains (if anything).
10011 hr
= IUriBuilder_GetIUri(builder
, &uri
);
10013 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
10014 hr
, S_OK
, test_index
);
10015 if(SUCCEEDED(hr
)) {
10017 received
= (void*) 0xdeadbeef;
10020 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
10022 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
10023 hr
, S_FALSE
, test_index
);
10024 if(SUCCEEDED(hr
)) {
10025 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
10027 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
10028 received
, test_index
);
10031 BSTR expected
= NULL
;
10032 BOOL has_prop
= FALSE
;
10034 hr
= IUri_GetUserName(uri
, &expected
);
10036 "Error: Expected IUri_GetUserName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
10038 has_prop
= hr
== S_OK
;
10040 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
10043 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
10044 hr
, S_OK
, test_index
);
10045 if(SUCCEEDED(hr
)) {
10046 ok(!lstrcmpW(expected
, received
),
10047 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
10048 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
10049 ok(lstrlenW(expected
) == len
,
10050 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
10051 lstrlenW(expected
), len
, test_index
);
10055 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
10056 hr
, S_FALSE
, test_index
);
10057 if(SUCCEEDED(hr
)) {
10058 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
10059 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
10063 SysFreeString(expected
);
10066 if(uri
) IUri_Release(uri
);
10070 /* Tests IUriBuilder functions. */
10071 static void test_IUriBuilder(void) {
10073 IUriBuilder
*builder
;
10076 for(i
= 0; i
< ARRAY_SIZE(uri_builder_tests
); ++i
) {
10078 uri_builder_test test
= uri_builder_tests
[i
];
10079 LPWSTR uriW
= NULL
;
10082 uriW
= a2w(test
.uri
);
10083 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
10084 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
10086 if(FAILED(hr
)) continue;
10088 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10089 todo_wine_if(test
.create_builder_todo
)
10090 ok(hr
== test
.create_builder_expected
,
10091 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
10092 hr
, test
.create_builder_expected
, i
);
10093 if(SUCCEEDED(hr
)) {
10095 BOOL modified
= FALSE
, received
= FALSE
;
10097 /* Perform all the string property changes. */
10098 for(j
= 0; j
< URI_BUILDER_STR_PROPERTY_COUNT
; ++j
) {
10099 uri_builder_property prop
= test
.properties
[j
];
10101 change_property(builder
, &prop
, i
);
10102 if(prop
.property
!= Uri_PROPERTY_SCHEME_NAME
&&
10103 prop
.property
!= Uri_PROPERTY_HOST
)
10105 else if(prop
.value
&& *prop
.value
)
10107 else if(prop
.value
&& !*prop
.value
&& prop
.property
== Uri_PROPERTY_HOST
)
10108 /* Host name property can't be NULL, but it can be empty. */
10113 if(test
.port_prop
.change
) {
10114 hr
= IUriBuilder_SetPort(builder
, test
.port_prop
.set
, test
.port_prop
.value
);
10116 todo_wine_if(test
.port_prop
.todo
)
10117 ok(hr
== test
.port_prop
.expected
,
10118 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
10119 hr
, test
.port_prop
.expected
, i
);
10122 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10124 "Error IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
10127 ok(received
== modified
,
10128 "Error: Expected received to be %d but was %d instead on uri_builder_tests[%d].\n",
10129 modified
, received
, i
);
10131 /* Test the "Get*" functions. */
10132 test_IUriBuilder_GetFragment(builder
, &test
, i
);
10133 test_IUriBuilder_GetHost(builder
, &test
, i
);
10134 test_IUriBuilder_GetPassword(builder
, &test
, i
);
10135 test_IUriBuilder_GetPath(builder
, &test
, i
);
10136 test_IUriBuilder_GetPort(builder
, &test
, i
);
10137 test_IUriBuilder_GetQuery(builder
, &test
, i
);
10138 test_IUriBuilder_GetSchemeName(builder
, &test
, i
);
10139 test_IUriBuilder_GetUserName(builder
, &test
, i
);
10141 test_IUriBuilder_CreateUri(builder
, &test
, i
);
10142 test_IUriBuilder_CreateUriSimple(builder
, &test
, i
);
10143 test_IUriBuilder_CreateUriWithFlags(builder
, &test
, i
);
10145 if(builder
) IUriBuilder_Release(builder
);
10146 if(uri
) IUri_Release(uri
);
10151 static void test_IUriBuilder_HasBeenModified(void) {
10153 IUriBuilder
*builder
= NULL
;
10155 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10156 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10157 if(SUCCEEDED(hr
)) {
10158 static const WCHAR hostW
[] = {'g','o','o','g','l','e','.','c','o','m',0};
10162 hr
= IUriBuilder_HasBeenModified(builder
, NULL
);
10163 ok(hr
== E_POINTER
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10166 hr
= IUriBuilder_SetHost(builder
, hostW
);
10167 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n",
10170 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10171 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10174 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10176 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10177 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10178 if(SUCCEEDED(hr
)) {
10182 hr
= IUriBuilder_SetIUri(builder
, uri
);
10183 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n",
10186 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10187 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10190 ok(received
== FALSE
, "Error: Expected received to be FALSE.\n");
10192 /* Test what happens with you call SetIUri with the same IUri again. */
10193 hr
= IUriBuilder_SetHost(builder
, hostW
);
10194 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10196 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10197 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10200 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10202 hr
= IUriBuilder_SetIUri(builder
, uri
);
10203 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10205 /* IUriBuilder already had 'uri' as its IUri property and so Windows doesn't
10206 * reset any of the changes that were made to the IUriBuilder.
10208 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10209 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10211 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10213 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
10214 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10215 if(SUCCEEDED(hr
)) {
10216 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
10217 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
10218 ok(len
== lstrlenW(hostW
), "Error: Expected len to be %d, but was %d instead.\n",
10219 lstrlenW(hostW
), len
);
10222 hr
= IUriBuilder_SetIUri(builder
, NULL
);
10223 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10225 hr
= IUriBuilder_SetHost(builder
, hostW
);
10226 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10227 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10228 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10231 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10233 hr
= IUriBuilder_SetIUri(builder
, NULL
);
10234 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%09x.\n", hr
, S_OK
);
10236 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10237 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10240 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10242 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
10243 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10244 if(SUCCEEDED(hr
)) {
10245 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
10246 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
10247 ok(len
== lstrlenW(hostW
), "Error: Expected len to %d, but was %d instead.\n",
10248 lstrlenW(hostW
), len
);
10251 if(uri
) IUri_Release(uri
);
10253 if(builder
) IUriBuilder_Release(builder
);
10256 /* Test IUriBuilder {Get,Set}IUri functions. */
10257 static void test_IUriBuilder_IUriProperty(void) {
10258 IUriBuilder
*builder
= NULL
;
10261 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10262 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10263 if(SUCCEEDED(hr
)) {
10266 hr
= IUriBuilder_GetIUri(builder
, NULL
);
10267 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x.\n",
10270 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10271 if(SUCCEEDED(hr
)) {
10273 ULONG cur_count
, orig_count
;
10275 /* IUriBuilder doesn't clone the IUri, it use the same IUri. */
10276 orig_count
= get_refcnt(uri
);
10277 hr
= IUriBuilder_SetIUri(builder
, uri
);
10278 cur_count
= get_refcnt(uri
);
10280 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10281 orig_count
+1, cur_count
);
10283 hr
= IUriBuilder_SetIUri(builder
, NULL
);
10284 cur_count
= get_refcnt(uri
);
10286 ok(cur_count
== orig_count
, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10287 orig_count
, cur_count
);
10289 /* CreateUri* functions will return back the same IUri if nothing has changed. */
10290 hr
= IUriBuilder_SetIUri(builder
, uri
);
10291 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10292 orig_count
= get_refcnt(uri
);
10294 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, &test
);
10295 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10296 if(SUCCEEDED(hr
)) {
10297 cur_count
= get_refcnt(uri
);
10298 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10299 orig_count
+1, cur_count
);
10300 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n",
10303 if(test
) IUri_Release(test
);
10306 hr
= IUriBuilder_CreateUri(builder
, -1, 0, 0, &test
);
10307 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10308 if(SUCCEEDED(hr
)) {
10309 cur_count
= get_refcnt(uri
);
10310 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10311 orig_count
+1, cur_count
);
10312 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10314 if(test
) IUri_Release(test
);
10316 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10320 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, &test
);
10321 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10323 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
10325 if(test
) IUri_Release(test
);
10327 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10328 * explicitly set (because it's a default flag).
10331 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_CANONICALIZE
, 0, 0, &test
);
10332 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10333 if(SUCCEEDED(hr
)) {
10334 cur_count
= get_refcnt(uri
);
10335 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10336 orig_count
+1, cur_count
);
10337 ok(test
== uri
, "Error: Expected 'test' to be %p, but was %p instead.\n", uri
, test
);
10339 if(test
) IUri_Release(test
);
10342 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, &test
);
10343 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10344 if(SUCCEEDED(hr
)) {
10345 cur_count
= get_refcnt(uri
);
10346 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10347 orig_count
+1, cur_count
);
10348 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10350 if(test
) IUri_Release(test
);
10353 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &test
);
10354 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
10356 if(SUCCEEDED(hr
)) {
10357 cur_count
= get_refcnt(uri
);
10358 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10359 orig_count
+1, cur_count
);
10360 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10362 if(test
) IUri_Release(test
);
10364 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10368 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, 0, &test
);
10369 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10371 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
10373 if(test
) IUri_Release(test
);
10375 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10376 * explicitly set (because it's a default flag).
10379 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_CANONICALIZE
, 0, 0, 0, &test
);
10380 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10381 if(SUCCEEDED(hr
)) {
10382 cur_count
= get_refcnt(uri
);
10383 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10384 orig_count
+1, cur_count
);
10385 ok(test
== uri
, "Error: Expected 'test' to be %p, but was %p instead.\n", uri
, test
);
10387 if(test
) IUri_Release(test
);
10389 if(uri
) IUri_Release(uri
);
10391 if(builder
) IUriBuilder_Release(builder
);
10394 static void test_IUriBuilder_RemoveProperties(void) {
10395 IUriBuilder
*builder
= NULL
;
10399 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10400 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10401 if(SUCCEEDED(hr
)) {
10402 /* Properties that can't be removed. */
10403 const DWORD invalid
= Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_RAW_URI
|Uri_HAS_HOST_TYPE
|
10404 Uri_HAS_SCHEME
|Uri_HAS_ZONE
;
10406 for(i
= Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_DWORD_LAST
; ++i
) {
10407 hr
= IUriBuilder_RemoveProperties(builder
, i
<< 1);
10408 if((i
<< 1) & invalid
) {
10409 ok(hr
== E_INVALIDARG
,
10410 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
10411 hr
, E_INVALIDARG
, i
);
10414 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
10419 /* Also doesn't accept anything that's outside the range of the
10422 hr
= IUriBuilder_RemoveProperties(builder
, (Uri_PROPERTY_DWORD_LAST
+1) << 1);
10423 ok(hr
== E_INVALIDARG
, "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x.\n",
10426 if(builder
) IUriBuilder_Release(builder
);
10428 for(i
= 0; i
< ARRAY_SIZE(uri_builder_remove_tests
); ++i
) {
10429 uri_builder_remove_test test
= uri_builder_remove_tests
[i
];
10433 uriW
= a2w(test
.uri
);
10434 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
10435 if(SUCCEEDED(hr
)) {
10438 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10439 todo_wine_if(test
.create_builder_todo
)
10440 ok(hr
== test
.create_builder_expected
,
10441 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
10442 hr
, test
.create_builder_expected
, i
);
10444 if(SUCCEEDED(hr
)) {
10445 hr
= IUriBuilder_RemoveProperties(builder
, test
.remove_properties
);
10446 todo_wine_if(test
.remove_todo
)
10447 ok(hr
== test
.remove_expected
,
10448 "Error: IUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
10449 hr
, test
.remove_expected
, i
);
10450 if(SUCCEEDED(hr
)) {
10451 IUri
*result
= NULL
;
10453 hr
= IUriBuilder_CreateUri(builder
, test
.expected_flags
, 0, 0, &result
);
10454 todo_wine_if(test
.expected_todo
)
10455 ok(hr
== test
.expected_hres
,
10456 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
10457 hr
, test
.expected_hres
, i
);
10458 if(SUCCEEDED(hr
)) {
10459 BSTR received
= NULL
;
10461 hr
= IUri_GetAbsoluteUri(result
, &received
);
10462 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10463 ok(!strcmp_aw(test
.expected_uri
, received
),
10464 "Error: Expected %s but got %s instead on test %d.\n",
10465 test
.expected_uri
, wine_dbgstr_w(received
), i
);
10466 SysFreeString(received
);
10468 if(result
) IUri_Release(result
);
10471 if(builder
) IUriBuilder_Release(builder
);
10473 if(uri
) IUri_Release(uri
);
10478 static void test_IUriBuilder_Misc(void) {
10482 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10483 if(SUCCEEDED(hr
)) {
10484 IUriBuilder
*builder
;
10486 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10487 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10488 if(SUCCEEDED(hr
)) {
10492 hr
= IUriBuilder_GetPort(builder
, &has
, &port
);
10493 ok(hr
== S_OK
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10494 if(SUCCEEDED(hr
)) {
10495 /* 'has' will be set to FALSE, even though uri had a port. */
10496 ok(has
== FALSE
, "Error: Expected 'has' to be FALSE, was %d instead.\n", has
);
10497 /* Still sets 'port' to 80. */
10498 ok(port
== 80, "Error: Expected the port to be 80, but, was %d instead.\n", port
);
10501 if(builder
) IUriBuilder_Release(builder
);
10503 if(uri
) IUri_Release(uri
);
10506 static void test_IUriBuilderFactory(void) {
10509 IUriBuilderFactory
*factory
;
10510 IUriBuilder
*builder
;
10512 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10513 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10514 if(SUCCEEDED(hr
)) {
10516 hr
= IUri_QueryInterface(uri
, &IID_IUriBuilderFactory
, (void**)&factory
);
10517 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x.\n", hr
);
10518 ok(factory
!= NULL
, "Error: Expected 'factory' to not be NULL.\n");
10520 if(SUCCEEDED(hr
)) {
10521 builder
= (void*) 0xdeadbeef;
10522 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 10, 0, &builder
);
10523 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10525 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10527 builder
= (void*) 0xdeadbeef;
10528 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 10, &builder
);
10529 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10531 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10533 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, NULL
);
10534 ok(hr
== E_POINTER
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10538 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, &builder
);
10539 ok(hr
== S_OK
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10541 if(SUCCEEDED(hr
)) {
10542 IUri
*tmp
= (void*) 0xdeadbeef;
10546 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
10547 ok(hr
== S_OK
, "Error: GetIUri returned 0x%08x, expected 0x%08x.\n",
10549 ok(!tmp
, "Error: Expected 'tmp' to be NULL, but was %p instead.\n", tmp
);
10551 hr
= IUriBuilder_GetHost(builder
, &result_len
, &result
);
10552 ok(hr
== S_FALSE
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n",
10555 if(builder
) IUriBuilder_Release(builder
);
10557 builder
= (void*) 0xdeadbeef;
10558 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 10, 0, &builder
);
10559 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10561 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10563 builder
= (void*) 0xdeadbeef;
10564 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 10, &builder
);
10565 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10567 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10569 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, NULL
);
10570 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10574 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, &builder
);
10575 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10577 if(SUCCEEDED(hr
)) {
10580 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
10581 ok(hr
== S_OK
, "Error: GetIUri return 0x%08x, expected 0x%08x.\n",
10583 ok(tmp
== uri
, "Error: Expected tmp to be %p, but was %p.\n", uri
, tmp
);
10584 if(tmp
) IUri_Release(tmp
);
10586 if(builder
) IUriBuilder_Release(builder
);
10588 if(factory
) IUriBuilderFactory_Release(factory
);
10590 if(uri
) IUri_Release(uri
);
10593 static void test_CoInternetCombineIUri(void) {
10595 IUri
*base
, *relative
, *result
;
10599 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
10600 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr
);
10601 if(SUCCEEDED(hr
)) {
10602 result
= (void*) 0xdeadbeef;
10603 hr
= pCoInternetCombineIUri(base
, NULL
, 0, &result
, 0);
10604 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10605 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
10609 hr
= pCreateUri(http_urlW
, 0, 0, &relative
);
10610 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr
);
10611 if(SUCCEEDED(hr
)) {
10612 result
= (void*) 0xdeadbeef;
10613 hr
= pCoInternetCombineIUri(NULL
, relative
, 0, &result
, 0);
10614 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10615 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
10618 hr
= pCoInternetCombineIUri(base
, relative
, 0, NULL
, 0);
10619 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10621 if(base
) IUri_Release(base
);
10622 if(relative
) IUri_Release(relative
);
10624 for(i
= 0; i
< ARRAY_SIZE(uri_combine_tests
); ++i
) {
10625 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
10627 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
10628 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10629 if(SUCCEEDED(hr
)) {
10630 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
10632 hr
= pCreateUri(relativeW
, uri_combine_tests
[i
].relative_create_flags
, 0, &relative
);
10633 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10634 if(SUCCEEDED(hr
)) {
10637 hr
= pCoInternetCombineIUri(base
, relative
, uri_combine_tests
[i
].combine_flags
, &result
, 0);
10638 todo_wine_if(uri_combine_tests
[i
].todo
)
10639 ok(hr
== uri_combine_tests
[i
].expected
||
10640 broken(hr
== S_OK
&& uri_combine_tests
[i
].expected
== E_INVALIDARG
) /* win10 1607 to 1709 */,
10641 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10642 hr
, uri_combine_tests
[i
]. expected
, i
);
10643 if(SUCCEEDED(hr
) && SUCCEEDED(uri_combine_tests
[i
].expected
)) {
10646 for(j
= 0; j
< ARRAY_SIZE(uri_combine_tests
[i
].str_props
); ++j
) {
10647 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
10650 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
10651 todo_wine_if(prop
.todo
) {
10652 ok(hr
== prop
.expected
,
10653 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10654 hr
, prop
.expected
, i
, j
);
10655 ok(!strcmp_aw(prop
.value
, received
) ||
10656 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10657 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10658 prop
.value
, wine_dbgstr_w(received
), i
, j
);
10660 SysFreeString(received
);
10663 for(j
= 0; j
< ARRAY_SIZE(uri_combine_tests
[i
].dword_props
); ++j
) {
10664 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
10667 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
10668 todo_wine_if(prop
.todo
) {
10669 ok(hr
== prop
.expected
|| broken(prop
.broken_combine_hres
&& hr
== S_FALSE
),
10670 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10671 hr
, prop
.expected
, i
, j
);
10672 if(!prop
.broken_combine_hres
|| hr
!= S_FALSE
)
10673 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10674 prop
.value
, received
, i
, j
);
10678 if(result
) IUri_Release(result
);
10680 if(relative
) IUri_Release(relative
);
10681 heap_free(relativeW
);
10683 if(base
) IUri_Release(base
);
10688 static HRESULT WINAPI
InternetProtocolInfo_QueryInterface(IInternetProtocolInfo
*iface
,
10689 REFIID riid
, void **ppv
)
10691 ok(0, "unexpected call\n");
10692 return E_NOINTERFACE
;
10695 static ULONG WINAPI
InternetProtocolInfo_AddRef(IInternetProtocolInfo
*iface
)
10700 static ULONG WINAPI
InternetProtocolInfo_Release(IInternetProtocolInfo
*iface
)
10705 static HRESULT WINAPI
InternetProtocolInfo_ParseUrl(IInternetProtocolInfo
*iface
, LPCWSTR pwzUrl
,
10706 PARSEACTION ParseAction
, DWORD dwParseFlags
, LPWSTR pwzResult
, DWORD cchResult
,
10707 DWORD
*pcchResult
, DWORD dwReserved
)
10709 CHECK_EXPECT(ParseUrl
);
10710 ok(!lstrcmpW(pwzUrl
, parse_urlW
), "Error: Expected %s, but got %s instead.\n",
10711 wine_dbgstr_w(parse_urlW
), wine_dbgstr_w(pwzUrl
));
10712 ok(ParseAction
== parse_action
, "Error: Expected %d, but got %d.\n", parse_action
, ParseAction
);
10713 ok(dwParseFlags
== parse_flags
, "Error: Expected 0x%08x, but got 0x%08x.\n", parse_flags
, dwParseFlags
);
10714 ok(cchResult
== 200, "Error: Got %d.\n", cchResult
);
10716 memcpy(pwzResult
, parse_resultW
, sizeof(parse_resultW
));
10717 *pcchResult
= lstrlenW(parse_resultW
);
10722 static HRESULT WINAPI
InternetProtocolInfo_CombineUrl(IInternetProtocolInfo
*iface
,
10723 LPCWSTR pwzBaseUrl
, LPCWSTR pwzRelativeUrl
, DWORD dwCombineFlags
,
10724 LPWSTR pwzResult
, DWORD cchResult
, DWORD
*pcchResult
, DWORD dwReserved
)
10726 CHECK_EXPECT(CombineUrl
);
10727 ok(!lstrcmpW(pwzBaseUrl
, combine_baseW
), "Error: Expected %s, but got %s instead.\n",
10728 wine_dbgstr_w(combine_baseW
), wine_dbgstr_w(pwzBaseUrl
));
10729 ok(!lstrcmpW(pwzRelativeUrl
, combine_relativeW
), "Error: Expected %s, but got %s instead.\n",
10730 wine_dbgstr_w(combine_relativeW
), wine_dbgstr_w(pwzRelativeUrl
));
10731 ok(dwCombineFlags
== (URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
),
10732 "Error: Expected 0, but got 0x%08x.\n", dwCombineFlags
);
10733 ok(cchResult
== INTERNET_MAX_URL_LENGTH
+1, "Error: Got %d.\n", cchResult
);
10735 memcpy(pwzResult
, combine_resultW
, sizeof(combine_resultW
));
10736 *pcchResult
= lstrlenW(combine_resultW
);
10741 static HRESULT WINAPI
InternetProtocolInfo_CompareUrl(IInternetProtocolInfo
*iface
,
10742 LPCWSTR pwzUrl1
, LPCWSTR pwzUrl2
, DWORD dwCompareFlags
)
10744 ok(0, "unexpected call\n");
10748 static HRESULT WINAPI
InternetProtocolInfo_QueryInfo(IInternetProtocolInfo
*iface
,
10749 LPCWSTR pwzUrl
, QUERYOPTION OueryOption
, DWORD dwQueryFlags
, LPVOID pBuffer
,
10750 DWORD cbBuffer
, DWORD
*pcbBuf
, DWORD dwReserved
)
10752 ok(0, "unexpected call\n");
10756 static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
= {
10757 InternetProtocolInfo_QueryInterface
,
10758 InternetProtocolInfo_AddRef
,
10759 InternetProtocolInfo_Release
,
10760 InternetProtocolInfo_ParseUrl
,
10761 InternetProtocolInfo_CombineUrl
,
10762 InternetProtocolInfo_CompareUrl
,
10763 InternetProtocolInfo_QueryInfo
10766 static IInternetProtocolInfo protocol_info
= { &InternetProtocolInfoVtbl
};
10768 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFIID riid
, void **ppv
)
10770 if(IsEqualGUID(&IID_IInternetProtocolInfo
, riid
)) {
10771 *ppv
= &protocol_info
;
10775 ok(0, "unexpected call\n");
10776 return E_NOINTERFACE
;
10779 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
10784 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
10789 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
, IUnknown
*pOuter
,
10790 REFIID riid
, void **ppv
)
10792 ok(0, "unexpected call\n");
10796 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL dolock
)
10798 ok(0, "unexpected call\n");
10802 static const IClassFactoryVtbl ClassFactoryVtbl
= {
10803 ClassFactory_QueryInterface
,
10804 ClassFactory_AddRef
,
10805 ClassFactory_Release
,
10806 ClassFactory_CreateInstance
,
10807 ClassFactory_LockServer
10810 static IClassFactory protocol_cf
= { &ClassFactoryVtbl
};
10812 static void register_protocols(void)
10814 IInternetSession
*session
;
10817 hres
= pCoInternetGetSession(0, &session
, 0);
10818 ok(hres
== S_OK
, "CoInternetGetSession failed: %08x\n", hres
);
10822 hres
= IInternetSession_RegisterNameSpace(session
, &protocol_cf
, &IID_NULL
,
10823 winetestW
, 0, NULL
, 0);
10824 ok(hres
== S_OK
, "RegisterNameSpace failed: %08x\n", hres
);
10826 IInternetSession_Release(session
);
10829 static void unregister_protocols(void) {
10830 IInternetSession
*session
;
10833 hr
= pCoInternetGetSession(0, &session
, 0);
10834 ok(hr
== S_OK
, "CoInternetGetSession failed: 0x%08x\n", hr
);
10838 hr
= IInternetSession_UnregisterNameSpace(session
, &protocol_cf
, winetestW
);
10839 ok(hr
== S_OK
, "UnregisterNameSpace failed: 0x%08x\n", hr
);
10841 IInternetSession_Release(session
);
10844 static void test_CoInternetCombineIUri_Pluggable(void) {
10848 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
10849 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10850 if(SUCCEEDED(hr
)) {
10851 IUri
*relative
= NULL
;
10853 hr
= pCreateUri(combine_relativeW
, Uri_CREATE_ALLOW_RELATIVE
, 0, &relative
);
10854 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10855 if(SUCCEEDED(hr
)) {
10856 IUri
*result
= NULL
;
10858 SET_EXPECT(CombineUrl
);
10860 hr
= pCoInternetCombineIUri(base
, relative
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
10862 ok(hr
== S_OK
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10864 CHECK_CALLED(CombineUrl
);
10866 if(SUCCEEDED(hr
)) {
10867 BSTR received
= NULL
;
10868 hr
= IUri_GetAbsoluteUri(result
, &received
);
10869 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10870 if(SUCCEEDED(hr
)) {
10871 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
10872 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
10874 SysFreeString(received
);
10876 if(result
) IUri_Release(result
);
10878 if(relative
) IUri_Release(relative
);
10880 if(base
) IUri_Release(base
);
10883 static void test_CoInternetCombineUrlEx(void) {
10885 IUri
*base
, *result
;
10889 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
10890 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10891 if(SUCCEEDED(hr
)) {
10892 result
= (void*) 0xdeadbeef;
10893 hr
= pCoInternetCombineUrlEx(base
, NULL
, 0, &result
, 0);
10894 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10896 ok(!result
, "Error: Expected 'result' to be NULL was %p instead.\n", result
);
10899 result
= (void*) 0xdeadbeef;
10900 hr
= pCoInternetCombineUrlEx(NULL
, http_urlW
, 0, &result
, 0);
10901 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10903 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
10905 result
= (void*) 0xdeadbeef;
10906 hr
= pCoInternetCombineUrlEx(NULL
, NULL
, 0, &result
, 0);
10907 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10909 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
10911 hr
= pCoInternetCombineUrlEx(base
, http_urlW
, 0, NULL
, 0);
10912 ok(hr
== E_POINTER
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10914 if(base
) IUri_Release(base
);
10916 for(i
= 0; i
< ARRAY_SIZE(uri_combine_tests
); ++i
) {
10917 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
10919 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
10920 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10921 if(SUCCEEDED(hr
)) {
10922 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
10924 hr
= pCoInternetCombineUrlEx(base
, relativeW
, uri_combine_tests
[i
].combine_flags
,
10926 todo_wine_if(uri_combine_tests
[i
].todo
)
10927 ok(hr
== uri_combine_tests
[i
].expected
||
10928 broken(hr
== S_OK
&& uri_combine_tests
[i
].expected
== E_INVALIDARG
) /* win10 1607 to 1709 */,
10929 "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10930 hr
, uri_combine_tests
[i
]. expected
, i
);
10931 if(SUCCEEDED(hr
) && SUCCEEDED(uri_combine_tests
[i
].expected
)) {
10934 for(j
= 0; j
< ARRAY_SIZE(uri_combine_tests
[i
].str_props
); ++j
) {
10935 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
10937 LPCSTR value
= (prop
.value_ex
) ? prop
.value_ex
: prop
.value
;
10939 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
10940 todo_wine_if(prop
.todo
) {
10941 ok(hr
== prop
.expected
,
10942 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10943 hr
, prop
.expected
, i
, j
);
10944 ok(!strcmp_aw(value
, received
) ||
10945 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10946 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10947 value
, wine_dbgstr_w(received
), i
, j
);
10949 SysFreeString(received
);
10952 for(j
= 0; j
< ARRAY_SIZE(uri_combine_tests
[i
].dword_props
); ++j
) {
10953 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
10956 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
10957 todo_wine_if(prop
.todo
) {
10958 ok(hr
== prop
.expected
|| broken(prop
.broken_combine_hres
&& hr
== S_FALSE
),
10959 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10960 hr
, prop
.expected
, i
, j
);
10961 if(!prop
.broken_combine_hres
|| hr
!= S_FALSE
)
10962 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10963 prop
.value
, received
, i
, j
);
10967 if(result
) IUri_Release(result
);
10968 heap_free(relativeW
);
10970 if(base
) IUri_Release(base
);
10975 static void test_CoInternetCombineUrlEx_Pluggable(void) {
10979 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
10980 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10981 if(SUCCEEDED(hr
)) {
10982 IUri
*result
= NULL
;
10984 SET_EXPECT(CombineUrl
);
10986 hr
= pCoInternetCombineUrlEx(base
, combine_relativeW
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
10988 ok(hr
== S_OK
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10990 CHECK_CALLED(CombineUrl
);
10992 if(SUCCEEDED(hr
)) {
10993 BSTR received
= NULL
;
10994 hr
= IUri_GetAbsoluteUri(result
, &received
);
10995 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10996 if(SUCCEEDED(hr
)) {
10997 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
10998 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
11000 SysFreeString(received
);
11002 if(result
) IUri_Release(result
);
11004 if(base
) IUri_Release(base
);
11007 static void test_CoInternetParseIUri_InvalidArgs(void) {
11011 WCHAR
*longurl
, *copy
;
11015 hr
= pCoInternetParseIUri(NULL
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
11016 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
11018 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
11020 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
11021 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
11022 if(SUCCEEDED(hr
)) {
11023 DWORD expected_len
;
11026 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, NULL
, 0, &result
, 0);
11027 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
11029 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
11031 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, NULL
, 0);
11032 ok(hr
== E_POINTER
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
11036 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_URL
, 0, tmp
, 3, &result
, 0);
11037 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x expected 0x%08x.\n",
11039 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
11042 hr
= pCoInternetParseIUri(uri
, PARSE_MIME
, 0, tmp
, 3, &result
, 0);
11043 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
11045 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
11048 hr
= pCoInternetParseIUri(uri
, PARSE_SERVER
, 0, tmp
, 3, &result
, 0);
11049 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
11051 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
11054 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_DOMAIN
, 0, tmp
, 3, &result
, 0);
11055 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
11057 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
11059 expected_len
= lstrlenW(http_urlW
);
11061 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
11062 ok(hr
== STRSAFE_E_INSUFFICIENT_BUFFER
,
11063 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
11064 hr
, STRSAFE_E_INSUFFICIENT_BUFFER
);
11065 ok(result
== expected_len
, "Error: Expected 'result' to be %d, but was %d instead.\n",
11066 expected_len
, result
);
11068 if(uri
) IUri_Release(uri
);
11070 /* a long url that causes a crash on Wine */
11071 len
= INTERNET_MAX_URL_LENGTH
*2;
11072 longurl
= heap_alloc((len
+1)*sizeof(WCHAR
));
11073 memcpy(longurl
, http_urlW
, sizeof(http_urlW
));
11074 for(i
= ARRAY_SIZE(http_urlW
)-1; i
< len
; i
++)
11078 copy
= heap_alloc((len
+1)*sizeof(WCHAR
));
11079 memcpy(copy
, longurl
, (len
+1)*sizeof(WCHAR
));
11081 hr
= pCreateUri(longurl
, 0, 0, &uri
);
11082 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
11083 if(SUCCEEDED(hr
)) {
11085 memset(longurl
, 0xcc, len
*sizeof(WCHAR
));
11086 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, longurl
, len
+1, &result
, 0);
11087 ok(SUCCEEDED(hr
), "Error: CoInternetParseIUri returned 0x%08x.\n", hr
);
11088 ok(!lstrcmpW(longurl
, copy
), "Error: expected long url '%s' but was '%s'.\n",
11089 wine_dbgstr_w(copy
), wine_dbgstr_w(longurl
));
11090 ok(result
== len
, "Error: Expected 'result' to be %d, but was %d instead.\n",
11093 heap_free(longurl
);
11095 if(uri
) IUri_Release(uri
);
11098 static void test_CoInternetParseIUri(void) {
11101 for(i
= 0; i
< ARRAY_SIZE(uri_parse_tests
); ++i
) {
11105 uri_parse_test test
= uri_parse_tests
[i
];
11107 uriW
= a2w(test
.uri
);
11108 hr
= pCreateUri(uriW
, test
.uri_flags
, 0, &uri
);
11109 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x on uri_parse_tests[%d].\n", hr
, i
);
11110 if(SUCCEEDED(hr
)) {
11111 WCHAR result
[INTERNET_MAX_URL_LENGTH
+1];
11112 DWORD result_len
= -1;
11114 hr
= pCoInternetParseIUri(uri
, test
.action
, test
.flags
, result
, INTERNET_MAX_URL_LENGTH
+1, &result_len
, 0);
11115 todo_wine_if(test
.todo
)
11116 ok(hr
== test
.expected
,
11117 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x on uri_parse_tests[%d].\n",
11118 hr
, test
.expected
, i
);
11119 if(SUCCEEDED(hr
)) {
11120 DWORD len
= lstrlenA(test
.property
);
11121 ok(!strcmp_aw(test
.property
, result
) || (test
.property2
&& !strcmp_aw(test
.property2
, result
)),
11122 "Error: Expected %s but got %s instead on uri_parse_tests[%d] - %s.\n",
11123 test
.property
, wine_dbgstr_w(result
), i
, wine_dbgstr_w(uriW
));
11124 ok(len
== result_len
|| (test
.property2
&& lstrlenA(test
.property2
) == result_len
),
11125 "Error: Expected %d, but got %d instead on uri_parse_tests[%d] - %s.\n",
11126 len
, result_len
, i
, wine_dbgstr_w(uriW
));
11129 "Error: Expected 'result_len' to be 0, but was %d on uri_parse_tests[%d].\n",
11133 if(uri
) IUri_Release(uri
);
11138 static void test_CoInternetParseIUri_Pluggable(void) {
11142 hr
= pCreateUri(parse_urlW
, 0, 0, &uri
);
11143 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, but got 0x%08x.\n", hr
);
11144 if(SUCCEEDED(hr
)) {
11148 SET_EXPECT(ParseUrl
);
11150 parse_action
= PARSE_CANONICALIZE
;
11151 parse_flags
= URL_UNESCAPE
|URL_ESCAPE_UNSAFE
;
11153 hr
= pCoInternetParseIUri(uri
, parse_action
, parse_flags
, result
, 200, &result_len
, 0);
11154 ok(hr
== S_OK
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
11156 CHECK_CALLED(ParseUrl
);
11158 if(SUCCEEDED(hr
)) {
11159 ok(result_len
== lstrlenW(parse_resultW
), "Error: Expected %d, but got %d.\n",
11160 lstrlenW(parse_resultW
), result_len
);
11161 ok(!lstrcmpW(result
, parse_resultW
), "Error: Expected %s, but got %s.\n",
11162 wine_dbgstr_w(parse_resultW
), wine_dbgstr_w(result
));
11165 if(uri
) IUri_Release(uri
);
11171 const char *base_url
;
11172 DWORD base_uri_flags
;
11173 const char *legacy_url
;
11174 const char *uniform_url
;
11175 const char *no_canon_url
;
11176 const char *uri_url
;
11177 } create_urlmon_test_t
;
11179 static const create_urlmon_test_t create_urlmon_tests
[] = {
11181 "http://www.winehq.org",Uri_CREATE_NO_CANONICALIZE
,
11183 "http://www.winehq.org/",
11184 "http://www.winehq.org/",
11185 "http://www.winehq.org",
11186 "http://www.winehq.org"
11189 "file://c:\\dir\\file.txt",Uri_CREATE_NO_CANONICALIZE
,
11191 "file://c:\\dir\\file.txt",
11192 "file:///c:/dir/file.txt",
11193 "file:///c:/dir/file.txt",
11194 "file:///c:/dir/file.txt"
11197 "file://c:\\dir\\file.txt",Uri_CREATE_FILE_USE_DOS_PATH
,
11199 "file://c:\\dir\\file.txt",
11200 "file:///c:/dir/file.txt",
11201 "file:///c:/dir/file.txt",
11202 "file://c:\\dir\\file.txt"
11205 "dat%61",Uri_CREATE_ALLOW_RELATIVE
,
11206 "http://www.winehq.org",0,
11207 "http://www.winehq.org/data",
11208 "http://www.winehq.org/data",
11209 "http://www.winehq.org:80/data",
11212 "file.txt",Uri_CREATE_ALLOW_RELATIVE
,
11213 "file://c:\\dir\\x.txt",Uri_CREATE_NO_CANONICALIZE
,
11214 "file://c:\\dir\\file.txt",
11215 "file:///c:/dir/file.txt",
11216 "file:///c:/dir/file.txt",
11219 "",Uri_CREATE_ALLOW_RELATIVE
,
11227 "test",Uri_CREATE_ALLOW_RELATIVE
,
11235 "c:\\dir\\file.txt",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
11237 "file://c:\\dir\\file.txt",
11238 "file:///c:/dir/file.txt",
11239 "file:///c:/dir/file.txt",
11240 "file:///c:/dir/file.txt",
11243 "c:\\dir\\file.txt#frag|part",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
11245 "file://c:\\dir\\file.txt#frag|part",
11246 "file:///c:/dir/file.txt#frag%7Cpart",
11247 "file:///c:/dir/file.txt#frag%7Cpart",
11248 "file:///c:/dir/file.txt#frag%7Cpart",
11252 #define test_urlmon_display_name(a,b) _test_urlmon_display_name(__LINE__,a,b)
11253 static void _test_urlmon_display_name(unsigned line
, IMoniker
*mon
, const char *exurl
)
11255 WCHAR
*display_name
;
11258 hres
= IMoniker_GetDisplayName(mon
, NULL
, NULL
, &display_name
);
11259 ok_(__FILE__
,line
)(hres
== S_OK
, "GetDisplayName failed: %08x\n", hres
);
11260 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_name
), "unexpected display name: %s, expected %s\n",
11261 wine_dbgstr_w(display_name
), exurl
);
11263 CoTaskMemFree(display_name
);
11266 #define test_display_uri(a,b) _test_display_uri(__LINE__,a,b)
11267 static void _test_display_uri(unsigned line
, IMoniker
*mon
, const char *exurl
)
11269 IUriContainer
*uri_container
;
11274 hres
= IMoniker_QueryInterface(mon
, &IID_IUriContainer
, (void**)&uri_container
);
11275 ok(hres
== S_OK
, "Could not get IUriContainer iface: %08x\n", hres
);
11278 hres
= IUriContainer_GetIUri(uri_container
, &uri
);
11279 IUriContainer_Release(uri_container
);
11280 ok(hres
== S_OK
, "GetIUri failed: %08x\n", hres
);
11281 ok(uri
!= NULL
, "uri == NULL\n");
11283 hres
= IUri_GetDisplayUri(uri
, &display_uri
);
11285 ok(hres
== S_OK
, "GetDisplayUri failed: %08x\n", hres
);
11286 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_uri
), "unexpected display uri: %s, expected %s\n",
11287 wine_dbgstr_w(display_uri
), exurl
);
11288 SysFreeString(display_uri
);
11291 static void test_CreateURLMoniker(void)
11293 const create_urlmon_test_t
*test
;
11294 IMoniker
*mon
, *base_mon
;
11295 WCHAR
*url
, *base_url
;
11296 IUri
*uri
, *base_uri
;
11299 for(test
= create_urlmon_tests
; test
< create_urlmon_tests
+ ARRAY_SIZE(create_urlmon_tests
); test
++) {
11300 url
= a2w(test
->url
);
11301 base_url
= a2w(test
->base_url
);
11304 hres
= pCreateUri(base_url
, test
->base_uri_flags
, 0, &base_uri
);
11305 ok(hres
== S_OK
, "CreateUri failed: %08x\n", hres
);
11307 hres
= pCreateURLMonikerEx2(NULL
, base_uri
, &base_mon
, URL_MK_NO_CANONICALIZE
);
11308 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11314 hres
= CreateURLMoniker(base_mon
, url
, &mon
);
11315 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11316 test_urlmon_display_name(mon
, test
->legacy_url
);
11317 test_display_uri(mon
, test
->legacy_url
);
11318 IMoniker_Release(mon
);
11320 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_LEGACY
);
11321 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11322 test_urlmon_display_name(mon
, test
->legacy_url
);
11323 test_display_uri(mon
, test
->legacy_url
);
11324 IMoniker_Release(mon
);
11326 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_UNIFORM
);
11327 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11328 test_urlmon_display_name(mon
, test
->uniform_url
);
11329 test_display_uri(mon
, test
->uniform_url
);
11330 IMoniker_Release(mon
);
11332 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_NO_CANONICALIZE
);
11333 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11334 test_urlmon_display_name(mon
, test
->no_canon_url
);
11335 test_display_uri(mon
, test
->no_canon_url
);
11336 IMoniker_Release(mon
);
11338 hres
= pCreateUri(url
, test
->uri_flags
, 0, &uri
);
11339 ok(hres
== S_OK
, "CreateUri failed: %08x\n", hres
);
11341 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_LEGACY
);
11342 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11343 test_urlmon_display_name(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
11344 test_display_uri(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
11345 IMoniker_Release(mon
);
11347 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_UNIFORM
);
11348 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11349 test_urlmon_display_name(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
11350 test_display_uri(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
11351 IMoniker_Release(mon
);
11353 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_NO_CANONICALIZE
);
11354 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11355 test_urlmon_display_name(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
11356 test_display_uri(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
11357 IMoniker_Release(mon
);
11361 heap_free(base_url
);
11363 IUri_Release(base_uri
);
11365 IMoniker_Release(base_mon
);
11369 static int add_default_flags(DWORD flags
) {
11370 if(!(flags
& Uri_CREATE_NO_CANONICALIZE
))
11371 flags
|= Uri_CREATE_CANONICALIZE
;
11372 if(!(flags
& Uri_CREATE_NO_DECODE_EXTRA_INFO
))
11373 flags
|= Uri_CREATE_DECODE_EXTRA_INFO
;
11374 if(!(flags
& Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
))
11375 flags
|= Uri_CREATE_CRACK_UNKNOWN_SCHEMES
;
11376 if(!(flags
& Uri_CREATE_NO_PRE_PROCESS_HTML_URI
))
11377 flags
|= Uri_CREATE_PRE_PROCESS_HTML_URI
;
11378 if(!(flags
& Uri_CREATE_IE_SETTINGS
))
11379 flags
|= Uri_CREATE_NO_IE_SETTINGS
;
11384 static void test_IPersistStream(void)
11386 int i
, props_order
[Uri_PROPERTY_DWORD_LAST
+1] = { 0 };
11388 props_order
[Uri_PROPERTY_RAW_URI
] = 1;
11389 props_order
[Uri_PROPERTY_FRAGMENT
] = 2;
11390 props_order
[Uri_PROPERTY_HOST
] = 3;
11391 props_order
[Uri_PROPERTY_PASSWORD
] = 4;
11392 props_order
[Uri_PROPERTY_PATH
] = 5;
11393 props_order
[Uri_PROPERTY_PORT
] = 6;
11394 props_order
[Uri_PROPERTY_QUERY
] = 7;
11395 props_order
[Uri_PROPERTY_SCHEME_NAME
] = 8;
11396 props_order
[Uri_PROPERTY_USER_NAME
] = 9;
11398 for(i
= 0; i
< ARRAY_SIZE(uri_tests
); i
++) {
11399 const uri_properties
*test
= uri_tests
+i
;
11402 IPersistStream
*persist_stream
;
11405 DWORD props
, props_no
, dw_data
[6];
11406 WCHAR str_data
[1024];
11407 ULARGE_INTEGER size
, max_size
;
11408 LARGE_INTEGER no_off
;
11413 if(test
->create_todo
|| test
->create_expected
!=S_OK
)
11416 uriW
= a2w(test
->uri
);
11417 hr
= pCreateUri(uriW
, test
->create_flags
, 0, &uri
);
11418 ok(hr
== S_OK
, "%d) CreateUri failed 0x%08x, expected S_OK..\n", i
, hr
);
11420 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&persist_stream
);
11421 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11423 hr
= CreateStreamOnHGlobal(NULL
, TRUE
, &stream
);
11424 ok(hr
== S_OK
, "CreateStreamOnHGlobal failed 0x%08x.\n", hr
);
11425 hr
= IPersistStream_IsDirty(persist_stream
);
11426 ok(hr
== S_FALSE
, "%d) IsDirty returned 0x%08x, expected S_FALSE.\n", i
, hr
);
11427 hr
= IPersistStream_Save(persist_stream
, stream
, FALSE
);
11428 ok(hr
== S_OK
, "%d) Save failed 0x%08x, expected S_OK.\n", i
, hr
);
11429 hr
= IPersistStream_IsDirty(persist_stream
);
11430 ok(hr
== S_FALSE
, "%d) IsDirty returned 0x%08x, expected S_FALSE.\n", i
, hr
);
11431 no_off
.QuadPart
= 0;
11432 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_CUR
, &size
);
11433 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11434 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11435 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11436 hr
= IPersistStream_GetSizeMax(persist_stream
, &max_size
);
11437 ok(hr
== S_OK
, "%d) GetSizeMax failed 0x%08x, expected S_OK.\n", i
, hr
);
11438 ok(U(size
).LowPart
+2 == U(max_size
).LowPart
,
11439 "%d) Written data size is %d, max_size %d.\n",
11440 i
, U(size
).LowPart
, U(max_size
).LowPart
);
11442 hr
= IStream_Read(stream
, (void*)dw_data
, sizeof(DWORD
), NULL
);
11443 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11444 ok(dw_data
[0]-2 == U(size
).LowPart
, "%d) Structure size is %d, expected %d\n",
11445 i
, dw_data
[0]-2, U(size
).LowPart
);
11446 hr
= IStream_Read(stream
, (void*)dw_data
, 6*sizeof(DWORD
), NULL
);
11447 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11448 ok(dw_data
[0] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[0]);
11449 ok(dw_data
[1] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[1]);
11450 ok(dw_data
[2] == add_default_flags(test
->create_flags
),
11451 "%d) Incorrect value %x, expected %x (creation flags).\n",
11452 i
, dw_data
[2], add_default_flags(test
->create_flags
));
11453 ok(dw_data
[3] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[3]);
11454 ok(dw_data
[4] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[4]);
11455 ok(dw_data
[5] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[5]);
11458 for(props
=0; props
<=Uri_PROPERTY_DWORD_LAST
; props
++) {
11459 if(!props_order
[props
])
11462 if(props
<= Uri_PROPERTY_STRING_LAST
) {
11463 if(test
->str_props
[props
].expected
== S_OK
)
11466 if(test
->dword_props
[props
-Uri_PROPERTY_DWORD_START
].expected
== S_OK
)
11470 if(test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_HTTP
11471 && test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_FTP
11472 && test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_HTTPS
)
11475 hr
= IStream_Read(stream
, (void*)&props
, sizeof(DWORD
), NULL
);
11476 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11477 ok(props
== props_no
, "%d) Properties no is %d, expected %d.\n", i
, props
, props_no
);
11482 hr
= IStream_Read(stream
, (void*)dw_data
, 2*sizeof(DWORD
), NULL
);
11483 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11485 ok(dw_data
[2]<props_order
[dw_data
[0]],
11486 "%d) Incorrect properties order (%d, %d)\n",
11487 i
, dw_data
[0], dw_data
[3]);
11488 dw_data
[2] = props_order
[dw_data
[0]];
11489 dw_data
[3] = dw_data
[0];
11491 if(dw_data
[0]<=Uri_PROPERTY_STRING_LAST
) {
11492 const uri_str_property
*prop
= test
->str_props
+dw_data
[0];
11493 hr
= IStream_Read(stream
, (void*)str_data
, dw_data
[1], NULL
);
11494 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11495 ok(!strcmp_aw(prop
->value
, str_data
) || broken(prop
->broken_value
&& !strcmp_aw(prop
->broken_value
, str_data
)),
11496 "%d) Expected %s but got %s (%d).\n", i
, prop
->value
, wine_dbgstr_w(str_data
), dw_data
[0]);
11497 } else if(dw_data
[0]>=Uri_PROPERTY_DWORD_START
&& dw_data
[0]<=Uri_PROPERTY_DWORD_LAST
) {
11498 const uri_dword_property
*prop
= test
->dword_props
+dw_data
[0]-Uri_PROPERTY_DWORD_START
;
11499 ok(dw_data
[1] == sizeof(DWORD
), "%d) Size of dword property is %d (%d)\n", i
, dw_data
[1], dw_data
[0]);
11500 hr
= IStream_Read(stream
, (void*)&dw_data
[1], sizeof(DWORD
), NULL
);
11501 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11502 ok(prop
->value
== dw_data
[1], "%d) Expected %d but got %d (%d).\n", i
, prop
->value
, dw_data
[1], dw_data
[0]);
11504 ok(FALSE
, "%d) Incorrect property type (%d)\n", i
, dw_data
[0]);
11508 ok(props
== 0, "%d) Not all properties were processed %d. Next property type: %d\n",
11509 i
, props
, dw_data
[0]);
11513 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11514 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11515 hr
= IPersistStream_GetClassID(persist_stream
, &curi
);
11516 ok(hr
== S_OK
, "%d) GetClassID failed 0x%08x, expected S_OK.\n", i
, hr
);
11517 ok(IsEqualCLSID(&curi
, &CLSID_CUri
), "%d) GetClassID returned incorrect CLSID.\n", i
);
11518 IPersistStream_Release(persist_stream
);
11520 hr
= CoCreateInstance(&curi
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11521 &IID_IUri
, (void**)&uri
);
11522 ok(hr
== S_OK
, "%d) Error creating uninitialized Uri: 0x%08x.\n", i
, hr
);
11523 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&persist_stream
);
11524 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11525 hr
= IPersistStream_Load(persist_stream
, stream
);
11526 ok(hr
== S_OK
, "%d) Load failed 0x%08x, expected S_OK.\n", i
, hr
);
11527 hr
= IUri_GetRawUri(uri
, &raw_uri
);
11528 ok(hr
== S_OK
, "%d) GetRawUri failed 0x%08x, expected S_OK.\n", i
, hr
);
11529 ok(!strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].value
, raw_uri
)
11530 || broken(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
11531 && !strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
, raw_uri
)),
11532 "%d) Expected %s but got %s.\n", i
, test
->str_props
[Uri_PROPERTY_RAW_URI
].value
,
11533 wine_dbgstr_w(raw_uri
));
11534 SysFreeString(raw_uri
);
11535 IPersistStream_Release(persist_stream
);
11537 hr
= IUri_QueryInterface(uri
, &IID_IMarshal
, (void**)&marshal
);
11538 ok(hr
== S_OK
, "%d) QueryInterface(IID_IMarshal) failed 0x%08x, expected S_OK.\n", i
, hr
);
11539 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11540 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11541 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11542 MSHCTX_DIFFERENTMACHINE
, NULL
, MSHLFLAGS_NORMAL
);
11543 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11544 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11545 MSHCTX_CROSSCTX
, NULL
, MSHLFLAGS_NORMAL
);
11546 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11547 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11548 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_TABLESTRONG
);
11549 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11550 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11551 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_TABLEWEAK
);
11552 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11553 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11554 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_NOPING
);
11555 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11556 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11557 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_NORMAL
);
11558 ok(hr
== S_OK
, "%d) MarshalInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11559 hr
= IMarshal_GetUnmarshalClass(marshal
, &IID_IUri
, (void*)uri
,
11560 MSHCTX_CROSSCTX
, NULL
, MSHLFLAGS_NORMAL
, &curi
);
11561 ok(hr
== E_INVALIDARG
, "%d) GetUnmarshalClass returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11562 hr
= IMarshal_GetUnmarshalClass(marshal
, &IID_IUri
, (void*)uri
,
11563 MSHCTX_INPROC
, NULL
, MSHLFLAGS_NORMAL
, &curi
);
11564 ok(hr
== S_OK
, "%d) GetUnmarshalClass failed 0x%08x, expected S_OK.\n", i
, hr
);
11565 ok(IsEqualCLSID(&curi
, &CLSID_CUri
), "%d) GetUnmarshalClass returned incorrect CLSID.\n", i
);
11567 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_CUR
, &size
);
11568 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11569 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11570 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11571 hr
= IStream_Read(stream
, (void*)dw_data
, 3*sizeof(DWORD
), NULL
);
11572 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11573 ok(dw_data
[0]-2 == U(size
).LowPart
, "%d) Structure size is %d, expected %d\n",
11574 i
, dw_data
[0]-2, U(size
).LowPart
);
11575 ok(dw_data
[1] == MSHCTX_LOCAL
, "%d) Incorrect value %d, expected MSHCTX_LOCAL.\n",
11577 ok(dw_data
[2] == dw_data
[0]-8, "%d) Incorrect value %d, expected %d (PersistStream size).\n",
11578 i
, dw_data
[2], dw_data
[0]-8);
11579 if(!test
->str_props
[Uri_PROPERTY_PATH
].value
[0] &&
11580 (test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_HTTP
11581 || test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_FTP
11582 || test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_HTTPS
))
11583 U(max_size
).LowPart
+= 3*sizeof(DWORD
);
11584 ok(dw_data
[2] == U(max_size
).LowPart
, "%d) Incorrect value %d, expected %d (PersistStream size).\n",
11585 i
, dw_data
[2], U(max_size
).LowPart
);
11586 IMarshal_Release(marshal
);
11589 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11590 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11591 hr
= CoCreateInstance(&curi
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11592 &IID_IUri
, (void**)&uri
);
11593 ok(hr
== S_OK
, "%d) Error creating uninitialized Uri: 0x%08x.\n", i
, hr
);
11594 hr
= IUri_QueryInterface(uri
, &IID_IMarshal
, (void**)&marshal
);
11595 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11597 hr
= IMarshal_UnmarshalInterface(marshal
, stream
, &IID_IUri
, (void**)&uri
);
11598 ok(hr
== S_OK
, "%d) UnmarshalInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11599 hr
= IUri_GetRawUri(uri
, &raw_uri
);
11600 ok(hr
== S_OK
, "%d) GetRawUri failed 0x%08x, expected S_OK.\n", i
, hr
);
11601 ok(!strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].value
, raw_uri
)
11602 || broken(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
11603 && !strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
, raw_uri
)),
11604 "%d) Expected %s but got %s.\n", i
, test
->str_props
[Uri_PROPERTY_RAW_URI
].value
,
11605 wine_dbgstr_w(raw_uri
));
11606 SysFreeString(raw_uri
);
11608 IMarshal_Release(marshal
);
11609 IStream_Release(stream
);
11615 static void test_UninitializedUri(void)
11618 IUriBuilderFactory
*ubf
;
11619 IPersistStream
*ps
;
11627 hr
= CoCreateInstance(&CLSID_CUri
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11628 &IID_IUri
, (void**)&uri
);
11630 win_skip("Skipping uninitialized Uri tests.\n");
11634 hr
= IUri_QueryInterface(uri
, &IID_IUriBuilderFactory
, (void**)&ubf
);
11635 ok(hr
== S_OK
, "QueryInterface(IID_IUriBuillderFactory) failed: %x.\n", hr
);
11636 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&ps
);
11637 ok(hr
== S_OK
, "QueryInterface(IID_IPersistStream) failed: %x.\n", hr
);
11639 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
11640 ok(hr
== E_UNEXPECTED
, "GetAbsoluteUri returned %x, expected E_UNEXPECTED.\n", hr
);
11641 hr
= IUri_GetAbsoluteUri(uri
, &bstr
);
11642 ok(hr
== E_UNEXPECTED
, "GetAbsoluteUri returned %x, expected E_UNEXPECTED.\n", hr
);
11643 hr
= IUri_GetAuthority(uri
, &bstr
);
11644 ok(hr
== E_UNEXPECTED
, "GetAuthority returned %x, expected E_UNEXPECTED.\n", hr
);
11645 hr
= IUri_GetDisplayUri(uri
, &bstr
);
11646 ok(hr
== E_UNEXPECTED
, "GetDisplayUri returned %x, expected E_UNEXPECTED.\n", hr
);
11647 hr
= IUri_GetDomain(uri
, &bstr
);
11648 ok(hr
== E_UNEXPECTED
, "GetDomain returned %x, expected E_UNEXPECTED.\n", hr
);
11649 hr
= IUri_GetExtension(uri
, &bstr
);
11650 ok(hr
== E_UNEXPECTED
, "GetExtension returned %x, expected E_UNEXPECTED.\n", hr
);
11651 hr
= IUri_GetFragment(uri
, &bstr
);
11652 ok(hr
== E_UNEXPECTED
, "GetFragment returned %x, expected E_UNEXPECTED.\n", hr
);
11653 hr
= IUri_GetHost(uri
, &bstr
);
11654 ok(hr
== E_UNEXPECTED
, "GetHost returned %x, expected E_UNEXPECTED.\n", hr
);
11655 hr
= IUri_GetHostType(uri
, &dword
);
11656 ok(hr
== E_UNEXPECTED
, "GetHostType returned %x, expected E_UNEXPECTED.\n", hr
);
11657 hr
= IUri_GetPassword(uri
, &bstr
);
11658 ok(hr
== E_UNEXPECTED
, "GetPassword returned %x, expected E_UNEXPECTED.\n", hr
);
11659 hr
= IUri_GetPassword(uri
, &bstr
);
11660 ok(hr
== E_UNEXPECTED
, "GetPassword returned %x, expected E_UNEXPECTED.\n", hr
);
11661 hr
= IUri_GetPathAndQuery(uri
, &bstr
);
11662 ok(hr
== E_UNEXPECTED
, "GetPathAndQuery returned %x, expected E_UNEXPECTED.\n", hr
);
11663 hr
= IUri_GetPort(uri
, &dword
);
11664 ok(hr
== E_UNEXPECTED
, "GetPort returned %x, expected E_UNEXPECTED.\n", hr
);
11665 hr
= IUri_GetProperties(uri
, &dword
);
11666 ok(hr
== E_UNEXPECTED
, "GetProperties returned %x, expected E_UNEXPECTED.\n", hr
);
11667 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, &bstr
, 0);
11668 ok(hr
== E_UNEXPECTED
, "GetPropertyBSTR returned %x, expected E_UNEXPECTED.\n", hr
);
11669 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_PORT
, &dword
, 0);
11670 ok(hr
== E_UNEXPECTED
, "GetPropertyDWORD returned %x, expected E_UNEXPECTED.\n", hr
);
11671 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_RAW_URI
, &dword
, 0);
11672 ok(hr
== E_UNEXPECTED
, "GetPropertyLength returned %x, expected E_UNEXPECTED.\n", hr
);
11673 hr
= IUri_GetQuery(uri
, &bstr
);
11674 ok(hr
== E_UNEXPECTED
, "GetQuery returned %x, expected E_UNEXPECTED.\n", hr
);
11675 hr
= IUri_GetRawUri(uri
, &bstr
);
11676 ok(hr
== E_UNEXPECTED
, "GetRawUri returned %x, expected E_UNEXPECTED.\n", hr
);
11677 hr
= IUri_GetScheme(uri
, &dword
);
11678 ok(hr
== E_UNEXPECTED
, "GetScheme returned %x, expected E_UNEXPECTED.\n", hr
);
11679 hr
= IUri_GetSchemeName(uri
, &bstr
);
11680 ok(hr
== E_UNEXPECTED
, "GetSchemeName returned %x, expected E_UNEXPECTED.\n", hr
);
11681 hr
= IUri_GetUserInfo(uri
, &bstr
);
11682 ok(hr
== E_UNEXPECTED
, "GetUserInfo returned %x, expected E_UNEXPECTED.\n", hr
);
11683 hr
= IUri_GetUserName(uri
, &bstr
);
11684 ok(hr
== E_UNEXPECTED
, "GetUserName returned %x, expected E_UNEXPECTED.\n", hr
);
11685 hr
= IUri_GetZone(uri
, &dword
);
11686 ok(hr
== E_UNEXPECTED
, "GetZone returned %x, expected E_UNEXPECTED.\n", hr
);
11687 hr
= IUri_IsEqual(uri
, uri
, &eq
);
11688 ok(hr
== E_UNEXPECTED
, "IsEqual returned %x, expected E_UNEXPECTED.\n", hr
);
11690 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(ubf
, 0, 0, &ub
);
11691 ok(hr
== E_UNEXPECTED
, "CreateInitializedIUriBuilder returned %x, expected E_UNEXPECTED.\n", hr
);
11692 hr
= IUriBuilderFactory_CreateIUriBuilder(ubf
, 0, 0, &ub
);
11693 ok(hr
== S_OK
, "CreateIUriBuilder returned %x, expected S_OK.\n", hr
);
11694 IUriBuilder_Release(ub
);
11696 hr
= IPersistStream_GetSizeMax(ps
, &ui
);
11697 ok(hr
== S_OK
, "GetSizeMax returned %x, expected S_OK.\n", hr
);
11698 ok(ui
.u
.LowPart
== 34, "ui.LowPart = %d, expected 34.\n", ui
.u
.LowPart
);
11699 hr
= IPersistStream_IsDirty(ps
);
11700 ok(hr
== S_FALSE
, "IsDirty returned %x, expected S_FALSE.\n", hr
);
11702 IPersistStream_Release(ps
);
11703 IUriBuilderFactory_Release(ubf
);
11710 hurlmon
= GetModuleHandleA("urlmon.dll");
11711 pCoInternetGetSession
= (void*) GetProcAddress(hurlmon
, "CoInternetGetSession");
11712 pCreateUri
= (void*) GetProcAddress(hurlmon
, "CreateUri");
11713 pCreateUriWithFragment
= (void*) GetProcAddress(hurlmon
, "CreateUriWithFragment");
11714 pCreateIUriBuilder
= (void*) GetProcAddress(hurlmon
, "CreateIUriBuilder");
11715 pCoInternetCombineIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineIUri");
11716 pCoInternetCombineUrlEx
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineUrlEx");
11717 pCoInternetParseIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetParseIUri");
11718 pCreateURLMonikerEx
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx");
11719 pCreateURLMonikerEx2
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx2");
11722 win_skip("CreateUri is not present, skipping tests.\n");
11726 trace("test CreateUri invalid flags...\n");
11727 test_CreateUri_InvalidFlags();
11729 trace("test CreateUri invalid args...\n");
11730 test_CreateUri_InvalidArgs();
11732 trace("test CreateUri invalid URIs...\n");
11733 test_CreateUri_InvalidUri();
11735 trace("test IUri_GetPropertyBSTR...\n");
11736 test_IUri_GetPropertyBSTR();
11738 trace("test IUri_GetPropertyDWORD...\n");
11739 test_IUri_GetPropertyDWORD();
11741 trace("test IUri_GetStrProperties...\n");
11742 test_IUri_GetStrProperties();
11744 trace("test IUri_GetDwordProperties...\n");
11745 test_IUri_GetDwordProperties();
11747 trace("test IUri_GetPropertyLength...\n");
11748 test_IUri_GetPropertyLength();
11750 trace("test IUri_GetProperties...\n");
11751 test_IUri_GetProperties();
11753 trace("test IUri_HasProperty...\n");
11754 test_IUri_HasProperty();
11756 trace("test IUri_IsEqual...\n");
11757 test_IUri_IsEqual();
11759 trace("test CreateUriWithFragment invalid args...\n");
11760 test_CreateUriWithFragment_InvalidArgs();
11762 trace("test CreateUriWithFragment invalid flags...\n");
11763 test_CreateUriWithFragment_InvalidFlags();
11765 trace("test CreateUriWithFragment...\n");
11766 test_CreateUriWithFragment();
11768 trace("test CreateIUriBuilder...\n");
11769 test_CreateIUriBuilder();
11771 trace("test IUriBuilder_CreateInvalidArgs...\n");
11772 test_IUriBuilder_CreateInvalidArgs();
11774 trace("test IUriBuilder...\n");
11775 test_IUriBuilder();
11777 trace("test IUriBuilder_GetInvalidArgs...\n");
11778 test_IUriBuilder_GetInvalidArgs();
11780 trace("test IUriBuilder_HasBeenModified...\n");
11781 test_IUriBuilder_HasBeenModified();
11783 trace("test IUriBuilder_IUriProperty...\n");
11784 test_IUriBuilder_IUriProperty();
11786 trace("test IUriBuilder_RemoveProperties...\n");
11787 test_IUriBuilder_RemoveProperties();
11789 trace("test IUriBuilder miscellaneous...\n");
11790 test_IUriBuilder_Misc();
11792 trace("test IUriBuilderFactory...\n");
11793 test_IUriBuilderFactory();
11795 trace("test CoInternetCombineIUri...\n");
11796 test_CoInternetCombineIUri();
11798 trace("test CoInternetCombineUrlEx...\n");
11799 test_CoInternetCombineUrlEx();
11801 trace("test CoInternetParseIUri Invalid Args...\n");
11802 test_CoInternetParseIUri_InvalidArgs();
11804 trace("test CoInternetParseIUri...\n");
11805 test_CoInternetParseIUri();
11807 register_protocols();
11809 trace("test CoInternetCombineIUri pluggable...\n");
11810 test_CoInternetCombineIUri_Pluggable();
11812 trace("test CoInternetCombineUrlEx Pluggable...\n");
11813 test_CoInternetCombineUrlEx_Pluggable();
11815 trace("test CoInternetParseIUri pluggable...\n");
11816 test_CoInternetParseIUri_Pluggable();
11818 trace("test CreateURLMoniker...\n");
11819 test_CreateURLMoniker();
11821 CoInitialize(NULL
);
11823 trace("test IPersistStream...\n");
11824 test_IPersistStream();
11826 trace("test uninitialized Uri...\n");
11827 test_UninitializedUri();
11830 unregister_protocols();