4 * Copyright 2010 Thomas Mullaly
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <wine/test.h>
27 #define WIN32_LEAN_AND_MEAN
37 DEFINE_GUID(CLSID_CUri
, 0xDF2FCE13, 0x25EC, 0x45BB, 0x9D,0x4C, 0xCE,0xCD,0x47,0xC2,0x43,0x0C);
39 #define URI_STR_PROPERTY_COUNT Uri_PROPERTY_STRING_LAST+1
40 #define URI_DWORD_PROPERTY_COUNT (Uri_PROPERTY_DWORD_LAST - Uri_PROPERTY_DWORD_START)+1
41 #define URI_BUILDER_STR_PROPERTY_COUNT 7
43 #define DEFINE_EXPECT(func) \
44 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
46 #define SET_EXPECT(func) \
47 expect_ ## func = TRUE
49 #define CHECK_EXPECT(func) \
51 ok(expect_ ##func, "unexpected call " #func "\n"); \
52 expect_ ## func = FALSE; \
53 called_ ## func = TRUE; \
56 #define CHECK_EXPECT2(func) \
58 ok(expect_ ##func, "unexpected call " #func "\n"); \
59 called_ ## func = TRUE; \
62 #define CHECK_CALLED(func) \
64 ok(called_ ## func, "expected " #func "\n"); \
65 expect_ ## func = called_ ## func = FALSE; \
68 DEFINE_EXPECT(CombineUrl
);
69 DEFINE_EXPECT(ParseUrl
);
71 static HRESULT (WINAPI
*pCreateUri
)(LPCWSTR
, DWORD
, DWORD_PTR
, IUri
**);
72 static HRESULT (WINAPI
*pCreateUriWithFragment
)(LPCWSTR
, LPCWSTR
, DWORD
, DWORD_PTR
, IUri
**);
73 static HRESULT (WINAPI
*pCreateIUriBuilder
)(IUri
*, DWORD
, DWORD_PTR
, IUriBuilder
**);
74 static HRESULT (WINAPI
*pCoInternetCombineIUri
)(IUri
*,IUri
*,DWORD
,IUri
**,DWORD_PTR
);
75 static HRESULT (WINAPI
*pCoInternetGetSession
)(DWORD
,IInternetSession
**,DWORD
);
76 static HRESULT (WINAPI
*pCoInternetCombineUrlEx
)(IUri
*,LPCWSTR
,DWORD
,IUri
**,DWORD_PTR
);
77 static HRESULT (WINAPI
*pCoInternetParseIUri
)(IUri
*,PARSEACTION
,DWORD
,LPWSTR
,DWORD
,DWORD
*,DWORD_PTR
);
78 static HRESULT (WINAPI
*pCreateURLMonikerEx
)(IMoniker
*,LPCWSTR
,IMoniker
**,DWORD
);
79 static HRESULT (WINAPI
*pCreateURLMonikerEx2
)(IMoniker
*,IUri
*,IMoniker
**,DWORD
);
81 static const WCHAR http_urlW
[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
82 '.','o','r','g','/',0};
83 static const WCHAR http_url_fragW
[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
84 '.','o','r','g','/','#','F','r','a','g',0};
86 static const WCHAR combine_baseW
[] = {'w','i','n','e','t','e','s','t',':','?','t',
87 'e','s','t','i','n','g',0};
88 static const WCHAR combine_relativeW
[] = {'?','t','e','s','t',0};
89 static const WCHAR combine_resultW
[] = {'z','i','p',':','t','e','s','t',0};
91 static const WCHAR winetestW
[] = {'w','i','n','e','t','e','s','t',0};
93 static const WCHAR parse_urlW
[] = {'w','i','n','e','t','e','s','t',':','t','e','s','t',0};
94 static const WCHAR parse_resultW
[] = {'z','i','p',':','t','e','s','t',0};
96 static PARSEACTION parse_action
;
97 static DWORD parse_flags
;
99 typedef struct _uri_create_flag_test
{
102 } uri_create_flag_test
;
104 static const uri_create_flag_test invalid_flag_tests
[] = {
105 /* Set of invalid flag combinations to test for. */
106 {Uri_CREATE_DECODE_EXTRA_INFO
| Uri_CREATE_NO_DECODE_EXTRA_INFO
, E_INVALIDARG
},
107 {Uri_CREATE_CANONICALIZE
| Uri_CREATE_NO_CANONICALIZE
, E_INVALIDARG
},
108 {Uri_CREATE_CRACK_UNKNOWN_SCHEMES
| Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
, E_INVALIDARG
},
109 {Uri_CREATE_PRE_PROCESS_HTML_URI
| Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, E_INVALIDARG
},
110 {Uri_CREATE_IE_SETTINGS
| Uri_CREATE_NO_IE_SETTINGS
, E_INVALIDARG
}
113 typedef struct _uri_str_property
{
117 const char* broken_value
;
120 typedef struct _uri_dword_property
{
124 BOOL broken_combine_hres
;
125 } uri_dword_property
;
127 typedef struct _uri_properties
{
130 HRESULT create_expected
;
133 uri_str_property str_props
[URI_STR_PROPERTY_COUNT
];
134 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
137 static const uri_properties uri_tests
[] = {
138 { "http://www.winehq.org/tests/../tests/../..", 0, S_OK
, FALSE
,
140 {"http://www.winehq.org/",S_OK
,FALSE
}, /* ABSOLUTE_URI */
141 {"www.winehq.org",S_OK
,FALSE
}, /* AUTHORITY */
142 {"http://www.winehq.org/",S_OK
,FALSE
}, /* DISPLAY_URI */
143 {"winehq.org",S_OK
,FALSE
}, /* DOMAIN */
144 {"",S_FALSE
,FALSE
}, /* EXTENSION */
145 {"",S_FALSE
,FALSE
}, /* FRAGMENT */
146 {"www.winehq.org",S_OK
,FALSE
}, /* HOST */
147 {"",S_FALSE
,FALSE
}, /* PASSWORD */
148 {"/",S_OK
,FALSE
}, /* PATH */
149 {"/",S_OK
,FALSE
}, /* PATH_AND_QUERY */
150 {"",S_FALSE
,FALSE
}, /* QUERY */
151 {"http://www.winehq.org/tests/../tests/../..",S_OK
,FALSE
}, /* RAW_URI */
152 {"http",S_OK
,FALSE
}, /* SCHEME_NAME */
153 {"",S_FALSE
,FALSE
}, /* USER_INFO */
154 {"",S_FALSE
,FALSE
} /* USER_NAME */
157 {Uri_HOST_DNS
,S_OK
,FALSE
}, /* HOST_TYPE */
158 {80,S_OK
,FALSE
}, /* PORT */
159 {URL_SCHEME_HTTP
,S_OK
,FALSE
}, /* SCHEME */
160 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
} /* ZONE */
163 { "http://winehq.org/tests/.././tests", 0, S_OK
, FALSE
,
165 {"http://winehq.org/tests",S_OK
,FALSE
},
166 {"winehq.org",S_OK
,FALSE
},
167 {"http://winehq.org/tests",S_OK
,FALSE
},
168 {"winehq.org",S_OK
,FALSE
},
171 {"winehq.org",S_OK
,FALSE
},
173 {"/tests",S_OK
,FALSE
},
174 {"/tests",S_OK
,FALSE
},
176 {"http://winehq.org/tests/.././tests",S_OK
,FALSE
},
182 {Uri_HOST_DNS
,S_OK
,FALSE
},
184 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
185 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
188 { "HtTp://www.winehq.org/tests/..?query=x&return=y", 0, S_OK
, FALSE
,
190 {"http://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
191 {"www.winehq.org",S_OK
,FALSE
},
192 {"http://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
193 {"winehq.org",S_OK
,FALSE
},
196 {"www.winehq.org",S_OK
,FALSE
},
199 {"/?query=x&return=y",S_OK
,FALSE
},
200 {"?query=x&return=y",S_OK
,FALSE
},
201 {"HtTp://www.winehq.org/tests/..?query=x&return=y",S_OK
,FALSE
},
207 {Uri_HOST_DNS
,S_OK
,FALSE
},
209 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
210 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
213 { "HtTpS://www.winehq.org/tests/..?query=x&return=y", 0, S_OK
, FALSE
,
215 {"https://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
216 {"www.winehq.org",S_OK
,FALSE
},
217 {"https://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
218 {"winehq.org",S_OK
,FALSE
},
221 {"www.winehq.org",S_OK
,FALSE
},
224 {"/?query=x&return=y",S_OK
,FALSE
},
225 {"?query=x&return=y",S_OK
,FALSE
},
226 {"HtTpS://www.winehq.org/tests/..?query=x&return=y",S_OK
,FALSE
},
227 {"https",S_OK
,FALSE
},
232 {Uri_HOST_DNS
,S_OK
,FALSE
},
234 {URL_SCHEME_HTTPS
,S_OK
,FALSE
},
235 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
238 { "hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters", 0, S_OK
, FALSE
,
240 {"http://usEr%3Ainfo@example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
241 {"usEr%3Ainfo@example.com",S_OK
,FALSE
},
242 {"http://example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
243 {"example.com",S_OK
,FALSE
},
246 {"example.com",S_OK
,FALSE
},
248 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
249 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
251 {"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters",S_OK
,FALSE
},
253 {"usEr%3Ainfo",S_OK
,FALSE
},
254 {"usEr%3Ainfo",S_OK
,FALSE
}
257 {Uri_HOST_DNS
,S_OK
,FALSE
},
259 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
260 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
263 { "ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt", 0, S_OK
, FALSE
,
265 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK
,FALSE
},
266 {"winepass:wine@ftp.winehq.org:9999",S_OK
,FALSE
},
267 {"ftp://ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK
,FALSE
},
268 {"winehq.org",S_OK
,FALSE
},
271 {"ftp.winehq.org",S_OK
,FALSE
},
273 {"/dir/foo%20bar.txt",S_OK
,FALSE
},
274 {"/dir/foo%20bar.txt",S_OK
,FALSE
},
276 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt",S_OK
,FALSE
},
278 {"winepass:wine",S_OK
,FALSE
},
279 {"winepass",S_OK
,FALSE
}
282 {Uri_HOST_DNS
,S_OK
,FALSE
},
284 {URL_SCHEME_FTP
,S_OK
,FALSE
},
285 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
288 { "file://c:\\tests\\../tests/foo%20bar.mp3", 0, S_OK
, FALSE
,
290 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
292 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
298 {"/c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
299 {"/c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
301 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK
,FALSE
},
307 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
309 {URL_SCHEME_FILE
,S_OK
,FALSE
},
310 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
313 { "file://c:\\tests\\../tests/foo%20bar.mp3", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
315 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
317 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
323 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
324 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
326 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK
,FALSE
},
332 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
334 {URL_SCHEME_FILE
,S_OK
,FALSE
},
335 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
338 { "FILE://localhost/test dir\\../tests/test%20file.README.txt", 0, S_OK
, FALSE
,
340 {"file:///tests/test%20file.README.txt",S_OK
,FALSE
},
342 {"file:///tests/test%20file.README.txt",S_OK
,FALSE
},
348 {"/tests/test%20file.README.txt",S_OK
,FALSE
},
349 {"/tests/test%20file.README.txt",S_OK
,FALSE
},
351 {"FILE://localhost/test dir\\../tests/test%20file.README.txt",S_OK
,FALSE
},
357 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
359 {URL_SCHEME_FILE
,S_OK
,FALSE
},
360 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
363 { "file:///z:/test dir/README.txt", 0, S_OK
, FALSE
,
365 {"file:///z:/test%20dir/README.txt",S_OK
},
367 {"file:///z:/test%20dir/README.txt",S_OK
},
373 {"/z:/test%20dir/README.txt",S_OK
},
374 {"/z:/test%20dir/README.txt",S_OK
},
376 {"file:///z:/test dir/README.txt",S_OK
},
382 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
384 {URL_SCHEME_FILE
,S_OK
,FALSE
},
385 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
388 { "urn:nothing:should:happen here", 0, S_OK
, FALSE
,
390 {"urn:nothing:should:happen here",S_OK
,FALSE
},
392 {"urn:nothing:should:happen here",S_OK
,FALSE
},
398 {"nothing:should:happen here",S_OK
,FALSE
},
399 {"nothing:should:happen here",S_OK
,FALSE
},
401 {"urn:nothing:should:happen here",S_OK
,FALSE
},
407 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
409 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
410 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
413 { "http://127.0.0.1/tests/../test dir/./test.txt", 0, S_OK
, FALSE
,
415 {"http://127.0.0.1/test%20dir/test.txt",S_OK
,FALSE
},
416 {"127.0.0.1",S_OK
,FALSE
},
417 {"http://127.0.0.1/test%20dir/test.txt",S_OK
,FALSE
},
421 {"127.0.0.1",S_OK
,FALSE
},
423 {"/test%20dir/test.txt",S_OK
,FALSE
},
424 {"/test%20dir/test.txt",S_OK
,FALSE
},
426 {"http://127.0.0.1/tests/../test dir/./test.txt",S_OK
,FALSE
},
432 {Uri_HOST_IPV4
,S_OK
,FALSE
},
434 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
435 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
438 { "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", 0, S_OK
, FALSE
,
440 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK
,FALSE
},
441 {"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]",S_OK
,FALSE
},
442 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK
,FALSE
},
446 {"fedc:ba98:7654:3210:fedc:ba98:7654:3210",S_OK
,FALSE
},
451 {"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]",S_OK
,FALSE
},
457 {Uri_HOST_IPV6
,S_OK
,FALSE
},
459 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
460 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
463 { "ftp://[::13.1.68.3]", 0, S_OK
, FALSE
,
465 {"ftp://[::13.1.68.3]/",S_OK
,FALSE
},
466 {"[::13.1.68.3]",S_OK
,FALSE
},
467 {"ftp://[::13.1.68.3]/",S_OK
,FALSE
},
471 {"::13.1.68.3",S_OK
,FALSE
},
476 {"ftp://[::13.1.68.3]",S_OK
,FALSE
},
482 {Uri_HOST_IPV6
,S_OK
,FALSE
},
484 {URL_SCHEME_FTP
,S_OK
,FALSE
},
485 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
488 { "http://[FEDC:BA98:0:0:0:0:0:3210]", 0, S_OK
, FALSE
,
490 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
491 {"[fedc:ba98::3210]",S_OK
,FALSE
},
492 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
496 {"fedc:ba98::3210",S_OK
,FALSE
},
501 {"http://[FEDC:BA98:0:0:0:0:0:3210]",S_OK
,FALSE
},
507 {Uri_HOST_IPV6
,S_OK
,FALSE
},
509 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
510 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
513 { "1234://www.winehq.org", 0, S_OK
, FALSE
,
515 {"1234://www.winehq.org/",S_OK
,FALSE
},
516 {"www.winehq.org",S_OK
,FALSE
},
517 {"1234://www.winehq.org/",S_OK
,FALSE
},
518 {"winehq.org",S_OK
,FALSE
},
521 {"www.winehq.org",S_OK
,FALSE
},
526 {"1234://www.winehq.org",S_OK
,FALSE
},
532 {Uri_HOST_DNS
,S_OK
,FALSE
},
534 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
535 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
538 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
539 { "C:/test/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
541 {"file:///C:/test/test.mp3",S_OK
,FALSE
},
543 {"file:///C:/test/test.mp3",S_OK
,FALSE
},
549 {"/C:/test/test.mp3",S_OK
,FALSE
},
550 {"/C:/test/test.mp3",S_OK
,FALSE
},
552 {"C:/test/test.mp3",S_OK
,FALSE
},
558 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
560 {URL_SCHEME_FILE
,S_OK
,FALSE
},
561 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
564 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
565 { "\\\\Server/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
567 {"file://server/test.mp3",S_OK
,FALSE
},
568 {"server",S_OK
,FALSE
},
569 {"file://server/test.mp3",S_OK
,FALSE
},
573 {"server",S_OK
,FALSE
},
575 {"/test.mp3",S_OK
,FALSE
},
576 {"/test.mp3",S_OK
,FALSE
},
578 {"\\\\Server/test.mp3",S_OK
,FALSE
},
584 {Uri_HOST_DNS
,S_OK
,FALSE
},
586 {URL_SCHEME_FILE
,S_OK
,FALSE
},
587 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
590 { "www.winehq.org/test", Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
592 {"*:www.winehq.org/test",S_OK
,FALSE
},
593 {"www.winehq.org",S_OK
,FALSE
},
594 {"*:www.winehq.org/test",S_OK
,FALSE
},
595 {"winehq.org",S_OK
,FALSE
},
598 {"www.winehq.org",S_OK
,FALSE
},
600 {"/test",S_OK
,FALSE
},
601 {"/test",S_OK
,FALSE
},
603 {"www.winehq.org/test",S_OK
,FALSE
},
609 {Uri_HOST_DNS
,S_OK
,FALSE
},
611 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
612 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
615 /* Valid since the '*' is the only character in the scheme name. */
616 { "*:www.winehq.org/test", 0, S_OK
, FALSE
,
618 {"*:www.winehq.org/test",S_OK
,FALSE
},
619 {"www.winehq.org",S_OK
,FALSE
},
620 {"*:www.winehq.org/test",S_OK
,FALSE
},
621 {"winehq.org",S_OK
,FALSE
},
624 {"www.winehq.org",S_OK
,FALSE
},
626 {"/test",S_OK
,FALSE
},
627 {"/test",S_OK
,FALSE
},
629 {"*:www.winehq.org/test",S_OK
,FALSE
},
635 {Uri_HOST_DNS
,S_OK
,FALSE
},
637 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
638 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
641 { "/../some dir/test.ext", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
643 {"/../some dir/test.ext",S_OK
,FALSE
},
645 {"/../some dir/test.ext",S_OK
,FALSE
},
651 {"/../some dir/test.ext",S_OK
,FALSE
},
652 {"/../some dir/test.ext",S_OK
,FALSE
},
654 {"/../some dir/test.ext",S_OK
,FALSE
},
660 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
662 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
663 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
666 { "//implicit/wildcard/uri scheme", Uri_CREATE_ALLOW_RELATIVE
|Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
668 {"*://implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
670 {"*://implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
676 {"//implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
677 {"//implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
679 {"//implicit/wildcard/uri scheme",S_OK
,FALSE
},
685 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
687 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
688 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
691 /* URI is considered opaque since CREATE_NO_CRACK_UNKNOWN_SCHEMES is set and it's an unknown scheme. */
692 { "zip://google.com", Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
, S_OK
, FALSE
,
694 {"zip:/.//google.com",S_OK
,FALSE
},
696 {"zip:/.//google.com",S_OK
,FALSE
},
702 {"/.//google.com",S_OK
,FALSE
},
703 {"/.//google.com",S_OK
,FALSE
},
705 {"zip://google.com",S_OK
,FALSE
},
711 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
713 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
714 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
717 /* Windows uses the first occurrence of ':' to delimit the userinfo. */
718 { "ftp://user:pass:word@winehq.org/", 0, S_OK
, FALSE
,
720 {"ftp://user:pass:word@winehq.org/",S_OK
,FALSE
},
721 {"user:pass:word@winehq.org",S_OK
,FALSE
},
722 {"ftp://winehq.org/",S_OK
,FALSE
},
723 {"winehq.org",S_OK
,FALSE
},
726 {"winehq.org",S_OK
,FALSE
},
727 {"pass:word",S_OK
,FALSE
},
731 {"ftp://user:pass:word@winehq.org/",S_OK
,FALSE
},
733 {"user:pass:word",S_OK
,FALSE
},
737 {Uri_HOST_DNS
,S_OK
,FALSE
},
739 {URL_SCHEME_FTP
,S_OK
,FALSE
},
740 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
743 /* Make sure % encoded unreserved characters are decoded. */
744 { "ftp://w%49%4Ee:PA%53%53@ftp.google.com/", 0, S_OK
, FALSE
,
746 {"ftp://wINe:PASS@ftp.google.com/",S_OK
,FALSE
},
747 {"wINe:PASS@ftp.google.com",S_OK
,FALSE
},
748 {"ftp://ftp.google.com/",S_OK
,FALSE
},
749 {"google.com",S_OK
,FALSE
},
752 {"ftp.google.com",S_OK
,FALSE
},
757 {"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK
,FALSE
},
759 {"wINe:PASS",S_OK
,FALSE
},
763 {Uri_HOST_DNS
,S_OK
,FALSE
},
765 {URL_SCHEME_FTP
,S_OK
,FALSE
},
766 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
769 /* Make sure % encoded characters which are NOT unreserved are NOT decoded. */
770 { "ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/", 0, S_OK
, FALSE
,
772 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK
,FALSE
},
773 {"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK
,FALSE
},
774 {"ftp://ftp.google.com/",S_OK
,FALSE
},
775 {"google.com",S_OK
,FALSE
},
778 {"ftp.google.com",S_OK
,FALSE
},
779 {"PA%7B%7D",S_OK
,FALSE
},
783 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK
,FALSE
},
785 {"w%5D%5Be:PA%7B%7D",S_OK
,FALSE
},
786 {"w%5D%5Be",S_OK
,FALSE
}
789 {Uri_HOST_DNS
,S_OK
,FALSE
},
791 {URL_SCHEME_FTP
,S_OK
,FALSE
},
792 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
795 /* You're allowed to have an empty password portion in the userinfo section. */
796 { "ftp://empty:@ftp.google.com/", 0, S_OK
, FALSE
,
798 {"ftp://empty:@ftp.google.com/",S_OK
,FALSE
},
799 {"empty:@ftp.google.com",S_OK
,FALSE
},
800 {"ftp://ftp.google.com/",S_OK
,FALSE
},
801 {"google.com",S_OK
,FALSE
},
804 {"ftp.google.com",S_OK
,FALSE
},
809 {"ftp://empty:@ftp.google.com/",S_OK
,FALSE
},
811 {"empty:",S_OK
,FALSE
},
815 {Uri_HOST_DNS
,S_OK
,FALSE
},
817 {URL_SCHEME_FTP
,S_OK
,FALSE
},
818 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
821 /* Make sure forbidden characters in "userinfo" get encoded. */
822 { "ftp://\" \"weird@ftp.google.com/", 0, S_OK
, FALSE
,
824 {"ftp://%22%20%22weird@ftp.google.com/",S_OK
,FALSE
},
825 {"%22%20%22weird@ftp.google.com",S_OK
,FALSE
},
826 {"ftp://ftp.google.com/",S_OK
,FALSE
},
827 {"google.com",S_OK
,FALSE
},
830 {"ftp.google.com",S_OK
,FALSE
},
835 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
837 {"%22%20%22weird",S_OK
,FALSE
},
838 {"%22%20%22weird",S_OK
,FALSE
}
841 {Uri_HOST_DNS
,S_OK
,FALSE
},
843 {URL_SCHEME_FTP
,S_OK
,FALSE
},
844 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
847 /* Make sure the forbidden characters don't get percent encoded. */
848 { "ftp://\" \"weird@ftp.google.com/", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
850 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
851 {"\" \"weird@ftp.google.com",S_OK
,FALSE
},
852 {"ftp://ftp.google.com/",S_OK
,FALSE
},
853 {"google.com",S_OK
,FALSE
},
856 {"ftp.google.com",S_OK
,FALSE
},
861 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
863 {"\" \"weird",S_OK
,FALSE
},
864 {"\" \"weird",S_OK
,FALSE
}
867 {Uri_HOST_DNS
,S_OK
,FALSE
},
869 {URL_SCHEME_FTP
,S_OK
,FALSE
},
870 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
873 /* Make sure already percent encoded characters don't get unencoded. */
874 { "ftp://\"%20\"weird@ftp.google.com/\"%20\"weird", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
876 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK
,FALSE
},
877 {"\"%20\"weird@ftp.google.com",S_OK
,FALSE
},
878 {"ftp://ftp.google.com/\"%20\"weird",S_OK
,FALSE
},
879 {"google.com",S_OK
,FALSE
},
882 {"ftp.google.com",S_OK
,FALSE
},
884 {"/\"%20\"weird",S_OK
,FALSE
},
885 {"/\"%20\"weird",S_OK
,FALSE
},
887 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK
,FALSE
},
889 {"\"%20\"weird",S_OK
,FALSE
},
890 {"\"%20\"weird",S_OK
,FALSE
}
893 {Uri_HOST_DNS
,S_OK
,FALSE
},
895 {URL_SCHEME_FTP
,S_OK
,FALSE
},
896 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
899 /* Allowed to have invalid % encoded because it's an unknown scheme type. */
900 { "zip://%xy:word@winehq.org/", 0, S_OK
, FALSE
,
902 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
903 {"%xy:word@winehq.org",S_OK
,FALSE
},
904 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
905 {"winehq.org",S_OK
,FALSE
},
908 {"winehq.org",S_OK
,FALSE
},
913 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
915 {"%xy:word",S_OK
,FALSE
},
919 {Uri_HOST_DNS
,S_OK
,FALSE
},
921 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
922 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
925 /* Unreserved, percent encoded characters aren't decoded in the userinfo because the scheme
928 { "zip://%2E:%52%53ord@winehq.org/", 0, S_OK
, FALSE
,
930 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
931 {"%2E:%52%53ord@winehq.org",S_OK
,FALSE
},
932 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
933 {"winehq.org",S_OK
,FALSE
},
936 {"winehq.org",S_OK
,FALSE
},
937 {"%52%53ord",S_OK
,FALSE
},
941 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
943 {"%2E:%52%53ord",S_OK
,FALSE
},
947 {Uri_HOST_DNS
,S_OK
,FALSE
},
949 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
950 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
953 { "ftp://[](),'test':word@winehq.org/", 0, S_OK
, FALSE
,
955 {"ftp://[](),'test':word@winehq.org/",S_OK
,FALSE
},
956 {"[](),'test':word@winehq.org",S_OK
,FALSE
},
957 {"ftp://winehq.org/",S_OK
,FALSE
},
958 {"winehq.org",S_OK
,FALSE
},
961 {"winehq.org",S_OK
,FALSE
},
966 {"ftp://[](),'test':word@winehq.org/",S_OK
,FALSE
},
968 {"[](),'test':word",S_OK
,FALSE
},
969 {"[](),'test'",S_OK
,FALSE
}
972 {Uri_HOST_DNS
,S_OK
,FALSE
},
974 {URL_SCHEME_FTP
,S_OK
,FALSE
},
975 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
978 { "ftp://test?:word@winehq.org/", 0, S_OK
, FALSE
,
980 {"ftp://test/?:word@winehq.org/",S_OK
,FALSE
},
982 {"ftp://test/?:word@winehq.org/",S_OK
,FALSE
},
989 {"/?:word@winehq.org/",S_OK
,FALSE
},
990 {"?:word@winehq.org/",S_OK
,FALSE
},
991 {"ftp://test?:word@winehq.org/",S_OK
,FALSE
},
997 {Uri_HOST_DNS
,S_OK
,FALSE
},
999 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1000 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1003 { "ftp://test#:word@winehq.org/", 0, S_OK
, FALSE
,
1005 {"ftp://test/#:word@winehq.org/",S_OK
,FALSE
},
1006 {"test",S_OK
,FALSE
},
1007 {"ftp://test/#:word@winehq.org/",S_OK
,FALSE
},
1010 {"#:word@winehq.org/",S_OK
,FALSE
},
1011 {"test",S_OK
,FALSE
},
1016 {"ftp://test#:word@winehq.org/",S_OK
,FALSE
},
1022 {Uri_HOST_DNS
,S_OK
,FALSE
},
1024 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1025 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1028 /* Allowed to have a backslash in the userinfo since it's an unknown scheme. */
1029 { "zip://test\\:word@winehq.org/", 0, S_OK
, FALSE
,
1031 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1032 {"test\\:word@winehq.org",S_OK
,FALSE
},
1033 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1034 {"winehq.org",S_OK
,FALSE
},
1037 {"winehq.org",S_OK
,FALSE
},
1038 {"word",S_OK
,FALSE
},
1042 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1044 {"test\\:word",S_OK
,FALSE
},
1045 {"test\\",S_OK
,FALSE
}
1048 {Uri_HOST_DNS
,S_OK
,FALSE
},
1050 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1051 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1054 /* It normalizes IPv4 addresses correctly. */
1055 { "http://127.000.000.100/", 0, S_OK
, FALSE
,
1057 {"http://127.0.0.100/",S_OK
,FALSE
},
1058 {"127.0.0.100",S_OK
,FALSE
},
1059 {"http://127.0.0.100/",S_OK
,FALSE
},
1063 {"127.0.0.100",S_OK
,FALSE
},
1068 {"http://127.000.000.100/",S_OK
,FALSE
},
1069 {"http",S_OK
,FALSE
},
1074 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1076 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1077 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1080 { "http://127.0.0.1:8000", 0, S_OK
, FALSE
,
1082 {"http://127.0.0.1:8000/",S_OK
},
1083 {"127.0.0.1:8000",S_OK
},
1084 {"http://127.0.0.1:8000/",S_OK
},
1093 {"http://127.0.0.1:8000",S_OK
},
1099 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1101 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1102 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1105 /* Make sure it normalizes partial IPv4 addresses correctly. */
1106 { "http://127.0/", 0, S_OK
, FALSE
,
1108 {"http://127.0.0.0/",S_OK
,FALSE
},
1109 {"127.0.0.0",S_OK
,FALSE
},
1110 {"http://127.0.0.0/",S_OK
,FALSE
},
1114 {"127.0.0.0",S_OK
,FALSE
},
1119 {"http://127.0/",S_OK
,FALSE
},
1120 {"http",S_OK
,FALSE
},
1125 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1127 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1128 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1131 /* Make sure it converts implicit IPv4's correctly. */
1132 { "http://123456/", 0, S_OK
, FALSE
,
1134 {"http://0.1.226.64/",S_OK
,FALSE
},
1135 {"0.1.226.64",S_OK
,FALSE
},
1136 {"http://0.1.226.64/",S_OK
,FALSE
},
1140 {"0.1.226.64",S_OK
,FALSE
},
1145 {"http://123456/",S_OK
,FALSE
},
1146 {"http",S_OK
,FALSE
},
1151 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1153 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1154 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1158 { "http://4294967295/", 0, S_OK
, FALSE
,
1160 {"http://255.255.255.255/",S_OK
,FALSE
},
1161 {"255.255.255.255",S_OK
,FALSE
},
1162 {"http://255.255.255.255/",S_OK
,FALSE
},
1166 {"255.255.255.255",S_OK
,FALSE
},
1171 {"http://4294967295/",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
}
1184 { "http://4294967296/", 0, S_OK
, FALSE
,
1186 {"http://4294967296/",S_OK
,FALSE
},
1187 {"4294967296",S_OK
,FALSE
},
1188 {"http://4294967296/",S_OK
,FALSE
},
1192 {"4294967296",S_OK
,FALSE
},
1197 {"http://4294967296/",S_OK
,FALSE
},
1198 {"http",S_OK
,FALSE
},
1203 {Uri_HOST_DNS
,S_OK
,FALSE
},
1205 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1206 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1209 /* Window's doesn't normalize IP address for unknown schemes. */
1210 { "1234://4294967295/", 0, S_OK
, FALSE
,
1212 {"1234://4294967295/",S_OK
,FALSE
},
1213 {"4294967295",S_OK
,FALSE
},
1214 {"1234://4294967295/",S_OK
,FALSE
},
1218 {"4294967295",S_OK
,FALSE
},
1223 {"1234://4294967295/",S_OK
,FALSE
},
1224 {"1234",S_OK
,FALSE
},
1229 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1231 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1232 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1235 /* Window's doesn't normalize IP address for unknown schemes. */
1236 { "1234://127.001/", 0, S_OK
, FALSE
,
1238 {"1234://127.001/",S_OK
,FALSE
},
1239 {"127.001",S_OK
,FALSE
},
1240 {"1234://127.001/",S_OK
,FALSE
},
1244 {"127.001",S_OK
,FALSE
},
1249 {"1234://127.001/",S_OK
,FALSE
},
1250 {"1234",S_OK
,FALSE
},
1255 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1257 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1258 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1261 { "http://[FEDC:BA98::3210]", 0, S_OK
, FALSE
,
1263 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
1264 {"[fedc:ba98::3210]",S_OK
,FALSE
},
1265 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
1269 {"fedc:ba98::3210",S_OK
,FALSE
},
1274 {"http://[FEDC:BA98::3210]",S_OK
,FALSE
},
1275 {"http",S_OK
,FALSE
},
1280 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1282 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1283 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1286 { "http://[::]", 0, S_OK
, FALSE
,
1288 {"http://[::]/",S_OK
,FALSE
},
1289 {"[::]",S_OK
,FALSE
},
1290 {"http://[::]/",S_OK
,FALSE
},
1299 {"http://[::]",S_OK
,FALSE
},
1300 {"http",S_OK
,FALSE
},
1305 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1307 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1308 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1311 { "http://[FEDC:BA98::]", 0, S_OK
, FALSE
,
1313 {"http://[fedc:ba98::]/",S_OK
,FALSE
},
1314 {"[fedc:ba98::]",S_OK
,FALSE
},
1315 {"http://[fedc:ba98::]/",S_OK
,FALSE
},
1319 {"fedc:ba98::",S_OK
,FALSE
},
1324 {"http://[FEDC:BA98::]",S_OK
,FALSE
},
1325 {"http",S_OK
,FALSE
},
1330 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1332 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1333 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1336 /* Valid even with 2 byte elision because it doesn't appear the beginning or end. */
1337 { "http://[1::3:4:5:6:7:8]", 0, S_OK
, FALSE
,
1339 {"http://[1:0:3:4:5:6:7:8]/",S_OK
,FALSE
},
1340 {"[1:0:3:4:5:6:7:8]",S_OK
,FALSE
},
1341 {"http://[1:0:3:4:5:6:7:8]/",S_OK
,FALSE
},
1345 {"1:0:3:4:5:6:7:8",S_OK
,FALSE
},
1350 {"http://[1::3:4:5:6:7:8]",S_OK
,FALSE
},
1351 {"http",S_OK
,FALSE
},
1356 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1358 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1359 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1362 { "http://[v2.34]/", 0, S_OK
, FALSE
,
1364 {"http://[v2.34]/",S_OK
,FALSE
},
1365 {"[v2.34]",S_OK
,FALSE
},
1366 {"http://[v2.34]/",S_OK
,FALSE
},
1370 {"[v2.34]",S_OK
,FALSE
},
1375 {"http://[v2.34]/",S_OK
,FALSE
},
1376 {"http",S_OK
,FALSE
},
1381 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
1383 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1384 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1387 /* Windows ignores ':' if they appear after a '[' on a non-IPLiteral host. */
1388 { "http://[xyz:12345.com/test", 0, S_OK
, FALSE
,
1390 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1391 {"[xyz:12345.com",S_OK
,FALSE
},
1392 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1393 {"[xyz:12345.com",S_OK
,FALSE
},
1396 {"[xyz:12345.com",S_OK
,FALSE
},
1398 {"/test",S_OK
,FALSE
},
1399 {"/test",S_OK
,FALSE
},
1401 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1402 {"http",S_OK
,FALSE
},
1407 {Uri_HOST_DNS
,S_OK
,FALSE
},
1409 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1410 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1413 /* Valid URI since the '[' and ']' don't appear at the beginning and end
1414 * of the host name (respectively).
1416 { "ftp://www.[works].com/", 0, S_OK
, FALSE
,
1418 {"ftp://www.[works].com/",S_OK
,FALSE
},
1419 {"www.[works].com",S_OK
,FALSE
},
1420 {"ftp://www.[works].com/",S_OK
,FALSE
},
1421 {"[works].com",S_OK
,FALSE
},
1424 {"www.[works].com",S_OK
,FALSE
},
1429 {"ftp://www.[works].com/",S_OK
,FALSE
},
1435 {Uri_HOST_DNS
,S_OK
,FALSE
},
1437 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1438 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1441 /* Considers ':' a delimiter since it appears after the ']'. */
1442 { "http://www.google.com]:12345/", 0, S_OK
, FALSE
,
1444 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1445 {"www.google.com]:12345",S_OK
,FALSE
},
1446 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1447 {"google.com]",S_OK
,FALSE
},
1450 {"www.google.com]",S_OK
,FALSE
},
1455 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1456 {"http",S_OK
,FALSE
},
1461 {Uri_HOST_DNS
,S_OK
,FALSE
},
1463 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1464 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1467 /* Unknown scheme types can have invalid % encoded data in the hostname. */
1468 { "zip://w%XXw%GEw.google.com/", 0, S_OK
, FALSE
,
1470 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1471 {"w%XXw%GEw.google.com",S_OK
,FALSE
},
1472 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1473 {"google.com",S_OK
,FALSE
},
1476 {"w%XXw%GEw.google.com",S_OK
,FALSE
},
1481 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1487 {Uri_HOST_DNS
,S_OK
,FALSE
},
1489 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1490 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1493 /* Unknown scheme types hostname doesn't get lower cased. */
1494 { "zip://GOOGLE.com/", 0, S_OK
, FALSE
,
1496 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1497 {"GOOGLE.com",S_OK
,FALSE
},
1498 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1499 {"GOOGLE.com",S_OK
,FALSE
},
1502 {"GOOGLE.com",S_OK
,FALSE
},
1507 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1513 {Uri_HOST_DNS
,S_OK
,FALSE
},
1515 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1516 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1519 /* Hostname gets lower-cased for known scheme types. */
1520 { "http://WWW.GOOGLE.com/", 0, S_OK
, FALSE
,
1522 {"http://www.google.com/",S_OK
,FALSE
},
1523 {"www.google.com",S_OK
,FALSE
},
1524 {"http://www.google.com/",S_OK
,FALSE
},
1525 {"google.com",S_OK
,FALSE
},
1528 {"www.google.com",S_OK
,FALSE
},
1533 {"http://WWW.GOOGLE.com/",S_OK
,FALSE
},
1534 {"http",S_OK
,FALSE
},
1539 {Uri_HOST_DNS
,S_OK
,FALSE
},
1541 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1542 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1545 /* Characters that get % encoded in the hostname also have their percent
1546 * encoded forms lower cased.
1548 { "http://www.%7Cgoogle|.com/", 0, S_OK
, FALSE
,
1550 {"http://www.%7cgoogle%7c.com/",S_OK
,FALSE
},
1551 {"www.%7cgoogle%7c.com",S_OK
,FALSE
},
1552 {"http://www.%7cgoogle%7c.com/",S_OK
,FALSE
},
1553 {"%7cgoogle%7c.com",S_OK
,FALSE
},
1556 {"www.%7cgoogle%7c.com",S_OK
,FALSE
},
1561 {"http://www.%7Cgoogle|.com/",S_OK
,FALSE
},
1562 {"http",S_OK
,FALSE
},
1567 {Uri_HOST_DNS
,S_OK
,FALSE
},
1569 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1570 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1573 /* IPv4 addresses attached to IPv6 can be included in elisions. */
1574 { "http://[1:2:3:4:5:6:0.0.0.0]", 0, S_OK
, FALSE
,
1576 {"http://[1:2:3:4:5:6::]/",S_OK
,FALSE
},
1577 {"[1:2:3:4:5:6::]",S_OK
,FALSE
},
1578 {"http://[1:2:3:4:5:6::]/",S_OK
,FALSE
},
1582 {"1:2:3:4:5:6::",S_OK
,FALSE
},
1587 {"http://[1:2:3:4:5:6:0.0.0.0]",S_OK
,FALSE
},
1588 {"http",S_OK
,FALSE
},
1593 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1595 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1596 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1599 /* IPv4 addresses get normalized. */
1600 { "http://[::001.002.003.000]", 0, S_OK
, FALSE
,
1602 {"http://[::1.2.3.0]/",S_OK
,FALSE
},
1603 {"[::1.2.3.0]",S_OK
,FALSE
},
1604 {"http://[::1.2.3.0]/",S_OK
,FALSE
},
1608 {"::1.2.3.0",S_OK
,FALSE
},
1613 {"http://[::001.002.003.000]",S_OK
,FALSE
},
1614 {"http",S_OK
,FALSE
},
1619 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1621 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1622 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1625 /* Windows doesn't do anything to IPv6's in unknown schemes. */
1626 { "zip://[0001:0:000:0004:0005:0006:001.002.003.000]", 0, S_OK
, FALSE
,
1628 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK
,FALSE
},
1629 {"[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK
,FALSE
},
1630 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK
,FALSE
},
1634 {"0001:0:000:0004:0005:0006:001.002.003.000",S_OK
,FALSE
},
1639 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK
,FALSE
},
1645 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1647 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1648 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1651 /* IPv4 address is converted into 2 h16 components. */
1652 { "http://[ffff::192.222.111.32]", 0, S_OK
, FALSE
,
1654 {"http://[ffff::c0de:6f20]/",S_OK
,FALSE
},
1655 {"[ffff::c0de:6f20]",S_OK
,FALSE
},
1656 {"http://[ffff::c0de:6f20]/",S_OK
,FALSE
},
1660 {"ffff::c0de:6f20",S_OK
,FALSE
},
1665 {"http://[ffff::192.222.111.32]",S_OK
,FALSE
},
1666 {"http",S_OK
,FALSE
},
1671 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1673 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1674 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1677 /* Max value for a port. */
1678 { "http://google.com:65535", 0, S_OK
, FALSE
,
1680 {"http://google.com:65535/",S_OK
,FALSE
},
1681 {"google.com:65535",S_OK
,FALSE
},
1682 {"http://google.com:65535/",S_OK
,FALSE
},
1683 {"google.com",S_OK
,FALSE
},
1686 {"google.com",S_OK
,FALSE
},
1691 {"http://google.com:65535",S_OK
,FALSE
},
1692 {"http",S_OK
,FALSE
},
1697 {Uri_HOST_DNS
,S_OK
,FALSE
},
1699 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1700 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1703 { "zip://google.com:65536", 0, S_OK
, FALSE
,
1705 {"zip://google.com:65536/",S_OK
,FALSE
},
1706 {"google.com:65536",S_OK
,FALSE
},
1707 {"zip://google.com:65536/",S_OK
,FALSE
},
1708 {"google.com:65536",S_OK
,FALSE
},
1711 {"google.com:65536",S_OK
,FALSE
},
1716 {"zip://google.com:65536",S_OK
,FALSE
},
1722 {Uri_HOST_DNS
,S_OK
,FALSE
},
1724 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1725 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1728 { "zip://google.com:65536:25", 0, S_OK
, FALSE
,
1730 {"zip://google.com:65536:25/",S_OK
,FALSE
},
1731 {"google.com:65536:25",S_OK
,FALSE
},
1732 {"zip://google.com:65536:25/",S_OK
,FALSE
},
1733 {"google.com:65536:25",S_OK
,FALSE
},
1736 {"google.com:65536:25",S_OK
,FALSE
},
1741 {"zip://google.com:65536:25",S_OK
,FALSE
},
1747 {Uri_HOST_DNS
,S_OK
,FALSE
},
1749 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1750 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1753 { "zip://[::ffff]:abcd", 0, S_OK
, FALSE
,
1755 {"zip://[::ffff]:abcd/",S_OK
,FALSE
},
1756 {"[::ffff]:abcd",S_OK
,FALSE
},
1757 {"zip://[::ffff]:abcd/",S_OK
,FALSE
},
1761 {"[::ffff]:abcd",S_OK
,FALSE
},
1766 {"zip://[::ffff]:abcd",S_OK
,FALSE
},
1772 {Uri_HOST_DNS
,S_OK
,FALSE
},
1774 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1775 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1778 { "zip://127.0.0.1:abcd", 0, S_OK
, FALSE
,
1780 {"zip://127.0.0.1:abcd/",S_OK
,FALSE
},
1781 {"127.0.0.1:abcd",S_OK
,FALSE
},
1782 {"zip://127.0.0.1:abcd/",S_OK
,FALSE
},
1783 {"0.1:abcd",S_OK
,FALSE
},
1786 {"127.0.0.1:abcd",S_OK
,FALSE
},
1791 {"zip://127.0.0.1:abcd",S_OK
,FALSE
},
1797 {Uri_HOST_DNS
,S_OK
,FALSE
},
1799 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1800 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1803 /* Port is just copied over. */
1804 { "http://google.com:00035", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
1806 {"http://google.com:00035",S_OK
,FALSE
},
1807 {"google.com:00035",S_OK
,FALSE
},
1808 {"http://google.com:00035",S_OK
,FALSE
,"http://google.com:35"},
1809 {"google.com",S_OK
,FALSE
},
1812 {"google.com",S_OK
,FALSE
},
1817 {"http://google.com:00035",S_OK
,FALSE
},
1818 {"http",S_OK
,FALSE
},
1823 {Uri_HOST_DNS
,S_OK
,FALSE
},
1825 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1826 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1829 /* Default port is copied over. */
1830 { "http://google.com:80", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
1832 {"http://google.com:80",S_OK
,FALSE
},
1833 {"google.com:80",S_OK
,FALSE
},
1834 {"http://google.com:80",S_OK
,FALSE
},
1835 {"google.com",S_OK
,FALSE
},
1838 {"google.com",S_OK
,FALSE
},
1843 {"http://google.com:80",S_OK
,FALSE
},
1844 {"http",S_OK
,FALSE
},
1849 {Uri_HOST_DNS
,S_OK
,FALSE
},
1851 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1852 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1855 { "http://google.com.uk", 0, S_OK
, FALSE
,
1857 {"http://google.com.uk/",S_OK
,FALSE
},
1858 {"google.com.uk",S_OK
,FALSE
},
1859 {"http://google.com.uk/",S_OK
,FALSE
},
1860 {"google.com.uk",S_OK
,FALSE
},
1863 {"google.com.uk",S_OK
,FALSE
},
1868 {"http://google.com.uk",S_OK
,FALSE
},
1869 {"http",S_OK
,FALSE
},
1874 {Uri_HOST_DNS
,S_OK
,FALSE
},
1876 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1877 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1880 { "http://google.com.com", 0, S_OK
, FALSE
,
1882 {"http://google.com.com/",S_OK
,FALSE
},
1883 {"google.com.com",S_OK
,FALSE
},
1884 {"http://google.com.com/",S_OK
,FALSE
},
1885 {"com.com",S_OK
,FALSE
},
1888 {"google.com.com",S_OK
,FALSE
},
1893 {"http://google.com.com",S_OK
,FALSE
},
1894 {"http",S_OK
,FALSE
},
1899 {Uri_HOST_DNS
,S_OK
,FALSE
},
1901 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1902 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1905 { "http://google.uk.1", 0, S_OK
, FALSE
,
1907 {"http://google.uk.1/",S_OK
,FALSE
},
1908 {"google.uk.1",S_OK
,FALSE
},
1909 {"http://google.uk.1/",S_OK
,FALSE
},
1910 {"google.uk.1",S_OK
,FALSE
},
1913 {"google.uk.1",S_OK
,FALSE
},
1918 {"http://google.uk.1",S_OK
,FALSE
},
1919 {"http",S_OK
,FALSE
},
1924 {Uri_HOST_DNS
,S_OK
,FALSE
},
1926 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1927 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1930 /* Since foo isn't a recognized 3 character TLD it's considered the domain name. */
1931 { "http://google.foo.uk", 0, S_OK
, FALSE
,
1933 {"http://google.foo.uk/",S_OK
,FALSE
},
1934 {"google.foo.uk",S_OK
,FALSE
},
1935 {"http://google.foo.uk/",S_OK
,FALSE
},
1936 {"foo.uk",S_OK
,FALSE
},
1939 {"google.foo.uk",S_OK
,FALSE
},
1944 {"http://google.foo.uk",S_OK
,FALSE
},
1945 {"http",S_OK
,FALSE
},
1950 {Uri_HOST_DNS
,S_OK
,FALSE
},
1952 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1953 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1956 { "http://.com", 0, S_OK
, FALSE
,
1958 {"http://.com/",S_OK
,FALSE
},
1959 {".com",S_OK
,FALSE
},
1960 {"http://.com/",S_OK
,FALSE
},
1961 {".com",S_OK
,FALSE
},
1964 {".com",S_OK
,FALSE
},
1969 {"http://.com",S_OK
,FALSE
},
1970 {"http",S_OK
,FALSE
},
1975 {Uri_HOST_DNS
,S_OK
,FALSE
},
1977 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1978 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1981 { "http://.uk", 0, S_OK
, FALSE
,
1983 {"http://.uk/",S_OK
,FALSE
},
1985 {"http://.uk/",S_OK
,FALSE
},
1994 {"http://.uk",S_OK
,FALSE
},
1995 {"http",S_OK
,FALSE
},
2000 {Uri_HOST_DNS
,S_OK
,FALSE
},
2002 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2003 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2006 { "http://www.co.google.com.[]", 0, S_OK
, FALSE
,
2008 {"http://www.co.google.com.[]/",S_OK
,FALSE
},
2009 {"www.co.google.com.[]",S_OK
,FALSE
},
2010 {"http://www.co.google.com.[]/",S_OK
,FALSE
},
2011 {"google.com.[]",S_OK
,FALSE
},
2014 {"www.co.google.com.[]",S_OK
,FALSE
},
2019 {"http://www.co.google.com.[]",S_OK
,FALSE
},
2020 {"http",S_OK
,FALSE
},
2025 {Uri_HOST_DNS
,S_OK
,FALSE
},
2027 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2028 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2031 { "http://co.uk", 0, S_OK
, FALSE
,
2033 {"http://co.uk/",S_OK
,FALSE
},
2034 {"co.uk",S_OK
,FALSE
},
2035 {"http://co.uk/",S_OK
,FALSE
},
2039 {"co.uk",S_OK
,FALSE
},
2044 {"http://co.uk",S_OK
,FALSE
},
2045 {"http",S_OK
,FALSE
},
2050 {Uri_HOST_DNS
,S_OK
,FALSE
},
2052 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2053 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2056 { "http://www.co.google.us.test", 0, S_OK
, FALSE
,
2058 {"http://www.co.google.us.test/",S_OK
,FALSE
},
2059 {"www.co.google.us.test",S_OK
,FALSE
},
2060 {"http://www.co.google.us.test/",S_OK
,FALSE
},
2061 {"us.test",S_OK
,FALSE
},
2064 {"www.co.google.us.test",S_OK
,FALSE
},
2069 {"http://www.co.google.us.test",S_OK
,FALSE
},
2070 {"http",S_OK
,FALSE
},
2075 {Uri_HOST_DNS
,S_OK
,FALSE
},
2077 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2078 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2081 { "http://gov.uk", 0, S_OK
, FALSE
,
2083 {"http://gov.uk/",S_OK
,FALSE
},
2084 {"gov.uk",S_OK
,FALSE
},
2085 {"http://gov.uk/",S_OK
,FALSE
},
2089 {"gov.uk",S_OK
,FALSE
},
2094 {"http://gov.uk",S_OK
,FALSE
},
2095 {"http",S_OK
,FALSE
},
2100 {Uri_HOST_DNS
,S_OK
,FALSE
},
2102 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2103 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2106 { "zip://www.google.com\\test", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2108 {"zip://www.google.com\\test",S_OK
,FALSE
},
2109 {"www.google.com\\test",S_OK
,FALSE
},
2110 {"zip://www.google.com\\test",S_OK
,FALSE
},
2111 {"google.com\\test",S_OK
,FALSE
},
2114 {"www.google.com\\test",S_OK
,FALSE
},
2119 {"zip://www.google.com\\test",S_OK
,FALSE
},
2125 {Uri_HOST_DNS
,S_OK
,FALSE
},
2127 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2128 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2131 { "urn:excepts:bad:%XY:encoded", 0, S_OK
, FALSE
,
2133 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2135 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2141 {"excepts:bad:%XY:encoded",S_OK
,FALSE
},
2142 {"excepts:bad:%XY:encoded",S_OK
,FALSE
},
2144 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2150 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2152 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2153 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2156 /* Since the original URI doesn't contain an extra '/' before the path no % encoded values
2157 * are decoded and all '%' are encoded.
2159 { "file://C:/te%3Es%2Et/tes%t.mp3", 0, S_OK
, FALSE
,
2161 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2163 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2165 {".mp3",S_OK
,FALSE
},
2169 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2170 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2172 {"file://C:/te%3Es%2Et/tes%t.mp3",S_OK
,FALSE
},
2173 {"file",S_OK
,FALSE
},
2178 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2180 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2181 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2184 /* Since there's a '/' in front of the drive letter, any percent encoded, non-forbidden character
2185 * is decoded and only %'s in front of invalid hex digits are encoded.
2187 { "file:///C:/te%3Es%2Et/t%23es%t.mp3", 0, S_OK
, FALSE
,
2189 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2191 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2193 {".mp3",S_OK
,FALSE
},
2197 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2198 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2200 {"file:///C:/te%3Es%2Et/t%23es%t.mp3",S_OK
,FALSE
},
2201 {"file",S_OK
,FALSE
},
2206 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2208 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2209 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2212 /* Only unreserved percent encoded characters are decoded for known schemes that aren't file. */
2213 { "http://[::001.002.003.000]/%3F%23%2E%54/test", 0, S_OK
, FALSE
,
2215 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK
,FALSE
},
2216 {"[::1.2.3.0]",S_OK
,FALSE
},
2217 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK
,FALSE
},
2221 {"::1.2.3.0",S_OK
,FALSE
},
2223 {"/%3F%23.T/test",S_OK
,FALSE
},
2224 {"/%3F%23.T/test",S_OK
,FALSE
},
2226 {"http://[::001.002.003.000]/%3F%23%2E%54/test",S_OK
,FALSE
},
2227 {"http",S_OK
,FALSE
},
2232 {Uri_HOST_IPV6
,S_OK
,FALSE
},
2234 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2235 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2238 /* Forbidden characters are always encoded for file URIs. */
2239 { "file:///C:/\"test\"/test.mp3", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2241 {"file:///C:/%22test%22/test.mp3",S_OK
,FALSE
},
2243 {"file:///C:/%22test%22/test.mp3",S_OK
,FALSE
},
2245 {".mp3",S_OK
,FALSE
},
2249 {"/C:/%22test%22/test.mp3",S_OK
,FALSE
},
2250 {"/C:/%22test%22/test.mp3",S_OK
,FALSE
},
2252 {"file:///C:/\"test\"/test.mp3",S_OK
,FALSE
},
2253 {"file",S_OK
,FALSE
},
2258 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2260 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2261 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2264 /* Forbidden characters are never encoded for unknown scheme types. */
2265 { "1234://4294967295/<|>\" test<|>", 0, S_OK
, FALSE
,
2267 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2268 {"4294967295",S_OK
,FALSE
},
2269 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2273 {"4294967295",S_OK
,FALSE
},
2275 {"/<|>\" test<|>",S_OK
,FALSE
},
2276 {"/<|>\" test<|>",S_OK
,FALSE
},
2278 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2279 {"1234",S_OK
,FALSE
},
2284 {Uri_HOST_IPV4
,S_OK
,FALSE
},
2286 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2287 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2290 /* Make sure forbidden characters are percent encoded. */
2291 { "http://gov.uk/<|> test<|>", 0, S_OK
, FALSE
,
2293 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2294 {"gov.uk",S_OK
,FALSE
},
2295 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2299 {"gov.uk",S_OK
,FALSE
},
2301 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2302 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2304 {"http://gov.uk/<|> test<|>",S_OK
,FALSE
},
2305 {"http",S_OK
,FALSE
},
2310 {Uri_HOST_DNS
,S_OK
,FALSE
},
2312 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2313 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2316 { "http://gov.uk/test/../test2/././../test3/.././././", 0, S_OK
, FALSE
,
2318 {"http://gov.uk/",S_OK
,FALSE
},
2319 {"gov.uk",S_OK
,FALSE
},
2320 {"http://gov.uk/",S_OK
,FALSE
},
2324 {"gov.uk",S_OK
,FALSE
},
2329 {"http://gov.uk/test/../test2/././../test3/.././././",S_OK
,FALSE
},
2330 {"http",S_OK
,FALSE
},
2335 {Uri_HOST_DNS
,S_OK
,FALSE
},
2337 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2338 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2341 { "http://gov.uk/test/test2/../../..", 0, S_OK
, FALSE
,
2343 {"http://gov.uk/",S_OK
,FALSE
},
2344 {"gov.uk",S_OK
,FALSE
},
2345 {"http://gov.uk/",S_OK
,FALSE
},
2349 {"gov.uk",S_OK
,FALSE
},
2354 {"http://gov.uk/test/test2/../../..",S_OK
,FALSE
},
2355 {"http",S_OK
,FALSE
},
2360 {Uri_HOST_DNS
,S_OK
,FALSE
},
2362 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2363 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2366 { "http://gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2368 {"http://gov.uk/",S_OK
,FALSE
},
2369 {"gov.uk",S_OK
,FALSE
},
2370 {"http://gov.uk/",S_OK
,FALSE
},
2374 {"gov.uk",S_OK
,FALSE
},
2379 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2380 {"http",S_OK
,FALSE
},
2385 {Uri_HOST_DNS
,S_OK
,FALSE
},
2387 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2388 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2391 { "file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3", 0, S_OK
, FALSE
,
2393 {"file:///c:/foo%2520bar.mp3",S_OK
,FALSE
},
2395 {"file:///c:/foo%2520bar.mp3",S_OK
,FALSE
},
2397 {".mp3",S_OK
,FALSE
},
2401 {"/c:/foo%2520bar.mp3",S_OK
,FALSE
},
2402 {"/c:/foo%2520bar.mp3",S_OK
,FALSE
},
2404 {"file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3",S_OK
,FALSE
},
2405 {"file",S_OK
,FALSE
},
2410 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2412 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2413 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2416 /* Dot removal happens for unknown scheme types. */
2417 { "zip://gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2419 {"zip://gov.uk/",S_OK
,FALSE
},
2420 {"gov.uk",S_OK
,FALSE
},
2421 {"zip://gov.uk/",S_OK
,FALSE
},
2425 {"gov.uk",S_OK
,FALSE
},
2430 {"zip://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2436 {Uri_HOST_DNS
,S_OK
,FALSE
},
2438 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2439 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2442 /* Dot removal doesn't happen if NO_CANONICALIZE is set. */
2443 { "http://gov.uk/test/test2/../../.", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2445 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2446 {"gov.uk",S_OK
,FALSE
},
2447 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2451 {"gov.uk",S_OK
,FALSE
},
2453 {"/test/test2/../../.",S_OK
,FALSE
},
2454 {"/test/test2/../../.",S_OK
,FALSE
},
2456 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2457 {"http",S_OK
,FALSE
},
2462 {Uri_HOST_DNS
,S_OK
,FALSE
},
2464 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2465 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2468 /* Dot removal doesn't happen for wildcard scheme types. */
2469 { "*:gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2471 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2472 {"gov.uk",S_OK
,FALSE
},
2473 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2477 {"gov.uk",S_OK
,FALSE
},
2479 {"/test/test2/../../.",S_OK
,FALSE
},
2480 {"/test/test2/../../.",S_OK
,FALSE
},
2482 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2488 {Uri_HOST_DNS
,S_OK
,FALSE
},
2490 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
2491 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2494 /* Forbidden characters are encoded for opaque known scheme types. */
2495 { "mailto:\"acco<|>unt@example.com\"", 0, S_OK
, FALSE
,
2497 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2499 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2501 {".com%22",S_OK
,FALSE
},
2505 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2506 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2508 {"mailto:\"acco<|>unt@example.com\"",S_OK
,FALSE
},
2509 {"mailto",S_OK
,FALSE
},
2514 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2516 {URL_SCHEME_MAILTO
,S_OK
,FALSE
},
2517 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2520 { "news:test.tes<|>t.com", 0, S_OK
, FALSE
,
2522 {"news:test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2524 {"news:test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2526 {".com",S_OK
,FALSE
},
2530 {"test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2531 {"test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2533 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2534 {"news",S_OK
,FALSE
},
2539 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2541 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2542 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2545 /* Don't encode forbidden characters. */
2546 { "news:test.tes<|>t.com", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2548 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2550 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2552 {".com",S_OK
,FALSE
},
2556 {"test.tes<|>t.com",S_OK
,FALSE
},
2557 {"test.tes<|>t.com",S_OK
,FALSE
},
2559 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2560 {"news",S_OK
,FALSE
},
2565 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2567 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2568 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2571 /* Forbidden characters aren't encoded for unknown, opaque URIs. */
2572 { "urn:test.tes<|>t.com", 0, S_OK
, FALSE
,
2574 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2576 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2578 {".com",S_OK
,FALSE
},
2582 {"test.tes<|>t.com",S_OK
,FALSE
},
2583 {"test.tes<|>t.com",S_OK
,FALSE
},
2585 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2591 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2593 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2594 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2597 /* Percent encoded unreserved characters are decoded for known opaque URIs. */
2598 { "news:test.%74%65%73%74.com", 0, S_OK
, FALSE
,
2600 {"news:test.test.com",S_OK
,FALSE
},
2602 {"news:test.test.com",S_OK
,FALSE
},
2604 {".com",S_OK
,FALSE
},
2608 {"test.test.com",S_OK
,FALSE
},
2609 {"test.test.com",S_OK
,FALSE
},
2611 {"news:test.%74%65%73%74.com",S_OK
,FALSE
},
2612 {"news",S_OK
,FALSE
},
2617 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2619 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2620 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2623 /* Percent encoded characters are still decoded for known scheme types. */
2624 { "news:test.%74%65%73%74.com", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2626 {"news:test.test.com",S_OK
,FALSE
},
2628 {"news:test.test.com",S_OK
,FALSE
},
2630 {".com",S_OK
,FALSE
},
2634 {"test.test.com",S_OK
,FALSE
},
2635 {"test.test.com",S_OK
,FALSE
},
2637 {"news:test.%74%65%73%74.com",S_OK
,FALSE
},
2638 {"news",S_OK
,FALSE
},
2643 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2645 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2646 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2649 /* Percent encoded characters aren't decoded for unknown scheme types. */
2650 { "urn:test.%74%65%73%74.com", 0, S_OK
, FALSE
,
2652 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2654 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2656 {".com",S_OK
,FALSE
},
2660 {"test.%74%65%73%74.com",S_OK
,FALSE
},
2661 {"test.%74%65%73%74.com",S_OK
,FALSE
},
2663 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2669 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2671 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2672 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2675 /* Unknown scheme types can have invalid % encoded data in query string. */
2676 { "zip://www.winehq.org/tests/..?query=%xx&return=y", 0, S_OK
, FALSE
,
2678 {"zip://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2679 {"www.winehq.org",S_OK
,FALSE
},
2680 {"zip://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2681 {"winehq.org",S_OK
,FALSE
},
2684 {"www.winehq.org",S_OK
,FALSE
},
2687 {"/?query=%xx&return=y",S_OK
,FALSE
},
2688 {"?query=%xx&return=y",S_OK
,FALSE
},
2689 {"zip://www.winehq.org/tests/..?query=%xx&return=y",S_OK
,FALSE
},
2695 {Uri_HOST_DNS
,S_OK
,FALSE
},
2697 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2698 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2701 /* Known scheme types can have invalid % encoded data with the right flags. */
2702 { "http://www.winehq.org/tests/..?query=%xx&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
2704 {"http://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2705 {"www.winehq.org",S_OK
,FALSE
},
2706 {"http://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2707 {"winehq.org",S_OK
,FALSE
},
2710 {"www.winehq.org",S_OK
,FALSE
},
2713 {"/?query=%xx&return=y",S_OK
,FALSE
},
2714 {"?query=%xx&return=y",S_OK
,FALSE
},
2715 {"http://www.winehq.org/tests/..?query=%xx&return=y",S_OK
,FALSE
},
2716 {"http",S_OK
,FALSE
},
2721 {Uri_HOST_DNS
,S_OK
,FALSE
},
2723 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2724 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2727 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2728 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
2730 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2731 {"www.winehq.org",S_OK
,FALSE
},
2732 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2733 {"winehq.org",S_OK
,FALSE
},
2736 {"www.winehq.org",S_OK
,FALSE
},
2739 {"/?query=<|>&return=y",S_OK
,FALSE
},
2740 {"?query=<|>&return=y",S_OK
,FALSE
},
2741 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2742 {"http",S_OK
,FALSE
},
2747 {Uri_HOST_DNS
,S_OK
,FALSE
},
2749 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2750 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2753 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2754 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2756 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2757 {"www.winehq.org",S_OK
,FALSE
},
2758 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2759 {"winehq.org",S_OK
,FALSE
},
2762 {"www.winehq.org",S_OK
,FALSE
},
2765 {"/?query=<|>&return=y",S_OK
,FALSE
},
2766 {"?query=<|>&return=y",S_OK
,FALSE
},
2767 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2768 {"http",S_OK
,FALSE
},
2773 {Uri_HOST_DNS
,S_OK
,FALSE
},
2775 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2776 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2779 /* Forbidden characters are encoded for known scheme types. */
2780 { "http://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK
, FALSE
,
2782 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2783 {"www.winehq.org",S_OK
,FALSE
},
2784 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2785 {"winehq.org",S_OK
,FALSE
},
2788 {"www.winehq.org",S_OK
,FALSE
},
2791 {"/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2792 {"?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2793 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2794 {"http",S_OK
,FALSE
},
2799 {Uri_HOST_DNS
,S_OK
,FALSE
},
2801 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2802 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2805 /* Forbidden characters are not encoded for unknown scheme types. */
2806 { "zip://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK
, FALSE
,
2808 {"zip://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2809 {"www.winehq.org",S_OK
,FALSE
},
2810 {"zip://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2811 {"winehq.org",S_OK
,FALSE
},
2814 {"www.winehq.org",S_OK
,FALSE
},
2817 {"/?query=<|>&return=y",S_OK
,FALSE
},
2818 {"?query=<|>&return=y",S_OK
,FALSE
},
2819 {"zip://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2825 {Uri_HOST_DNS
,S_OK
,FALSE
},
2827 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2828 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2831 /* Percent encoded, unreserved characters are decoded for known scheme types. */
2832 { "http://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK
, FALSE
,
2834 {"http://www.winehq.org/?query=01&return=y",S_OK
,FALSE
},
2835 {"www.winehq.org",S_OK
,FALSE
},
2836 {"http://www.winehq.org/?query=01&return=y",S_OK
,FALSE
},
2837 {"winehq.org",S_OK
,FALSE
},
2840 {"www.winehq.org",S_OK
,FALSE
},
2843 {"/?query=01&return=y",S_OK
,FALSE
},
2844 {"?query=01&return=y",S_OK
,FALSE
},
2845 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
2846 {"http",S_OK
,FALSE
},
2851 {Uri_HOST_DNS
,S_OK
,FALSE
},
2853 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2854 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2857 /* Percent encoded, unreserved characters aren't decoded for unknown scheme types. */
2858 { "zip://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK
, FALSE
,
2860 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
2861 {"www.winehq.org",S_OK
,FALSE
},
2862 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
2863 {"winehq.org",S_OK
,FALSE
},
2866 {"www.winehq.org",S_OK
,FALSE
},
2869 {"/?query=%30%31&return=y",S_OK
,FALSE
},
2870 {"?query=%30%31&return=y",S_OK
,FALSE
},
2871 {"zip://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
2877 {Uri_HOST_DNS
,S_OK
,FALSE
},
2879 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2880 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2883 /* Percent encoded characters aren't decoded when NO_DECODE_EXTRA_INFO is set. */
2884 { "http://www.winehq.org/tests/..?query=%30%31&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
2886 {"http://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
2887 {"www.winehq.org",S_OK
,FALSE
},
2888 {"http://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
2889 {"winehq.org",S_OK
,FALSE
},
2892 {"www.winehq.org",S_OK
,FALSE
},
2895 {"/?query=%30%31&return=y",S_OK
,FALSE
},
2896 {"?query=%30%31&return=y",S_OK
,FALSE
},
2897 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
2898 {"http",S_OK
,FALSE
},
2903 {Uri_HOST_DNS
,S_OK
,FALSE
},
2905 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2906 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2909 { "http://www.winehq.org?query=12&return=y", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2911 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
2912 {"www.winehq.org",S_OK
,FALSE
},
2913 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
2914 {"winehq.org",S_OK
,FALSE
},
2917 {"www.winehq.org",S_OK
,FALSE
},
2920 {"?query=12&return=y",S_OK
,FALSE
},
2921 {"?query=12&return=y",S_OK
,FALSE
},
2922 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
2923 {"http",S_OK
,FALSE
},
2928 {Uri_HOST_DNS
,S_OK
,FALSE
},
2930 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2931 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2934 /* Unknown scheme types can have invalid % encoded data in fragments. */
2935 { "zip://www.winehq.org/tests/#Te%xx", 0, S_OK
, FALSE
,
2937 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
2938 {"www.winehq.org",S_OK
,FALSE
},
2939 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
2940 {"winehq.org",S_OK
,FALSE
},
2942 {"#Te%xx",S_OK
,FALSE
},
2943 {"www.winehq.org",S_OK
,FALSE
},
2945 {"/tests/",S_OK
,FALSE
},
2946 {"/tests/",S_OK
,FALSE
},
2948 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
2954 {Uri_HOST_DNS
,S_OK
,FALSE
},
2956 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2957 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2960 /* Forbidden characters in fragment aren't encoded for unknown schemes. */
2961 { "zip://www.winehq.org/tests/#Te<|>", 0, S_OK
, FALSE
,
2963 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
2964 {"www.winehq.org",S_OK
,FALSE
},
2965 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
2966 {"winehq.org",S_OK
,FALSE
},
2968 {"#Te<|>",S_OK
,FALSE
},
2969 {"www.winehq.org",S_OK
,FALSE
},
2971 {"/tests/",S_OK
,FALSE
},
2972 {"/tests/",S_OK
,FALSE
},
2974 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
2980 {Uri_HOST_DNS
,S_OK
,FALSE
},
2982 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2983 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2986 /* Forbidden characters in the fragment are percent encoded for known schemes. */
2987 { "http://www.winehq.org/tests/#Te<|>", 0, S_OK
, FALSE
,
2989 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK
,FALSE
},
2990 {"www.winehq.org",S_OK
,FALSE
},
2991 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK
,FALSE
},
2992 {"winehq.org",S_OK
,FALSE
},
2994 {"#Te%3C%7C%3E",S_OK
,FALSE
},
2995 {"www.winehq.org",S_OK
,FALSE
},
2997 {"/tests/",S_OK
,FALSE
},
2998 {"/tests/",S_OK
,FALSE
},
3000 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3001 {"http",S_OK
,FALSE
},
3006 {Uri_HOST_DNS
,S_OK
,FALSE
},
3008 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3009 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3012 /* Forbidden characters aren't encoded in the fragment with this flag. */
3013 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
3015 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3016 {"www.winehq.org",S_OK
,FALSE
},
3017 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3018 {"winehq.org",S_OK
,FALSE
},
3020 {"#Te<|>",S_OK
,FALSE
},
3021 {"www.winehq.org",S_OK
,FALSE
},
3023 {"/tests/",S_OK
,FALSE
},
3024 {"/tests/",S_OK
,FALSE
},
3026 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3027 {"http",S_OK
,FALSE
},
3032 {Uri_HOST_DNS
,S_OK
,FALSE
},
3034 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3035 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3038 /* Forbidden characters aren't encoded in the fragment with this flag. */
3039 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
3041 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3042 {"www.winehq.org",S_OK
,FALSE
},
3043 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3044 {"winehq.org",S_OK
,FALSE
},
3046 {"#Te<|>",S_OK
,FALSE
},
3047 {"www.winehq.org",S_OK
,FALSE
},
3049 {"/tests/",S_OK
,FALSE
},
3050 {"/tests/",S_OK
,FALSE
},
3052 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3053 {"http",S_OK
,FALSE
},
3058 {Uri_HOST_DNS
,S_OK
,FALSE
},
3060 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3061 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3064 /* Percent encoded, unreserved characters aren't decoded for known scheme types. */
3065 { "zip://www.winehq.org/tests/#Te%30%31%32", 0, S_OK
, FALSE
,
3067 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3068 {"www.winehq.org",S_OK
,FALSE
},
3069 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3070 {"winehq.org",S_OK
,FALSE
},
3072 {"#Te%30%31%32",S_OK
,FALSE
},
3073 {"www.winehq.org",S_OK
,FALSE
},
3075 {"/tests/",S_OK
,FALSE
},
3076 {"/tests/",S_OK
,FALSE
},
3078 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3084 {Uri_HOST_DNS
,S_OK
,FALSE
},
3086 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3087 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3090 /* Percent encoded, unreserved characters are decoded for known schemes. */
3091 { "http://www.winehq.org/tests/#Te%30%31%32", 0, S_OK
, FALSE
,
3093 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3094 {"www.winehq.org",S_OK
,FALSE
},
3095 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3096 {"winehq.org",S_OK
,FALSE
},
3098 {"#Te012",S_OK
,FALSE
},
3099 {"www.winehq.org",S_OK
,FALSE
},
3101 {"/tests/",S_OK
,FALSE
},
3102 {"/tests/",S_OK
,FALSE
},
3104 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3105 {"http",S_OK
,FALSE
},
3110 {Uri_HOST_DNS
,S_OK
,FALSE
},
3112 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3113 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3116 /* Percent encoded, unreserved characters are decoded even if NO_CANONICALIZE is set. */
3117 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
3119 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3120 {"www.winehq.org",S_OK
,FALSE
},
3121 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3122 {"winehq.org",S_OK
,FALSE
},
3124 {"#Te012",S_OK
,FALSE
},
3125 {"www.winehq.org",S_OK
,FALSE
},
3127 {"/tests/",S_OK
,FALSE
},
3128 {"/tests/",S_OK
,FALSE
},
3130 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3131 {"http",S_OK
,FALSE
},
3136 {Uri_HOST_DNS
,S_OK
,FALSE
},
3138 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3139 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3142 /* Percent encoded, unreserved characters aren't decoded when NO_DECODE_EXTRA is set. */
3143 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
3145 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3146 {"www.winehq.org",S_OK
,FALSE
},
3147 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3148 {"winehq.org",S_OK
,FALSE
},
3150 {"#Te%30%31%32",S_OK
,FALSE
},
3151 {"www.winehq.org",S_OK
,FALSE
},
3153 {"/tests/",S_OK
,FALSE
},
3154 {"/tests/",S_OK
,FALSE
},
3156 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3157 {"http",S_OK
,FALSE
},
3162 {Uri_HOST_DNS
,S_OK
,FALSE
},
3164 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3165 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3168 /* Leading/Trailing whitespace is removed. */
3169 { " http://google.com/ ", 0, S_OK
, FALSE
,
3171 {"http://google.com/",S_OK
,FALSE
},
3172 {"google.com",S_OK
,FALSE
},
3173 {"http://google.com/",S_OK
,FALSE
},
3174 {"google.com",S_OK
,FALSE
},
3177 {"google.com",S_OK
,FALSE
},
3182 {"http://google.com/",S_OK
,FALSE
},
3183 {"http",S_OK
,FALSE
},
3188 {Uri_HOST_DNS
,S_OK
,FALSE
},
3190 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3191 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3194 { "\t\t\r\nhttp\n://g\noogle.co\rm/\n\n\n", 0, S_OK
, FALSE
,
3196 {"http://google.com/",S_OK
,FALSE
},
3197 {"google.com",S_OK
,FALSE
},
3198 {"http://google.com/",S_OK
,FALSE
},
3199 {"google.com",S_OK
,FALSE
},
3202 {"google.com",S_OK
,FALSE
},
3207 {"http://google.com/",S_OK
,FALSE
},
3208 {"http",S_OK
,FALSE
},
3213 {Uri_HOST_DNS
,S_OK
,FALSE
},
3215 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3216 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3219 { "http://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
3221 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK
,FALSE
},
3222 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3223 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK
,FALSE
},
3224 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3227 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3229 {"/%0A%0A%0A",S_OK
,FALSE
},
3230 {"/%0A%0A%0A",S_OK
,FALSE
},
3232 {"http://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3233 {"http",S_OK
,FALSE
},
3238 {Uri_HOST_DNS
,S_OK
,FALSE
},
3240 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3241 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3244 { "zip://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
3246 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3247 {"g\noogle.co\rm",S_OK
,FALSE
},
3248 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3249 {"g\noogle.co\rm",S_OK
,FALSE
},
3252 {"g\noogle.co\rm",S_OK
,FALSE
},
3254 {"/\n\n\n",S_OK
,FALSE
},
3255 {"/\n\n\n",S_OK
,FALSE
},
3257 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3263 {Uri_HOST_DNS
,S_OK
,FALSE
},
3265 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3266 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3269 /* Since file URLs are usually hierarchical, it returns an empty string
3270 * for the absolute URI property since it was declared as an opaque URI.
3272 { "file:index.html", 0, S_OK
, FALSE
,
3276 {"file:index.html",S_OK
,FALSE
},
3278 {".html",S_OK
,FALSE
},
3282 {"index.html",S_OK
,FALSE
},
3283 {"index.html",S_OK
,FALSE
},
3285 {"file:index.html",S_OK
,FALSE
},
3286 {"file",S_OK
,FALSE
},
3291 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3293 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3294 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3297 /* Doesn't have an absolute since it's opaque, but gets it port set. */
3298 { "http:test.com/index.html", 0, S_OK
, FALSE
,
3302 {"http:test.com/index.html",S_OK
,FALSE
},
3304 {".html",S_OK
,FALSE
},
3308 {"test.com/index.html",S_OK
,FALSE
},
3309 {"test.com/index.html",S_OK
,FALSE
},
3311 {"http:test.com/index.html",S_OK
,FALSE
},
3312 {"http",S_OK
,FALSE
},
3317 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3319 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3320 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3323 { "ftp:test.com/index.html", 0, S_OK
, FALSE
,
3327 {"ftp:test.com/index.html",S_OK
,FALSE
},
3329 {".html",S_OK
,FALSE
},
3333 {"test.com/index.html",S_OK
,FALSE
},
3334 {"test.com/index.html",S_OK
,FALSE
},
3336 {"ftp:test.com/index.html",S_OK
,FALSE
},
3342 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3344 {URL_SCHEME_FTP
,S_OK
,FALSE
},
3345 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3348 { "file://C|/test.mp3", 0, S_OK
, FALSE
,
3350 {"file:///C:/test.mp3",S_OK
,FALSE
},
3352 {"file:///C:/test.mp3",S_OK
,FALSE
},
3354 {".mp3",S_OK
,FALSE
},
3358 {"/C:/test.mp3",S_OK
,FALSE
},
3359 {"/C:/test.mp3",S_OK
,FALSE
},
3361 {"file://C|/test.mp3",S_OK
,FALSE
},
3362 {"file",S_OK
,FALSE
},
3367 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3369 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3370 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3373 { "file:///C|/test.mp3", 0, S_OK
, FALSE
,
3375 {"file:///C:/test.mp3",S_OK
,FALSE
},
3377 {"file:///C:/test.mp3",S_OK
,FALSE
},
3379 {".mp3",S_OK
,FALSE
},
3383 {"/C:/test.mp3",S_OK
,FALSE
},
3384 {"/C:/test.mp3",S_OK
,FALSE
},
3386 {"file:///C|/test.mp3",S_OK
,FALSE
},
3387 {"file",S_OK
,FALSE
},
3392 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3394 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3395 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3398 /* Extra '/' isn't added before "c:" since USE_DOS_PATH is set and '/' are converted
3401 { "file://c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3403 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3405 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3407 {".html",S_OK
,FALSE
},
3411 {"c:\\dir\\index.html",S_OK
,FALSE
},
3412 {"c:\\dir\\index.html",S_OK
,FALSE
},
3414 {"file://c:/dir/index.html",S_OK
,FALSE
},
3415 {"file",S_OK
,FALSE
},
3420 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3422 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3423 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3426 /* Extra '/' after "file://" is removed. */
3427 { "file:///c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3429 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3431 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3433 {".html",S_OK
,FALSE
},
3437 {"c:\\dir\\index.html",S_OK
,FALSE
},
3438 {"c:\\dir\\index.html",S_OK
,FALSE
},
3440 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3441 {"file",S_OK
,FALSE
},
3446 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3448 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3449 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3452 /* Allow more characters when Uri_CREATE_FILE_USE_DOS_PATH is specified */
3453 { "file:///c:/dir\\%%61%20%5Fname/file%2A.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3455 {"file://c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3457 {"file://c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3459 {".html",S_OK
,FALSE
},
3463 {"c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3464 {"c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3466 {"file:///c:/dir\\%%61%20%5Fname/file%2A.html",S_OK
,FALSE
},
3467 {"file",S_OK
,FALSE
},
3472 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3474 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3475 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3478 { "file://c|/dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3480 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3482 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3484 {".html",S_OK
,FALSE
},
3488 {"c:\\dir\\index.html",S_OK
,FALSE
},
3489 {"c:\\dir\\index.html",S_OK
,FALSE
},
3491 {"file://c|/dir\\index.html",S_OK
,FALSE
},
3492 {"file",S_OK
,FALSE
},
3497 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3499 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3500 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3503 /* The backslashes after the scheme name are converted to forward slashes. */
3504 { "file:\\\\c:\\dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3506 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3508 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3510 {".html",S_OK
,FALSE
},
3514 {"c:\\dir\\index.html",S_OK
,FALSE
},
3515 {"c:\\dir\\index.html",S_OK
,FALSE
},
3517 {"file:\\\\c:\\dir\\index.html",S_OK
,FALSE
},
3518 {"file",S_OK
,FALSE
},
3523 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3525 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3526 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3529 { "file:\\\\c:/dir/index.html", 0, S_OK
, FALSE
,
3531 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3533 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3535 {".html",S_OK
,FALSE
},
3539 {"/c:/dir/index.html",S_OK
,FALSE
},
3540 {"/c:/dir/index.html",S_OK
,FALSE
},
3542 {"file:\\\\c:/dir/index.html",S_OK
,FALSE
},
3543 {"file",S_OK
,FALSE
},
3548 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3550 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3551 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3554 { "http:\\\\google.com", 0, S_OK
, FALSE
,
3556 {"http://google.com/",S_OK
,FALSE
},
3557 {"google.com",S_OK
,FALSE
},
3558 {"http://google.com/",S_OK
,FALSE
},
3559 {"google.com",S_OK
,FALSE
},
3562 {"google.com",S_OK
,FALSE
},
3567 {"http:\\\\google.com",S_OK
,FALSE
},
3568 {"http",S_OK
,FALSE
},
3573 {Uri_HOST_DNS
,S_OK
,FALSE
},
3575 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3576 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3579 /* the "\\\\" aren't converted to "//" for unknown scheme types and it's considered opaque. */
3580 { "zip:\\\\google.com", 0, S_OK
, FALSE
,
3582 {"zip:\\\\google.com",S_OK
,FALSE
},
3584 {"zip:\\\\google.com",S_OK
,FALSE
},
3586 {".com",S_OK
,FALSE
},
3590 {"\\\\google.com",S_OK
,FALSE
},
3591 {"\\\\google.com",S_OK
,FALSE
},
3593 {"zip:\\\\google.com",S_OK
,FALSE
},
3599 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3601 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3602 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3605 /* Dot segments aren't removed. */
3606 { "file://c:\\dir\\../..\\./index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3608 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3610 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3612 {".html",S_OK
,FALSE
},
3616 {"c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3617 {"c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3619 {"file://c:\\dir\\../..\\./index.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 /* Forbidden characters aren't percent encoded. */
3632 { "file://c:\\dir\\i^|ndex.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3634 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3636 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3638 {".html",S_OK
,FALSE
},
3642 {"c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3643 {"c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3645 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3646 {"file",S_OK
,FALSE
},
3651 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3653 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3654 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3657 /* The '\' are still converted to '/' even though it's an opaque file URI. */
3658 { "file:c:\\dir\\../..\\index.html", 0, S_OK
, FALSE
,
3662 {"file:c:/dir/../../index.html",S_OK
,FALSE
},
3664 {".html",S_OK
,FALSE
},
3668 {"c:/dir/../../index.html",S_OK
,FALSE
},
3669 {"c:/dir/../../index.html",S_OK
,FALSE
},
3671 {"file:c:\\dir\\../..\\index.html",S_OK
,FALSE
},
3672 {"file",S_OK
,FALSE
},
3677 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3679 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3680 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3683 /* '/' are still converted to '\' even though it's an opaque URI. */
3684 { "file:c:/dir\\../..\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3688 {"file:c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3690 {".html",S_OK
,FALSE
},
3694 {"c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3695 {"c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3697 {"file:c:/dir\\../..\\index.html",S_OK
,FALSE
},
3698 {"file",S_OK
,FALSE
},
3703 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3705 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3706 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3709 /* Forbidden characters aren't percent encoded. */
3710 { "file:c:\\in^|dex.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3714 {"file:c:\\in^|dex.html",S_OK
,FALSE
},
3716 {".html",S_OK
,FALSE
},
3720 {"c:\\in^|dex.html",S_OK
,FALSE
},
3721 {"c:\\in^|dex.html",S_OK
,FALSE
},
3723 {"file:c:\\in^|dex.html",S_OK
,FALSE
},
3724 {"file",S_OK
,FALSE
},
3729 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3731 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3732 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3735 /* Doesn't have a UserName since the ':' appears at the beginning of the
3738 { "http://:password@gov.uk", 0, S_OK
, FALSE
,
3740 {"http://:password@gov.uk/",S_OK
,FALSE
},
3741 {":password@gov.uk",S_OK
,FALSE
},
3742 {"http://gov.uk/",S_OK
,FALSE
},
3746 {"gov.uk",S_OK
,FALSE
},
3747 {"password",S_OK
,FALSE
},
3751 {"http://:password@gov.uk",S_OK
,FALSE
},
3752 {"http",S_OK
,FALSE
},
3753 {":password",S_OK
,FALSE
},
3757 {Uri_HOST_DNS
,S_OK
,FALSE
},
3759 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3760 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3763 /* Has a UserName since the userinfo section doesn't contain a password. */
3764 { "http://@gov.uk", 0, S_OK
, FALSE
,
3766 {"http://gov.uk/",S_OK
,FALSE
,"http://@gov.uk/"},
3767 {"@gov.uk",S_OK
,FALSE
},
3768 {"http://gov.uk/",S_OK
,FALSE
},
3772 {"gov.uk",S_OK
,FALSE
},
3777 {"http://@gov.uk",S_OK
,FALSE
},
3778 {"http",S_OK
,FALSE
},
3783 {Uri_HOST_DNS
,S_OK
,FALSE
},
3785 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3786 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3789 /* ":@" not included in the absolute URI. */
3790 { "http://:@gov.uk", 0, S_OK
, FALSE
,
3792 {"http://gov.uk/",S_OK
,FALSE
,"http://:@gov.uk/"},
3793 {":@gov.uk",S_OK
,FALSE
},
3794 {"http://gov.uk/",S_OK
,FALSE
},
3798 {"gov.uk",S_OK
,FALSE
},
3803 {"http://:@gov.uk",S_OK
,FALSE
},
3804 {"http",S_OK
,FALSE
},
3809 {Uri_HOST_DNS
,S_OK
,FALSE
},
3811 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3812 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3815 /* '@' is included because it's an unknown scheme type. */
3816 { "zip://@gov.uk", 0, S_OK
, FALSE
,
3818 {"zip://@gov.uk/",S_OK
,FALSE
},
3819 {"@gov.uk",S_OK
,FALSE
},
3820 {"zip://@gov.uk/",S_OK
,FALSE
},
3824 {"gov.uk",S_OK
,FALSE
},
3829 {"zip://@gov.uk",S_OK
,FALSE
},
3835 {Uri_HOST_DNS
,S_OK
,FALSE
},
3837 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3838 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3841 /* ":@" are included because it's an unknown scheme type. */
3842 { "zip://:@gov.uk", 0, S_OK
, FALSE
,
3844 {"zip://:@gov.uk/",S_OK
,FALSE
},
3845 {":@gov.uk",S_OK
,FALSE
},
3846 {"zip://:@gov.uk/",S_OK
,FALSE
},
3850 {"gov.uk",S_OK
,FALSE
},
3855 {"zip://:@gov.uk",S_OK
,FALSE
},
3861 {Uri_HOST_DNS
,S_OK
,FALSE
},
3863 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3864 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3867 { "about:blank", 0, S_OK
, FALSE
,
3869 {"about:blank",S_OK
,FALSE
},
3871 {"about:blank",S_OK
,FALSE
},
3877 {"blank",S_OK
,FALSE
},
3878 {"blank",S_OK
,FALSE
},
3880 {"about:blank",S_OK
,FALSE
},
3881 {"about",S_OK
,FALSE
},
3886 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3888 {URL_SCHEME_ABOUT
,S_OK
,FALSE
},
3889 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3892 { "mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",0,S_OK
,FALSE
,
3894 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
3896 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
3898 {".htm",S_OK
,FALSE
},
3902 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
3903 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
3905 {"mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
3911 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3913 {URL_SCHEME_MK
,S_OK
,FALSE
},
3914 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3917 { "mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",0,S_OK
,FALSE
,
3919 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
3921 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
3923 {".htm",S_OK
,FALSE
},
3927 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
3928 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
3930 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
3936 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3938 {URL_SCHEME_MK
,S_OK
,FALSE
},
3939 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3942 /* Two '\' are added to the URI when USE_DOS_PATH is set, and it's a UNC path. */
3943 { "file://server/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3945 {"file://\\\\server\\dir\\index.html",S_OK
,FALSE
},
3946 {"server",S_OK
,FALSE
},
3947 {"file://\\\\server\\dir\\index.html",S_OK
,FALSE
},
3949 {".html",S_OK
,FALSE
},
3951 {"server",S_OK
,FALSE
},
3953 {"\\dir\\index.html",S_OK
,FALSE
},
3954 {"\\dir\\index.html",S_OK
,FALSE
},
3956 {"file://server/dir/index.html",S_OK
,FALSE
},
3957 {"file",S_OK
,FALSE
},
3962 {Uri_HOST_DNS
,S_OK
,FALSE
},
3964 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3965 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3968 /* When CreateUri generates an IUri, it still displays the default port in the
3971 { "http://google.com:80/", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
3973 {"http://google.com:80/",S_OK
,FALSE
},
3974 {"google.com:80",S_OK
,FALSE
},
3975 {"http://google.com:80/",S_OK
,FALSE
},
3976 {"google.com",S_OK
,FALSE
},
3979 {"google.com",S_OK
,FALSE
},
3984 {"http://google.com:80/",S_OK
,FALSE
},
3985 {"http",S_OK
,FALSE
},
3990 {Uri_HOST_DNS
,S_OK
,FALSE
},
3992 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3993 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3996 /* For res URIs the host is everything up until the first '/'. */
3997 { "res://C:\\dir\\file.exe/DATA/test.html", 0, S_OK
, FALSE
,
3999 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK
,FALSE
},
4000 {"C:\\dir\\file.exe",S_OK
,FALSE
},
4001 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK
,FALSE
},
4003 {".html",S_OK
,FALSE
},
4005 {"C:\\dir\\file.exe",S_OK
,FALSE
},
4007 {"/DATA/test.html",S_OK
,FALSE
},
4008 {"/DATA/test.html",S_OK
,FALSE
},
4010 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK
,FALSE
},
4016 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4018 {URL_SCHEME_RES
,S_OK
,FALSE
},
4019 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4022 /* Res URI can contain a '|' in the host name. */
4023 { "res://c:\\di|r\\file.exe/test", 0, S_OK
, FALSE
,
4025 {"res://c:\\di|r\\file.exe/test",S_OK
,FALSE
},
4026 {"c:\\di|r\\file.exe",S_OK
,FALSE
},
4027 {"res://c:\\di|r\\file.exe/test",S_OK
,FALSE
},
4031 {"c:\\di|r\\file.exe",S_OK
,FALSE
},
4033 {"/test",S_OK
,FALSE
},
4034 {"/test",S_OK
,FALSE
},
4036 {"res://c:\\di|r\\file.exe/test",S_OK
,FALSE
},
4042 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4044 {URL_SCHEME_RES
,S_OK
,FALSE
},
4045 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
4048 /* Res URIs can have invalid percent encoded values. */
4049 { "res://c:\\dir%xx\\file.exe/test", 0, S_OK
, FALSE
,
4051 {"res://c:\\dir%xx\\file.exe/test",S_OK
,FALSE
},
4052 {"c:\\dir%xx\\file.exe",S_OK
,FALSE
},
4053 {"res://c:\\dir%xx\\file.exe/test",S_OK
,FALSE
},
4057 {"c:\\dir%xx\\file.exe",S_OK
,FALSE
},
4059 {"/test",S_OK
,FALSE
},
4060 {"/test",S_OK
,FALSE
},
4062 {"res://c:\\dir%xx\\file.exe/test",S_OK
,FALSE
},
4068 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4070 {URL_SCHEME_RES
,S_OK
,FALSE
},
4071 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4074 /* Res doesn't get forbidden characters percent encoded in its path. */
4075 { "res://c:\\test/tes<|>t", 0, S_OK
, FALSE
,
4077 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4078 {"c:\\test",S_OK
,FALSE
},
4079 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4083 {"c:\\test",S_OK
,FALSE
},
4085 {"/tes<|>t",S_OK
,FALSE
},
4086 {"/tes<|>t",S_OK
,FALSE
},
4088 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4094 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4096 {URL_SCHEME_RES
,S_OK
,FALSE
},
4097 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4100 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK
, FALSE
,
4102 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4104 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4106 {".jpg",S_OK
,FALSE
},
4110 {"@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4111 {"@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4113 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4119 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4121 {URL_SCHEME_MK
,S_OK
,FALSE
},
4122 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4125 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4127 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4129 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4131 {".jpg",S_OK
,FALSE
},
4135 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4136 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4138 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4144 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4146 {URL_SCHEME_MK
,S_OK
,FALSE
},
4147 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4150 { "xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK
, FALSE
,
4152 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4154 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4156 {".jpg",S_OK
,FALSE
},
4160 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4161 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4163 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4169 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4171 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4172 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4175 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg", 0, S_OK
, FALSE
,
4177 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4179 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4181 {".jpg",S_OK
,FALSE
},
4185 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4186 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4188 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg",S_OK
,FALSE
},
4194 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4196 {URL_SCHEME_MK
,S_OK
,FALSE
},
4197 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4200 { "mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg", 0, S_OK
, FALSE
,
4202 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4204 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4206 {".jpg",S_OK
,FALSE
},
4210 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4211 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4213 {"mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg",S_OK
,FALSE
},
4219 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4221 {URL_SCHEME_MK
,S_OK
,FALSE
},
4222 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4225 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg", 0, S_OK
, FALSE
,
4227 {"mk:images/xxx.jpg",S_OK
,FALSE
},
4229 {"mk:images/xxx.jpg",S_OK
,FALSE
},
4231 {".jpg",S_OK
,FALSE
},
4235 {"images/xxx.jpg",S_OK
,FALSE
},
4236 {"images/xxx.jpg",S_OK
,FALSE
},
4238 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg",S_OK
,FALSE
},
4244 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4246 {URL_SCHEME_MK
,S_OK
,FALSE
},
4247 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4250 { "", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4269 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4271 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4272 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4275 { " \t ", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4294 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4296 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4297 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4300 { "javascript:void", 0, S_OK
, FALSE
,
4302 {"javascript:void",S_OK
},
4304 {"javascript:void",S_OK
},
4313 {"javascript:void",S_OK
},
4314 {"javascript",S_OK
},
4319 {Uri_HOST_UNKNOWN
,S_OK
},
4321 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4322 {URLZONE_INVALID
,E_NOTIMPL
}
4325 { "javascript://undefined", 0, S_OK
, FALSE
,
4327 {"javascript://undefined",S_OK
},
4329 {"javascript://undefined",S_OK
},
4335 {"//undefined",S_OK
},
4336 {"//undefined",S_OK
},
4338 {"javascript://undefined",S_OK
},
4339 {"javascript",S_OK
},
4344 {Uri_HOST_UNKNOWN
,S_OK
},
4346 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4347 {URLZONE_INVALID
,E_NOTIMPL
}
4350 { "JavaSCript:escape('/\\?#?')", 0, S_OK
, FALSE
,
4352 {"javascript:escape('/\\?#?')",S_OK
},
4354 {"javascript:escape('/\\?#?')",S_OK
},
4360 {"escape('/\\?#?')",S_OK
},
4361 {"escape('/\\?#?')",S_OK
},
4363 {"JavaSCript:escape('/\\?#?')",S_OK
},
4364 {"javascript",S_OK
},
4369 {Uri_HOST_UNKNOWN
,S_OK
},
4371 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4372 {URLZONE_INVALID
,E_NOTIMPL
}
4375 { "*://google.com", 0, S_OK
, FALSE
,
4377 {"*:google.com/",S_OK
,FALSE
},
4378 {"google.com",S_OK
},
4379 {"*:google.com/",S_OK
,FALSE
},
4380 {"google.com",S_OK
,FALSE
},
4383 {"google.com",S_OK
,FALSE
},
4388 {"*://google.com",S_OK
,FALSE
},
4394 {Uri_HOST_DNS
,S_OK
,FALSE
},
4396 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
4397 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4400 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",0,S_OK
,FALSE
,
4402 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4404 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4410 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4411 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4413 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4419 {Uri_HOST_UNKNOWN
,S_OK
},
4421 {URL_SCHEME_MK
,S_OK
},
4422 {URLZONE_INVALID
,E_NOTIMPL
}
4425 { "gopher://test.winehq.org:151/file.txt",0,S_OK
,FALSE
,
4427 {"gopher://test.winehq.org:151/file.txt",S_OK
},
4428 {"test.winehq.org:151",S_OK
},
4429 {"gopher://test.winehq.org:151/file.txt",S_OK
},
4430 {"winehq.org",S_OK
},
4433 {"test.winehq.org",S_OK
},
4438 {"gopher://test.winehq.org:151/file.txt",S_OK
},
4444 {Uri_HOST_DNS
,S_OK
},
4446 {URL_SCHEME_GOPHER
,S_OK
},
4447 {URLZONE_INVALID
,E_NOTIMPL
}
4450 { "//host.com/path/file.txt?query", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4452 {"//host.com/path/file.txt?query",S_OK
},
4454 {"//host.com/path/file.txt?query",S_OK
},
4460 {"/path/file.txt",S_OK
},
4461 {"/path/file.txt?query",S_OK
},
4463 {"//host.com/path/file.txt?query",S_OK
},
4469 {Uri_HOST_DNS
,S_OK
},
4471 {URL_SCHEME_UNKNOWN
,S_OK
},
4472 {URLZONE_INVALID
,E_NOTIMPL
}
4475 { "//host/path/file.txt?query", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4477 {"//host/path/file.txt?query",S_OK
},
4479 {"//host/path/file.txt?query",S_OK
},
4485 {"/path/file.txt",S_OK
},
4486 {"/path/file.txt?query",S_OK
},
4488 {"//host/path/file.txt?query",S_OK
},
4494 {Uri_HOST_DNS
,S_OK
},
4496 {URL_SCHEME_UNKNOWN
,S_OK
},
4497 {URLZONE_INVALID
,E_NOTIMPL
}
4500 { "//host", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4519 {Uri_HOST_DNS
,S_OK
},
4521 {URL_SCHEME_UNKNOWN
,S_OK
},
4522 {URLZONE_INVALID
,E_NOTIMPL
}
4525 { "mailto://", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4538 {"mailto://",S_OK
,FALSE
,"mailto:"},
4544 {Uri_HOST_UNKNOWN
,S_OK
},
4546 {URL_SCHEME_MAILTO
,S_OK
},
4547 {URLZONE_INVALID
,E_NOTIMPL
}
4550 { "mailto://a@b.com", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4552 {"mailto:a@b.com",S_OK
},
4554 {"mailto:a@b.com",S_OK
},
4563 {"mailto://a@b.com",S_OK
,FALSE
,"mailto:a@b.com"},
4569 {Uri_HOST_UNKNOWN
,S_OK
},
4571 {URL_SCHEME_MAILTO
,S_OK
},
4572 {URLZONE_INVALID
,E_NOTIMPL
}
4575 { "c:\\test file.html", Uri_CREATE_FILE_USE_DOS_PATH
|Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4577 {"file://c:\\test file.html",S_OK
,FALSE
},
4579 {"file://c:\\test file.html",S_OK
,FALSE
},
4581 {".html",S_OK
,FALSE
},
4585 {"c:\\test file.html",S_OK
,FALSE
},
4586 {"c:\\test file.html",S_OK
,FALSE
},
4588 {"c:\\test file.html",S_OK
,FALSE
},
4589 {"file",S_OK
,FALSE
},
4594 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4596 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4597 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4600 { "c:\\test%20file.html", Uri_CREATE_FILE_USE_DOS_PATH
|Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4602 {"file://c:\\test%20file.html",S_OK
,FALSE
},
4604 {"file://c:\\test%20file.html",S_OK
,FALSE
},
4606 {".html",S_OK
,FALSE
},
4610 {"c:\\test%20file.html",S_OK
,FALSE
},
4611 {"c:\\test%20file.html",S_OK
,FALSE
},
4613 {"c:\\test%20file.html",S_OK
,FALSE
},
4614 {"file",S_OK
,FALSE
},
4619 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4621 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4622 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4625 { "c:\\test file.html", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4627 {"file:///c:/test%20file.html",S_OK
,FALSE
},
4629 {"file:///c:/test%20file.html",S_OK
,FALSE
},
4631 {".html",S_OK
,FALSE
},
4635 {"/c:/test%20file.html",S_OK
,FALSE
},
4636 {"/c:/test%20file.html",S_OK
,FALSE
},
4638 {"c:\\test file.html",S_OK
,FALSE
},
4639 {"file",S_OK
,FALSE
},
4644 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4646 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4647 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4650 { "c:\\test%20file.html", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
4652 {"file:///c:/test%2520file.html",S_OK
,FALSE
},
4654 {"file:///c:/test%2520file.html",S_OK
,FALSE
},
4656 {".html",S_OK
,FALSE
},
4660 {"/c:/test%2520file.html",S_OK
,FALSE
},
4661 {"/c:/test%2520file.html",S_OK
,FALSE
},
4663 {"c:\\test%20file.html",S_OK
,FALSE
},
4664 {"file",S_OK
,FALSE
},
4669 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4671 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4672 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4677 typedef struct _invalid_uri
{
4683 static const invalid_uri invalid_uri_tests
[] = {
4684 /* Has to have a scheme name. */
4685 {"://www.winehq.org",0,FALSE
},
4686 /* Windows doesn't like URIs which are implicitly file paths without the
4687 * ALLOW_IMPLICIT_FILE_SCHEME flag set.
4689 {"C:/test/test.mp3",0,FALSE
},
4690 {"\\\\Server/test/test.mp3",0,FALSE
},
4691 {"C:/test/test.mp3",Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
,FALSE
},
4692 {"\\\\Server/test/test.mp3",Uri_CREATE_ALLOW_RELATIVE
,FALSE
},
4693 /* Invalid schemes. */
4694 {"*abcd://not.valid.com",0,FALSE
},
4695 {"*a*b*c*d://not.valid.com",0,FALSE
},
4696 /* Not allowed to have invalid % encoded data. */
4697 {"ftp://google.co%XX/",0,FALSE
},
4698 /* Too many h16 components. */
4699 {"http://[1:2:3:4:5:6:7:8:9]",0,FALSE
},
4700 /* Not enough room for IPv4 address. */
4701 {"http://[1:2:3:4:5:6:7:192.0.1.0]",0,FALSE
},
4702 /* Not enough h16 components. */
4703 {"http://[1:2:3:4]",0,FALSE
},
4704 /* Not enough components including IPv4. */
4705 {"http://[1:192.0.1.0]",0,FALSE
},
4706 /* Not allowed to have partial IPv4 in IPv6. */
4707 {"http://[::192.0]",0,FALSE
},
4708 /* Can't have elision of 1 h16 at beginning of address. */
4709 {"http://[::2:3:4:5:6:7:8]",0,FALSE
},
4710 /* Expects a valid IP Literal. */
4711 {"ftp://[not.valid.uri]/",0,FALSE
},
4712 /* Expects valid port for a known scheme type. */
4713 {"ftp://www.winehq.org:123fgh",0,FALSE
},
4714 /* Port exceeds USHORT_MAX for known scheme type. */
4715 {"ftp://www.winehq.org:65536",0,FALSE
},
4716 /* Invalid port with IPv4 address. */
4717 {"http://www.winehq.org:1abcd",0,FALSE
},
4718 /* Invalid port with IPv6 address. */
4719 {"http://[::ffff]:32xy",0,FALSE
},
4720 /* Not allowed to have backslashes with NO_CANONICALIZE. */
4721 {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE
,FALSE
},
4722 /* Not allowed to have invalid % encoded data in opaque URI path. */
4723 {"news:test%XX",0,FALSE
},
4724 {"mailto:wine@winehq%G8.com",0,FALSE
},
4725 /* Known scheme types can't have invalid % encoded data in query string. */
4726 {"http://google.com/?query=te%xx",0,FALSE
},
4727 /* Invalid % encoded data in fragment of know scheme type. */
4728 {"ftp://google.com/#Test%xx",0,FALSE
},
4729 {" http://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
4730 {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
4731 {"file://c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4732 {"file://c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4733 {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4734 {"file:c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4735 {"file:c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4736 {"file:c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4737 /* res URIs aren't allowed to have forbidden dos path characters in the
4740 {"res://c:\\te<st\\test/test",0,FALSE
},
4741 {"res://c:\\te>st\\test/test",0,FALSE
},
4742 {"res://c:\\te\"st\\test/test",0,FALSE
},
4743 {"res://c:\\test/te%xxst",0,FALSE
}
4746 typedef struct _uri_equality
{
4748 DWORD create_flags_a
;
4750 DWORD create_flags_b
;
4755 static const uri_equality equality_tests
[] = {
4757 "HTTP://www.winehq.org/test dir/./",0,
4758 "http://www.winehq.org/test dir/../test dir/",0,
4762 /* http://www.winehq.org/test%20dir */
4763 "http://%77%77%77%2E%77%69%6E%65%68%71%2E%6F%72%67/%74%65%73%74%20%64%69%72",0,
4764 "http://www.winehq.org/test dir",0,
4768 "c:\\test.mp3",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
4769 "file:///c:/test.mp3",0,
4773 "ftp://ftp.winehq.org/",0,
4774 "ftp://ftp.winehq.org",0,
4778 "ftp://ftp.winehq.org/test/test2/../../testB/",0,
4779 "ftp://ftp.winehq.org/t%45stB/",0,
4783 "http://google.com/TEST",0,
4784 "http://google.com/test",0,
4788 "http://GOOGLE.com/",0,
4789 "http://google.com/",0,
4792 /* Performs case insensitive compare of host names (for known scheme types). */
4794 "ftp://GOOGLE.com/",Uri_CREATE_NO_CANONICALIZE
,
4795 "ftp://google.com/",0,
4799 "zip://GOOGLE.com/",0,
4800 "zip://google.com/",0,
4804 "file:///c:/TEST/TeST/",0,
4805 "file:///c:/test/test/",0,
4809 "file:///server/TEST",0,
4810 "file:///SERVER/TEST",0,
4814 "http://google.com",Uri_CREATE_NO_CANONICALIZE
,
4815 "http://google.com/",0,
4819 "ftp://google.com:21/",0,
4820 "ftp://google.com/",0,
4824 "http://google.com:80/",Uri_CREATE_NO_CANONICALIZE
,
4825 "http://google.com/",0,
4829 "http://google.com:70/",0,
4830 "http://google.com:71/",0,
4834 "file:///c:/dir/file.txt", 0,
4835 "file:///c:/dir/file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
4839 "file:///c:/dir/file.txt", 0,
4840 "file:///c:\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
4844 "file:///c:/dir/file.txt", 0,
4845 "file:///c:\\dir2\\..\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
4849 "file:///c:\\dir2\\..\\ dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
4850 "file:///c:/%20dir/file.txt", 0,
4854 "file:///c:/Dir/file.txt", 0,
4855 "file:///C:/dir/file.TXT", Uri_CREATE_FILE_USE_DOS_PATH
,
4859 "file:///c:/dir/file.txt", 0,
4860 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
4864 "file:///c:/dir/file.txt#a", 0,
4865 "file:///c:\\dir\\file.txt#b", Uri_CREATE_FILE_USE_DOS_PATH
,
4868 /* Tests of an empty hash/fragment part */
4870 "http://google.com/test",0,
4871 "http://google.com/test#",0,
4875 "ftp://ftp.winehq.org/",0,
4876 "ftp://ftp.winehq.org/#",0,
4880 "file:///c:/dir/file.txt#", 0,
4881 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
4886 typedef struct _uri_with_fragment
{
4888 const char* fragment
;
4890 HRESULT create_expected
;
4893 const char* expected_uri
;
4895 } uri_with_fragment
;
4897 static const uri_with_fragment uri_fragment_tests
[] = {
4899 "http://google.com/","#fragment",0,S_OK
,FALSE
,
4900 "http://google.com/#fragment",FALSE
4903 "http://google.com/","fragment",0,S_OK
,FALSE
,
4904 "http://google.com/#fragment",FALSE
4907 "zip://test.com/","?test",0,S_OK
,FALSE
,
4908 "zip://test.com/#?test",FALSE
4910 /* The fragment can be empty. */
4912 "ftp://ftp.google.com/","",0,S_OK
,FALSE
,
4913 "ftp://ftp.google.com/#",FALSE
4917 typedef struct _uri_builder_property
{
4920 const char *expected_value
;
4921 Uri_PROPERTY property
;
4924 } uri_builder_property
;
4926 typedef struct _uri_builder_port
{
4934 typedef struct _uri_builder_str_property
{
4935 const char* expected
;
4938 } uri_builder_str_property
;
4940 typedef struct _uri_builder_dword_property
{
4944 } uri_builder_dword_property
;
4946 typedef struct _uri_builder_test
{
4949 HRESULT create_builder_expected
;
4950 BOOL create_builder_todo
;
4952 uri_builder_property properties
[URI_BUILDER_STR_PROPERTY_COUNT
];
4954 uri_builder_port port_prop
;
4960 DWORD uri_simple_encode_flags
;
4961 HRESULT uri_simple_hres
;
4962 BOOL uri_simple_todo
;
4964 DWORD uri_with_flags
;
4965 DWORD uri_with_builder_flags
;
4966 DWORD uri_with_encode_flags
;
4967 HRESULT uri_with_hres
;
4970 uri_builder_str_property expected_str_props
[URI_STR_PROPERTY_COUNT
];
4971 uri_builder_dword_property expected_dword_props
[URI_DWORD_PROPERTY_COUNT
];
4974 static const uri_builder_test uri_builder_tests
[] = {
4975 { "http://google.com/",0,S_OK
,FALSE
,
4977 {TRUE
,"#fragment",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
4978 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
},
4979 {TRUE
,"?query=x",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
4980 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
4987 {"http://username:password@google.com/?query=x#fragment",S_OK
},
4988 {"username:password@google.com",S_OK
},
4989 {"http://google.com/?query=x#fragment",S_OK
},
4990 {"google.com",S_OK
},
4993 {"google.com",S_OK
},
4998 {"http://username:password@google.com/?query=x#fragment",S_OK
},
5000 {"username:password",S_OK
},
5004 {Uri_HOST_DNS
,S_OK
},
5006 {URL_SCHEME_HTTP
,S_OK
},
5007 {URLZONE_INVALID
,E_NOTIMPL
}
5010 { "http://google.com/",0,S_OK
,FALSE
,
5012 {TRUE
,"test",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
5014 {TRUE
,TRUE
,120,S_OK
,FALSE
},
5019 {"test://google.com:120/",S_OK
},
5020 {"google.com:120",S_OK
},
5021 {"test://google.com:120/",S_OK
},
5022 {"google.com",S_OK
},
5025 {"google.com",S_OK
},
5030 {"test://google.com:120/",S_OK
},
5036 {Uri_HOST_DNS
,S_OK
},
5038 {URL_SCHEME_UNKNOWN
,S_OK
},
5039 {URLZONE_INVALID
,E_NOTIMPL
}
5042 { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5044 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
5045 {TRUE
,"::192.2.3.4",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
5046 {TRUE
,NULL
,NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
5053 {"http://[::192.2.3.4]/",S_OK
},
5054 {"[::192.2.3.4]",S_OK
},
5055 {"http://[::192.2.3.4]/",S_OK
},
5059 {"::192.2.3.4",S_OK
},
5064 {"http://[::192.2.3.4]/",S_OK
},
5070 {Uri_HOST_IPV6
,S_OK
},
5072 {URL_SCHEME_HTTP
,S_OK
},
5073 {URLZONE_INVALID
,E_NOTIMPL
}
5076 { "http://google.com/",0,S_OK
,FALSE
,
5078 {TRUE
,"Frag","#Frag",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5085 {"http://google.com/#Frag",S_OK
},
5086 {"google.com",S_OK
},
5087 {"http://google.com/#Frag",S_OK
},
5088 {"google.com",S_OK
},
5091 {"google.com",S_OK
},
5096 {"http://google.com/#Frag",S_OK
},
5102 {Uri_HOST_DNS
,S_OK
},
5104 {URL_SCHEME_HTTP
,S_OK
},
5105 {URLZONE_INVALID
,E_NOTIMPL
}
5108 { "http://google.com/",0,S_OK
,FALSE
,
5110 {TRUE
,"","#",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
5117 {"http://google.com/#",S_OK
},
5118 {"google.com",S_OK
},
5119 {"http://google.com/#",S_OK
},
5120 {"google.com",S_OK
},
5123 {"google.com",S_OK
},
5128 {"http://google.com/#",S_OK
},
5134 {Uri_HOST_DNS
,S_OK
},
5136 {URL_SCHEME_HTTP
,S_OK
},
5137 {URLZONE_INVALID
,E_NOTIMPL
}
5140 { "http://google.com/",0,S_OK
,FALSE
,
5142 {TRUE
,":password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5149 {"http://::password@google.com/",S_OK
},
5150 {"::password@google.com",S_OK
},
5151 {"http://google.com/",S_OK
},
5152 {"google.com",S_OK
},
5155 {"google.com",S_OK
},
5160 {"http://::password@google.com/",S_OK
},
5162 {"::password",S_OK
},
5166 {Uri_HOST_DNS
,S_OK
},
5168 {URL_SCHEME_HTTP
,S_OK
},
5169 {URLZONE_INVALID
,E_NOTIMPL
}
5172 { "test/test",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5174 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5177 Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5179 Uri_CREATE_ALLOW_RELATIVE
,0,0,S_OK
,FALSE
,
5181 {":password@test/test",S_OK
},
5182 {":password@",S_OK
},
5183 {":password@test/test",S_OK
},
5192 {":password@test/test",S_OK
},
5198 {Uri_HOST_UNKNOWN
,S_OK
},
5200 {URL_SCHEME_UNKNOWN
,S_OK
},
5201 {URLZONE_INVALID
,E_NOTIMPL
}
5204 { "http://google.com/",0,S_OK
,FALSE
,
5206 {TRUE
,"test/test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5213 {"http://google.com/test/test",S_OK
},
5214 {"google.com",S_OK
},
5215 {"http://google.com/test/test",S_OK
},
5216 {"google.com",S_OK
},
5219 {"google.com",S_OK
},
5221 {"/test/test",S_OK
},
5222 {"/test/test",S_OK
},
5224 {"http://google.com/test/test",S_OK
},
5230 {Uri_HOST_DNS
,S_OK
},
5232 {URL_SCHEME_HTTP
,S_OK
},
5233 {URLZONE_INVALID
,E_NOTIMPL
}
5236 { "zip:testing/test",0,S_OK
,FALSE
,
5238 {TRUE
,"test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5262 {Uri_HOST_UNKNOWN
,S_OK
},
5264 {URL_SCHEME_UNKNOWN
,S_OK
},
5265 {URLZONE_INVALID
,E_NOTIMPL
}
5268 { "http://google.com/",0,S_OK
,FALSE
,
5272 /* 555 will be returned from GetPort even though FALSE was passed as the hasPort parameter. */
5273 {TRUE
,FALSE
,555,S_OK
,FALSE
},
5278 {"http://google.com/",S_OK
},
5279 {"google.com",S_OK
},
5280 {"http://google.com/",S_OK
},
5281 {"google.com",S_OK
},
5284 {"google.com",S_OK
},
5289 {"http://google.com/",S_OK
},
5295 {Uri_HOST_DNS
,S_OK
},
5296 /* Still returns 80, even though earlier the port was disabled. */
5298 {URL_SCHEME_HTTP
,S_OK
},
5299 {URLZONE_INVALID
,E_NOTIMPL
}
5302 { "http://google.com/",0,S_OK
,FALSE
,
5306 /* Instead of getting "TRUE" back as the "hasPort" parameter in GetPort,
5307 * you'll get 122345 instead.
5309 {TRUE
,122345,222,S_OK
,FALSE
},
5314 {"http://google.com:222/",S_OK
},
5315 {"google.com:222",S_OK
},
5316 {"http://google.com:222/",S_OK
},
5317 {"google.com",S_OK
},
5320 {"google.com",S_OK
},
5325 {"http://google.com:222/",S_OK
},
5331 {Uri_HOST_DNS
,S_OK
},
5333 {URL_SCHEME_HTTP
,S_OK
},
5334 {URLZONE_INVALID
,E_NOTIMPL
}
5337 /* IUri's created with the IUriBuilder can have ports that exceed USHORT_MAX. */
5338 { "http://google.com/",0,S_OK
,FALSE
,
5342 {TRUE
,TRUE
,999999,S_OK
,FALSE
},
5347 {"http://google.com:999999/",S_OK
},
5348 {"google.com:999999",S_OK
},
5349 {"http://google.com:999999/",S_OK
},
5350 {"google.com",S_OK
},
5353 {"google.com",S_OK
},
5358 {"http://google.com:999999/",S_OK
},
5364 {Uri_HOST_DNS
,S_OK
},
5366 {URL_SCHEME_HTTP
,S_OK
},
5367 {URLZONE_INVALID
,E_NOTIMPL
}
5370 { "http://google.com/",0,S_OK
,FALSE
,
5372 {TRUE
,"test","?test",Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
5380 {"http://google.com/?test",S_OK
},
5381 {"google.com",S_OK
},
5382 {"http://google.com/?test",S_OK
},
5383 {"google.com",S_OK
},
5386 {"google.com",S_OK
},
5391 {"http://google.com/?test",S_OK
},
5397 {Uri_HOST_DNS
,S_OK
},
5399 {URL_SCHEME_HTTP
,S_OK
},
5400 {URLZONE_INVALID
,E_NOTIMPL
}
5403 { "http://:password@google.com/",0,S_OK
,FALSE
,
5412 {"http://:password@google.com/",S_OK
},
5413 {":password@google.com",S_OK
},
5414 {"http://google.com/",S_OK
},
5415 {"google.com",S_OK
},
5418 {"google.com",S_OK
},
5423 {"http://:password@google.com/",S_OK
},
5429 {Uri_HOST_DNS
,S_OK
},
5431 {URL_SCHEME_HTTP
,S_OK
},
5432 {URLZONE_INVALID
,E_NOTIMPL
}
5435 /* IUriBuilder doesn't need a base IUri to build a IUri. */
5436 { NULL
,0,S_OK
,FALSE
,
5438 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
5439 {TRUE
,"google.com",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5446 {"http://google.com/",S_OK
},
5447 {"google.com",S_OK
},
5448 {"http://google.com/",S_OK
},
5449 {"google.com",S_OK
},
5452 {"google.com",S_OK
},
5457 {"http://google.com/",S_OK
},
5463 {Uri_HOST_DNS
,S_OK
},
5465 {URL_SCHEME_HTTP
,S_OK
},
5466 {URLZONE_INVALID
,E_NOTIMPL
}
5469 /* Can't set the scheme name to NULL. */
5470 { "zip://google.com/",0,S_OK
,FALSE
,
5472 {TRUE
,NULL
,"zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5479 {"zip://google.com/",S_OK
},
5480 {"google.com",S_OK
},
5481 {"zip://google.com/",S_OK
},
5482 {"google.com",S_OK
},
5485 {"google.com",S_OK
},
5490 {"zip://google.com/",S_OK
},
5496 {Uri_HOST_DNS
,S_OK
},
5498 {URL_SCHEME_UNKNOWN
,S_OK
},
5499 {URLZONE_INVALID
,E_NOTIMPL
}
5502 /* Can't set the scheme name to an empty string. */
5503 { "zip://google.com/",0,S_OK
,FALSE
,
5505 {TRUE
,"","zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5512 {"zip://google.com/",S_OK
},
5513 {"google.com",S_OK
},
5514 {"zip://google.com/",S_OK
},
5515 {"google.com",S_OK
},
5518 {"google.com",S_OK
},
5523 {"zip://google.com/",S_OK
},
5529 {Uri_HOST_DNS
,S_OK
},
5531 {URL_SCHEME_UNKNOWN
,S_OK
},
5532 {URLZONE_INVALID
,E_NOTIMPL
}
5535 /* -1 to CreateUri makes it use the same flags as the base IUri was created with.
5536 * CreateUriSimple always uses the flags the base IUri was created with (if any).
5538 { "http://google.com/../../",Uri_CREATE_NO_CANONICALIZE
,S_OK
,FALSE
,
5543 0,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5545 {"http://google.com/../../",S_OK
},
5546 {"google.com",S_OK
},
5547 {"http://google.com/../../",S_OK
},
5548 {"google.com",S_OK
},
5551 {"google.com",S_OK
},
5556 {"http://google.com/../../",S_OK
},
5562 {Uri_HOST_DNS
,S_OK
},
5564 {URL_SCHEME_HTTP
,S_OK
},
5565 {URLZONE_INVALID
,E_NOTIMPL
}
5568 { "http://google.com/",0,S_OK
,FALSE
,
5570 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5575 Uri_CREATE_NO_DECODE_EXTRA_INFO
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5577 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5578 {"google.com",S_OK
},
5579 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5580 {"google.com",S_OK
},
5582 {"#Fr%3C%7C%3Eg",S_OK
},
5583 {"google.com",S_OK
},
5588 {"http://google.com/#Fr<|>g",S_OK
},
5594 {Uri_HOST_DNS
,S_OK
},
5596 {URL_SCHEME_HTTP
,S_OK
},
5597 {URLZONE_INVALID
,E_NOTIMPL
}
5600 { "http://google.com/",0,S_OK
,FALSE
,
5602 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5605 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,E_INVALIDARG
,FALSE
,
5607 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5609 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5610 {"google.com",S_OK
},
5611 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5612 {"google.com",S_OK
},
5614 {"#Fr%3C%7C%3Eg",S_OK
},
5615 {"google.com",S_OK
},
5620 {"http://google.com/#Fr<|>g",S_OK
},
5626 {Uri_HOST_DNS
,S_OK
},
5628 {URL_SCHEME_HTTP
,S_OK
},
5629 {URLZONE_INVALID
,E_NOTIMPL
}
5632 { NULL
,0,S_OK
,FALSE
,
5634 {TRUE
,"/test/test/",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5635 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5638 0,INET_E_INVALID_URL
,FALSE
,
5639 0,INET_E_INVALID_URL
,FALSE
,
5640 0,0,0,INET_E_INVALID_URL
,FALSE
5642 { "http://google.com/",0,S_OK
,FALSE
,
5644 {TRUE
,"ht%xxtp",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
5647 0,INET_E_INVALID_URL
,FALSE
,
5648 0,INET_E_INVALID_URL
,FALSE
,
5649 0,0,0,INET_E_INVALID_URL
,FALSE
5651 /* File scheme's can't have a username set. */
5652 { "file://google.com/",0,S_OK
,FALSE
,
5654 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5657 0,INET_E_INVALID_URL
,FALSE
,
5658 0,INET_E_INVALID_URL
,FALSE
,
5659 0,0,0,INET_E_INVALID_URL
,FALSE
5661 /* File schemes can't have a password set. */
5662 { "file://google.com/",0,S_OK
,FALSE
,
5664 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5667 0,INET_E_INVALID_URL
,FALSE
,
5668 0,INET_E_INVALID_URL
,FALSE
,
5669 0,0,0,INET_E_INVALID_URL
,FALSE
5671 /* UserName can't contain any character that is a delimeter for another
5672 * component that appears after it in a normal URI.
5674 { "http://google.com/",0,S_OK
,FALSE
,
5676 {TRUE
,"user:pass",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5679 0,INET_E_INVALID_URL
,FALSE
,
5680 0,INET_E_INVALID_URL
,FALSE
,
5681 0,0,0,INET_E_INVALID_URL
,FALSE
5683 { "http://google.com/",0,S_OK
,FALSE
,
5685 {TRUE
,"user@google.com",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5688 0,INET_E_INVALID_URL
,FALSE
,
5689 0,INET_E_INVALID_URL
,FALSE
,
5690 0,0,0,INET_E_INVALID_URL
,FALSE
5692 { "http://google.com/",0,S_OK
,FALSE
,
5694 {TRUE
,"user/path",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5697 0,INET_E_INVALID_URL
,FALSE
,
5698 0,INET_E_INVALID_URL
,FALSE
,
5699 0,0,0,INET_E_INVALID_URL
,FALSE
5701 { "http://google.com/",0,S_OK
,FALSE
,
5703 {TRUE
,"user?Query",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5706 0,INET_E_INVALID_URL
,FALSE
,
5707 0,INET_E_INVALID_URL
,FALSE
,
5708 0,0,0,INET_E_INVALID_URL
,FALSE
5710 { "http://google.com/",0,S_OK
,FALSE
,
5712 {TRUE
,"user#Frag",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5715 0,INET_E_INVALID_URL
,FALSE
,
5716 0,INET_E_INVALID_URL
,FALSE
,
5717 0,0,0,INET_E_INVALID_URL
,FALSE
5719 { "http://google.com/",0,S_OK
,FALSE
,
5721 {TRUE
,"pass@google.com",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5724 0,INET_E_INVALID_URL
,FALSE
,
5725 0,INET_E_INVALID_URL
,FALSE
,
5726 0,0,0,INET_E_INVALID_URL
,FALSE
5728 { "http://google.com/",0,S_OK
,FALSE
,
5730 {TRUE
,"pass/path",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5733 0,INET_E_INVALID_URL
,FALSE
,
5734 0,INET_E_INVALID_URL
,FALSE
,
5735 0,0,0,INET_E_INVALID_URL
,FALSE
5737 { "http://google.com/",0,S_OK
,FALSE
,
5739 {TRUE
,"pass?query",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5742 0,INET_E_INVALID_URL
,FALSE
,
5743 0,INET_E_INVALID_URL
,FALSE
,
5744 0,0,0,INET_E_INVALID_URL
,FALSE
5746 { "http://google.com/",0,S_OK
,FALSE
,
5748 {TRUE
,"pass#frag",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5751 0,INET_E_INVALID_URL
,FALSE
,
5752 0,INET_E_INVALID_URL
,FALSE
,
5753 0,0,0,INET_E_INVALID_URL
,FALSE
5755 { "http://google.com/",0,S_OK
,FALSE
,
5757 {TRUE
,"winehq.org/test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5760 0,INET_E_INVALID_URL
,FALSE
,
5761 0,INET_E_INVALID_URL
,FALSE
,
5762 0,0,0,INET_E_INVALID_URL
,FALSE
5764 { "http://google.com/",0,S_OK
,FALSE
,
5766 {TRUE
,"winehq.org?test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5769 0,INET_E_INVALID_URL
,FALSE
,
5770 0,INET_E_INVALID_URL
,FALSE
,
5771 0,0,0,INET_E_INVALID_URL
,FALSE
5773 { "http://google.com/",0,S_OK
,FALSE
,
5775 {TRUE
,"winehq.org#test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5778 0,INET_E_INVALID_URL
,FALSE
,
5779 0,INET_E_INVALID_URL
,FALSE
,
5780 0,0,0,INET_E_INVALID_URL
,FALSE
5782 /* Hostname is allowed to contain a ':' (even for known scheme types). */
5783 { "http://google.com/",0,S_OK
,FALSE
,
5785 {TRUE
,"winehq.org:test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
5792 {"http://winehq.org:test/",S_OK
},
5793 {"winehq.org:test",S_OK
},
5794 {"http://winehq.org:test/",S_OK
},
5795 {"winehq.org:test",S_OK
},
5798 {"winehq.org:test",S_OK
},
5803 {"http://winehq.org:test/",S_OK
},
5809 {Uri_HOST_DNS
,S_OK
},
5811 {URL_SCHEME_HTTP
,S_OK
},
5812 {URLZONE_INVALID
,E_NOTIMPL
}
5815 /* Can't set the host name to NULL. */
5816 { "http://google.com/",0,S_OK
,FALSE
,
5818 {TRUE
,NULL
,"google.com",Uri_PROPERTY_HOST
,E_INVALIDARG
,FALSE
}
5825 {"http://google.com/",S_OK
},
5826 {"google.com",S_OK
},
5827 {"http://google.com/",S_OK
},
5828 {"google.com",S_OK
},
5831 {"google.com",S_OK
},
5836 {"http://google.com/",S_OK
},
5842 {Uri_HOST_DNS
,S_OK
},
5844 {URL_SCHEME_HTTP
,S_OK
},
5845 {URLZONE_INVALID
,E_NOTIMPL
}
5848 /* Can set the host name to an empty string. */
5849 { "http://google.com/",0,S_OK
,FALSE
,
5851 {TRUE
,"",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5875 {Uri_HOST_UNKNOWN
,S_OK
},
5877 {URL_SCHEME_HTTP
,S_OK
},
5878 {URLZONE_INVALID
,E_NOTIMPL
}
5881 { "http://google.com/",0,S_OK
,FALSE
,
5883 {TRUE
,"/path?query",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
5886 0,INET_E_INVALID_URL
,FALSE
,
5887 0,INET_E_INVALID_URL
,FALSE
,
5888 0,0,0,INET_E_INVALID_URL
,FALSE
5890 { "http://google.com/",0,S_OK
,FALSE
,
5892 {TRUE
,"/path#test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
5895 0,INET_E_INVALID_URL
,FALSE
,
5896 0,INET_E_INVALID_URL
,FALSE
,
5897 0,0,0,INET_E_INVALID_URL
,FALSE
5899 { "http://google.com/",0,S_OK
,FALSE
,
5901 {TRUE
,"?path#test",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
}
5904 0,INET_E_INVALID_URL
,FALSE
,
5905 0,INET_E_INVALID_URL
,FALSE
,
5906 0,0,0,INET_E_INVALID_URL
,FALSE
5908 { "file:///c:/dir/file.html",0,S_OK
,FALSE
,
5910 {TRUE
,NULL
,NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
},
5917 {"file:///c:/dir/file.html",S_OK
},
5919 {"file:///c:/dir/file.html",S_OK
},
5925 {"/c:/dir/file.html",S_OK
},
5926 {"/c:/dir/file.html",S_OK
},
5928 {"file:///c:/dir/file.html",S_OK
},
5934 {Uri_HOST_UNKNOWN
,S_OK
},
5936 {URL_SCHEME_FILE
,S_OK
},
5937 {URLZONE_INVALID
,E_NOTIMPL
}
5940 { "file:///c:/dir/file.html",0,S_OK
,FALSE
,
5942 {TRUE
,"#",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
},
5949 {"file:///c:/dir/file.html#",S_OK
},
5951 {"file:///c:/dir/file.html#",S_OK
},
5957 {"/c:/dir/file.html",S_OK
},
5958 {"/c:/dir/file.html",S_OK
},
5960 {"file:///c:/dir/file.html#",S_OK
},
5966 {Uri_HOST_UNKNOWN
,S_OK
},
5968 {URL_SCHEME_FILE
,S_OK
},
5969 {URLZONE_INVALID
,E_NOTIMPL
}
5974 typedef struct _uri_builder_remove_test
{
5977 HRESULT create_builder_expected
;
5978 BOOL create_builder_todo
;
5980 DWORD remove_properties
;
5981 HRESULT remove_expected
;
5984 const char *expected_uri
;
5985 DWORD expected_flags
;
5986 HRESULT expected_hres
;
5988 } uri_builder_remove_test
;
5990 static const uri_builder_remove_test uri_builder_remove_tests
[] = {
5991 { "http://google.com/test?test=y#Frag",0,S_OK
,FALSE
,
5992 Uri_HAS_FRAGMENT
|Uri_HAS_PATH
|Uri_HAS_QUERY
,S_OK
,FALSE
,
5993 "http://google.com/",0,S_OK
,FALSE
5995 { "http://user:pass@winehq.org/",0,S_OK
,FALSE
,
5996 Uri_HAS_USER_NAME
|Uri_HAS_PASSWORD
,S_OK
,FALSE
,
5997 "http://winehq.org/",0,S_OK
,FALSE
5999 { "zip://google.com?Test=x",0,S_OK
,FALSE
,
6000 Uri_HAS_HOST
,S_OK
,FALSE
,
6001 "zip:/?Test=x",0,S_OK
,FALSE
6003 /* Doesn't remove the whole userinfo component. */
6004 { "http://username:pass@google.com/",0,S_OK
,FALSE
,
6005 Uri_HAS_USER_INFO
,S_OK
,FALSE
,
6006 "http://username:pass@google.com/",0,S_OK
,FALSE
6008 /* Doesn't remove the domain. */
6009 { "http://google.com/",0,S_OK
,FALSE
,
6010 Uri_HAS_DOMAIN
,S_OK
,FALSE
,
6011 "http://google.com/",0,S_OK
,FALSE
6013 { "http://google.com:120/",0,S_OK
,FALSE
,
6014 Uri_HAS_AUTHORITY
,S_OK
,FALSE
,
6015 "http://google.com:120/",0,S_OK
,FALSE
6017 { "http://google.com/test.com/",0,S_OK
,FALSE
,
6018 Uri_HAS_EXTENSION
,S_OK
,FALSE
,
6019 "http://google.com/test.com/",0,S_OK
,FALSE
6021 { "http://google.com/?test=x",0,S_OK
,FALSE
,
6022 Uri_HAS_PATH_AND_QUERY
,S_OK
,FALSE
,
6023 "http://google.com/?test=x",0,S_OK
,FALSE
6025 /* Can't remove the scheme name. */
6026 { "http://google.com/?test=x",0,S_OK
,FALSE
,
6027 Uri_HAS_SCHEME_NAME
|Uri_HAS_QUERY
,E_INVALIDARG
,FALSE
,
6028 "http://google.com/?test=x",0,S_OK
,FALSE
6032 typedef struct _uri_combine_str_property
{
6036 const char *broken_value
;
6037 const char *value_ex
;
6038 } uri_combine_str_property
;
6040 typedef struct _uri_combine_test
{
6041 const char *base_uri
;
6042 DWORD base_create_flags
;
6043 const char *relative_uri
;
6044 DWORD relative_create_flags
;
6045 DWORD combine_flags
;
6049 uri_combine_str_property str_props
[URI_STR_PROPERTY_COUNT
];
6050 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
6053 static const uri_combine_test uri_combine_tests
[] = {
6054 { "http://google.com/fun/stuff",0,
6055 "../not/fun/stuff",Uri_CREATE_ALLOW_RELATIVE
,
6058 {"http://google.com/not/fun/stuff",S_OK
},
6059 {"google.com",S_OK
},
6060 {"http://google.com/not/fun/stuff",S_OK
},
6061 {"google.com",S_OK
},
6064 {"google.com",S_OK
},
6066 {"/not/fun/stuff",S_OK
},
6067 {"/not/fun/stuff",S_OK
},
6069 {"http://google.com/not/fun/stuff",S_OK
},
6075 {Uri_HOST_DNS
,S_OK
},
6077 {URL_SCHEME_HTTP
,S_OK
},
6078 {URLZONE_INVALID
,E_NOTIMPL
}
6081 { "http://google.com/test",0,
6082 "zip://test.com/cool",0,
6085 {"zip://test.com/cool",S_OK
},
6087 {"zip://test.com/cool",S_OK
},
6096 {"zip://test.com/cool",S_OK
},
6102 {Uri_HOST_DNS
,S_OK
},
6104 {URL_SCHEME_UNKNOWN
,S_OK
},
6105 {URLZONE_INVALID
,E_NOTIMPL
}
6108 { "http://google.com/use/base/path",0,
6109 "?relative",Uri_CREATE_ALLOW_RELATIVE
,
6112 {"http://google.com/use/base/path?relative",S_OK
},
6113 {"google.com",S_OK
},
6114 {"http://google.com/use/base/path?relative",S_OK
},
6115 {"google.com",S_OK
},
6118 {"google.com",S_OK
},
6120 {"/use/base/path",S_OK
},
6121 {"/use/base/path?relative",S_OK
},
6123 {"http://google.com/use/base/path?relative",S_OK
},
6129 {Uri_HOST_DNS
,S_OK
},
6131 {URL_SCHEME_HTTP
,S_OK
},
6132 {URLZONE_INVALID
,E_NOTIMPL
}
6135 { "http://google.com/path",0,
6136 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
6139 {"http://google.com/testing",S_OK
},
6140 {"google.com",S_OK
},
6141 {"http://google.com/testing",S_OK
},
6142 {"google.com",S_OK
},
6145 {"google.com",S_OK
},
6150 {"http://google.com/testing",S_OK
},
6156 {Uri_HOST_DNS
,S_OK
},
6158 {URL_SCHEME_HTTP
,S_OK
},
6159 {URLZONE_INVALID
,E_NOTIMPL
}
6162 { "http://google.com/path",0,
6163 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
6164 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6166 {"http://google.com:80/test/../test/.././testing",S_OK
},
6167 {"google.com",S_OK
},
6168 {"http://google.com:80/test/../test/.././testing",S_OK
},
6169 {"google.com",S_OK
},
6172 {"google.com",S_OK
},
6174 {"/test/../test/.././testing",S_OK
},
6175 {"/test/../test/.././testing",S_OK
},
6177 {"http://google.com:80/test/../test/.././testing",S_OK
},
6183 {Uri_HOST_DNS
,S_OK
},
6185 {URL_SCHEME_HTTP
,S_OK
},
6186 {URLZONE_INVALID
,E_NOTIMPL
}
6189 { "http://winehq.org/test/abc",0,
6190 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
6193 {"http://winehq.org/test/testing/test",S_OK
},
6194 {"winehq.org",S_OK
},
6195 {"http://winehq.org/test/testing/test",S_OK
},
6196 {"winehq.org",S_OK
},
6199 {"winehq.org",S_OK
},
6201 {"/test/testing/test",S_OK
},
6202 {"/test/testing/test",S_OK
},
6204 {"http://winehq.org/test/testing/test",S_OK
},
6210 {Uri_HOST_DNS
,S_OK
},
6212 {URL_SCHEME_HTTP
,S_OK
},
6213 {URLZONE_INVALID
,E_NOTIMPL
}
6216 { "http://winehq.org/test/abc",0,
6217 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
6218 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6220 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6221 /* Default port is hidden in the authority. */
6222 {"winehq.org",S_OK
},
6223 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6224 {"winehq.org",S_OK
},
6227 {"winehq.org",S_OK
},
6229 {"/test/testing/abc/../test",S_OK
},
6230 {"/test/testing/abc/../test",S_OK
},
6232 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6238 {Uri_HOST_DNS
,S_OK
},
6240 {URL_SCHEME_HTTP
,S_OK
},
6241 {URLZONE_INVALID
,E_NOTIMPL
}
6244 { "http://winehq.org/test?query",0,
6245 "testing",Uri_CREATE_ALLOW_RELATIVE
,
6248 {"http://winehq.org/testing",S_OK
},
6249 {"winehq.org",S_OK
},
6250 {"http://winehq.org/testing",S_OK
},
6251 {"winehq.org",S_OK
},
6254 {"winehq.org",S_OK
},
6259 {"http://winehq.org/testing",S_OK
},
6265 {Uri_HOST_DNS
,S_OK
},
6267 {URL_SCHEME_HTTP
,S_OK
},
6268 {URLZONE_INVALID
,E_NOTIMPL
}
6271 { "http://winehq.org/test#frag",0,
6272 "testing",Uri_CREATE_ALLOW_RELATIVE
,
6275 {"http://winehq.org/testing",S_OK
},
6276 {"winehq.org",S_OK
},
6277 {"http://winehq.org/testing",S_OK
},
6278 {"winehq.org",S_OK
},
6281 {"winehq.org",S_OK
},
6286 {"http://winehq.org/testing",S_OK
},
6292 {Uri_HOST_DNS
,S_OK
},
6294 {URL_SCHEME_HTTP
,S_OK
},
6295 {URLZONE_INVALID
,E_NOTIMPL
}
6298 { "testing?query#frag",Uri_CREATE_ALLOW_RELATIVE
,
6299 "test",Uri_CREATE_ALLOW_RELATIVE
,
6319 {Uri_HOST_UNKNOWN
,S_OK
},
6321 {URL_SCHEME_UNKNOWN
,S_OK
},
6322 {URLZONE_INVALID
,E_NOTIMPL
}
6325 { "file:///c:/test/test",0,
6326 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6327 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6329 {"file://c:\\testing.mp3",S_OK
},
6331 {"file://c:\\testing.mp3",S_OK
},
6337 {"c:\\testing.mp3",S_OK
},
6338 {"c:\\testing.mp3",S_OK
},
6340 {"file://c:\\testing.mp3",S_OK
},
6346 {Uri_HOST_UNKNOWN
,S_OK
},
6348 {URL_SCHEME_FILE
,S_OK
},
6349 {URLZONE_INVALID
,E_NOTIMPL
}
6352 { "file:///c:/test/test",0,
6353 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6356 {"file:///c:/testing.mp3",S_OK
},
6358 {"file:///c:/testing.mp3",S_OK
},
6364 {"/c:/testing.mp3",S_OK
},
6365 {"/c:/testing.mp3",S_OK
},
6367 {"file:///c:/testing.mp3",S_OK
},
6373 {Uri_HOST_UNKNOWN
,S_OK
},
6375 {URL_SCHEME_FILE
,S_OK
},
6376 {URLZONE_INVALID
,E_NOTIMPL
}
6379 { "file://test.com/test/test",0,
6380 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6381 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6383 {"file://\\\\test.com\\testing.mp3",S_OK
},
6385 {"file://\\\\test.com\\testing.mp3",S_OK
},
6391 {"\\testing.mp3",S_OK
},
6392 {"\\testing.mp3",S_OK
},
6394 {"file://\\\\test.com\\testing.mp3",S_OK
},
6400 {Uri_HOST_DNS
,S_OK
},
6402 {URL_SCHEME_FILE
,S_OK
},
6403 {URLZONE_INVALID
,E_NOTIMPL
}
6406 /* URL_DONT_SIMPLIFY has no effect. */
6407 { "http://google.com/test",0,
6408 "zip://test.com/cool/../cool/test",0,
6409 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6411 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
6413 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
6419 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
6420 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
6422 /* The resulting IUri has the same Raw URI as the relative URI (only IE 8).
6423 * On IE 7 it reduces the path in the Raw URI.
6425 {"zip://test.com/cool/../cool/test",S_OK
,FALSE
,"zip://test.com/cool/test"},
6431 {Uri_HOST_DNS
,S_OK
},
6433 {URL_SCHEME_UNKNOWN
,S_OK
},
6434 {URLZONE_INVALID
,E_NOTIMPL
}
6437 /* FILE_USE_PATHURL has no effect in IE 8, in IE 7 the
6438 * resulting URI is converted into a dos path.
6440 { "http://google.com/test",0,
6441 "file:///c:/test/",0,
6442 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6444 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6446 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6452 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
6453 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
6455 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6461 {Uri_HOST_UNKNOWN
,S_OK
},
6463 {URL_SCHEME_FILE
,S_OK
},
6464 {URLZONE_INVALID
,E_NOTIMPL
}
6467 { "http://google.com/test",0,
6468 "http://test.com/test#%30test",0,
6469 URL_DONT_UNESCAPE_EXTRA_INFO
,S_OK
,FALSE
,
6471 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
6473 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
6476 {"#0test",S_OK
,FALSE
,NULL
,"#%30test"},
6482 /* IE 7 decodes the %30 to a 0 in the Raw URI. */
6483 {"http://test.com/test#%30test",S_OK
,FALSE
,"http://test.com/test#0test"},
6489 {Uri_HOST_DNS
,S_OK
},
6491 {URL_SCHEME_HTTP
,S_OK
},
6492 {URLZONE_INVALID
,E_NOTIMPL
}
6495 /* Windows validates the path component from the relative Uri. */
6496 { "http://google.com/test",0,
6497 "/Te%XXst",Uri_CREATE_ALLOW_RELATIVE
,
6498 0,E_INVALIDARG
,FALSE
6500 /* Windows doesn't validate the query from the relative Uri. */
6501 { "http://google.com/test",0,
6502 "?Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6505 {"http://google.com/test?Tes%XXt",S_OK
},
6506 {"google.com",S_OK
},
6507 {"http://google.com/test?Tes%XXt",S_OK
},
6508 {"google.com",S_OK
},
6511 {"google.com",S_OK
},
6514 {"/test?Tes%XXt",S_OK
},
6516 {"http://google.com/test?Tes%XXt",S_OK
},
6522 {Uri_HOST_DNS
,S_OK
},
6524 {URL_SCHEME_HTTP
,S_OK
},
6525 {URLZONE_INVALID
,E_NOTIMPL
}
6528 /* Windows doesn't validate the fragment from the relative Uri. */
6529 { "http://google.com/test",0,
6530 "#Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6533 {"http://google.com/test#Tes%XXt",S_OK
},
6534 {"google.com",S_OK
},
6535 {"http://google.com/test#Tes%XXt",S_OK
},
6536 {"google.com",S_OK
},
6539 {"google.com",S_OK
},
6544 {"http://google.com/test#Tes%XXt",S_OK
},
6550 {Uri_HOST_DNS
,S_OK
},
6552 {URL_SCHEME_HTTP
,S_OK
},
6553 {URLZONE_INVALID
,E_NOTIMPL
}
6556 /* Creates an IUri which contains an invalid dos path char. */
6557 { "file:///c:/test",0,
6558 "/test<ing",Uri_CREATE_ALLOW_RELATIVE
,
6559 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6561 {"file://c:\\test<ing",S_OK
},
6563 {"file://c:\\test<ing",S_OK
},
6569 {"c:\\test<ing",S_OK
},
6570 {"c:\\test<ing",S_OK
},
6572 {"file://c:\\test<ing",S_OK
},
6578 {Uri_HOST_UNKNOWN
,S_OK
},
6580 {URL_SCHEME_FILE
,S_OK
},
6581 {URLZONE_INVALID
,E_NOTIMPL
}
6584 /* Appends the path after the drive letter (if any). */
6585 { "file:///c:/test",0,
6586 "/c:/testing",Uri_CREATE_ALLOW_RELATIVE
,
6589 {"file:///c:/c:/testing",S_OK
},
6591 {"file:///c:/c:/testing",S_OK
},
6597 {"/c:/c:/testing",S_OK
},
6598 {"/c:/c:/testing",S_OK
},
6600 {"file:///c:/c:/testing",S_OK
},
6606 {Uri_HOST_UNKNOWN
,S_OK
},
6608 {URL_SCHEME_FILE
,S_OK
},
6609 {URLZONE_INVALID
,E_NOTIMPL
}
6612 /* A '/' is added if the base URI doesn't have a path and the
6613 * relative URI doesn't contain a path (since the base URI is
6616 { "http://google.com",Uri_CREATE_NO_CANONICALIZE
,
6617 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6620 {"http://google.com/?test",S_OK
},
6621 {"google.com",S_OK
},
6622 {"http://google.com/?test",S_OK
},
6623 {"google.com",S_OK
},
6626 {"google.com",S_OK
},
6631 {"http://google.com/?test",S_OK
},
6637 {Uri_HOST_DNS
,S_OK
},
6639 {URL_SCHEME_HTTP
,S_OK
},
6640 {URLZONE_INVALID
,E_NOTIMPL
}
6643 { "zip://google.com",Uri_CREATE_NO_CANONICALIZE
,
6644 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6647 {"zip://google.com/?test",S_OK
},
6648 {"google.com",S_OK
},
6649 {"zip://google.com/?test",S_OK
},
6650 {"google.com",S_OK
},
6653 {"google.com",S_OK
},
6658 {"zip://google.com/?test",S_OK
},
6664 {Uri_HOST_DNS
,S_OK
},
6666 {URL_SCHEME_UNKNOWN
,S_OK
},
6667 {URLZONE_INVALID
,E_NOTIMPL
}
6670 /* No path is appended since the base URI is opaque. */
6672 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6692 {Uri_HOST_UNKNOWN
,S_OK
},
6694 {URL_SCHEME_UNKNOWN
,S_OK
},
6695 {URLZONE_INVALID
,E_NOTIMPL
}
6699 "../testing/test",Uri_CREATE_ALLOW_RELATIVE
,
6702 {"file:///c:/testing/test",S_OK
},
6704 {"file:///c:/testing/test",S_OK
},
6710 {"/c:/testing/test",S_OK
},
6711 {"/c:/testing/test",S_OK
},
6713 {"file:///c:/testing/test",S_OK
},
6719 {Uri_HOST_UNKNOWN
,S_OK
},
6721 {URL_SCHEME_FILE
,S_OK
},
6722 {URLZONE_INVALID
,E_NOTIMPL
}
6725 { "http://winehq.org/dir/testfile",0,
6726 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
6729 {"http://winehq.org/dir/test?querystring",S_OK
},
6730 {"winehq.org",S_OK
},
6731 {"http://winehq.org/dir/test?querystring",S_OK
},
6732 {"winehq.org",S_OK
},
6735 {"winehq.org",S_OK
},
6738 {"/dir/test?querystring",S_OK
},
6739 {"?querystring",S_OK
},
6740 {"http://winehq.org/dir/test?querystring",S_OK
},
6746 {Uri_HOST_DNS
,S_OK
},
6748 {URL_SCHEME_HTTP
,S_OK
},
6749 {URLZONE_INVALID
,E_NOTIMPL
}
6752 { "http://winehq.org/dir/test",0,
6753 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
6756 {"http://winehq.org/dir/test?querystring",S_OK
},
6757 {"winehq.org",S_OK
},
6758 {"http://winehq.org/dir/test?querystring",S_OK
},
6759 {"winehq.org",S_OK
},
6762 {"winehq.org",S_OK
},
6765 {"/dir/test?querystring",S_OK
},
6766 {"?querystring",S_OK
},
6767 {"http://winehq.org/dir/test?querystring",S_OK
},
6773 {Uri_HOST_DNS
,S_OK
},
6775 {URL_SCHEME_HTTP
,S_OK
},
6776 {URLZONE_INVALID
,E_NOTIMPL
}
6779 { "http://winehq.org/dir/test?querystring",0,
6780 "#hash",Uri_CREATE_ALLOW_RELATIVE
,
6783 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6784 {"winehq.org",S_OK
},
6785 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6786 {"winehq.org",S_OK
},
6789 {"winehq.org",S_OK
},
6792 {"/dir/test?querystring",S_OK
},
6793 {"?querystring",S_OK
},
6794 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6800 {Uri_HOST_DNS
,S_OK
},
6802 {URL_SCHEME_HTTP
,S_OK
},
6803 {URLZONE_INVALID
,E_NOTIMPL
}
6806 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir\\file.txt",0,
6807 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6810 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6812 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6818 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6819 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6821 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6827 {Uri_HOST_UNKNOWN
,S_OK
},
6829 {URL_SCHEME_MK
,S_OK
},
6830 {URLZONE_INVALID
,E_NOTIMPL
}
6833 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::\\subdir\\file.txt",0,
6834 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6837 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6839 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6845 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6846 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6848 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6854 {Uri_HOST_UNKNOWN
,S_OK
},
6856 {URL_SCHEME_MK
,S_OK
},
6857 {URLZONE_INVALID
,E_NOTIMPL
}
6860 { "mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir\\file.txt",0,
6861 "relative\\path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6864 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6866 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6872 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6873 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6875 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6881 {Uri_HOST_UNKNOWN
,S_OK
},
6883 {URL_SCHEME_MK
,S_OK
},
6884 {URLZONE_INVALID
,E_NOTIMPL
}
6887 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
6888 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6891 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6893 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6899 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6900 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6902 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6908 {Uri_HOST_UNKNOWN
,S_OK
},
6910 {URL_SCHEME_MK
,S_OK
},
6911 {URLZONE_INVALID
,E_NOTIMPL
}
6914 { "mk:MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
6915 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6918 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6920 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6926 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6927 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6929 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6935 {Uri_HOST_UNKNOWN
,S_OK
},
6937 {URL_SCHEME_MK
,S_OK
},
6938 {URLZONE_INVALID
,E_NOTIMPL
}
6941 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/../../file.txt",0,
6942 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6945 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
6947 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
6953 {"@MSITSTORE:/relative/path.txt",S_OK
},
6954 {"@MSITSTORE:/relative/path.txt",S_OK
},
6956 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
6962 {Uri_HOST_UNKNOWN
,S_OK
},
6964 {URL_SCHEME_MK
,S_OK
},
6965 {URLZONE_INVALID
,E_NOTIMPL
}
6968 { "mk:@xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
6969 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6972 {"mk:@xxx:/relative/path.txt",S_OK
},
6974 {"mk:@xxx:/relative/path.txt",S_OK
},
6980 {"@xxx:/relative/path.txt",S_OK
},
6981 {"@xxx:/relative/path.txt",S_OK
},
6983 {"mk:@xxx:/relative/path.txt",S_OK
},
6989 {Uri_HOST_UNKNOWN
,S_OK
},
6991 {URL_SCHEME_MK
,S_OK
},
6992 {URLZONE_INVALID
,E_NOTIMPL
}
6995 { "mk:xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
6996 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6999 {"mk:/relative/path.txt",S_OK
},
7001 {"mk:/relative/path.txt",S_OK
},
7007 {"/relative/path.txt",S_OK
},
7008 {"/relative/path.txt",S_OK
},
7010 {"mk:/relative/path.txt",S_OK
},
7016 {Uri_HOST_UNKNOWN
,S_OK
},
7018 {URL_SCHEME_MK
,S_OK
},
7019 {URLZONE_INVALID
,E_NOTIMPL
}
7022 { "ml:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
7023 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
7026 {"ml:/relative/path.txt",S_OK
},
7028 {"ml:/relative/path.txt",S_OK
},
7034 {"/relative/path.txt",S_OK
},
7035 {"/relative/path.txt",S_OK
},
7037 {"ml:/relative/path.txt",S_OK
},
7043 {Uri_HOST_UNKNOWN
,S_OK
},
7045 {URL_SCHEME_UNKNOWN
,S_OK
},
7046 {URLZONE_INVALID
,E_NOTIMPL
}
7049 { "http://winehq.org/dir/test?querystring",0,
7050 "//winehq.com/#hash",Uri_CREATE_ALLOW_RELATIVE
,
7053 {"http://winehq.com/#hash",S_OK
},
7054 {"winehq.com",S_OK
},
7055 {"http://winehq.com/#hash",S_OK
},
7056 {"winehq.com",S_OK
},
7059 {"winehq.com",S_OK
},
7064 {"http://winehq.com/#hash",S_OK
},
7070 {Uri_HOST_DNS
,S_OK
},
7071 {80,S_OK
,FALSE
,TRUE
},
7072 {URL_SCHEME_HTTP
,S_OK
},
7073 {URLZONE_INVALID
,E_NOTIMPL
}
7076 { "http://winehq.org/dir/test?querystring",0,
7077 "//winehq.com/dir2/../dir/file.txt?query#hash",Uri_CREATE_ALLOW_RELATIVE
,
7080 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
7081 {"winehq.com",S_OK
},
7082 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
7083 {"winehq.com",S_OK
},
7086 {"winehq.com",S_OK
},
7088 {"/dir/file.txt",S_OK
},
7089 {"/dir/file.txt?query",S_OK
},
7091 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
7097 {Uri_HOST_DNS
,S_OK
},
7098 {80,S_OK
,FALSE
,TRUE
},
7099 {URL_SCHEME_HTTP
,S_OK
},
7100 {URLZONE_INVALID
,E_NOTIMPL
}
7103 { "http://google.com/test",0,
7104 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
7107 {"file:///c:/test/",S_OK
},
7109 {"file:///c:/test/",S_OK
},
7118 {"c:\\test\\",S_OK
,FALSE
,"file:///c:/test/"},
7124 {Uri_HOST_UNKNOWN
,S_OK
},
7126 {URL_SCHEME_FILE
,S_OK
},
7127 {URLZONE_INVALID
,E_NOTIMPL
}
7130 { "http://google.com/test",0,
7131 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
7134 {"file:///c:/test/",S_OK
},
7136 {"file:///c:/test/",S_OK
},
7145 {"c:\\test\\",S_OK
,FALSE
,"file:///c:/test/"},
7151 {Uri_HOST_UNKNOWN
,S_OK
},
7153 {URL_SCHEME_FILE
,S_OK
},
7154 {URLZONE_INVALID
,E_NOTIMPL
}
7157 { "http://winehq.org",0,
7158 "mailto://",Uri_CREATE_NO_CANONICALIZE
,
7172 {"mailto://",S_OK
,FALSE
,"mailto:"},
7178 {Uri_HOST_UNKNOWN
,S_OK
},
7180 {URL_SCHEME_MAILTO
,S_OK
},
7181 {URLZONE_INVALID
,E_NOTIMPL
}
7184 { "http://winehq.org",0,
7185 "mailto://a@b.com",Uri_CREATE_NO_CANONICALIZE
,
7188 {"mailto:a@b.com",S_OK
},
7190 {"mailto:a@b.com",S_OK
},
7199 {"mailto://a@b.com",S_OK
,FALSE
,"mailto:a@b.com"},
7205 {Uri_HOST_UNKNOWN
,S_OK
},
7207 {URL_SCHEME_MAILTO
,S_OK
},
7208 {URLZONE_INVALID
,E_NOTIMPL
}
7213 typedef struct _uri_parse_test
{
7218 const char *property
;
7223 static const uri_parse_test uri_parse_tests
[] = {
7224 /* PARSE_CANONICALIZE tests. */
7225 {"zip://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"zip://google.com/test<|>",S_OK
,FALSE
},
7226 {"http://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"http://google.com/test%3C%7C%3E",S_OK
,FALSE
},
7227 {"http://google.com/%30%23%3F",0,PARSE_CANONICALIZE
,URL_UNESCAPE
,"http://google.com/0#?",S_OK
,FALSE
},
7228 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_UNSAFE
,"test %3C%7C%3E",S_OK
,FALSE
},
7229 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_SPACES_ONLY
,"test%20<|>",S_OK
,FALSE
},
7230 {"test%20<|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_UNESCAPE
|URL_ESCAPE_UNSAFE
,"test%20%3C%7C%3E",S_OK
,FALSE
},
7231 {"http://google.com/%20",0,PARSE_CANONICALIZE
,URL_ESCAPE_PERCENT
,"http://google.com/%2520",S_OK
,FALSE
},
7232 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"http://google.com/test/../",S_OK
,FALSE
},
7233 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_NO_META
,"http://google.com/test/../",S_OK
,FALSE
},
7234 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"http://google.com/",S_OK
,FALSE
},
7235 {"zip://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"zip://google.com/",S_OK
,FALSE
},
7236 {"file:///c:/test/../test",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"file:///c:/test/../test",S_OK
,FALSE
},
7238 /* PARSE_FRIENDLY tests. */
7239 {"http://test@google.com/test#test",0,PARSE_FRIENDLY
,0,"http://google.com/test#test",S_OK
,FALSE
},
7240 {"zip://test@google.com/test",0,PARSE_FRIENDLY
,0,"zip://test@google.com/test",S_OK
,FALSE
},
7242 /* PARSE_ROOTDOCUMENT tests. */
7243 {"http://google.com:200/test/test",0,PARSE_ROOTDOCUMENT
,0,"http://google.com:200/",S_OK
,FALSE
},
7244 {"http://google.com",Uri_CREATE_NO_CANONICALIZE
,PARSE_ROOTDOCUMENT
,0,"http://google.com/",S_OK
,FALSE
},
7245 {"zip://google.com/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7246 {"file:///c:/testing/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7247 {"file://server/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7248 {"zip:test/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7250 /* PARSE_DOCUMENT tests. */
7251 {"http://test@google.com/test?query#frag",0,PARSE_DOCUMENT
,0,"http://test@google.com/test?query",S_OK
,FALSE
},
7252 {"http:testing#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7253 {"file:///c:/test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7254 {"zip://google.com/#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7255 {"zip:test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7256 {"testing#frag",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7258 /* PARSE_PATH_FROM_URL tests. */
7259 {"file:///c:/test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\test.mp3",S_OK
,FALSE
},
7260 {"file:///c:/t<|>est.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\t<|>est.mp3",S_OK
,FALSE
},
7261 {"file:///c:/te%XX t/",0,PARSE_PATH_FROM_URL
,0,"c:\\te%XX t\\",S_OK
,FALSE
},
7262 {"file://server/test",0,PARSE_PATH_FROM_URL
,0,"\\\\server\\test",S_OK
,FALSE
},
7263 {"http://google.com/",0,PARSE_PATH_FROM_URL
,0,"",E_INVALIDARG
,FALSE
},
7265 /* PARSE_URL_FROM_PATH tests. */
7266 /* This function almost seems to useless (just returns the absolute uri). */
7267 {"test.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"test.com",S_OK
,FALSE
},
7268 {"/test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"/test/test",S_OK
,FALSE
},
7269 {"file://c:\\test\\test",Uri_CREATE_FILE_USE_DOS_PATH
,PARSE_URL_FROM_PATH
,0,"file://c:\\test\\test",S_OK
,FALSE
},
7270 {"file:c:/test",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
7271 {"http:google.com/",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
7273 /* PARSE_SCHEMA tests. */
7274 {"http://google.com/test",0,PARSE_SCHEMA
,0,"http",S_OK
,FALSE
},
7275 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SCHEMA
,0,"",S_OK
,FALSE
},
7277 /* PARSE_SITE tests. */
7278 {"http://google.uk.com/",0,PARSE_SITE
,0,"google.uk.com",S_OK
,FALSE
},
7279 {"http://google.com.com/",0,PARSE_SITE
,0,"google.com.com",S_OK
,FALSE
},
7280 {"google.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SITE
,0,"",S_OK
,FALSE
},
7281 {"file://server/test",0,PARSE_SITE
,0,"server",S_OK
,FALSE
},
7283 /* PARSE_DOMAIN tests. */
7284 {"http://google.com.uk/",0,PARSE_DOMAIN
,0,"google.com.uk",S_OK
,FALSE
},
7285 {"http://google.com.com/",0,PARSE_DOMAIN
,0,"com.com",S_OK
,FALSE
},
7286 {"test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
7287 {"file://server/test",0,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
7289 /* PARSE_LOCATION and PARSE_ANCHOR tests. */
7290 {"http://google.com/test#Test",0,PARSE_ANCHOR
,0,"#Test",S_OK
,FALSE
},
7291 {"http://google.com/test#Test",0,PARSE_LOCATION
,0,"#Test",S_OK
,FALSE
},
7292 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_ANCHOR
,0,"",S_OK
,FALSE
},
7293 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_LOCATION
,0,"",S_OK
,FALSE
}
7296 static inline LPWSTR
a2w(LPCSTR str
) {
7300 DWORD len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
7301 ret
= HeapAlloc(GetProcessHeap(), 0, len
*sizeof(WCHAR
));
7302 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
7308 static inline BOOL
heap_free(void* mem
) {
7309 return HeapFree(GetProcessHeap(), 0, mem
);
7312 static inline DWORD
strcmp_aw(LPCSTR strA
, LPCWSTR strB
) {
7313 LPWSTR strAW
= a2w(strA
);
7314 DWORD ret
= lstrcmpW(strAW
, strB
);
7319 static inline ULONG
get_refcnt(IUri
*uri
) {
7321 return IUri_Release(uri
);
7324 static void change_property(IUriBuilder
*builder
, const uri_builder_property
*prop
,
7329 valueW
= a2w(prop
->value
);
7330 switch(prop
->property
) {
7331 case Uri_PROPERTY_FRAGMENT
:
7332 hr
= IUriBuilder_SetFragment(builder
, valueW
);
7335 ok(hr
== prop
->expected
,
7336 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7337 hr
, prop
->expected
, test_index
);
7340 ok(hr
== prop
->expected
,
7341 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7342 hr
, prop
->expected
, test_index
);
7345 case Uri_PROPERTY_HOST
:
7346 hr
= IUriBuilder_SetHost(builder
, valueW
);
7349 ok(hr
== prop
->expected
,
7350 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7351 hr
, prop
->expected
, test_index
);
7354 ok(hr
== prop
->expected
,
7355 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7356 hr
, prop
->expected
, test_index
);
7359 case Uri_PROPERTY_PASSWORD
:
7360 hr
= IUriBuilder_SetPassword(builder
, valueW
);
7363 ok(hr
== prop
->expected
,
7364 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7365 hr
, prop
->expected
, test_index
);
7368 ok(hr
== prop
->expected
,
7369 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7370 hr
, prop
->expected
, test_index
);
7373 case Uri_PROPERTY_PATH
:
7374 hr
= IUriBuilder_SetPath(builder
, valueW
);
7377 ok(hr
== prop
->expected
,
7378 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7379 hr
, prop
->expected
, test_index
);
7382 ok(hr
== prop
->expected
,
7383 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7384 hr
, prop
->expected
, test_index
);
7387 case Uri_PROPERTY_QUERY
:
7388 hr
= IUriBuilder_SetQuery(builder
, valueW
);
7391 ok(hr
== prop
->expected
,
7392 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7393 hr
, prop
->expected
, test_index
);
7396 ok(hr
== prop
->expected
,
7397 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7398 hr
, prop
->expected
, test_index
);
7401 case Uri_PROPERTY_SCHEME_NAME
:
7402 hr
= IUriBuilder_SetSchemeName(builder
, valueW
);
7405 ok(hr
== prop
->expected
,
7406 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7407 hr
, prop
->expected
, test_index
);
7410 ok(hr
== prop
->expected
,
7411 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7412 hr
, prop
->expected
, test_index
);
7415 case Uri_PROPERTY_USER_NAME
:
7416 hr
= IUriBuilder_SetUserName(builder
, valueW
);
7419 ok(hr
== prop
->expected
,
7420 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7421 hr
, prop
->expected
, test_index
);
7424 ok(hr
== prop
->expected
,
7425 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7426 hr
, prop
->expected
, test_index
);
7430 trace("Unsupported operation for %d on uri_builder_tests[%d].\n", prop
->property
, test_index
);
7437 * Simple tests to make sure the CreateUri function handles invalid flag combinations
7440 static void test_CreateUri_InvalidFlags(void) {
7443 for(i
= 0; i
< sizeof(invalid_flag_tests
)/sizeof(invalid_flag_tests
[0]); ++i
) {
7445 IUri
*uri
= (void*) 0xdeadbeef;
7447 hr
= pCreateUri(http_urlW
, invalid_flag_tests
[i
].flags
, 0, &uri
);
7448 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x\n",
7449 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
7450 ok(uri
== NULL
, "Error: expected the IUri to be NULL, but it was %p instead\n", uri
);
7454 static void test_CreateUri_InvalidArgs(void) {
7456 IUri
*uri
= (void*) 0xdeadbeef;
7458 const WCHAR invalidW
[] = {'i','n','v','a','l','i','d',0};
7459 static const WCHAR emptyW
[] = {0};
7461 hr
= pCreateUri(http_urlW
, 0, 0, NULL
);
7462 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
7464 hr
= pCreateUri(NULL
, 0, 0, &uri
);
7465 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
7466 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7468 uri
= (void*) 0xdeadbeef;
7469 hr
= pCreateUri(invalidW
, 0, 0, &uri
);
7470 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7471 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7473 uri
= (void*) 0xdeadbeef;
7474 hr
= pCreateUri(emptyW
, 0, 0, &uri
);
7475 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7476 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7479 static void test_CreateUri_InvalidUri(void) {
7482 for(i
= 0; i
< sizeof(invalid_uri_tests
)/sizeof(invalid_uri_tests
[0]); ++i
) {
7483 invalid_uri test
= invalid_uri_tests
[i
];
7488 uriW
= a2w(test
.uri
);
7489 hr
= pCreateUri(uriW
, test
.flags
, 0, &uri
);
7492 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
7493 hr
, E_INVALIDARG
, i
);
7496 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
7497 hr
, E_INVALIDARG
, i
);
7499 if(uri
) IUri_Release(uri
);
7505 static void test_IUri_GetPropertyBSTR(void) {
7510 /* Make sure GetPropertyBSTR handles invalid args correctly. */
7511 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7512 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7514 BSTR received
= NULL
;
7516 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, NULL
, 0);
7517 ok(hr
== E_POINTER
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7519 /* Make sure it handles an invalid Uri_PROPERTY correctly. */
7520 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_PORT
, &received
, 0);
7521 ok(hr
== E_INVALIDARG
/* IE10 */ || broken(hr
== S_OK
), "Error: GetPropertyBSTR returned 0x%08x, expected E_INVALIDARG or S_OK.\n", hr
);
7523 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
7524 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
7525 SysFreeString(received
);
7527 ok(!received
, "received = %s\n", wine_dbgstr_w(received
));
7530 /* Make sure it handles the ZONE property correctly. */
7532 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_ZONE
, &received
, 0);
7533 ok(hr
== S_FALSE
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, S_FALSE
);
7534 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
7535 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
7536 SysFreeString(received
);
7538 if(uri
) IUri_Release(uri
);
7540 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7541 uri_properties test
= uri_tests
[i
];
7545 uriW
= a2w(test
.uri
);
7546 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7547 if(test
.create_todo
) {
7549 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7550 hr
, test
.create_expected
, i
);
7553 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7554 hr
, test
.create_expected
, i
);
7560 /* Checks all the string properties of the uri. */
7561 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
7562 BSTR received
= NULL
;
7563 uri_str_property prop
= test
.str_props
[j
];
7565 hr
= IUri_GetPropertyBSTR(uri
, j
, &received
, 0);
7568 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
7569 hr
, prop
.expected
, i
, j
);
7572 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7573 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
7574 prop
.value
, wine_dbgstr_w(received
), i
, j
);
7577 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
7578 hr
, prop
.expected
, i
, j
);
7579 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7580 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
7581 prop
.value
, wine_dbgstr_w(received
), i
, j
);
7584 SysFreeString(received
);
7588 if(uri
) IUri_Release(uri
);
7594 static void test_IUri_GetPropertyDWORD(void) {
7599 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7600 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7602 DWORD received
= 0xdeadbeef;
7604 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_DWORD_START
, NULL
, 0);
7605 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7607 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_ABSOLUTE_URI
, &received
, 0);
7608 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7609 ok(received
== 0, "Error: Expected received=%d but instead received=%d.\n", 0, received
);
7611 if(uri
) IUri_Release(uri
);
7613 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7614 uri_properties test
= uri_tests
[i
];
7618 uriW
= a2w(test
.uri
);
7619 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7620 if(test
.create_todo
) {
7622 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7623 hr
, test
.create_expected
, i
);
7626 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7627 hr
, test
.create_expected
, i
);
7633 /* Checks all the DWORD properties of the uri. */
7634 for(j
= 0; j
< sizeof(test
.dword_props
)/sizeof(test
.dword_props
[0]); ++j
) {
7636 uri_dword_property prop
= test
.dword_props
[j
];
7638 hr
= IUri_GetPropertyDWORD(uri
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
7641 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
7642 hr
, prop
.expected
, i
, j
);
7645 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
7646 prop
.value
, received
, i
, j
);
7649 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
7650 hr
, prop
.expected
, i
, j
);
7651 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
7652 prop
.value
, received
, i
, j
);
7657 if(uri
) IUri_Release(uri
);
7663 /* Tests all the 'Get*' property functions which deal with strings. */
7664 static void test_IUri_GetStrProperties(void) {
7669 /* Make sure all the 'Get*' string property functions handle invalid args correctly. */
7670 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7671 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7673 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
7674 ok(hr
== E_POINTER
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7676 hr
= IUri_GetAuthority(uri
, NULL
);
7677 ok(hr
== E_POINTER
, "Error: GetAuthority returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7679 hr
= IUri_GetDisplayUri(uri
, NULL
);
7680 ok(hr
== E_POINTER
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7682 hr
= IUri_GetDomain(uri
, NULL
);
7683 ok(hr
== E_POINTER
, "Error: GetDomain returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7685 hr
= IUri_GetExtension(uri
, NULL
);
7686 ok(hr
== E_POINTER
, "Error: GetExtension returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7688 hr
= IUri_GetFragment(uri
, NULL
);
7689 ok(hr
== E_POINTER
, "Error: GetFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7691 hr
= IUri_GetHost(uri
, NULL
);
7692 ok(hr
== E_POINTER
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7694 hr
= IUri_GetPassword(uri
, NULL
);
7695 ok(hr
== E_POINTER
, "Error: GetPassword returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7697 hr
= IUri_GetPath(uri
, NULL
);
7698 ok(hr
== E_POINTER
, "Error: GetPath returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7700 hr
= IUri_GetPathAndQuery(uri
, NULL
);
7701 ok(hr
== E_POINTER
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7703 hr
= IUri_GetQuery(uri
, NULL
);
7704 ok(hr
== E_POINTER
, "Error: GetQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7706 hr
= IUri_GetRawUri(uri
, NULL
);
7707 ok(hr
== E_POINTER
, "Error: GetRawUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7709 hr
= IUri_GetSchemeName(uri
, NULL
);
7710 ok(hr
== E_POINTER
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7712 hr
= IUri_GetUserInfo(uri
, NULL
);
7713 ok(hr
== E_POINTER
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7715 hr
= IUri_GetUserName(uri
, NULL
);
7716 ok(hr
== E_POINTER
, "Error: GetUserName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7718 if(uri
) IUri_Release(uri
);
7720 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7721 uri_properties test
= uri_tests
[i
];
7725 uriW
= a2w(test
.uri
);
7726 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7727 if(test
.create_todo
) {
7729 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7730 hr
, test
.create_expected
, i
);
7733 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7734 hr
, test
.create_expected
, i
);
7738 uri_str_property prop
;
7739 BSTR received
= NULL
;
7741 /* GetAbsoluteUri() tests. */
7742 prop
= test
.str_props
[Uri_PROPERTY_ABSOLUTE_URI
];
7743 hr
= IUri_GetAbsoluteUri(uri
, &received
);
7746 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7747 hr
, prop
.expected
, i
);
7750 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7751 "Error: Expected %s but got %s on uri_tests[%d].\n",
7752 prop
.value
, wine_dbgstr_w(received
), i
);
7755 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7756 hr
, prop
.expected
, i
);
7757 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7758 "Error: Expected %s but got %s on uri_tests[%d].\n",
7759 prop
.value
, wine_dbgstr_w(received
), i
);
7761 SysFreeString(received
);
7764 /* GetAuthority() tests. */
7765 prop
= test
.str_props
[Uri_PROPERTY_AUTHORITY
];
7766 hr
= IUri_GetAuthority(uri
, &received
);
7769 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7770 hr
, prop
.expected
, i
);
7773 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7774 prop
.value
, wine_dbgstr_w(received
), i
);
7777 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7778 hr
, prop
.expected
, i
);
7779 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7780 prop
.value
, wine_dbgstr_w(received
), i
);
7782 SysFreeString(received
);
7785 /* GetDisplayUri() tests. */
7786 prop
= test
.str_props
[Uri_PROPERTY_DISPLAY_URI
];
7787 hr
= IUri_GetDisplayUri(uri
, &received
);
7790 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7791 hr
, prop
.expected
, i
);
7794 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7795 "Error: Expected %s but got %s on uri_test[%d].\n",
7796 prop
.value
, wine_dbgstr_w(received
), i
);
7799 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7800 hr
, prop
.expected
, i
);
7801 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7802 "Error: Expected %s but got %s on uri_tests[%d].\n",
7803 prop
.value
, wine_dbgstr_w(received
), i
);
7805 SysFreeString(received
);
7808 /* GetDomain() tests. */
7809 prop
= test
.str_props
[Uri_PROPERTY_DOMAIN
];
7810 hr
= IUri_GetDomain(uri
, &received
);
7813 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7814 hr
, prop
.expected
, i
);
7817 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7818 prop
.value
, wine_dbgstr_w(received
), i
);
7821 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7822 hr
, prop
.expected
, i
);
7823 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7824 prop
.value
, wine_dbgstr_w(received
), i
);
7826 SysFreeString(received
);
7829 /* GetExtension() tests. */
7830 prop
= test
.str_props
[Uri_PROPERTY_EXTENSION
];
7831 hr
= IUri_GetExtension(uri
, &received
);
7834 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7835 hr
, prop
.expected
, i
);
7838 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7839 prop
.value
, wine_dbgstr_w(received
), i
);
7842 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7843 hr
, prop
.expected
, i
);
7844 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7845 prop
.value
, wine_dbgstr_w(received
), i
);
7847 SysFreeString(received
);
7850 /* GetFragment() tests. */
7851 prop
= test
.str_props
[Uri_PROPERTY_FRAGMENT
];
7852 hr
= IUri_GetFragment(uri
, &received
);
7855 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7856 hr
, prop
.expected
, i
);
7859 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7860 prop
.value
, wine_dbgstr_w(received
), i
);
7863 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7864 hr
, prop
.expected
, i
);
7865 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7866 prop
.value
, wine_dbgstr_w(received
), i
);
7868 SysFreeString(received
);
7871 /* GetHost() tests. */
7872 prop
= test
.str_props
[Uri_PROPERTY_HOST
];
7873 hr
= IUri_GetHost(uri
, &received
);
7876 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7877 hr
, prop
.expected
, i
);
7880 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7881 prop
.value
, wine_dbgstr_w(received
), i
);
7884 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7885 hr
, prop
.expected
, i
);
7886 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7887 prop
.value
, wine_dbgstr_w(received
), i
);
7889 SysFreeString(received
);
7892 /* GetPassword() tests. */
7893 prop
= test
.str_props
[Uri_PROPERTY_PASSWORD
];
7894 hr
= IUri_GetPassword(uri
, &received
);
7897 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7898 hr
, prop
.expected
, i
);
7901 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7902 prop
.value
, wine_dbgstr_w(received
), i
);
7905 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7906 hr
, prop
.expected
, i
);
7907 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7908 prop
.value
, wine_dbgstr_w(received
), i
);
7910 SysFreeString(received
);
7913 /* GetPath() tests. */
7914 prop
= test
.str_props
[Uri_PROPERTY_PATH
];
7915 hr
= IUri_GetPath(uri
, &received
);
7918 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7919 hr
, prop
.expected
, i
);
7922 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7923 prop
.value
, wine_dbgstr_w(received
), i
);
7926 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7927 hr
, prop
.expected
, i
);
7928 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7929 prop
.value
, wine_dbgstr_w(received
), i
);
7931 SysFreeString(received
);
7934 /* GetPathAndQuery() tests. */
7935 prop
= test
.str_props
[Uri_PROPERTY_PATH_AND_QUERY
];
7936 hr
= IUri_GetPathAndQuery(uri
, &received
);
7939 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7940 hr
, prop
.expected
, i
);
7943 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7944 prop
.value
, wine_dbgstr_w(received
), i
);
7947 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7948 hr
, prop
.expected
, i
);
7949 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7950 prop
.value
, wine_dbgstr_w(received
), i
);
7952 SysFreeString(received
);
7955 /* GetQuery() tests. */
7956 prop
= test
.str_props
[Uri_PROPERTY_QUERY
];
7957 hr
= IUri_GetQuery(uri
, &received
);
7960 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7961 hr
, prop
.expected
, i
);
7964 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7965 prop
.value
, wine_dbgstr_w(received
), i
);
7968 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7969 hr
, prop
.expected
, i
);
7970 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7971 prop
.value
, wine_dbgstr_w(received
), i
);
7973 SysFreeString(received
);
7976 /* GetRawUri() tests. */
7977 prop
= test
.str_props
[Uri_PROPERTY_RAW_URI
];
7978 hr
= IUri_GetRawUri(uri
, &received
);
7981 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7982 hr
, prop
.expected
, i
);
7985 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7986 prop
.value
, wine_dbgstr_w(received
), i
);
7989 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7990 hr
, prop
.expected
, i
);
7991 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7992 prop
.value
, wine_dbgstr_w(received
), i
);
7994 SysFreeString(received
);
7997 /* GetSchemeName() tests. */
7998 prop
= test
.str_props
[Uri_PROPERTY_SCHEME_NAME
];
7999 hr
= IUri_GetSchemeName(uri
, &received
);
8002 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8003 hr
, prop
.expected
, i
);
8006 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8007 prop
.value
, wine_dbgstr_w(received
), i
);
8010 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8011 hr
, prop
.expected
, i
);
8012 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8013 prop
.value
, wine_dbgstr_w(received
), i
);
8015 SysFreeString(received
);
8018 /* GetUserInfo() tests. */
8019 prop
= test
.str_props
[Uri_PROPERTY_USER_INFO
];
8020 hr
= IUri_GetUserInfo(uri
, &received
);
8023 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8024 hr
, prop
.expected
, i
);
8027 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8028 prop
.value
, wine_dbgstr_w(received
), i
);
8031 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8032 hr
, prop
.expected
, i
);
8033 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8034 prop
.value
, wine_dbgstr_w(received
), i
);
8036 SysFreeString(received
);
8039 /* GetUserName() tests. */
8040 prop
= test
.str_props
[Uri_PROPERTY_USER_NAME
];
8041 hr
= IUri_GetUserName(uri
, &received
);
8044 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8045 hr
, prop
.expected
, i
);
8048 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8049 prop
.value
, wine_dbgstr_w(received
), i
);
8052 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8053 hr
, prop
.expected
, i
);
8054 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
8055 prop
.value
, wine_dbgstr_w(received
), i
);
8057 SysFreeString(received
);
8060 if(uri
) IUri_Release(uri
);
8066 static void test_IUri_GetDwordProperties(void) {
8071 /* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
8072 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8073 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8075 hr
= IUri_GetHostType(uri
, NULL
);
8076 ok(hr
== E_INVALIDARG
, "Error: GetHostType returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8078 hr
= IUri_GetPort(uri
, NULL
);
8079 ok(hr
== E_INVALIDARG
, "Error: GetPort returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8081 hr
= IUri_GetScheme(uri
, NULL
);
8082 ok(hr
== E_INVALIDARG
, "Error: GetScheme returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8084 hr
= IUri_GetZone(uri
, NULL
);
8085 ok(hr
== E_INVALIDARG
, "Error: GetZone returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8087 if(uri
) IUri_Release(uri
);
8089 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
8090 uri_properties test
= uri_tests
[i
];
8094 uriW
= a2w(test
.uri
);
8095 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8096 if(test
.create_todo
) {
8098 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8099 hr
, test
.create_expected
, i
);
8102 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8103 hr
, test
.create_expected
, i
);
8107 uri_dword_property prop
;
8110 /* Assign an insane value so tests don't accidentally pass when
8113 received
= -9999999;
8115 /* GetHostType() tests. */
8116 prop
= test
.dword_props
[Uri_PROPERTY_HOST_TYPE
-Uri_PROPERTY_DWORD_START
];
8117 hr
= IUri_GetHostType(uri
, &received
);
8120 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8121 hr
, prop
.expected
, i
);
8124 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8127 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8128 hr
, prop
.expected
, i
);
8129 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8131 received
= -9999999;
8133 /* GetPort() tests. */
8134 prop
= test
.dword_props
[Uri_PROPERTY_PORT
-Uri_PROPERTY_DWORD_START
];
8135 hr
= IUri_GetPort(uri
, &received
);
8138 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8139 hr
, prop
.expected
, i
);
8142 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8145 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8146 hr
, prop
.expected
, i
);
8147 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8149 received
= -9999999;
8151 /* GetScheme() tests. */
8152 prop
= test
.dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
];
8153 hr
= IUri_GetScheme(uri
, &received
);
8156 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8157 hr
, prop
.expected
, i
);
8160 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8163 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8164 hr
, prop
.expected
, i
);
8165 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8167 received
= -9999999;
8169 /* GetZone() tests. */
8170 prop
= test
.dword_props
[Uri_PROPERTY_ZONE
-Uri_PROPERTY_DWORD_START
];
8171 hr
= IUri_GetZone(uri
, &received
);
8174 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8175 hr
, prop
.expected
, i
);
8178 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8181 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8182 hr
, prop
.expected
, i
);
8183 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8187 if(uri
) IUri_Release(uri
);
8193 static void test_IUri_GetPropertyLength(void) {
8198 /* Make sure it handles invalid args correctly. */
8199 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8200 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8202 DWORD received
= 0xdeadbeef;
8204 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_STRING_START
, NULL
, 0);
8205 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8207 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_DWORD_START
, &received
, 0);
8208 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength return 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8209 ok(received
== 0xdeadbeef, "Error: Expected 0xdeadbeef but got 0x%08x.\n", received
);
8211 if(uri
) IUri_Release(uri
);
8213 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
8214 uri_properties test
= uri_tests
[i
];
8218 uriW
= a2w(test
.uri
);
8219 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8220 if(test
.create_todo
) {
8222 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8223 hr
, test
.create_expected
, i
);
8226 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_test[%d].\n",
8227 hr
, test
.create_expected
, i
);
8233 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
8234 DWORD expectedLen
, receivedLen
;
8235 uri_str_property prop
= test
.str_props
[j
];
8237 expectedLen
= lstrlenA(prop
.value
);
8239 /* This won't be necessary once GetPropertyLength is implemented. */
8242 hr
= IUri_GetPropertyLength(uri
, j
, &receivedLen
, 0);
8245 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
8246 hr
, prop
.expected
, i
, j
);
8249 ok(receivedLen
== expectedLen
|| broken(prop
.broken_value
&& receivedLen
== lstrlenA(prop
.broken_value
)),
8250 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
8251 expectedLen
, receivedLen
, i
, j
);
8254 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
8255 hr
, prop
.expected
, i
, j
);
8256 ok(receivedLen
== expectedLen
|| broken(prop
.broken_value
&& receivedLen
== lstrlenA(prop
.broken_value
)),
8257 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
8258 expectedLen
, receivedLen
, i
, j
);
8263 if(uri
) IUri_Release(uri
);
8269 static DWORD
compute_expected_props(uri_properties
*test
)
8273 for(i
=Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_STRING_LAST
; i
++) {
8274 if(test
->str_props
[i
-Uri_PROPERTY_STRING_START
].expected
== S_OK
)
8278 for(i
=Uri_PROPERTY_DWORD_START
; i
<= Uri_PROPERTY_DWORD_LAST
; i
++) {
8279 if(test
->dword_props
[i
-Uri_PROPERTY_DWORD_START
].expected
== S_OK
)
8286 static void test_IUri_GetProperties(void) {
8291 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8292 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8294 hr
= IUri_GetProperties(uri
, NULL
);
8295 ok(hr
== E_INVALIDARG
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8297 if(uri
) IUri_Release(uri
);
8299 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
8300 uri_properties test
= uri_tests
[i
];
8304 uriW
= a2w(test
.uri
);
8305 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8306 if(test
.create_todo
) {
8308 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8311 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8315 DWORD received
= 0, expected_props
;
8318 hr
= IUri_GetProperties(uri
, &received
);
8319 ok(hr
== S_OK
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8321 expected_props
= compute_expected_props(&test
);
8323 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
8324 /* (1 << j) converts a Uri_PROPERTY to its corresponding Uri_HAS_* flag mask. */
8325 if(expected_props
& (1 << j
))
8326 ok(received
& (1 << j
), "Error: Expected flag for property %d on uri_tests[%d].\n", j
, i
);
8328 ok(!(received
& (1 << j
)), "Error: Received flag for property %d when not expected on uri_tests[%d].\n", j
, i
);
8332 if(uri
) IUri_Release(uri
);
8338 static void test_IUri_HasProperty(void) {
8343 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8344 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8346 hr
= IUri_HasProperty(uri
, Uri_PROPERTY_RAW_URI
, NULL
);
8347 ok(hr
== E_INVALIDARG
, "Error: HasProperty returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8349 if(uri
) IUri_Release(uri
);
8351 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
8352 uri_properties test
= uri_tests
[i
];
8356 uriW
= a2w(test
.uri
);
8358 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8359 if(test
.create_todo
) {
8361 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8364 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8368 DWORD expected_props
, j
;
8370 expected_props
= compute_expected_props(&test
);
8372 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
8373 /* Assign -1, then explicitly test for TRUE or FALSE later. */
8376 hr
= IUri_HasProperty(uri
, j
, &received
);
8377 ok(hr
== S_OK
, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
8380 if(expected_props
& (1 << j
)) {
8381 ok(received
== TRUE
, "Error: Expected to have property %d on uri_tests[%d].\n", j
, i
);
8383 ok(received
== FALSE
, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j
, i
);
8388 if(uri
) IUri_Release(uri
);
8394 static void test_IUri_IsEqual(void) {
8402 /* Make sure IsEqual handles invalid args correctly. */
8403 hres
= pCreateUri(http_urlW
, 0, 0, &uriA
);
8404 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8405 hres
= pCreateUri(http_urlW
, 0, 0, &uriB
);
8406 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8409 hres
= IUri_IsEqual(uriA
, NULL
, &equal
);
8410 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8411 ok(!equal
, "Error: Expected equal to be FALSE, but was %d instead.\n", equal
);
8413 hres
= IUri_IsEqual(uriA
, uriB
, NULL
);
8414 ok(hres
== E_POINTER
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hres
, E_POINTER
);
8419 for(i
= 0; i
< sizeof(equality_tests
)/sizeof(equality_tests
[0]); ++i
) {
8420 uri_equality test
= equality_tests
[i
];
8421 LPWSTR uriA_W
, uriB_W
;
8425 uriA_W
= a2w(test
.a
);
8426 uriB_W
= a2w(test
.b
);
8428 hres
= pCreateUri(uriA_W
, test
.create_flags_a
, 0, &uriA
);
8429 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n", hres
, S_OK
, i
);
8431 hres
= pCreateUri(uriB_W
, test
.create_flags_b
, 0, &uriB
);
8432 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n", hres
, S_OK
, i
);
8435 hres
= IUri_IsEqual(uriA
, uriB
, &equal
);
8436 if(test
.todo
) todo_wine
{
8437 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hres
, S_OK
, i
);
8438 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
8440 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hres
, S_OK
, i
);
8441 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
8443 if(uriA
) IUri_Release(uriA
);
8444 if(uriB
) IUri_Release(uriB
);
8451 static void test_CreateUriWithFragment_InvalidArgs(void) {
8453 IUri
*uri
= (void*) 0xdeadbeef;
8454 const WCHAR fragmentW
[] = {'#','f','r','a','g','m','e','n','t',0};
8456 hr
= pCreateUriWithFragment(NULL
, fragmentW
, 0, 0, &uri
);
8457 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8458 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8460 hr
= pCreateUriWithFragment(http_urlW
, fragmentW
, 0, 0, NULL
);
8461 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8463 /* Original URI can't already contain a fragment component. */
8464 uri
= (void*) 0xdeadbeef;
8465 hr
= pCreateUriWithFragment(http_url_fragW
, fragmentW
, 0, 0, &uri
);
8466 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8467 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8470 /* CreateUriWithFragment has the same invalid flag combinations as CreateUri. */
8471 static void test_CreateUriWithFragment_InvalidFlags(void) {
8474 for(i
= 0; i
< sizeof(invalid_flag_tests
)/sizeof(invalid_flag_tests
[0]); ++i
) {
8476 IUri
*uri
= (void*) 0xdeadbeef;
8478 hr
= pCreateUriWithFragment(http_urlW
, NULL
, invalid_flag_tests
[i
].flags
, 0, &uri
);
8479 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x. flags=0x%08x.\n",
8480 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
8481 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8485 static void test_CreateUriWithFragment(void) {
8488 for(i
= 0; i
< sizeof(uri_fragment_tests
)/sizeof(uri_fragment_tests
[0]); ++i
) {
8492 uri_with_fragment test
= uri_fragment_tests
[i
];
8494 uriW
= a2w(test
.uri
);
8495 fragW
= a2w(test
.fragment
);
8497 hr
= pCreateUriWithFragment(uriW
, fragW
, test
.create_flags
, 0, &uri
);
8498 if(test
.expected_todo
) {
8500 ok(hr
== test
.create_expected
,
8501 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8502 hr
, test
.create_expected
, i
);
8505 ok(hr
== test
.create_expected
,
8506 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8507 hr
, test
.create_expected
, i
);
8510 BSTR received
= NULL
;
8512 hr
= IUri_GetAbsoluteUri(uri
, &received
);
8513 if(test
.expected_todo
) {
8516 "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8520 ok(!strcmp_aw(test
.expected_uri
, received
),
8521 "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
8522 test
.expected_uri
, wine_dbgstr_w(received
), i
);
8525 ok(hr
== S_OK
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8527 ok(!strcmp_aw(test
.expected_uri
, received
), "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
8528 test
.expected_uri
, wine_dbgstr_w(received
), i
);
8531 SysFreeString(received
);
8534 if(uri
) IUri_Release(uri
);
8540 static void test_CreateIUriBuilder(void) {
8542 IUriBuilder
*builder
= NULL
;
8545 hr
= pCreateIUriBuilder(NULL
, 0, 0, NULL
);
8546 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x\n",
8549 /* CreateIUriBuilder increases the ref count of the IUri it receives. */
8550 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8551 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8553 ULONG cur_count
, orig_count
;
8555 orig_count
= get_refcnt(uri
);
8556 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
8557 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8558 ok(builder
!= NULL
, "Error: Expecting builder not to be NULL\n");
8560 cur_count
= get_refcnt(uri
);
8561 ok(cur_count
== orig_count
+1, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
+1, cur_count
);
8563 if(builder
) IUriBuilder_Release(builder
);
8564 cur_count
= get_refcnt(uri
);
8565 ok(cur_count
== orig_count
, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
, cur_count
);
8567 if(uri
) IUri_Release(uri
);
8570 static void test_IUriBuilder_CreateUri(IUriBuilder
*builder
, const uri_builder_test
*test
,
8575 hr
= IUriBuilder_CreateUri(builder
, test
->uri_flags
, 0, 0, &uri
);
8576 if(test
->uri_todo
) {
8578 ok(hr
== test
->uri_hres
,
8579 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8580 hr
, test
->uri_hres
, test_index
);
8583 ok(hr
== test
->uri_hres
,
8584 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8585 hr
, test
->uri_hres
, test_index
);
8591 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
8592 uri_builder_str_property prop
= test
->expected_str_props
[i
];
8593 BSTR received
= NULL
;
8595 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
8598 ok(hr
== prop
.result
,
8599 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8600 hr
, prop
.result
, test_index
, i
);
8603 ok(hr
== prop
.result
,
8604 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8605 hr
, prop
.result
, test_index
, i
);
8610 ok(!strcmp_aw(prop
.expected
, received
),
8611 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8612 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8615 ok(!strcmp_aw(prop
.expected
, received
),
8616 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8617 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8620 SysFreeString(received
);
8623 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
8624 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
8625 DWORD received
= -2;
8627 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
8630 ok(hr
== prop
.result
,
8631 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8632 hr
, prop
.result
, test_index
, i
);
8635 ok(hr
== prop
.result
,
8636 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8637 hr
, prop
.result
, test_index
, i
);
8642 ok(received
== prop
.expected
,
8643 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8644 prop
.expected
, received
, test_index
, i
);
8647 ok(received
== prop
.expected
,
8648 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8649 prop
.expected
, received
, test_index
, i
);
8654 if(uri
) IUri_Release(uri
);
8657 static void test_IUriBuilder_CreateUriSimple(IUriBuilder
*builder
, const uri_builder_test
*test
,
8662 hr
= IUriBuilder_CreateUriSimple(builder
, test
->uri_simple_encode_flags
, 0, &uri
);
8663 if(test
->uri_simple_todo
) {
8665 ok(hr
== test
->uri_simple_hres
,
8666 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8667 hr
, test
->uri_simple_hres
, test_index
);
8670 ok(hr
== test
->uri_simple_hres
,
8671 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8672 hr
, test
->uri_simple_hres
, test_index
);
8678 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
8679 uri_builder_str_property prop
= test
->expected_str_props
[i
];
8680 BSTR received
= NULL
;
8682 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
8685 ok(hr
== prop
.result
,
8686 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8687 hr
, prop
.result
, test_index
, i
);
8690 ok(hr
== prop
.result
,
8691 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8692 hr
, prop
.result
, test_index
, i
);
8697 ok(!strcmp_aw(prop
.expected
, received
),
8698 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8699 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8702 ok(!strcmp_aw(prop
.expected
, received
),
8703 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8704 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8707 SysFreeString(received
);
8710 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
8711 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
8712 DWORD received
= -2;
8714 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
8717 ok(hr
== prop
.result
,
8718 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8719 hr
, prop
.result
, test_index
, i
);
8722 ok(hr
== prop
.result
,
8723 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8724 hr
, prop
.result
, test_index
, i
);
8729 ok(received
== prop
.expected
,
8730 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8731 prop
.expected
, received
, test_index
, i
);
8734 ok(received
== prop
.expected
,
8735 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8736 prop
.expected
, received
, test_index
, i
);
8741 if(uri
) IUri_Release(uri
);
8744 static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder
*builder
, const uri_builder_test
*test
,
8749 hr
= IUriBuilder_CreateUriWithFlags(builder
, test
->uri_with_flags
, test
->uri_with_builder_flags
,
8750 test
->uri_with_encode_flags
, 0, &uri
);
8751 if(test
->uri_with_todo
) {
8753 ok(hr
== test
->uri_with_hres
,
8754 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8755 hr
, test
->uri_with_hres
, test_index
);
8758 ok(hr
== test
->uri_with_hres
,
8759 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8760 hr
, test
->uri_with_hres
, test_index
);
8766 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
8767 uri_builder_str_property prop
= test
->expected_str_props
[i
];
8768 BSTR received
= NULL
;
8770 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
8773 ok(hr
== prop
.result
,
8774 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8775 hr
, prop
.result
, test_index
, i
);
8778 ok(hr
== prop
.result
,
8779 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8780 hr
, prop
.result
, test_index
, i
);
8785 ok(!strcmp_aw(prop
.expected
, received
),
8786 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8787 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8790 ok(!strcmp_aw(prop
.expected
, received
),
8791 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8792 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8795 SysFreeString(received
);
8798 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
8799 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
8800 DWORD received
= -2;
8802 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
8805 ok(hr
== prop
.result
,
8806 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8807 hr
, prop
.result
, test_index
, i
);
8810 ok(hr
== prop
.result
,
8811 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8812 hr
, prop
.result
, test_index
, i
);
8817 ok(received
== prop
.expected
,
8818 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8819 prop
.expected
, received
, test_index
, i
);
8822 ok(received
== prop
.expected
,
8823 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8824 prop
.expected
, received
, test_index
, i
);
8829 if(uri
) IUri_Release(uri
);
8832 static void test_IUriBuilder_CreateInvalidArgs(void) {
8833 IUriBuilder
*builder
;
8836 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
8837 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8839 IUri
*test
= NULL
, *uri
= (void*) 0xdeadbeef;
8841 /* Test what happens if the IUriBuilder doesn't have a IUri set. */
8842 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, NULL
);
8843 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8845 uri
= (void*) 0xdeadbeef;
8846 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8847 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_NOTIMPL
);
8848 ok(uri
== NULL
, "Error: expected uri to be NULL, but was %p instead.\n", uri
);
8850 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, NULL
);
8851 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8854 uri
= (void*) 0xdeadbeef;
8855 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
8856 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8858 ok(!uri
, "Error: Expected uri to NULL, but was %p instead.\n", uri
);
8860 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, NULL
);
8861 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8864 uri
= (void*) 0xdeadbeef;
8865 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8866 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8868 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8870 hr
= pCreateUri(http_urlW
, 0, 0, &test
);
8871 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8873 hr
= IUriBuilder_SetIUri(builder
, test
);
8874 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8876 /* No longer returns E_NOTIMPL, since a IUri has been set and hasn't been modified. */
8878 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8879 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8880 ok(uri
!= NULL
, "Error: The uri was NULL.\n");
8881 if(uri
) IUri_Release(uri
);
8884 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
8885 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8887 ok(uri
!= NULL
, "Error: uri was NULL.\n");
8888 if(uri
) IUri_Release(uri
);
8891 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &uri
);
8892 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8894 ok(uri
!= NULL
, "Error: uri was NULL.\n");
8895 if(uri
) IUri_Release(uri
);
8897 hr
= IUriBuilder_SetFragment(builder
, NULL
);
8898 ok(hr
== S_OK
, "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8900 /* The IUriBuilder is changed, so it returns E_NOTIMPL again. */
8901 uri
= (void*) 0xdeadbeef;
8902 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8903 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8904 ok(!uri
, "Error: Expected uri to be NULL but was %p instead.\n", uri
);
8906 uri
= (void*) 0xdeadbeef;
8907 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
8908 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8910 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8912 uri
= (void*) 0xdeadbeef;
8913 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8914 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8916 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8918 if(test
) IUri_Release(test
);
8920 if(builder
) IUriBuilder_Release(builder
);
8923 /* Tests invalid args to the "Get*" functions. */
8924 static void test_IUriBuilder_GetInvalidArgs(void) {
8925 IUriBuilder
*builder
= NULL
;
8928 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
8929 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8931 LPCWSTR received
= (void*) 0xdeadbeef;
8932 DWORD len
= -1, port
= -1;
8935 hr
= IUriBuilder_GetFragment(builder
, NULL
, NULL
);
8936 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8938 hr
= IUriBuilder_GetFragment(builder
, NULL
, &received
);
8939 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8941 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8942 hr
= IUriBuilder_GetFragment(builder
, &len
, NULL
);
8943 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8945 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8947 hr
= IUriBuilder_GetHost(builder
, NULL
, NULL
);
8948 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8950 received
= (void*) 0xdeadbeef;
8951 hr
= IUriBuilder_GetHost(builder
, NULL
, &received
);
8952 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8954 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8956 hr
= IUriBuilder_GetHost(builder
, &len
, NULL
);
8957 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8959 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8961 hr
= IUriBuilder_GetPassword(builder
, NULL
, NULL
);
8962 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8964 received
= (void*) 0xdeadbeef;
8965 hr
= IUriBuilder_GetPassword(builder
, NULL
, &received
);
8966 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8968 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8970 hr
= IUriBuilder_GetPassword(builder
, &len
, NULL
);
8971 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8973 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8975 hr
= IUriBuilder_GetPath(builder
, NULL
, NULL
);
8976 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8978 received
= (void*) 0xdeadbeef;
8979 hr
= IUriBuilder_GetPath(builder
, NULL
, &received
);
8980 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8982 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8984 hr
= IUriBuilder_GetPath(builder
, &len
, NULL
);
8985 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8987 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8989 hr
= IUriBuilder_GetPort(builder
, NULL
, NULL
);
8990 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8992 hr
= IUriBuilder_GetPort(builder
, NULL
, &port
);
8993 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8995 ok(!port
, "Error: Expected port to be 0, but was %d instead.\n", port
);
8996 hr
= IUriBuilder_GetPort(builder
, &set
, NULL
);
8997 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8999 ok(!set
, "Error: Expected set to be FALSE, but was %d instead.\n", set
);
9001 hr
= IUriBuilder_GetQuery(builder
, NULL
, NULL
);
9002 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
9004 received
= (void*) 0xdeadbeef;
9005 hr
= IUriBuilder_GetQuery(builder
, NULL
, &received
);
9006 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
9008 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9010 hr
= IUriBuilder_GetQuery(builder
, &len
, NULL
);
9011 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
9013 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
9015 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, NULL
);
9016 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
9018 received
= (void*) 0xdeadbeef;
9019 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, &received
);
9020 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
9022 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9024 hr
= IUriBuilder_GetSchemeName(builder
, &len
, NULL
);
9025 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
9027 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
9029 hr
= IUriBuilder_GetUserName(builder
, NULL
, NULL
);
9030 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
9032 received
= (void*) 0xdeadbeef;
9033 hr
= IUriBuilder_GetUserName(builder
, NULL
, &received
);
9034 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
9036 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
9038 hr
= IUriBuilder_GetUserName(builder
, &len
, NULL
);
9039 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
9041 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
9043 if(builder
) IUriBuilder_Release(builder
);
9046 static void test_IUriBuilder_GetFragment(IUriBuilder
*builder
, const uri_builder_test
*test
,
9050 LPCWSTR received
= NULL
;
9052 const uri_builder_property
*prop
= NULL
;
9054 /* Check if the property was set earlier. */
9055 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9056 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_FRAGMENT
)
9057 prop
= &(test
->properties
[i
]);
9061 /* Use expected_value unless it's NULL, then use value. */
9062 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9063 DWORD expected_len
= expected
? strlen(expected
) : 0;
9064 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9067 ok(hr
== (expected
? S_OK
: S_FALSE
),
9068 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9069 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9073 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9074 expected
, wine_dbgstr_w(received
), test_index
);
9077 ok(expected_len
== len
,
9078 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9079 expected_len
, len
, test_index
);
9083 ok(hr
== (expected
? S_OK
: S_FALSE
),
9084 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9085 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9086 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9087 expected
, wine_dbgstr_w(received
), test_index
);
9088 ok(expected_len
== len
,
9089 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9090 expected_len
, len
, test_index
);
9093 /* The property wasn't set earlier, so it should return whatever
9094 * the base IUri contains (if anything).
9097 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9099 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9100 hr
, S_OK
, test_index
);
9103 received
= (void*) 0xdeadbeef;
9106 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9108 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9109 hr
, S_FALSE
, test_index
);
9111 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9113 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9114 received
, test_index
);
9117 BOOL has_prop
= FALSE
;
9118 BSTR expected
= NULL
;
9120 hr
= IUri_GetFragment(uri
, &expected
);
9122 "Error: Expected IUri_GetFragment to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9124 has_prop
= hr
== S_OK
;
9126 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9129 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9130 hr
, S_OK
, test_index
);
9132 ok(!lstrcmpW(expected
, received
),
9133 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9134 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9135 ok(lstrlenW(expected
) == len
,
9136 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9137 lstrlenW(expected
), len
, test_index
);
9141 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9142 hr
, S_FALSE
, test_index
);
9144 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9145 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9149 SysFreeString(expected
);
9152 if(uri
) IUri_Release(uri
);
9156 static void test_IUriBuilder_GetHost(IUriBuilder
*builder
, const uri_builder_test
*test
,
9160 LPCWSTR received
= NULL
;
9162 const uri_builder_property
*prop
= NULL
;
9164 /* Check if the property was set earlier. */
9165 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9166 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_HOST
)
9167 prop
= &(test
->properties
[i
]);
9171 /* Use expected_value unless it's NULL, then use value. */
9172 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9173 DWORD expected_len
= expected
? strlen(expected
) : 0;
9174 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9177 ok(hr
== (expected
? S_OK
: S_FALSE
),
9178 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9179 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9183 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9184 expected
, wine_dbgstr_w(received
), test_index
);
9187 ok(expected_len
== len
,
9188 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9189 expected_len
, len
, test_index
);
9193 ok(hr
== (expected
? S_OK
: S_FALSE
),
9194 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9195 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9196 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9197 expected
, wine_dbgstr_w(received
), test_index
);
9198 ok(expected_len
== len
,
9199 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9200 expected_len
, len
, test_index
);
9203 /* The property wasn't set earlier, so it should return whatever
9204 * the base IUri contains (if anything).
9207 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9209 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9210 hr
, S_OK
, test_index
);
9213 received
= (void*) 0xdeadbeef;
9216 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9218 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9219 hr
, S_FALSE
, test_index
);
9221 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9223 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9224 received
, test_index
);
9227 BOOL has_prop
= FALSE
;
9228 BSTR expected
= NULL
;
9230 hr
= IUri_GetHost(uri
, &expected
);
9232 "Error: Expected IUri_GetHost to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9234 has_prop
= hr
== S_OK
;
9236 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9239 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9240 hr
, S_OK
, test_index
);
9242 ok(!lstrcmpW(expected
, received
),
9243 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9244 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9245 ok(lstrlenW(expected
) == len
,
9246 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9247 lstrlenW(expected
), len
, test_index
);
9251 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9252 hr
, S_FALSE
, test_index
);
9254 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9255 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9259 SysFreeString(expected
);
9262 if(uri
) IUri_Release(uri
);
9266 static void test_IUriBuilder_GetPassword(IUriBuilder
*builder
, const uri_builder_test
*test
,
9270 LPCWSTR received
= NULL
;
9272 const uri_builder_property
*prop
= NULL
;
9274 /* Check if the property was set earlier. */
9275 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9276 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PASSWORD
)
9277 prop
= &(test
->properties
[i
]);
9281 /* Use expected_value unless it's NULL, then use value. */
9282 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9283 DWORD expected_len
= expected
? strlen(expected
) : 0;
9284 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9287 ok(hr
== (expected
? S_OK
: S_FALSE
),
9288 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9289 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9293 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9294 expected
, wine_dbgstr_w(received
), test_index
);
9297 ok(expected_len
== len
,
9298 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9299 expected_len
, len
, test_index
);
9303 ok(hr
== (expected
? S_OK
: S_FALSE
),
9304 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9305 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9306 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9307 expected
, wine_dbgstr_w(received
), test_index
);
9308 ok(expected_len
== len
,
9309 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9310 expected_len
, len
, test_index
);
9313 /* The property wasn't set earlier, so it should return whatever
9314 * the base IUri contains (if anything).
9317 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9319 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9320 hr
, S_OK
, test_index
);
9323 received
= (void*) 0xdeadbeef;
9326 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9328 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9329 hr
, S_FALSE
, test_index
);
9331 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9333 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9334 received
, test_index
);
9337 BOOL has_prop
= FALSE
;
9338 BSTR expected
= NULL
;
9340 hr
= IUri_GetPassword(uri
, &expected
);
9342 "Error: Expected IUri_GetPassword to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9344 has_prop
= hr
== S_OK
;
9346 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9349 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9350 hr
, S_OK
, test_index
);
9352 ok(!lstrcmpW(expected
, received
),
9353 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9354 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9355 ok(lstrlenW(expected
) == len
,
9356 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9357 lstrlenW(expected
), len
, test_index
);
9361 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9362 hr
, S_FALSE
, test_index
);
9364 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9365 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9369 SysFreeString(expected
);
9372 if(uri
) IUri_Release(uri
);
9376 static void test_IUriBuilder_GetPath(IUriBuilder
*builder
, const uri_builder_test
*test
,
9380 LPCWSTR received
= NULL
;
9382 const uri_builder_property
*prop
= NULL
;
9384 /* Check if the property was set earlier. */
9385 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9386 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PATH
)
9387 prop
= &(test
->properties
[i
]);
9391 /* Use expected_value unless it's NULL, then use value. */
9392 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9393 DWORD expected_len
= expected
? strlen(expected
) : 0;
9394 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9397 ok(hr
== (expected
? S_OK
: S_FALSE
),
9398 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9399 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9403 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9404 expected
, wine_dbgstr_w(received
), test_index
);
9407 ok(expected_len
== len
,
9408 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9409 expected_len
, len
, test_index
);
9413 ok(hr
== (expected
? S_OK
: S_FALSE
),
9414 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9415 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9416 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9417 expected
, wine_dbgstr_w(received
), test_index
);
9418 ok(expected_len
== len
,
9419 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9420 expected_len
, len
, test_index
);
9423 /* The property wasn't set earlier, so it should return whatever
9424 * the base IUri contains (if anything).
9427 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9429 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9430 hr
, S_OK
, test_index
);
9433 received
= (void*) 0xdeadbeef;
9436 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9438 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9439 hr
, S_FALSE
, test_index
);
9441 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9443 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9444 received
, test_index
);
9447 BOOL has_prop
= FALSE
;
9448 BSTR expected
= NULL
;
9450 hr
= IUri_GetPath(uri
, &expected
);
9452 "Error: Expected IUri_GetPath to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9454 has_prop
= hr
== S_OK
;
9456 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9459 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9460 hr
, S_OK
, test_index
);
9462 ok(!lstrcmpW(expected
, received
),
9463 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9464 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9465 ok(lstrlenW(expected
) == len
,
9466 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9467 lstrlenW(expected
), len
, test_index
);
9471 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9472 hr
, S_FALSE
, test_index
);
9474 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9475 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9479 SysFreeString(expected
);
9482 if(uri
) IUri_Release(uri
);
9486 static void test_IUriBuilder_GetPort(IUriBuilder
*builder
, const uri_builder_test
*test
,
9489 BOOL has_port
= FALSE
;
9490 DWORD received
= -1;
9492 if(test
->port_prop
.change
) {
9493 DWORD expected
= test
->port_prop
.value
;
9495 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9496 if(test
->port_prop
.todo
) {
9499 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9500 hr
, S_OK
, test_index
);
9504 ok(has_port
== test
->port_prop
.set
,
9505 "Error: Expected has_port to be %d but was %d instead on uri_builder_tests[%d].\n",
9506 test
->port_prop
.set
, has_port
, test_index
);
9509 ok(received
== expected
,
9510 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
9511 expected
, received
, test_index
);
9516 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9517 hr
, S_OK
, test_index
);
9518 ok(has_port
== test
->port_prop
.set
,
9519 "Error: Expected has_port to be %d, but was %d instead on uri_builder_tests[%d].\n",
9520 test
->port_prop
.set
, has_port
, test_index
);
9521 ok(received
== test
->port_prop
.value
,
9522 "Error: Expected port to be %d, but was %d instead on uri_builder_tests[%d].\n",
9523 test
->port_prop
.value
, received
, test_index
);
9528 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9530 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9531 hr
, S_OK
, test_index
);
9534 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9536 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9537 hr
, S_OK
, test_index
);
9539 ok(has_port
== FALSE
,
9540 "Error: Expected has_port to be FALSE, but was %d instead on uri_builder_tests[%d].\n",
9541 has_port
, test_index
);
9542 ok(!received
, "Error: Expected received to be 0, but was %d instead on uri_builder_tests[%d].\n",
9543 received
, test_index
);
9548 hr
= IUri_GetPort(uri
, &expected
);
9550 "Error: Expected IUri_Port to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9553 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9555 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9556 hr
, S_OK
, test_index
);
9559 "Error: Expected has_port to be FALSE but was TRUE instead on uri_builder_tests[%d].\n",
9561 ok(received
== expected
,
9562 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
9563 expected
, received
, test_index
);
9567 if(uri
) IUri_Release(uri
);
9571 static void test_IUriBuilder_GetQuery(IUriBuilder
*builder
, const uri_builder_test
*test
,
9575 LPCWSTR received
= NULL
;
9577 const uri_builder_property
*prop
= NULL
;
9579 /* Check if the property was set earlier. */
9580 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9581 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_QUERY
)
9582 prop
= &(test
->properties
[i
]);
9586 /* Use expected_value unless it's NULL, then use value. */
9587 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9588 DWORD expected_len
= expected
? strlen(expected
) : 0;
9589 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9592 ok(hr
== (expected
? S_OK
: S_FALSE
),
9593 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9594 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9598 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9599 expected
, wine_dbgstr_w(received
), test_index
);
9602 ok(expected_len
== len
,
9603 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9604 expected_len
, len
, test_index
);
9608 ok(hr
== (expected
? S_OK
: S_FALSE
),
9609 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9610 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9611 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9612 expected
, wine_dbgstr_w(received
), test_index
);
9613 ok(expected_len
== len
,
9614 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9615 expected_len
, len
, test_index
);
9618 /* The property wasn't set earlier, so it should return whatever
9619 * the base IUri contains (if anything).
9622 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9624 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9625 hr
, S_OK
, test_index
);
9628 received
= (void*) 0xdeadbeef;
9631 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9633 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9634 hr
, S_FALSE
, test_index
);
9636 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9638 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9639 received
, test_index
);
9642 BOOL has_prop
= FALSE
;
9643 BSTR expected
= NULL
;
9645 hr
= IUri_GetQuery(uri
, &expected
);
9647 "Error: Expected IUri_GetQuery to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9649 has_prop
= hr
== S_OK
;
9651 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9654 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9655 hr
, S_OK
, test_index
);
9657 ok(!lstrcmpW(expected
, received
),
9658 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9659 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9660 ok(lstrlenW(expected
) == len
,
9661 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9662 lstrlenW(expected
), len
, test_index
);
9666 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9667 hr
, S_FALSE
, test_index
);
9669 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9670 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9674 SysFreeString(expected
);
9677 if(uri
) IUri_Release(uri
);
9681 static void test_IUriBuilder_GetSchemeName(IUriBuilder
*builder
, const uri_builder_test
*test
,
9685 LPCWSTR received
= NULL
;
9687 const uri_builder_property
*prop
= NULL
;
9689 /* Check if the property was set earlier. */
9690 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9691 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_SCHEME_NAME
)
9692 prop
= &(test
->properties
[i
]);
9696 /* Use expected_value unless it's NULL, then use value. */
9697 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9698 DWORD expected_len
= expected
? strlen(expected
) : 0;
9699 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9702 ok(hr
== (expected
? S_OK
: S_FALSE
),
9703 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9704 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9708 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9709 expected
, wine_dbgstr_w(received
), test_index
);
9712 ok(expected_len
== len
,
9713 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9714 expected_len
, len
, test_index
);
9718 ok(hr
== (expected
? S_OK
: S_FALSE
),
9719 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9720 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9721 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9722 expected
, wine_dbgstr_w(received
), test_index
);
9723 ok(expected_len
== len
,
9724 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9725 expected_len
, len
, test_index
);
9728 /* The property wasn't set earlier, so it should return whatever
9729 * the base IUri contains (if anything).
9732 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9734 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9735 hr
, S_OK
, test_index
);
9738 received
= (void*) 0xdeadbeef;
9741 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9743 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9744 hr
, S_FALSE
, test_index
);
9746 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9748 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9749 received
, test_index
);
9752 BOOL has_prop
= FALSE
;
9753 BSTR expected
= NULL
;
9755 hr
= IUri_GetSchemeName(uri
, &expected
);
9757 "Error: Expected IUri_GetSchemeName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9759 has_prop
= hr
== S_OK
;
9761 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9764 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9765 hr
, S_OK
, test_index
);
9767 ok(!lstrcmpW(expected
, received
),
9768 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9769 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9770 ok(lstrlenW(expected
) == len
,
9771 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9772 lstrlenW(expected
), len
, test_index
);
9776 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9777 hr
, S_FALSE
, test_index
);
9779 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9780 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9784 SysFreeString(expected
);
9787 if(uri
) IUri_Release(uri
);
9791 static void test_IUriBuilder_GetUserName(IUriBuilder
*builder
, const uri_builder_test
*test
,
9795 LPCWSTR received
= NULL
;
9797 const uri_builder_property
*prop
= NULL
;
9799 /* Check if the property was set earlier. */
9800 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9801 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_USER_NAME
)
9802 prop
= &(test
->properties
[i
]);
9805 if(prop
&& prop
->value
&& *prop
->value
) {
9806 /* Use expected_value unless it's NULL, then use value. */
9807 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9808 DWORD expected_len
= expected
? strlen(expected
) : 0;
9809 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
9812 ok(hr
== (expected
? S_OK
: S_FALSE
),
9813 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9814 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9818 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9819 expected
, wine_dbgstr_w(received
), test_index
);
9822 ok(expected_len
== len
,
9823 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9824 expected_len
, len
, test_index
);
9828 ok(hr
== (expected
? S_OK
: S_FALSE
),
9829 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9830 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9831 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9832 expected
, wine_dbgstr_w(received
), test_index
);
9833 ok(expected_len
== len
,
9834 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9835 expected_len
, len
, test_index
);
9838 /* The property wasn't set earlier, so it should return whatever
9839 * the base IUri contains (if anything).
9842 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9844 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9845 hr
, S_OK
, test_index
);
9848 received
= (void*) 0xdeadbeef;
9851 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
9853 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9854 hr
, S_FALSE
, test_index
);
9856 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9858 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9859 received
, test_index
);
9862 BSTR expected
= NULL
;
9863 BOOL has_prop
= FALSE
;
9865 hr
= IUri_GetUserName(uri
, &expected
);
9867 "Error: Expected IUri_GetUserName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9869 has_prop
= hr
== S_OK
;
9871 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
9874 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9875 hr
, S_OK
, test_index
);
9877 ok(!lstrcmpW(expected
, received
),
9878 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9879 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9880 ok(lstrlenW(expected
) == len
,
9881 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9882 lstrlenW(expected
), len
, test_index
);
9886 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9887 hr
, S_FALSE
, test_index
);
9889 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9890 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9894 SysFreeString(expected
);
9897 if(uri
) IUri_Release(uri
);
9901 /* Tests IUriBuilder functions. */
9902 static void test_IUriBuilder(void) {
9904 IUriBuilder
*builder
;
9907 for(i
= 0; i
< sizeof(uri_builder_tests
)/sizeof(uri_builder_tests
[0]); ++i
) {
9909 uri_builder_test test
= uri_builder_tests
[i
];
9913 uriW
= a2w(test
.uri
);
9914 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
9915 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9917 if(FAILED(hr
)) continue;
9919 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
9920 if(test
.create_builder_todo
) {
9922 ok(hr
== test
.create_builder_expected
,
9923 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9924 hr
, test
.create_builder_expected
, i
);
9927 ok(hr
== test
.create_builder_expected
,
9928 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9929 hr
, test
.create_builder_expected
, i
);
9933 BOOL modified
= FALSE
, received
= FALSE
;
9935 /* Perform all the string property changes. */
9936 for(j
= 0; j
< URI_BUILDER_STR_PROPERTY_COUNT
; ++j
) {
9937 uri_builder_property prop
= test
.properties
[j
];
9939 change_property(builder
, &prop
, i
);
9940 if(prop
.property
!= Uri_PROPERTY_SCHEME_NAME
&&
9941 prop
.property
!= Uri_PROPERTY_HOST
)
9943 else if(prop
.value
&& *prop
.value
)
9945 else if(prop
.value
&& !*prop
.value
&& prop
.property
== Uri_PROPERTY_HOST
)
9946 /* Host name property can't be NULL, but it can be empty. */
9951 if(test
.port_prop
.change
) {
9952 hr
= IUriBuilder_SetPort(builder
, test
.port_prop
.set
, test
.port_prop
.value
);
9954 if(test
.port_prop
.todo
) {
9956 ok(hr
== test
.port_prop
.expected
,
9957 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9958 hr
, test
.port_prop
.expected
, i
);
9961 ok(hr
== test
.port_prop
.expected
,
9962 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9963 hr
, test
.port_prop
.expected
, i
);
9967 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9969 "Error IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9972 ok(received
== modified
,
9973 "Error: Expected received to be %d but was %d instead on uri_builder_tests[%d].\n",
9974 modified
, received
, i
);
9976 /* Test the "Get*" functions. */
9977 test_IUriBuilder_GetFragment(builder
, &test
, i
);
9978 test_IUriBuilder_GetHost(builder
, &test
, i
);
9979 test_IUriBuilder_GetPassword(builder
, &test
, i
);
9980 test_IUriBuilder_GetPath(builder
, &test
, i
);
9981 test_IUriBuilder_GetPort(builder
, &test
, i
);
9982 test_IUriBuilder_GetQuery(builder
, &test
, i
);
9983 test_IUriBuilder_GetSchemeName(builder
, &test
, i
);
9984 test_IUriBuilder_GetUserName(builder
, &test
, i
);
9986 test_IUriBuilder_CreateUri(builder
, &test
, i
);
9987 test_IUriBuilder_CreateUriSimple(builder
, &test
, i
);
9988 test_IUriBuilder_CreateUriWithFlags(builder
, &test
, i
);
9990 if(builder
) IUriBuilder_Release(builder
);
9991 if(uri
) IUri_Release(uri
);
9996 static void test_IUriBuilder_HasBeenModified(void) {
9998 IUriBuilder
*builder
= NULL
;
10000 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10001 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10002 if(SUCCEEDED(hr
)) {
10003 static const WCHAR hostW
[] = {'g','o','o','g','l','e','.','c','o','m',0};
10007 hr
= IUriBuilder_HasBeenModified(builder
, NULL
);
10008 ok(hr
== E_POINTER
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10011 hr
= IUriBuilder_SetHost(builder
, hostW
);
10012 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n",
10015 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10016 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10019 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10021 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10022 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10023 if(SUCCEEDED(hr
)) {
10027 hr
= IUriBuilder_SetIUri(builder
, uri
);
10028 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n",
10031 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10032 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10035 ok(received
== FALSE
, "Error: Expected received to be FALSE.\n");
10037 /* Test what happens with you call SetIUri with the same IUri again. */
10038 hr
= IUriBuilder_SetHost(builder
, hostW
);
10039 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10041 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10042 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10045 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10047 hr
= IUriBuilder_SetIUri(builder
, uri
);
10048 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10050 /* IUriBuilder already had 'uri' as its IUri property and so Windows doesn't
10051 * reset any of the changes that were made to the IUriBuilder.
10053 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10054 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10056 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10058 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
10059 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10060 if(SUCCEEDED(hr
)) {
10061 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
10062 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
10063 ok(len
== lstrlenW(hostW
), "Error: Expected len to be %d, but was %d instead.\n",
10064 lstrlenW(hostW
), len
);
10067 hr
= IUriBuilder_SetIUri(builder
, NULL
);
10068 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10070 hr
= IUriBuilder_SetHost(builder
, hostW
);
10071 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10072 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10073 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10076 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10078 hr
= IUriBuilder_SetIUri(builder
, NULL
);
10079 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%09x.\n", hr
, S_OK
);
10081 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
10082 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
10085 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
10087 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
10088 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10089 if(SUCCEEDED(hr
)) {
10090 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
10091 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
10092 ok(len
== lstrlenW(hostW
), "Error: Expected len to %d, but was %d instead.\n",
10093 lstrlenW(hostW
), len
);
10096 if(uri
) IUri_Release(uri
);
10098 if(builder
) IUriBuilder_Release(builder
);
10101 /* Test IUriBuilder {Get,Set}IUri functions. */
10102 static void test_IUriBuilder_IUriProperty(void) {
10103 IUriBuilder
*builder
= NULL
;
10106 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10107 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10108 if(SUCCEEDED(hr
)) {
10111 hr
= IUriBuilder_GetIUri(builder
, NULL
);
10112 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x.\n",
10115 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10116 if(SUCCEEDED(hr
)) {
10118 ULONG cur_count
, orig_count
;
10120 /* IUriBuilder doesn't clone the IUri, it use the same IUri. */
10121 orig_count
= get_refcnt(uri
);
10122 hr
= IUriBuilder_SetIUri(builder
, uri
);
10123 cur_count
= get_refcnt(uri
);
10125 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10126 orig_count
+1, cur_count
);
10128 hr
= IUriBuilder_SetIUri(builder
, NULL
);
10129 cur_count
= get_refcnt(uri
);
10131 ok(cur_count
== orig_count
, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10132 orig_count
, cur_count
);
10134 /* CreateUri* functions will return back the same IUri if nothing has changed. */
10135 hr
= IUriBuilder_SetIUri(builder
, uri
);
10136 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10137 orig_count
= get_refcnt(uri
);
10139 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, &test
);
10140 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10141 if(SUCCEEDED(hr
)) {
10142 cur_count
= get_refcnt(uri
);
10143 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10144 orig_count
+1, cur_count
);
10145 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n",
10148 if(test
) IUri_Release(test
);
10151 hr
= IUriBuilder_CreateUri(builder
, -1, 0, 0, &test
);
10152 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10153 if(SUCCEEDED(hr
)) {
10154 cur_count
= get_refcnt(uri
);
10155 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10156 orig_count
+1, cur_count
);
10157 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10159 if(test
) IUri_Release(test
);
10161 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10165 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, &test
);
10166 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10168 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
10170 if(test
) IUri_Release(test
);
10172 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10173 * explicitly set (because it's a default flag).
10176 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_CANONICALIZE
, 0, 0, &test
);
10177 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10178 if(SUCCEEDED(hr
)) {
10179 cur_count
= get_refcnt(uri
);
10180 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10181 orig_count
+1, cur_count
);
10182 ok(test
== uri
, "Error: Expected 'test' to be %p, but was %p instead.\n", uri
, test
);
10184 if(test
) IUri_Release(test
);
10187 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, &test
);
10188 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10189 if(SUCCEEDED(hr
)) {
10190 cur_count
= get_refcnt(uri
);
10191 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10192 orig_count
+1, cur_count
);
10193 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10195 if(test
) IUri_Release(test
);
10198 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &test
);
10199 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
10201 if(SUCCEEDED(hr
)) {
10202 cur_count
= get_refcnt(uri
);
10203 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10204 orig_count
+1, cur_count
);
10205 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10207 if(test
) IUri_Release(test
);
10209 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10213 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, 0, &test
);
10214 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10216 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
10218 if(test
) IUri_Release(test
);
10220 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10221 * explicitly set (because it's a default flag).
10224 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_CANONICALIZE
, 0, 0, 0, &test
);
10225 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10226 if(SUCCEEDED(hr
)) {
10227 cur_count
= get_refcnt(uri
);
10228 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10229 orig_count
+1, cur_count
);
10230 ok(test
== uri
, "Error: Expected 'test' to be %p, but was %p instead.\n", uri
, test
);
10232 if(test
) IUri_Release(test
);
10234 if(uri
) IUri_Release(uri
);
10236 if(builder
) IUriBuilder_Release(builder
);
10239 static void test_IUriBuilder_RemoveProperties(void) {
10240 IUriBuilder
*builder
= NULL
;
10244 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10245 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10246 if(SUCCEEDED(hr
)) {
10247 /* Properties that can't be removed. */
10248 const DWORD invalid
= Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_RAW_URI
|Uri_HAS_HOST_TYPE
|
10249 Uri_HAS_SCHEME
|Uri_HAS_ZONE
;
10251 for(i
= Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_DWORD_LAST
; ++i
) {
10252 hr
= IUriBuilder_RemoveProperties(builder
, i
<< 1);
10253 if((i
<< 1) & invalid
) {
10254 ok(hr
== E_INVALIDARG
,
10255 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
10256 hr
, E_INVALIDARG
, i
);
10259 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
10264 /* Also doesn't accept anything that's outside the range of the
10267 hr
= IUriBuilder_RemoveProperties(builder
, (Uri_PROPERTY_DWORD_LAST
+1) << 1);
10268 ok(hr
== E_INVALIDARG
, "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x.\n",
10271 if(builder
) IUriBuilder_Release(builder
);
10273 for(i
= 0; i
< sizeof(uri_builder_remove_tests
)/sizeof(uri_builder_remove_tests
[0]); ++i
) {
10274 uri_builder_remove_test test
= uri_builder_remove_tests
[i
];
10278 uriW
= a2w(test
.uri
);
10279 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
10280 if(SUCCEEDED(hr
)) {
10283 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10284 if(test
.create_builder_todo
) {
10286 ok(hr
== test
.create_builder_expected
,
10287 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
10288 hr
, test
.create_builder_expected
, i
);
10291 ok(hr
== test
.create_builder_expected
,
10292 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
10293 hr
, test
.create_builder_expected
, i
);
10295 if(SUCCEEDED(hr
)) {
10296 hr
= IUriBuilder_RemoveProperties(builder
, test
.remove_properties
);
10297 if(test
.remove_todo
) {
10299 ok(hr
== test
.remove_expected
,
10300 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x on test %d.\n",
10301 hr
, test
.remove_expected
, i
);
10304 ok(hr
== test
.remove_expected
,
10305 "Error: IUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
10306 hr
, test
.remove_expected
, i
);
10308 if(SUCCEEDED(hr
)) {
10309 IUri
*result
= NULL
;
10311 hr
= IUriBuilder_CreateUri(builder
, test
.expected_flags
, 0, 0, &result
);
10312 if(test
.expected_todo
) {
10314 ok(hr
== test
.expected_hres
,
10315 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
10316 hr
, test
.expected_hres
, i
);
10319 ok(hr
== test
.expected_hres
,
10320 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
10321 hr
, test
.expected_hres
, i
);
10323 if(SUCCEEDED(hr
)) {
10324 BSTR received
= NULL
;
10326 hr
= IUri_GetAbsoluteUri(result
, &received
);
10327 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10328 ok(!strcmp_aw(test
.expected_uri
, received
),
10329 "Error: Expected %s but got %s instead on test %d.\n",
10330 test
.expected_uri
, wine_dbgstr_w(received
), i
);
10331 SysFreeString(received
);
10333 if(result
) IUri_Release(result
);
10336 if(builder
) IUriBuilder_Release(builder
);
10338 if(uri
) IUri_Release(uri
);
10343 static void test_IUriBuilder_Misc(void) {
10347 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10348 if(SUCCEEDED(hr
)) {
10349 IUriBuilder
*builder
;
10351 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10352 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10353 if(SUCCEEDED(hr
)) {
10357 hr
= IUriBuilder_GetPort(builder
, &has
, &port
);
10358 ok(hr
== S_OK
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10359 if(SUCCEEDED(hr
)) {
10360 /* 'has' will be set to FALSE, even though uri had a port. */
10361 ok(has
== FALSE
, "Error: Expected 'has' to be FALSE, was %d instead.\n", has
);
10362 /* Still sets 'port' to 80. */
10363 ok(port
== 80, "Error: Expected the port to be 80, but, was %d instead.\n", port
);
10366 if(builder
) IUriBuilder_Release(builder
);
10368 if(uri
) IUri_Release(uri
);
10371 static void test_IUriBuilderFactory(void) {
10374 IUriBuilderFactory
*factory
;
10375 IUriBuilder
*builder
;
10377 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10378 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10379 if(SUCCEEDED(hr
)) {
10381 hr
= IUri_QueryInterface(uri
, &IID_IUriBuilderFactory
, (void**)&factory
);
10382 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x.\n", hr
);
10383 ok(factory
!= NULL
, "Error: Expected 'factory' to not be NULL.\n");
10385 if(SUCCEEDED(hr
)) {
10386 builder
= (void*) 0xdeadbeef;
10387 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 10, 0, &builder
);
10388 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10390 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10392 builder
= (void*) 0xdeadbeef;
10393 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 10, &builder
);
10394 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10396 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10398 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, NULL
);
10399 ok(hr
== E_POINTER
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10403 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, &builder
);
10404 ok(hr
== S_OK
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10406 if(SUCCEEDED(hr
)) {
10407 IUri
*tmp
= (void*) 0xdeadbeef;
10411 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
10412 ok(hr
== S_OK
, "Error: GetIUri returned 0x%08x, expected 0x%08x.\n",
10414 ok(!tmp
, "Error: Expected 'tmp' to be NULL, but was %p instead.\n", tmp
);
10416 hr
= IUriBuilder_GetHost(builder
, &result_len
, &result
);
10417 ok(hr
== S_FALSE
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n",
10420 if(builder
) IUriBuilder_Release(builder
);
10422 builder
= (void*) 0xdeadbeef;
10423 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 10, 0, &builder
);
10424 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10426 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10428 builder
= (void*) 0xdeadbeef;
10429 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 10, &builder
);
10430 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10432 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10434 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, NULL
);
10435 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10439 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, &builder
);
10440 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10442 if(SUCCEEDED(hr
)) {
10445 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
10446 ok(hr
== S_OK
, "Error: GetIUri return 0x%08x, expected 0x%08x.\n",
10448 ok(tmp
== uri
, "Error: Expected tmp to be %p, but was %p.\n", uri
, tmp
);
10449 if(uri
) IUri_Release(uri
);
10451 if(builder
) IUriBuilder_Release(builder
);
10453 if(factory
) IUriBuilderFactory_Release(factory
);
10455 if(uri
) IUri_Release(uri
);
10458 static void test_CoInternetCombineIUri(void) {
10460 IUri
*base
, *relative
, *result
;
10464 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
10465 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr
);
10466 if(SUCCEEDED(hr
)) {
10467 result
= (void*) 0xdeadbeef;
10468 hr
= pCoInternetCombineIUri(base
, NULL
, 0, &result
, 0);
10469 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10470 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
10474 hr
= pCreateUri(http_urlW
, 0, 0, &relative
);
10475 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr
);
10476 if(SUCCEEDED(hr
)) {
10477 result
= (void*) 0xdeadbeef;
10478 hr
= pCoInternetCombineIUri(NULL
, relative
, 0, &result
, 0);
10479 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10480 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
10483 hr
= pCoInternetCombineIUri(base
, relative
, 0, NULL
, 0);
10484 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10486 if(base
) IUri_Release(base
);
10487 if(relative
) IUri_Release(relative
);
10489 for(i
= 0; i
< sizeof(uri_combine_tests
)/sizeof(uri_combine_tests
[0]); ++i
) {
10490 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
10492 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
10493 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10494 if(SUCCEEDED(hr
)) {
10495 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
10497 hr
= pCreateUri(relativeW
, uri_combine_tests
[i
].relative_create_flags
, 0, &relative
);
10498 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10499 if(SUCCEEDED(hr
)) {
10502 hr
= pCoInternetCombineIUri(base
, relative
, uri_combine_tests
[i
].combine_flags
, &result
, 0);
10503 if(uri_combine_tests
[i
].todo
) {
10505 ok(hr
== uri_combine_tests
[i
].expected
,
10506 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10507 hr
, uri_combine_tests
[i
].expected
, i
);
10510 ok(hr
== uri_combine_tests
[i
].expected
,
10511 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10512 hr
, uri_combine_tests
[i
]. expected
, i
);
10514 if(SUCCEEDED(hr
)) {
10517 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].str_props
)/sizeof(uri_combine_tests
[i
].str_props
[0]); ++j
) {
10518 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
10521 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
10524 ok(hr
== prop
.expected
,
10525 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10526 hr
, prop
.expected
, i
, j
);
10529 ok(!strcmp_aw(prop
.value
, received
) ||
10530 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10531 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10532 prop
.value
, wine_dbgstr_w(received
), i
, j
);
10535 ok(hr
== prop
.expected
,
10536 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10537 hr
, prop
.expected
, i
, j
);
10538 ok(!strcmp_aw(prop
.value
, received
) ||
10539 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10540 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10541 prop
.value
, wine_dbgstr_w(received
), i
, j
);
10543 SysFreeString(received
);
10546 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].dword_props
)/sizeof(uri_combine_tests
[i
].dword_props
[0]); ++j
) {
10547 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
10550 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
10553 ok(hr
== prop
.expected
,
10554 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10555 hr
, prop
.expected
, i
, j
);
10558 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10559 prop
.value
, received
, i
, j
);
10562 ok(hr
== prop
.expected
|| broken(prop
.broken_combine_hres
&& hr
== S_FALSE
),
10563 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10564 hr
, prop
.expected
, i
, j
);
10565 if(!prop
.broken_combine_hres
|| hr
!= S_FALSE
)
10566 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10567 prop
.value
, received
, i
, j
);
10571 if(result
) IUri_Release(result
);
10573 if(relative
) IUri_Release(relative
);
10574 heap_free(relativeW
);
10576 if(base
) IUri_Release(base
);
10581 static HRESULT WINAPI
InternetProtocolInfo_QueryInterface(IInternetProtocolInfo
*iface
,
10582 REFIID riid
, void **ppv
)
10584 ok(0, "unexpected call\n");
10585 return E_NOINTERFACE
;
10588 static ULONG WINAPI
InternetProtocolInfo_AddRef(IInternetProtocolInfo
*iface
)
10593 static ULONG WINAPI
InternetProtocolInfo_Release(IInternetProtocolInfo
*iface
)
10598 static HRESULT WINAPI
InternetProtocolInfo_ParseUrl(IInternetProtocolInfo
*iface
, LPCWSTR pwzUrl
,
10599 PARSEACTION ParseAction
, DWORD dwParseFlags
, LPWSTR pwzResult
, DWORD cchResult
,
10600 DWORD
*pcchResult
, DWORD dwReserved
)
10602 CHECK_EXPECT(ParseUrl
);
10603 ok(!lstrcmpW(pwzUrl
, parse_urlW
), "Error: Expected %s, but got %s instead.\n",
10604 wine_dbgstr_w(parse_urlW
), wine_dbgstr_w(pwzUrl
));
10605 ok(ParseAction
== parse_action
, "Error: Expected %d, but got %d.\n", parse_action
, ParseAction
);
10606 ok(dwParseFlags
== parse_flags
, "Error: Expected 0x%08x, but got 0x%08x.\n", parse_flags
, dwParseFlags
);
10607 ok(cchResult
== 200, "Error: Got %d.\n", cchResult
);
10609 memcpy(pwzResult
, parse_resultW
, sizeof(parse_resultW
));
10610 *pcchResult
= lstrlenW(parse_resultW
);
10615 static HRESULT WINAPI
InternetProtocolInfo_CombineUrl(IInternetProtocolInfo
*iface
,
10616 LPCWSTR pwzBaseUrl
, LPCWSTR pwzRelativeUrl
, DWORD dwCombineFlags
,
10617 LPWSTR pwzResult
, DWORD cchResult
, DWORD
*pcchResult
, DWORD dwReserved
)
10619 CHECK_EXPECT(CombineUrl
);
10620 ok(!lstrcmpW(pwzBaseUrl
, combine_baseW
), "Error: Expected %s, but got %s instead.\n",
10621 wine_dbgstr_w(combine_baseW
), wine_dbgstr_w(pwzBaseUrl
));
10622 ok(!lstrcmpW(pwzRelativeUrl
, combine_relativeW
), "Error: Expected %s, but got %s instead.\n",
10623 wine_dbgstr_w(combine_relativeW
), wine_dbgstr_w(pwzRelativeUrl
));
10624 ok(dwCombineFlags
== (URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
),
10625 "Error: Expected 0, but got 0x%08x.\n", dwCombineFlags
);
10626 ok(cchResult
== INTERNET_MAX_URL_LENGTH
+1, "Error: Got %d.\n", cchResult
);
10628 memcpy(pwzResult
, combine_resultW
, sizeof(combine_resultW
));
10629 *pcchResult
= lstrlenW(combine_resultW
);
10634 static HRESULT WINAPI
InternetProtocolInfo_CompareUrl(IInternetProtocolInfo
*iface
,
10635 LPCWSTR pwzUrl1
, LPCWSTR pwzUrl2
, DWORD dwCompareFlags
)
10637 ok(0, "unexpected call\n");
10641 static HRESULT WINAPI
InternetProtocolInfo_QueryInfo(IInternetProtocolInfo
*iface
,
10642 LPCWSTR pwzUrl
, QUERYOPTION OueryOption
, DWORD dwQueryFlags
, LPVOID pBuffer
,
10643 DWORD cbBuffer
, DWORD
*pcbBuf
, DWORD dwReserved
)
10645 ok(0, "unexpected call\n");
10649 static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
= {
10650 InternetProtocolInfo_QueryInterface
,
10651 InternetProtocolInfo_AddRef
,
10652 InternetProtocolInfo_Release
,
10653 InternetProtocolInfo_ParseUrl
,
10654 InternetProtocolInfo_CombineUrl
,
10655 InternetProtocolInfo_CompareUrl
,
10656 InternetProtocolInfo_QueryInfo
10659 static IInternetProtocolInfo protocol_info
= { &InternetProtocolInfoVtbl
};
10661 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFIID riid
, void **ppv
)
10663 if(IsEqualGUID(&IID_IInternetProtocolInfo
, riid
)) {
10664 *ppv
= &protocol_info
;
10668 ok(0, "unexpected call\n");
10669 return E_NOINTERFACE
;
10672 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
10677 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
10682 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
, IUnknown
*pOuter
,
10683 REFIID riid
, void **ppv
)
10685 ok(0, "unexpected call\n");
10689 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL dolock
)
10691 ok(0, "unexpected call\n");
10695 static const IClassFactoryVtbl ClassFactoryVtbl
= {
10696 ClassFactory_QueryInterface
,
10697 ClassFactory_AddRef
,
10698 ClassFactory_Release
,
10699 ClassFactory_CreateInstance
,
10700 ClassFactory_LockServer
10703 static IClassFactory protocol_cf
= { &ClassFactoryVtbl
};
10705 static void register_protocols(void)
10707 IInternetSession
*session
;
10710 hres
= pCoInternetGetSession(0, &session
, 0);
10711 ok(hres
== S_OK
, "CoInternetGetSession failed: %08x\n", hres
);
10715 hres
= IInternetSession_RegisterNameSpace(session
, &protocol_cf
, &IID_NULL
,
10716 winetestW
, 0, NULL
, 0);
10717 ok(hres
== S_OK
, "RegisterNameSpace failed: %08x\n", hres
);
10719 IInternetSession_Release(session
);
10722 static void unregister_protocols(void) {
10723 IInternetSession
*session
;
10726 hr
= pCoInternetGetSession(0, &session
, 0);
10727 ok(hr
== S_OK
, "CoInternetGetSession failed: 0x%08x\n", hr
);
10731 hr
= IInternetSession_UnregisterNameSpace(session
, &protocol_cf
, winetestW
);
10732 ok(hr
== S_OK
, "UnregisterNameSpace failed: 0x%08x\n", hr
);
10734 IInternetSession_Release(session
);
10737 static void test_CoInternetCombineIUri_Pluggable(void) {
10741 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
10742 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10743 if(SUCCEEDED(hr
)) {
10744 IUri
*relative
= NULL
;
10746 hr
= pCreateUri(combine_relativeW
, Uri_CREATE_ALLOW_RELATIVE
, 0, &relative
);
10747 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10748 if(SUCCEEDED(hr
)) {
10749 IUri
*result
= NULL
;
10751 SET_EXPECT(CombineUrl
);
10753 hr
= pCoInternetCombineIUri(base
, relative
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
10755 ok(hr
== S_OK
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10757 CHECK_CALLED(CombineUrl
);
10759 if(SUCCEEDED(hr
)) {
10760 BSTR received
= NULL
;
10761 hr
= IUri_GetAbsoluteUri(result
, &received
);
10762 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10763 if(SUCCEEDED(hr
)) {
10764 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
10765 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
10767 SysFreeString(received
);
10769 if(result
) IUri_Release(result
);
10771 if(relative
) IUri_Release(relative
);
10773 if(base
) IUri_Release(base
);
10776 static void test_CoInternetCombineUrlEx(void) {
10778 IUri
*base
, *result
;
10782 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
10783 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10784 if(SUCCEEDED(hr
)) {
10785 result
= (void*) 0xdeadbeef;
10786 hr
= pCoInternetCombineUrlEx(base
, NULL
, 0, &result
, 0);
10787 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10789 ok(!result
, "Error: Expected 'result' to be NULL was %p instead.\n", result
);
10792 result
= (void*) 0xdeadbeef;
10793 hr
= pCoInternetCombineUrlEx(NULL
, http_urlW
, 0, &result
, 0);
10794 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10796 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
10798 result
= (void*) 0xdeadbeef;
10799 hr
= pCoInternetCombineUrlEx(NULL
, NULL
, 0, &result
, 0);
10800 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10802 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
10804 hr
= pCoInternetCombineUrlEx(base
, http_urlW
, 0, NULL
, 0);
10805 ok(hr
== E_POINTER
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10807 if(base
) IUri_Release(base
);
10809 for(i
= 0; i
< sizeof(uri_combine_tests
)/sizeof(uri_combine_tests
[0]); ++i
) {
10810 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
10812 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
10813 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10814 if(SUCCEEDED(hr
)) {
10815 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
10817 hr
= pCoInternetCombineUrlEx(base
, relativeW
, uri_combine_tests
[i
].combine_flags
,
10819 if(uri_combine_tests
[i
].todo
) {
10821 ok(hr
== uri_combine_tests
[i
].expected
,
10822 "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10823 hr
, uri_combine_tests
[i
].expected
, i
);
10826 ok(hr
== uri_combine_tests
[i
].expected
,
10827 "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10828 hr
, uri_combine_tests
[i
]. expected
, i
);
10830 if(SUCCEEDED(hr
)) {
10833 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].str_props
)/sizeof(uri_combine_tests
[i
].str_props
[0]); ++j
) {
10834 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
10836 LPCSTR value
= (prop
.value_ex
) ? prop
.value_ex
: prop
.value
;
10838 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
10841 ok(hr
== prop
.expected
,
10842 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10843 hr
, prop
.expected
, i
, j
);
10846 ok(!strcmp_aw(value
, received
) ||
10847 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10848 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10849 value
, wine_dbgstr_w(received
), i
, j
);
10852 ok(hr
== prop
.expected
,
10853 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10854 hr
, prop
.expected
, i
, j
);
10855 ok(!strcmp_aw(value
, received
) ||
10856 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10857 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10858 value
, wine_dbgstr_w(received
), i
, j
);
10860 SysFreeString(received
);
10863 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].dword_props
)/sizeof(uri_combine_tests
[i
].dword_props
[0]); ++j
) {
10864 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
10867 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
10870 ok(hr
== prop
.expected
,
10871 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10872 hr
, prop
.expected
, i
, j
);
10875 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10876 prop
.value
, received
, i
, j
);
10879 ok(hr
== prop
.expected
|| broken(prop
.broken_combine_hres
&& hr
== S_FALSE
),
10880 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10881 hr
, prop
.expected
, i
, j
);
10882 if(!prop
.broken_combine_hres
|| hr
!= S_FALSE
)
10883 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10884 prop
.value
, received
, i
, j
);
10888 if(result
) IUri_Release(result
);
10889 heap_free(relativeW
);
10891 if(base
) IUri_Release(base
);
10896 static void test_CoInternetCombineUrlEx_Pluggable(void) {
10900 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
10901 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10902 if(SUCCEEDED(hr
)) {
10903 IUri
*result
= NULL
;
10905 SET_EXPECT(CombineUrl
);
10907 hr
= pCoInternetCombineUrlEx(base
, combine_relativeW
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
10909 ok(hr
== S_OK
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10911 CHECK_CALLED(CombineUrl
);
10913 if(SUCCEEDED(hr
)) {
10914 BSTR received
= NULL
;
10915 hr
= IUri_GetAbsoluteUri(result
, &received
);
10916 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10917 if(SUCCEEDED(hr
)) {
10918 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
10919 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
10921 SysFreeString(received
);
10923 if(result
) IUri_Release(result
);
10925 if(base
) IUri_Release(base
);
10928 static void test_CoInternetParseIUri_InvalidArgs(void) {
10934 hr
= pCoInternetParseIUri(NULL
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
10935 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10937 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10939 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10940 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10941 if(SUCCEEDED(hr
)) {
10942 DWORD expected_len
;
10945 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, NULL
, 0, &result
, 0);
10946 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10948 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10950 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, NULL
, 0);
10951 ok(hr
== E_POINTER
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10955 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_URL
, 0, tmp
, 3, &result
, 0);
10956 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x expected 0x%08x.\n",
10958 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10961 hr
= pCoInternetParseIUri(uri
, PARSE_MIME
, 0, tmp
, 3, &result
, 0);
10962 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10964 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10967 hr
= pCoInternetParseIUri(uri
, PARSE_SERVER
, 0, tmp
, 3, &result
, 0);
10968 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10970 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10973 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_DOMAIN
, 0, tmp
, 3, &result
, 0);
10974 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10976 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10978 expected_len
= lstrlenW(http_urlW
);
10980 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
10981 ok(hr
== STRSAFE_E_INSUFFICIENT_BUFFER
,
10982 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10983 hr
, STRSAFE_E_INSUFFICIENT_BUFFER
);
10984 ok(result
== expected_len
, "Error: Expected 'result' to be %d, but was %d instead.\n",
10985 expected_len
, result
);
10987 if(uri
) IUri_Release(uri
);
10990 static void test_CoInternetParseIUri(void) {
10993 for(i
= 0; i
< sizeof(uri_parse_tests
)/sizeof(uri_parse_tests
[0]); ++i
) {
10997 uri_parse_test test
= uri_parse_tests
[i
];
10999 uriW
= a2w(test
.uri
);
11000 hr
= pCreateUri(uriW
, test
.uri_flags
, 0, &uri
);
11001 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x on uri_parse_tests[%d].\n", hr
, i
);
11002 if(SUCCEEDED(hr
)) {
11003 WCHAR result
[INTERNET_MAX_URL_LENGTH
+1];
11004 DWORD result_len
= -1;
11006 hr
= pCoInternetParseIUri(uri
, test
.action
, test
.flags
, result
, INTERNET_MAX_URL_LENGTH
+1, &result_len
, 0);
11009 ok(hr
== test
.expected
,
11010 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x on uri_parse_tests[%d].\n",
11011 hr
, test
.expected
, i
);
11014 ok(hr
== test
.expected
,
11015 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x on uri_parse_tests[%d].\n",
11016 hr
, test
.expected
, i
);
11018 if(SUCCEEDED(hr
)) {
11019 DWORD len
= lstrlenA(test
.property
);
11020 ok(!strcmp_aw(test
.property
, result
),
11021 "Error: Expected %s but got %s instead on uri_parse_tests[%d].\n",
11022 test
.property
, wine_dbgstr_w(result
), i
);
11023 ok(len
== result_len
,
11024 "Error: Expected %d, but got %d instead on uri_parse_tests[%d].\n",
11025 len
, result_len
, i
);
11028 "Error: Expected 'result_len' to be 0, but was %d on uri_parse_tests[%d].\n",
11032 if(uri
) IUri_Release(uri
);
11037 static void test_CoInternetParseIUri_Pluggable(void) {
11041 hr
= pCreateUri(parse_urlW
, 0, 0, &uri
);
11042 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, but got 0x%08x.\n", hr
);
11043 if(SUCCEEDED(hr
)) {
11047 SET_EXPECT(ParseUrl
);
11049 parse_action
= PARSE_CANONICALIZE
;
11050 parse_flags
= URL_UNESCAPE
|URL_ESCAPE_UNSAFE
;
11052 hr
= pCoInternetParseIUri(uri
, parse_action
, parse_flags
, result
, 200, &result_len
, 0);
11053 ok(hr
== S_OK
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
11055 CHECK_CALLED(ParseUrl
);
11057 if(SUCCEEDED(hr
)) {
11058 ok(result_len
== lstrlenW(parse_resultW
), "Error: Expected %d, but got %d.\n",
11059 lstrlenW(parse_resultW
), result_len
);
11060 ok(!lstrcmpW(result
, parse_resultW
), "Error: Expected %s, but got %s.\n",
11061 wine_dbgstr_w(parse_resultW
), wine_dbgstr_w(result
));
11064 if(uri
) IUri_Release(uri
);
11070 const char *base_url
;
11071 DWORD base_uri_flags
;
11072 const char *legacy_url
;
11073 const char *uniform_url
;
11074 const char *no_canon_url
;
11075 const char *uri_url
;
11076 } create_urlmon_test_t
;
11078 static const create_urlmon_test_t create_urlmon_tests
[] = {
11080 "http://www.winehq.org",Uri_CREATE_NO_CANONICALIZE
,
11082 "http://www.winehq.org/",
11083 "http://www.winehq.org/",
11084 "http://www.winehq.org",
11085 "http://www.winehq.org"
11088 "file://c:\\dir\\file.txt",Uri_CREATE_NO_CANONICALIZE
,
11090 "file://c:\\dir\\file.txt",
11091 "file:///c:/dir/file.txt",
11092 "file:///c:/dir/file.txt",
11093 "file:///c:/dir/file.txt"
11096 "file://c:\\dir\\file.txt",Uri_CREATE_FILE_USE_DOS_PATH
,
11098 "file://c:\\dir\\file.txt",
11099 "file:///c:/dir/file.txt",
11100 "file:///c:/dir/file.txt",
11101 "file://c:\\dir\\file.txt"
11104 "dat%61",Uri_CREATE_ALLOW_RELATIVE
,
11105 "http://www.winehq.org",0,
11106 "http://www.winehq.org/data",
11107 "http://www.winehq.org/data",
11108 "http://www.winehq.org:80/data",
11111 "file.txt",Uri_CREATE_ALLOW_RELATIVE
,
11112 "file://c:\\dir\\x.txt",Uri_CREATE_NO_CANONICALIZE
,
11113 "file://c:\\dir\\file.txt",
11114 "file:///c:/dir/file.txt",
11115 "file:///c:/dir/file.txt",
11118 "",Uri_CREATE_ALLOW_RELATIVE
,
11126 "test",Uri_CREATE_ALLOW_RELATIVE
,
11134 "c:\\dir\\file.txt",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
11136 "file://c:\\dir\\file.txt",
11137 "file:///c:/dir/file.txt",
11138 "file:///c:/dir/file.txt",
11139 "file:///c:/dir/file.txt",
11143 #define test_urlmon_display_name(a,b) _test_urlmon_display_name(__LINE__,a,b)
11144 static void _test_urlmon_display_name(unsigned line
, IMoniker
*mon
, const char *exurl
)
11146 WCHAR
*display_name
;
11149 hres
= IMoniker_GetDisplayName(mon
, NULL
, NULL
, &display_name
);
11150 ok_(__FILE__
,line
)(hres
== S_OK
, "GetDisplayName failed: %08x\n", hres
);
11151 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_name
), "unexpected display name: %s, expected %s\n",
11152 wine_dbgstr_w(display_name
), exurl
);
11154 CoTaskMemFree(display_name
);
11157 #define test_display_uri(a,b) _test_display_uri(__LINE__,a,b)
11158 static void _test_display_uri(unsigned line
, IMoniker
*mon
, const char *exurl
)
11160 IUriContainer
*uri_container
;
11165 hres
= IMoniker_QueryInterface(mon
, &IID_IUriContainer
, (void**)&uri_container
);
11166 ok(hres
== S_OK
, "Could not get IUriContainer iface: %08x\n", hres
);
11169 hres
= IUriContainer_GetIUri(uri_container
, &uri
);
11170 IUriContainer_Release(uri_container
);
11171 ok(hres
== S_OK
, "GetIUri failed: %08x\n", hres
);
11172 ok(uri
!= NULL
, "uri == NULL\n");
11174 hres
= IUri_GetDisplayUri(uri
, &display_uri
);
11176 ok(hres
== S_OK
, "GetDisplayUri failed: %08x\n", hres
);
11177 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_uri
), "unexpected display uri: %s, expected %s\n",
11178 wine_dbgstr_w(display_uri
), exurl
);
11179 SysFreeString(display_uri
);
11182 static void test_CreateURLMoniker(void)
11184 const create_urlmon_test_t
*test
;
11185 IMoniker
*mon
, *base_mon
;
11186 WCHAR
*url
, *base_url
;
11187 IUri
*uri
, *base_uri
;
11190 for(test
= create_urlmon_tests
; test
< create_urlmon_tests
+ sizeof(create_urlmon_tests
)/sizeof(*create_urlmon_tests
); test
++) {
11191 url
= a2w(test
->url
);
11192 base_url
= a2w(test
->base_url
);
11195 hres
= pCreateUri(base_url
, test
->base_uri_flags
, 0, &base_uri
);
11196 ok(hres
== S_OK
, "CreateUri failed: %08x\n", hres
);
11198 hres
= pCreateURLMonikerEx2(NULL
, base_uri
, &base_mon
, URL_MK_NO_CANONICALIZE
);
11199 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11205 hres
= CreateURLMoniker(base_mon
, url
, &mon
);
11206 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11207 test_urlmon_display_name(mon
, test
->legacy_url
);
11208 test_display_uri(mon
, test
->legacy_url
);
11209 IMoniker_Release(mon
);
11211 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_LEGACY
);
11212 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11213 test_urlmon_display_name(mon
, test
->legacy_url
);
11214 test_display_uri(mon
, test
->legacy_url
);
11215 IMoniker_Release(mon
);
11217 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_UNIFORM
);
11218 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11219 test_urlmon_display_name(mon
, test
->uniform_url
);
11220 test_display_uri(mon
, test
->uniform_url
);
11221 IMoniker_Release(mon
);
11223 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_NO_CANONICALIZE
);
11224 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11225 test_urlmon_display_name(mon
, test
->no_canon_url
);
11226 test_display_uri(mon
, test
->no_canon_url
);
11227 IMoniker_Release(mon
);
11229 hres
= pCreateUri(url
, test
->uri_flags
, 0, &uri
);
11230 ok(hres
== S_OK
, "CreateUri failed: %08x\n", hres
);
11232 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_LEGACY
);
11233 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11234 test_urlmon_display_name(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
11235 test_display_uri(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
11236 IMoniker_Release(mon
);
11238 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_UNIFORM
);
11239 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11240 test_urlmon_display_name(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
11241 test_display_uri(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
11242 IMoniker_Release(mon
);
11244 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_NO_CANONICALIZE
);
11245 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11246 test_urlmon_display_name(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
11247 test_display_uri(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
11248 IMoniker_Release(mon
);
11252 heap_free(base_url
);
11254 IUri_Release(base_uri
);
11256 IMoniker_Release(base_mon
);
11260 static int add_default_flags(DWORD flags
) {
11261 if(!(flags
& Uri_CREATE_NO_CANONICALIZE
))
11262 flags
|= Uri_CREATE_CANONICALIZE
;
11263 if(!(flags
& Uri_CREATE_NO_DECODE_EXTRA_INFO
))
11264 flags
|= Uri_CREATE_DECODE_EXTRA_INFO
;
11265 if(!(flags
& Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
))
11266 flags
|= Uri_CREATE_CRACK_UNKNOWN_SCHEMES
;
11267 if(!(flags
& Uri_CREATE_NO_PRE_PROCESS_HTML_URI
))
11268 flags
|= Uri_CREATE_PRE_PROCESS_HTML_URI
;
11269 if(!(flags
& Uri_CREATE_IE_SETTINGS
))
11270 flags
|= Uri_CREATE_NO_IE_SETTINGS
;
11275 static void test_IPersistStream(void)
11277 int i
, props_order
[Uri_PROPERTY_DWORD_LAST
+1] = { 0 };
11279 props_order
[Uri_PROPERTY_RAW_URI
] = 1;
11280 props_order
[Uri_PROPERTY_FRAGMENT
] = 2;
11281 props_order
[Uri_PROPERTY_HOST
] = 3;
11282 props_order
[Uri_PROPERTY_PASSWORD
] = 4;
11283 props_order
[Uri_PROPERTY_PATH
] = 5;
11284 props_order
[Uri_PROPERTY_PORT
] = 6;
11285 props_order
[Uri_PROPERTY_QUERY
] = 7;
11286 props_order
[Uri_PROPERTY_SCHEME_NAME
] = 8;
11287 props_order
[Uri_PROPERTY_USER_NAME
] = 9;
11289 for(i
=0; i
<sizeof(uri_tests
)/sizeof(*uri_tests
); i
++) {
11290 const uri_properties
*test
= uri_tests
+i
;
11293 IPersistStream
*persist_stream
;
11296 DWORD props
, props_no
, dw_data
[6];
11297 WCHAR str_data
[1024];
11298 ULARGE_INTEGER size
, max_size
;
11299 LARGE_INTEGER no_off
;
11304 if(test
->create_todo
|| test
->create_expected
!=S_OK
)
11307 uriW
= a2w(test
->uri
);
11308 hr
= pCreateUri(uriW
, test
->create_flags
, 0, &uri
);
11309 ok(hr
== S_OK
, "%d) CreateUri failed 0x%08x, expected S_OK..\n", i
, hr
);
11311 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&persist_stream
);
11312 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11314 hr
= CreateStreamOnHGlobal(NULL
, TRUE
, &stream
);
11315 ok(hr
== S_OK
, "CreateStreamOnHGlobal failed 0x%08x.\n", hr
);
11316 hr
= IPersistStream_IsDirty(persist_stream
);
11317 ok(hr
== S_FALSE
, "%d) IsDirty returned 0x%08x, expected S_FALSE.\n", i
, hr
);
11318 hr
= IPersistStream_Save(persist_stream
, stream
, FALSE
);
11319 ok(hr
== S_OK
, "%d) Save failed 0x%08x, expected S_OK.\n", i
, hr
);
11320 hr
= IPersistStream_IsDirty(persist_stream
);
11321 ok(hr
== S_FALSE
, "%d) IsDirty returned 0x%08x, expected S_FALSE.\n", i
, hr
);
11322 no_off
.QuadPart
= 0;
11323 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_CUR
, &size
);
11324 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11325 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11326 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11327 hr
= IPersistStream_GetSizeMax(persist_stream
, &max_size
);
11328 ok(hr
== S_OK
, "%d) GetSizeMax failed 0x%08x, expected S_OK.\n", i
, hr
);
11329 ok(U(size
).LowPart
+2 == U(max_size
).LowPart
,
11330 "%d) Written data size is %d, max_size %d.\n",
11331 i
, U(size
).LowPart
, U(max_size
).LowPart
);
11333 hr
= IStream_Read(stream
, (void*)dw_data
, sizeof(DWORD
), NULL
);
11334 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11335 ok(dw_data
[0]-2 == U(size
).LowPart
, "%d) Structure size is %d, expected %d\n",
11336 i
, dw_data
[0]-2, U(size
).LowPart
);
11337 hr
= IStream_Read(stream
, (void*)dw_data
, 6*sizeof(DWORD
), NULL
);
11338 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11339 ok(dw_data
[0] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[0]);
11340 ok(dw_data
[1] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[1]);
11341 ok(dw_data
[2] == add_default_flags(test
->create_flags
),
11342 "%d) Incorrect value %x, expected %x (creation flags).\n",
11343 i
, dw_data
[2], add_default_flags(test
->create_flags
));
11344 ok(dw_data
[3] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[3]);
11345 ok(dw_data
[4] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[4]);
11346 ok(dw_data
[5] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[5]);
11349 for(props
=0; props
<=Uri_PROPERTY_DWORD_LAST
; props
++) {
11350 if(!props_order
[props
])
11353 if(props
<= Uri_PROPERTY_STRING_LAST
) {
11354 if(test
->str_props
[props
].expected
== S_OK
)
11357 if(test
->dword_props
[props
-Uri_PROPERTY_DWORD_START
].expected
== S_OK
)
11361 if(test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_HTTP
11362 && test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_FTP
11363 && test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_HTTPS
)
11366 hr
= IStream_Read(stream
, (void*)&props
, sizeof(DWORD
), NULL
);
11367 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11368 ok(props
== props_no
, "%d) Properties no is %d, expected %d.\n", i
, props
, props_no
);
11373 hr
= IStream_Read(stream
, (void*)dw_data
, 2*sizeof(DWORD
), NULL
);
11374 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11376 ok(dw_data
[2]<props_order
[dw_data
[0]],
11377 "%d) Incorrect properties order (%d, %d)\n",
11378 i
, dw_data
[0], dw_data
[3]);
11379 dw_data
[2] = props_order
[dw_data
[0]];
11380 dw_data
[3] = dw_data
[0];
11382 if(dw_data
[0]<=Uri_PROPERTY_STRING_LAST
) {
11383 const uri_str_property
*prop
= test
->str_props
+dw_data
[0];
11384 hr
= IStream_Read(stream
, (void*)str_data
, dw_data
[1], NULL
);
11385 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11386 ok(!strcmp_aw(prop
->value
, str_data
) || broken(prop
->broken_value
&& !strcmp_aw(prop
->broken_value
, str_data
)),
11387 "%d) Expected %s but got %s (%d).\n", i
, prop
->value
, wine_dbgstr_w(str_data
), dw_data
[0]);
11388 } else if(dw_data
[0]>=Uri_PROPERTY_DWORD_START
&& dw_data
[0]<=Uri_PROPERTY_DWORD_LAST
) {
11389 const uri_dword_property
*prop
= test
->dword_props
+dw_data
[0]-Uri_PROPERTY_DWORD_START
;
11390 ok(dw_data
[1] == sizeof(DWORD
), "%d) Size of dword property is %d (%d)\n", i
, dw_data
[1], dw_data
[0]);
11391 hr
= IStream_Read(stream
, (void*)&dw_data
[1], sizeof(DWORD
), NULL
);
11392 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11393 ok(prop
->value
== dw_data
[1], "%d) Expected %d but got %d (%d).\n", i
, prop
->value
, dw_data
[1], dw_data
[0]);
11395 ok(FALSE
, "%d) Incorrect property type (%d)\n", i
, dw_data
[0]);
11399 ok(props
== 0, "%d) Not all properties were processed %d. Next property type: %d\n",
11400 i
, props
, dw_data
[0]);
11404 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11405 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11406 hr
= IPersistStream_GetClassID(persist_stream
, &curi
);
11407 ok(hr
== S_OK
, "%d) GetClassID failed 0x%08x, expected S_OK.\n", i
, hr
);
11408 ok(IsEqualCLSID(&curi
, &CLSID_CUri
), "%d) GetClassID returned incorrect CLSID.\n", i
);
11409 IPersistStream_Release(persist_stream
);
11411 hr
= CoCreateInstance(&curi
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11412 &IID_IUri
, (void**)&uri
);
11413 ok(hr
== S_OK
, "%d) Error creating uninitialized Uri: 0x%08x.\n", i
, hr
);
11414 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&persist_stream
);
11415 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11416 hr
= IPersistStream_Load(persist_stream
, stream
);
11417 ok(hr
== S_OK
, "%d) Load failed 0x%08x, expected S_OK.\n", i
, hr
);
11418 hr
= IUri_GetRawUri(uri
, &raw_uri
);
11419 ok(hr
== S_OK
, "%d) GetRawUri failed 0x%08x, expected S_OK.\n", i
, hr
);
11420 ok(!strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].value
, raw_uri
)
11421 || broken(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
11422 && !strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
, raw_uri
)),
11423 "%d) Expected %s but got %s.\n", i
, test
->str_props
[Uri_PROPERTY_RAW_URI
].value
,
11424 wine_dbgstr_w(raw_uri
));
11425 SysFreeString(raw_uri
);
11426 IPersistStream_Release(persist_stream
);
11428 hr
= IUri_QueryInterface(uri
, &IID_IMarshal
, (void**)&marshal
);
11429 ok(hr
== S_OK
, "%d) QueryInterface(IID_IMarshal) failed 0x%08x, expected S_OK.\n", i
, hr
);
11430 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11431 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11432 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11433 MSHCTX_DIFFERENTMACHINE
, NULL
, MSHLFLAGS_NORMAL
);
11434 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11435 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11436 MSHCTX_CROSSCTX
, NULL
, MSHLFLAGS_NORMAL
);
11437 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11438 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11439 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_TABLESTRONG
);
11440 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11441 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11442 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_TABLEWEAK
);
11443 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11444 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11445 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_NOPING
);
11446 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11447 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11448 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_NORMAL
);
11449 ok(hr
== S_OK
, "%d) MarshalInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11450 hr
= IMarshal_GetUnmarshalClass(marshal
, &IID_IUri
, (void*)uri
,
11451 MSHCTX_CROSSCTX
, NULL
, MSHLFLAGS_NORMAL
, &curi
);
11452 ok(hr
== E_INVALIDARG
, "%d) GetUnmarshalClass returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11453 hr
= IMarshal_GetUnmarshalClass(marshal
, &IID_IUri
, (void*)uri
,
11454 MSHCTX_INPROC
, NULL
, MSHLFLAGS_NORMAL
, &curi
);
11455 ok(hr
== S_OK
, "%d) GetUnmarshalClass failed 0x%08x, expected S_OK.\n", i
, hr
);
11456 ok(IsEqualCLSID(&curi
, &CLSID_CUri
), "%d) GetUnmarshalClass returned incorrect CLSID.\n", i
);
11458 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_CUR
, &size
);
11459 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11460 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11461 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11462 hr
= IStream_Read(stream
, (void*)dw_data
, 3*sizeof(DWORD
), NULL
);
11463 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11464 ok(dw_data
[0]-2 == U(size
).LowPart
, "%d) Structure size is %d, expected %d\n",
11465 i
, dw_data
[0]-2, U(size
).LowPart
);
11466 ok(dw_data
[1] == MSHCTX_LOCAL
, "%d) Incorrect value %d, expected MSHCTX_LOCAL.\n",
11468 ok(dw_data
[2] == dw_data
[0]-8, "%d) Incorrect value %d, expected %d (PersistStream size).\n",
11469 i
, dw_data
[2], dw_data
[0]-8);
11470 if(!test
->str_props
[Uri_PROPERTY_PATH
].value
[0] &&
11471 (test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_HTTP
11472 || test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_FTP
11473 || test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_HTTPS
))
11474 U(max_size
).LowPart
+= 3*sizeof(DWORD
);
11475 ok(dw_data
[2] == U(max_size
).LowPart
, "%d) Incorrect value %d, expected %d (PersistStream size).\n",
11476 i
, dw_data
[2], U(max_size
).LowPart
);
11477 IMarshal_Release(marshal
);
11480 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11481 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11482 hr
= CoCreateInstance(&curi
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11483 &IID_IUri
, (void**)&uri
);
11484 ok(hr
== S_OK
, "%d) Error creating uninitialized Uri: 0x%08x.\n", i
, hr
);
11485 hr
= IUri_QueryInterface(uri
, &IID_IMarshal
, (void**)&marshal
);
11486 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11487 hr
= IMarshal_UnmarshalInterface(marshal
, stream
, &IID_IUri
, (void**)&uri
);
11488 ok(hr
== S_OK
, "%d) UnmarshalInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11489 hr
= IUri_GetRawUri(uri
, &raw_uri
);
11490 ok(hr
== S_OK
, "%d) GetRawUri failed 0x%08x, expected S_OK.\n", i
, hr
);
11491 ok(!strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].value
, raw_uri
)
11492 || broken(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
11493 && !strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
, raw_uri
)),
11494 "%d) Expected %s but got %s.\n", i
, test
->str_props
[Uri_PROPERTY_RAW_URI
].value
,
11495 wine_dbgstr_w(raw_uri
));
11496 SysFreeString(raw_uri
);
11498 IMarshal_Release(marshal
);
11499 IStream_Release(stream
);
11505 static void test_UninitializedUri(void)
11508 IUriBuilderFactory
*ubf
;
11509 IPersistStream
*ps
;
11517 hr
= CoCreateInstance(&CLSID_CUri
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11518 &IID_IUri
, (void**)&uri
);
11520 win_skip("Skipping uninitialized Uri tests.\n");
11524 hr
= IUri_QueryInterface(uri
, &IID_IUriBuilderFactory
, (void**)&ubf
);
11525 ok(hr
== S_OK
, "QueryInterface(IID_IUriBuillderFactory) failed: %x.\n", hr
);
11526 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&ps
);
11527 ok(hr
== S_OK
, "QueryInterface(IID_IPersistStream) failed: %x.\n", hr
);
11529 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
11530 ok(hr
== E_UNEXPECTED
, "GetAbsoluteUri returned %x, expected E_UNEXPECTED.\n", hr
);
11531 hr
= IUri_GetAbsoluteUri(uri
, &bstr
);
11532 ok(hr
== E_UNEXPECTED
, "GetAbsoluteUri returned %x, expected E_UNEXPECTED.\n", hr
);
11533 hr
= IUri_GetAuthority(uri
, &bstr
);
11534 ok(hr
== E_UNEXPECTED
, "GetAuthority returned %x, expected E_UNEXPECTED.\n", hr
);
11535 hr
= IUri_GetDisplayUri(uri
, &bstr
);
11536 ok(hr
== E_UNEXPECTED
, "GetDisplayUri returned %x, expected E_UNEXPECTED.\n", hr
);
11537 hr
= IUri_GetDomain(uri
, &bstr
);
11538 ok(hr
== E_UNEXPECTED
, "GetDomain returned %x, expected E_UNEXPECTED.\n", hr
);
11539 hr
= IUri_GetExtension(uri
, &bstr
);
11540 ok(hr
== E_UNEXPECTED
, "GetExtension returned %x, expected E_UNEXPECTED.\n", hr
);
11541 hr
= IUri_GetFragment(uri
, &bstr
);
11542 ok(hr
== E_UNEXPECTED
, "GetFragment returned %x, expected E_UNEXPECTED.\n", hr
);
11543 hr
= IUri_GetHost(uri
, &bstr
);
11544 ok(hr
== E_UNEXPECTED
, "GetHost returned %x, expected E_UNEXPECTED.\n", hr
);
11545 hr
= IUri_GetHostType(uri
, &dword
);
11546 ok(hr
== E_UNEXPECTED
, "GetHostType returned %x, expected E_UNEXPECTED.\n", hr
);
11547 hr
= IUri_GetPassword(uri
, &bstr
);
11548 ok(hr
== E_UNEXPECTED
, "GetPassword returned %x, expected E_UNEXPECTED.\n", hr
);
11549 hr
= IUri_GetPassword(uri
, &bstr
);
11550 ok(hr
== E_UNEXPECTED
, "GetPassword returned %x, expected E_UNEXPECTED.\n", hr
);
11551 hr
= IUri_GetPathAndQuery(uri
, &bstr
);
11552 ok(hr
== E_UNEXPECTED
, "GetPathAndQuery returned %x, expected E_UNEXPECTED.\n", hr
);
11553 hr
= IUri_GetPort(uri
, &dword
);
11554 ok(hr
== E_UNEXPECTED
, "GetPort returned %x, expected E_UNEXPECTED.\n", hr
);
11555 hr
= IUri_GetProperties(uri
, &dword
);
11556 ok(hr
== E_UNEXPECTED
, "GetProperties returned %x, expected E_UNEXPECTED.\n", hr
);
11557 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, &bstr
, 0);
11558 ok(hr
== E_UNEXPECTED
, "GetPropertyBSTR returned %x, expected E_UNEXPECTED.\n", hr
);
11559 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_PORT
, &dword
, 0);
11560 ok(hr
== E_UNEXPECTED
, "GetPropertyDWORD returned %x, expected E_UNEXPECTED.\n", hr
);
11561 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_RAW_URI
, &dword
, 0);
11562 ok(hr
== E_UNEXPECTED
, "GetPropertyLength returned %x, expected E_UNEXPECTED.\n", hr
);
11563 hr
= IUri_GetQuery(uri
, &bstr
);
11564 ok(hr
== E_UNEXPECTED
, "GetQuery returned %x, expected E_UNEXPECTED.\n", hr
);
11565 hr
= IUri_GetRawUri(uri
, &bstr
);
11566 ok(hr
== E_UNEXPECTED
, "GetRawUri returned %x, expected E_UNEXPECTED.\n", hr
);
11567 hr
= IUri_GetScheme(uri
, &dword
);
11568 ok(hr
== E_UNEXPECTED
, "GetScheme returned %x, expected E_UNEXPECTED.\n", hr
);
11569 hr
= IUri_GetSchemeName(uri
, &bstr
);
11570 ok(hr
== E_UNEXPECTED
, "GetSchemeName returned %x, expected E_UNEXPECTED.\n", hr
);
11571 hr
= IUri_GetUserInfo(uri
, &bstr
);
11572 ok(hr
== E_UNEXPECTED
, "GetUserInfo returned %x, expected E_UNEXPECTED.\n", hr
);
11573 hr
= IUri_GetUserName(uri
, &bstr
);
11574 ok(hr
== E_UNEXPECTED
, "GetUserName returned %x, expected E_UNEXPECTED.\n", hr
);
11575 hr
= IUri_GetZone(uri
, &dword
);
11576 ok(hr
== E_UNEXPECTED
, "GetZone returned %x, expected E_UNEXPECTED.\n", hr
);
11577 hr
= IUri_IsEqual(uri
, uri
, &eq
);
11578 ok(hr
== E_UNEXPECTED
, "IsEqual returned %x, expected E_UNEXPECTED.\n", hr
);
11580 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(ubf
, 0, 0, &ub
);
11581 ok(hr
== E_UNEXPECTED
, "CreateInitializedIUriBuilder returned %x, expected E_UNEXPECTED.\n", hr
);
11582 hr
= IUriBuilderFactory_CreateIUriBuilder(ubf
, 0, 0, &ub
);
11583 ok(hr
== S_OK
, "CreateIUriBuilder returned %x, expected S_OK.\n", hr
);
11584 IUriBuilder_Release(ub
);
11586 hr
= IPersistStream_GetSizeMax(ps
, &ui
);
11587 ok(hr
== S_OK
, "GetSizeMax returned %x, expected S_OK.\n", hr
);
11588 ok(ui
.u
.LowPart
== 34, "ui.LowPart = %d, expected 34.\n", ui
.u
.LowPart
);
11589 hr
= IPersistStream_IsDirty(ps
);
11590 ok(hr
== S_FALSE
, "IsDirty returned %x, expected S_FALSE.\n", hr
);
11592 IPersistStream_Release(ps
);
11593 IUriBuilderFactory_Release(ubf
);
11600 hurlmon
= GetModuleHandleA("urlmon.dll");
11601 pCoInternetGetSession
= (void*) GetProcAddress(hurlmon
, "CoInternetGetSession");
11602 pCreateUri
= (void*) GetProcAddress(hurlmon
, "CreateUri");
11603 pCreateUriWithFragment
= (void*) GetProcAddress(hurlmon
, "CreateUriWithFragment");
11604 pCreateIUriBuilder
= (void*) GetProcAddress(hurlmon
, "CreateIUriBuilder");
11605 pCoInternetCombineIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineIUri");
11606 pCoInternetCombineUrlEx
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineUrlEx");
11607 pCoInternetParseIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetParseIUri");
11608 pCreateURLMonikerEx
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx");
11609 pCreateURLMonikerEx2
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx2");
11612 win_skip("CreateUri is not present, skipping tests.\n");
11616 trace("test CreateUri invalid flags...\n");
11617 test_CreateUri_InvalidFlags();
11619 trace("test CreateUri invalid args...\n");
11620 test_CreateUri_InvalidArgs();
11622 trace("test CreateUri invalid URIs...\n");
11623 test_CreateUri_InvalidUri();
11625 trace("test IUri_GetPropertyBSTR...\n");
11626 test_IUri_GetPropertyBSTR();
11628 trace("test IUri_GetPropertyDWORD...\n");
11629 test_IUri_GetPropertyDWORD();
11631 trace("test IUri_GetStrProperties...\n");
11632 test_IUri_GetStrProperties();
11634 trace("test IUri_GetDwordProperties...\n");
11635 test_IUri_GetDwordProperties();
11637 trace("test IUri_GetPropertyLength...\n");
11638 test_IUri_GetPropertyLength();
11640 trace("test IUri_GetProperties...\n");
11641 test_IUri_GetProperties();
11643 trace("test IUri_HasProperty...\n");
11644 test_IUri_HasProperty();
11646 trace("test IUri_IsEqual...\n");
11647 test_IUri_IsEqual();
11649 trace("test CreateUriWithFragment invalid args...\n");
11650 test_CreateUriWithFragment_InvalidArgs();
11652 trace("test CreateUriWithFragment invalid flags...\n");
11653 test_CreateUriWithFragment_InvalidFlags();
11655 trace("test CreateUriWithFragment...\n");
11656 test_CreateUriWithFragment();
11658 trace("test CreateIUriBuilder...\n");
11659 test_CreateIUriBuilder();
11661 trace("test IUriBuilder_CreateInvalidArgs...\n");
11662 test_IUriBuilder_CreateInvalidArgs();
11664 trace("test IUriBuilder...\n");
11665 test_IUriBuilder();
11667 trace("test IUriBuilder_GetInvalidArgs...\n");
11668 test_IUriBuilder_GetInvalidArgs();
11670 trace("test IUriBuilder_HasBeenModified...\n");
11671 test_IUriBuilder_HasBeenModified();
11673 trace("test IUriBuilder_IUriProperty...\n");
11674 test_IUriBuilder_IUriProperty();
11676 trace("test IUriBuilder_RemoveProperties...\n");
11677 test_IUriBuilder_RemoveProperties();
11679 trace("test IUriBuilder miscellaneous...\n");
11680 test_IUriBuilder_Misc();
11682 trace("test IUriBuilderFactory...\n");
11683 test_IUriBuilderFactory();
11685 trace("test CoInternetCombineIUri...\n");
11686 test_CoInternetCombineIUri();
11688 trace("test CoInternetCombineUrlEx...\n");
11689 test_CoInternetCombineUrlEx();
11691 trace("test CoInternetParseIUri Invalid Args...\n");
11692 test_CoInternetParseIUri_InvalidArgs();
11694 trace("test CoInternetParseIUri...\n");
11695 test_CoInternetParseIUri();
11697 register_protocols();
11699 trace("test CoInternetCombineIUri pluggable...\n");
11700 test_CoInternetCombineIUri_Pluggable();
11702 trace("test CoInternetCombineUrlEx Pluggable...\n");
11703 test_CoInternetCombineUrlEx_Pluggable();
11705 trace("test CoInternetParseIUri pluggable...\n");
11706 test_CoInternetParseIUri_Pluggable();
11708 trace("test CreateURLMoniker...\n");
11709 test_CreateURLMoniker();
11711 CoInitialize(NULL
);
11713 trace("test IPersistStream...\n");
11714 test_IPersistStream();
11716 trace("test uninitialized Uri...\n");
11717 test_UninitializedUri();
11720 unregister_protocols();