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 #define WIN32_NO_STATUS
23 #define COM_NO_WINDOWS_H
25 #include <wine/test.h>
31 #define WIN32_LEAN_AND_MEAN
34 //#include "winbase.h"
44 DEFINE_GUID(CLSID_CUri
, 0xDF2FCE13, 0x25EC, 0x45BB, 0x9D,0x4C, 0xCE,0xCD,0x47,0xC2,0x43,0x0C);
46 #define URI_STR_PROPERTY_COUNT Uri_PROPERTY_STRING_LAST+1
47 #define URI_DWORD_PROPERTY_COUNT (Uri_PROPERTY_DWORD_LAST - Uri_PROPERTY_DWORD_START)+1
48 #define URI_BUILDER_STR_PROPERTY_COUNT 7
50 #define DEFINE_EXPECT(func) \
51 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
53 #define SET_EXPECT(func) \
54 expect_ ## func = TRUE
56 #define CHECK_EXPECT(func) \
58 ok(expect_ ##func, "unexpected call " #func "\n"); \
59 expect_ ## func = FALSE; \
60 called_ ## func = TRUE; \
63 #define CHECK_EXPECT2(func) \
65 ok(expect_ ##func, "unexpected call " #func "\n"); \
66 called_ ## func = TRUE; \
69 #define CHECK_CALLED(func) \
71 ok(called_ ## func, "expected " #func "\n"); \
72 expect_ ## func = called_ ## func = FALSE; \
75 DEFINE_EXPECT(CombineUrl
);
76 DEFINE_EXPECT(ParseUrl
);
78 static HRESULT (WINAPI
*pCreateUri
)(LPCWSTR
, DWORD
, DWORD_PTR
, IUri
**);
79 static HRESULT (WINAPI
*pCreateUriWithFragment
)(LPCWSTR
, LPCWSTR
, DWORD
, DWORD_PTR
, IUri
**);
80 static HRESULT (WINAPI
*pCreateIUriBuilder
)(IUri
*, DWORD
, DWORD_PTR
, IUriBuilder
**);
81 static HRESULT (WINAPI
*pCoInternetCombineIUri
)(IUri
*,IUri
*,DWORD
,IUri
**,DWORD_PTR
);
82 static HRESULT (WINAPI
*pCoInternetGetSession
)(DWORD
,IInternetSession
**,DWORD
);
83 static HRESULT (WINAPI
*pCoInternetCombineUrlEx
)(IUri
*,LPCWSTR
,DWORD
,IUri
**,DWORD_PTR
);
84 static HRESULT (WINAPI
*pCoInternetParseIUri
)(IUri
*,PARSEACTION
,DWORD
,LPWSTR
,DWORD
,DWORD
*,DWORD_PTR
);
85 static HRESULT (WINAPI
*pCreateURLMonikerEx
)(IMoniker
*,LPCWSTR
,IMoniker
**,DWORD
);
86 static HRESULT (WINAPI
*pCreateURLMonikerEx2
)(IMoniker
*,IUri
*,IMoniker
**,DWORD
);
88 static const WCHAR http_urlW
[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
89 '.','o','r','g','/',0};
90 static const WCHAR http_url_fragW
[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
91 '.','o','r','g','/','#','F','r','a','g',0};
93 static const WCHAR combine_baseW
[] = {'w','i','n','e','t','e','s','t',':','?','t',
94 'e','s','t','i','n','g',0};
95 static const WCHAR combine_relativeW
[] = {'?','t','e','s','t',0};
96 static const WCHAR combine_resultW
[] = {'z','i','p',':','t','e','s','t',0};
98 static const WCHAR winetestW
[] = {'w','i','n','e','t','e','s','t',0};
100 static const WCHAR parse_urlW
[] = {'w','i','n','e','t','e','s','t',':','t','e','s','t',0};
101 static const WCHAR parse_resultW
[] = {'z','i','p',':','t','e','s','t',0};
103 static PARSEACTION parse_action
;
104 static DWORD parse_flags
;
106 typedef struct _uri_create_flag_test
{
109 } uri_create_flag_test
;
111 static const uri_create_flag_test invalid_flag_tests
[] = {
112 /* Set of invalid flag combinations to test for. */
113 {Uri_CREATE_DECODE_EXTRA_INFO
| Uri_CREATE_NO_DECODE_EXTRA_INFO
, E_INVALIDARG
},
114 {Uri_CREATE_CANONICALIZE
| Uri_CREATE_NO_CANONICALIZE
, E_INVALIDARG
},
115 {Uri_CREATE_CRACK_UNKNOWN_SCHEMES
| Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
, E_INVALIDARG
},
116 {Uri_CREATE_PRE_PROCESS_HTML_URI
| Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, E_INVALIDARG
},
117 {Uri_CREATE_IE_SETTINGS
| Uri_CREATE_NO_IE_SETTINGS
, E_INVALIDARG
}
120 typedef struct _uri_str_property
{
124 const char* broken_value
;
127 typedef struct _uri_dword_property
{
131 BOOL broken_combine_hres
;
132 } uri_dword_property
;
134 typedef struct _uri_properties
{
137 HRESULT create_expected
;
140 uri_str_property str_props
[URI_STR_PROPERTY_COUNT
];
141 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
144 static const uri_properties uri_tests
[] = {
145 { "http://www.winehq.org/tests/../tests/../..", 0, S_OK
, FALSE
,
147 {"http://www.winehq.org/",S_OK
,FALSE
}, /* ABSOLUTE_URI */
148 {"www.winehq.org",S_OK
,FALSE
}, /* AUTHORITY */
149 {"http://www.winehq.org/",S_OK
,FALSE
}, /* DISPLAY_URI */
150 {"winehq.org",S_OK
,FALSE
}, /* DOMAIN */
151 {"",S_FALSE
,FALSE
}, /* EXTENSION */
152 {"",S_FALSE
,FALSE
}, /* FRAGMENT */
153 {"www.winehq.org",S_OK
,FALSE
}, /* HOST */
154 {"",S_FALSE
,FALSE
}, /* PASSWORD */
155 {"/",S_OK
,FALSE
}, /* PATH */
156 {"/",S_OK
,FALSE
}, /* PATH_AND_QUERY */
157 {"",S_FALSE
,FALSE
}, /* QUERY */
158 {"http://www.winehq.org/tests/../tests/../..",S_OK
,FALSE
}, /* RAW_URI */
159 {"http",S_OK
,FALSE
}, /* SCHEME_NAME */
160 {"",S_FALSE
,FALSE
}, /* USER_INFO */
161 {"",S_FALSE
,FALSE
} /* USER_NAME */
164 {Uri_HOST_DNS
,S_OK
,FALSE
}, /* HOST_TYPE */
165 {80,S_OK
,FALSE
}, /* PORT */
166 {URL_SCHEME_HTTP
,S_OK
,FALSE
}, /* SCHEME */
167 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
} /* ZONE */
170 { "http://winehq.org/tests/.././tests", 0, S_OK
, FALSE
,
172 {"http://winehq.org/tests",S_OK
,FALSE
},
173 {"winehq.org",S_OK
,FALSE
},
174 {"http://winehq.org/tests",S_OK
,FALSE
},
175 {"winehq.org",S_OK
,FALSE
},
178 {"winehq.org",S_OK
,FALSE
},
180 {"/tests",S_OK
,FALSE
},
181 {"/tests",S_OK
,FALSE
},
183 {"http://winehq.org/tests/.././tests",S_OK
,FALSE
},
189 {Uri_HOST_DNS
,S_OK
,FALSE
},
191 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
192 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
195 { "HtTp://www.winehq.org/tests/..?query=x&return=y", 0, S_OK
, FALSE
,
197 {"http://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
198 {"www.winehq.org",S_OK
,FALSE
},
199 {"http://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
200 {"winehq.org",S_OK
,FALSE
},
203 {"www.winehq.org",S_OK
,FALSE
},
206 {"/?query=x&return=y",S_OK
,FALSE
},
207 {"?query=x&return=y",S_OK
,FALSE
},
208 {"HtTp://www.winehq.org/tests/..?query=x&return=y",S_OK
,FALSE
},
214 {Uri_HOST_DNS
,S_OK
,FALSE
},
216 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
217 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
220 { "HtTpS://www.winehq.org/tests/..?query=x&return=y", 0, S_OK
, FALSE
,
222 {"https://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
223 {"www.winehq.org",S_OK
,FALSE
},
224 {"https://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
225 {"winehq.org",S_OK
,FALSE
},
228 {"www.winehq.org",S_OK
,FALSE
},
231 {"/?query=x&return=y",S_OK
,FALSE
},
232 {"?query=x&return=y",S_OK
,FALSE
},
233 {"HtTpS://www.winehq.org/tests/..?query=x&return=y",S_OK
,FALSE
},
234 {"https",S_OK
,FALSE
},
239 {Uri_HOST_DNS
,S_OK
,FALSE
},
241 {URL_SCHEME_HTTPS
,S_OK
,FALSE
},
242 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
245 { "hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters", 0, S_OK
, FALSE
,
247 {"http://usEr%3Ainfo@example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
248 {"usEr%3Ainfo@example.com",S_OK
,FALSE
},
249 {"http://example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
250 {"example.com",S_OK
,FALSE
},
253 {"example.com",S_OK
,FALSE
},
255 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
256 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
258 {"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters",S_OK
,FALSE
},
260 {"usEr%3Ainfo",S_OK
,FALSE
},
261 {"usEr%3Ainfo",S_OK
,FALSE
}
264 {Uri_HOST_DNS
,S_OK
,FALSE
},
266 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
267 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
270 { "ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt", 0, S_OK
, FALSE
,
272 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK
,FALSE
},
273 {"winepass:wine@ftp.winehq.org:9999",S_OK
,FALSE
},
274 {"ftp://ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK
,FALSE
},
275 {"winehq.org",S_OK
,FALSE
},
278 {"ftp.winehq.org",S_OK
,FALSE
},
280 {"/dir/foo%20bar.txt",S_OK
,FALSE
},
281 {"/dir/foo%20bar.txt",S_OK
,FALSE
},
283 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt",S_OK
,FALSE
},
285 {"winepass:wine",S_OK
,FALSE
},
286 {"winepass",S_OK
,FALSE
}
289 {Uri_HOST_DNS
,S_OK
,FALSE
},
291 {URL_SCHEME_FTP
,S_OK
,FALSE
},
292 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
295 { "file://c:\\tests\\../tests/foo%20bar.mp3", 0, S_OK
, FALSE
,
297 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
299 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
305 {"/c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
306 {"/c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
308 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK
,FALSE
},
314 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
316 {URL_SCHEME_FILE
,S_OK
,FALSE
},
317 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
320 { "file://c:\\tests\\../tests/foo%20bar.mp3", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
322 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
324 {"file:///c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
330 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
331 {"/c:/tests/../tests/foo%2520bar.mp3",S_OK
,FALSE
},
333 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK
,FALSE
},
339 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
341 {URL_SCHEME_FILE
,S_OK
,FALSE
},
342 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
345 { "FILE://localhost/test dir\\../tests/test%20file.README.txt", 0, S_OK
, FALSE
,
347 {"file:///tests/test%20file.README.txt",S_OK
,FALSE
},
349 {"file:///tests/test%20file.README.txt",S_OK
,FALSE
},
355 {"/tests/test%20file.README.txt",S_OK
,FALSE
},
356 {"/tests/test%20file.README.txt",S_OK
,FALSE
},
358 {"FILE://localhost/test dir\\../tests/test%20file.README.txt",S_OK
,FALSE
},
364 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
366 {URL_SCHEME_FILE
,S_OK
,FALSE
},
367 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
370 { "file:///z:/test dir/README.txt", 0, S_OK
, FALSE
,
372 {"file:///z:/test%20dir/README.txt",S_OK
},
374 {"file:///z:/test%20dir/README.txt",S_OK
},
380 {"/z:/test%20dir/README.txt",S_OK
},
381 {"/z:/test%20dir/README.txt",S_OK
},
383 {"file:///z:/test dir/README.txt",S_OK
},
389 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
391 {URL_SCHEME_FILE
,S_OK
,FALSE
},
392 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
395 { "urn:nothing:should:happen here", 0, S_OK
, FALSE
,
397 {"urn:nothing:should:happen here",S_OK
,FALSE
},
399 {"urn:nothing:should:happen here",S_OK
,FALSE
},
405 {"nothing:should:happen here",S_OK
,FALSE
},
406 {"nothing:should:happen here",S_OK
,FALSE
},
408 {"urn:nothing:should:happen here",S_OK
,FALSE
},
414 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
416 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
417 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
420 { "http://127.0.0.1/tests/../test dir/./test.txt", 0, S_OK
, FALSE
,
422 {"http://127.0.0.1/test%20dir/test.txt",S_OK
,FALSE
},
423 {"127.0.0.1",S_OK
,FALSE
},
424 {"http://127.0.0.1/test%20dir/test.txt",S_OK
,FALSE
},
428 {"127.0.0.1",S_OK
,FALSE
},
430 {"/test%20dir/test.txt",S_OK
,FALSE
},
431 {"/test%20dir/test.txt",S_OK
,FALSE
},
433 {"http://127.0.0.1/tests/../test dir/./test.txt",S_OK
,FALSE
},
439 {Uri_HOST_IPV4
,S_OK
,FALSE
},
441 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
442 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
445 { "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", 0, S_OK
, FALSE
,
447 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK
,FALSE
},
448 {"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]",S_OK
,FALSE
},
449 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK
,FALSE
},
453 {"fedc:ba98:7654:3210:fedc:ba98:7654:3210",S_OK
,FALSE
},
458 {"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]",S_OK
,FALSE
},
464 {Uri_HOST_IPV6
,S_OK
,FALSE
},
466 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
467 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
470 { "ftp://[::13.1.68.3]", 0, S_OK
, FALSE
,
472 {"ftp://[::13.1.68.3]/",S_OK
,FALSE
},
473 {"[::13.1.68.3]",S_OK
,FALSE
},
474 {"ftp://[::13.1.68.3]/",S_OK
,FALSE
},
478 {"::13.1.68.3",S_OK
,FALSE
},
483 {"ftp://[::13.1.68.3]",S_OK
,FALSE
},
489 {Uri_HOST_IPV6
,S_OK
,FALSE
},
491 {URL_SCHEME_FTP
,S_OK
,FALSE
},
492 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
495 { "http://[FEDC:BA98:0:0:0:0:0:3210]", 0, S_OK
, FALSE
,
497 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
498 {"[fedc:ba98::3210]",S_OK
,FALSE
},
499 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
503 {"fedc:ba98::3210",S_OK
,FALSE
},
508 {"http://[FEDC:BA98:0:0:0:0:0:3210]",S_OK
,FALSE
},
514 {Uri_HOST_IPV6
,S_OK
,FALSE
},
516 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
517 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
520 { "1234://www.winehq.org", 0, S_OK
, FALSE
,
522 {"1234://www.winehq.org/",S_OK
,FALSE
},
523 {"www.winehq.org",S_OK
,FALSE
},
524 {"1234://www.winehq.org/",S_OK
,FALSE
},
525 {"winehq.org",S_OK
,FALSE
},
528 {"www.winehq.org",S_OK
,FALSE
},
533 {"1234://www.winehq.org",S_OK
,FALSE
},
539 {Uri_HOST_DNS
,S_OK
,FALSE
},
541 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
542 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
545 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
546 { "C:/test/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
548 {"file:///C:/test/test.mp3",S_OK
,FALSE
},
550 {"file:///C:/test/test.mp3",S_OK
,FALSE
},
556 {"/C:/test/test.mp3",S_OK
,FALSE
},
557 {"/C:/test/test.mp3",S_OK
,FALSE
},
559 {"C:/test/test.mp3",S_OK
,FALSE
},
565 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
567 {URL_SCHEME_FILE
,S_OK
,FALSE
},
568 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
571 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
572 { "\\\\Server/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
574 {"file://server/test.mp3",S_OK
,FALSE
},
575 {"server",S_OK
,FALSE
},
576 {"file://server/test.mp3",S_OK
,FALSE
},
580 {"server",S_OK
,FALSE
},
582 {"/test.mp3",S_OK
,FALSE
},
583 {"/test.mp3",S_OK
,FALSE
},
585 {"\\\\Server/test.mp3",S_OK
,FALSE
},
591 {Uri_HOST_DNS
,S_OK
,FALSE
},
593 {URL_SCHEME_FILE
,S_OK
,FALSE
},
594 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
597 { "www.winehq.org/test", Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
599 {"*:www.winehq.org/test",S_OK
,FALSE
},
600 {"www.winehq.org",S_OK
,FALSE
},
601 {"*:www.winehq.org/test",S_OK
,FALSE
},
602 {"winehq.org",S_OK
,FALSE
},
605 {"www.winehq.org",S_OK
,FALSE
},
607 {"/test",S_OK
,FALSE
},
608 {"/test",S_OK
,FALSE
},
610 {"www.winehq.org/test",S_OK
,FALSE
},
616 {Uri_HOST_DNS
,S_OK
,FALSE
},
618 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
619 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
622 /* Valid since the '*' is the only character in the scheme name. */
623 { "*:www.winehq.org/test", 0, S_OK
, FALSE
,
625 {"*:www.winehq.org/test",S_OK
,FALSE
},
626 {"www.winehq.org",S_OK
,FALSE
},
627 {"*:www.winehq.org/test",S_OK
,FALSE
},
628 {"winehq.org",S_OK
,FALSE
},
631 {"www.winehq.org",S_OK
,FALSE
},
633 {"/test",S_OK
,FALSE
},
634 {"/test",S_OK
,FALSE
},
636 {"*:www.winehq.org/test",S_OK
,FALSE
},
642 {Uri_HOST_DNS
,S_OK
,FALSE
},
644 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
645 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
648 { "/../some dir/test.ext", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
650 {"/../some dir/test.ext",S_OK
,FALSE
},
652 {"/../some dir/test.ext",S_OK
,FALSE
},
658 {"/../some dir/test.ext",S_OK
,FALSE
},
659 {"/../some dir/test.ext",S_OK
,FALSE
},
661 {"/../some dir/test.ext",S_OK
,FALSE
},
667 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
669 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
670 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
673 { "//implicit/wildcard/uri scheme", Uri_CREATE_ALLOW_RELATIVE
|Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
675 {"*://implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
677 {"*://implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
683 {"//implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
684 {"//implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
686 {"//implicit/wildcard/uri scheme",S_OK
,FALSE
},
692 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
694 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
695 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
698 /* URI is considered opaque since CREATE_NO_CRACK_UNKNOWN_SCHEMES is set and it's an unknown scheme. */
699 { "zip://google.com", Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
, S_OK
, FALSE
,
701 {"zip:/.//google.com",S_OK
,FALSE
},
703 {"zip:/.//google.com",S_OK
,FALSE
},
709 {"/.//google.com",S_OK
,FALSE
},
710 {"/.//google.com",S_OK
,FALSE
},
712 {"zip://google.com",S_OK
,FALSE
},
718 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
720 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
721 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
724 /* Windows uses the first occurrence of ':' to delimit the userinfo. */
725 { "ftp://user:pass:word@winehq.org/", 0, S_OK
, FALSE
,
727 {"ftp://user:pass:word@winehq.org/",S_OK
,FALSE
},
728 {"user:pass:word@winehq.org",S_OK
,FALSE
},
729 {"ftp://winehq.org/",S_OK
,FALSE
},
730 {"winehq.org",S_OK
,FALSE
},
733 {"winehq.org",S_OK
,FALSE
},
734 {"pass:word",S_OK
,FALSE
},
738 {"ftp://user:pass:word@winehq.org/",S_OK
,FALSE
},
740 {"user:pass:word",S_OK
,FALSE
},
744 {Uri_HOST_DNS
,S_OK
,FALSE
},
746 {URL_SCHEME_FTP
,S_OK
,FALSE
},
747 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
750 /* Make sure % encoded unreserved characters are decoded. */
751 { "ftp://w%49%4Ee:PA%53%53@ftp.google.com/", 0, S_OK
, FALSE
,
753 {"ftp://wINe:PASS@ftp.google.com/",S_OK
,FALSE
},
754 {"wINe:PASS@ftp.google.com",S_OK
,FALSE
},
755 {"ftp://ftp.google.com/",S_OK
,FALSE
},
756 {"google.com",S_OK
,FALSE
},
759 {"ftp.google.com",S_OK
,FALSE
},
764 {"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK
,FALSE
},
766 {"wINe:PASS",S_OK
,FALSE
},
770 {Uri_HOST_DNS
,S_OK
,FALSE
},
772 {URL_SCHEME_FTP
,S_OK
,FALSE
},
773 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
776 /* Make sure % encoded characters which are NOT unreserved are NOT decoded. */
777 { "ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/", 0, S_OK
, FALSE
,
779 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK
,FALSE
},
780 {"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK
,FALSE
},
781 {"ftp://ftp.google.com/",S_OK
,FALSE
},
782 {"google.com",S_OK
,FALSE
},
785 {"ftp.google.com",S_OK
,FALSE
},
786 {"PA%7B%7D",S_OK
,FALSE
},
790 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK
,FALSE
},
792 {"w%5D%5Be:PA%7B%7D",S_OK
,FALSE
},
793 {"w%5D%5Be",S_OK
,FALSE
}
796 {Uri_HOST_DNS
,S_OK
,FALSE
},
798 {URL_SCHEME_FTP
,S_OK
,FALSE
},
799 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
802 /* You're allowed to have an empty password portion in the userinfo section. */
803 { "ftp://empty:@ftp.google.com/", 0, S_OK
, FALSE
,
805 {"ftp://empty:@ftp.google.com/",S_OK
,FALSE
},
806 {"empty:@ftp.google.com",S_OK
,FALSE
},
807 {"ftp://ftp.google.com/",S_OK
,FALSE
},
808 {"google.com",S_OK
,FALSE
},
811 {"ftp.google.com",S_OK
,FALSE
},
816 {"ftp://empty:@ftp.google.com/",S_OK
,FALSE
},
818 {"empty:",S_OK
,FALSE
},
822 {Uri_HOST_DNS
,S_OK
,FALSE
},
824 {URL_SCHEME_FTP
,S_OK
,FALSE
},
825 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
828 /* Make sure forbidden characters in "userinfo" get encoded. */
829 { "ftp://\" \"weird@ftp.google.com/", 0, S_OK
, FALSE
,
831 {"ftp://%22%20%22weird@ftp.google.com/",S_OK
,FALSE
},
832 {"%22%20%22weird@ftp.google.com",S_OK
,FALSE
},
833 {"ftp://ftp.google.com/",S_OK
,FALSE
},
834 {"google.com",S_OK
,FALSE
},
837 {"ftp.google.com",S_OK
,FALSE
},
842 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
844 {"%22%20%22weird",S_OK
,FALSE
},
845 {"%22%20%22weird",S_OK
,FALSE
}
848 {Uri_HOST_DNS
,S_OK
,FALSE
},
850 {URL_SCHEME_FTP
,S_OK
,FALSE
},
851 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
854 /* Make sure the forbidden characters don't get percent encoded. */
855 { "ftp://\" \"weird@ftp.google.com/", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
857 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
858 {"\" \"weird@ftp.google.com",S_OK
,FALSE
},
859 {"ftp://ftp.google.com/",S_OK
,FALSE
},
860 {"google.com",S_OK
,FALSE
},
863 {"ftp.google.com",S_OK
,FALSE
},
868 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
870 {"\" \"weird",S_OK
,FALSE
},
871 {"\" \"weird",S_OK
,FALSE
}
874 {Uri_HOST_DNS
,S_OK
,FALSE
},
876 {URL_SCHEME_FTP
,S_OK
,FALSE
},
877 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
880 /* Make sure already percent encoded characters don't get unencoded. */
881 { "ftp://\"%20\"weird@ftp.google.com/\"%20\"weird", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
883 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK
,FALSE
},
884 {"\"%20\"weird@ftp.google.com",S_OK
,FALSE
},
885 {"ftp://ftp.google.com/\"%20\"weird",S_OK
,FALSE
},
886 {"google.com",S_OK
,FALSE
},
889 {"ftp.google.com",S_OK
,FALSE
},
891 {"/\"%20\"weird",S_OK
,FALSE
},
892 {"/\"%20\"weird",S_OK
,FALSE
},
894 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK
,FALSE
},
896 {"\"%20\"weird",S_OK
,FALSE
},
897 {"\"%20\"weird",S_OK
,FALSE
}
900 {Uri_HOST_DNS
,S_OK
,FALSE
},
902 {URL_SCHEME_FTP
,S_OK
,FALSE
},
903 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
906 /* Allowed to have invalid % encoded because it's an unknown scheme type. */
907 { "zip://%xy:word@winehq.org/", 0, S_OK
, FALSE
,
909 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
910 {"%xy:word@winehq.org",S_OK
,FALSE
},
911 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
912 {"winehq.org",S_OK
,FALSE
},
915 {"winehq.org",S_OK
,FALSE
},
920 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
922 {"%xy:word",S_OK
,FALSE
},
926 {Uri_HOST_DNS
,S_OK
,FALSE
},
928 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
929 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
932 /* Unreserved, percent encoded characters aren't decoded in the userinfo because the scheme
935 { "zip://%2E:%52%53ord@winehq.org/", 0, S_OK
, FALSE
,
937 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
938 {"%2E:%52%53ord@winehq.org",S_OK
,FALSE
},
939 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
940 {"winehq.org",S_OK
,FALSE
},
943 {"winehq.org",S_OK
,FALSE
},
944 {"%52%53ord",S_OK
,FALSE
},
948 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
950 {"%2E:%52%53ord",S_OK
,FALSE
},
954 {Uri_HOST_DNS
,S_OK
,FALSE
},
956 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
957 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
960 { "ftp://[](),'test':word@winehq.org/", 0, S_OK
, FALSE
,
962 {"ftp://[](),'test':word@winehq.org/",S_OK
,FALSE
},
963 {"[](),'test':word@winehq.org",S_OK
,FALSE
},
964 {"ftp://winehq.org/",S_OK
,FALSE
},
965 {"winehq.org",S_OK
,FALSE
},
968 {"winehq.org",S_OK
,FALSE
},
973 {"ftp://[](),'test':word@winehq.org/",S_OK
,FALSE
},
975 {"[](),'test':word",S_OK
,FALSE
},
976 {"[](),'test'",S_OK
,FALSE
}
979 {Uri_HOST_DNS
,S_OK
,FALSE
},
981 {URL_SCHEME_FTP
,S_OK
,FALSE
},
982 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
985 { "ftp://test?:word@winehq.org/", 0, S_OK
, FALSE
,
987 {"ftp://test/?:word@winehq.org/",S_OK
,FALSE
},
989 {"ftp://test/?:word@winehq.org/",S_OK
,FALSE
},
996 {"/?:word@winehq.org/",S_OK
,FALSE
},
997 {"?:word@winehq.org/",S_OK
,FALSE
},
998 {"ftp://test?:word@winehq.org/",S_OK
,FALSE
},
1004 {Uri_HOST_DNS
,S_OK
,FALSE
},
1006 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1007 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1010 { "ftp://test#:word@winehq.org/", 0, S_OK
, FALSE
,
1012 {"ftp://test/#:word@winehq.org/",S_OK
,FALSE
},
1013 {"test",S_OK
,FALSE
},
1014 {"ftp://test/#:word@winehq.org/",S_OK
,FALSE
},
1017 {"#:word@winehq.org/",S_OK
,FALSE
},
1018 {"test",S_OK
,FALSE
},
1023 {"ftp://test#:word@winehq.org/",S_OK
,FALSE
},
1029 {Uri_HOST_DNS
,S_OK
,FALSE
},
1031 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1032 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1035 /* Allowed to have a backslash in the userinfo since it's an unknown scheme. */
1036 { "zip://test\\:word@winehq.org/", 0, S_OK
, FALSE
,
1038 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1039 {"test\\:word@winehq.org",S_OK
,FALSE
},
1040 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1041 {"winehq.org",S_OK
,FALSE
},
1044 {"winehq.org",S_OK
,FALSE
},
1045 {"word",S_OK
,FALSE
},
1049 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1051 {"test\\:word",S_OK
,FALSE
},
1052 {"test\\",S_OK
,FALSE
}
1055 {Uri_HOST_DNS
,S_OK
,FALSE
},
1057 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1058 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1061 /* It normalizes IPv4 addresses correctly. */
1062 { "http://127.000.000.100/", 0, S_OK
, FALSE
,
1064 {"http://127.0.0.100/",S_OK
,FALSE
},
1065 {"127.0.0.100",S_OK
,FALSE
},
1066 {"http://127.0.0.100/",S_OK
,FALSE
},
1070 {"127.0.0.100",S_OK
,FALSE
},
1075 {"http://127.000.000.100/",S_OK
,FALSE
},
1076 {"http",S_OK
,FALSE
},
1081 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1083 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1084 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1087 { "http://127.0.0.1:8000", 0, S_OK
, FALSE
,
1089 {"http://127.0.0.1:8000/",S_OK
},
1090 {"127.0.0.1:8000",S_OK
},
1091 {"http://127.0.0.1:8000/",S_OK
},
1100 {"http://127.0.0.1:8000",S_OK
},
1106 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1108 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1109 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1112 /* Make sure it normalizes partial IPv4 addresses correctly. */
1113 { "http://127.0/", 0, S_OK
, FALSE
,
1115 {"http://127.0.0.0/",S_OK
,FALSE
},
1116 {"127.0.0.0",S_OK
,FALSE
},
1117 {"http://127.0.0.0/",S_OK
,FALSE
},
1121 {"127.0.0.0",S_OK
,FALSE
},
1126 {"http://127.0/",S_OK
,FALSE
},
1127 {"http",S_OK
,FALSE
},
1132 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1134 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1135 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1138 /* Make sure it converts implicit IPv4's correctly. */
1139 { "http://123456/", 0, S_OK
, FALSE
,
1141 {"http://0.1.226.64/",S_OK
,FALSE
},
1142 {"0.1.226.64",S_OK
,FALSE
},
1143 {"http://0.1.226.64/",S_OK
,FALSE
},
1147 {"0.1.226.64",S_OK
,FALSE
},
1152 {"http://123456/",S_OK
,FALSE
},
1153 {"http",S_OK
,FALSE
},
1158 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1160 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1161 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1165 { "http://4294967295/", 0, S_OK
, FALSE
,
1167 {"http://255.255.255.255/",S_OK
,FALSE
},
1168 {"255.255.255.255",S_OK
,FALSE
},
1169 {"http://255.255.255.255/",S_OK
,FALSE
},
1173 {"255.255.255.255",S_OK
,FALSE
},
1178 {"http://4294967295/",S_OK
,FALSE
},
1179 {"http",S_OK
,FALSE
},
1184 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1186 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1187 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1191 { "http://4294967296/", 0, S_OK
, FALSE
,
1193 {"http://4294967296/",S_OK
,FALSE
},
1194 {"4294967296",S_OK
,FALSE
},
1195 {"http://4294967296/",S_OK
,FALSE
},
1199 {"4294967296",S_OK
,FALSE
},
1204 {"http://4294967296/",S_OK
,FALSE
},
1205 {"http",S_OK
,FALSE
},
1210 {Uri_HOST_DNS
,S_OK
,FALSE
},
1212 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1213 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1216 /* Window's doesn't normalize IP address for unknown schemes. */
1217 { "1234://4294967295/", 0, S_OK
, FALSE
,
1219 {"1234://4294967295/",S_OK
,FALSE
},
1220 {"4294967295",S_OK
,FALSE
},
1221 {"1234://4294967295/",S_OK
,FALSE
},
1225 {"4294967295",S_OK
,FALSE
},
1230 {"1234://4294967295/",S_OK
,FALSE
},
1231 {"1234",S_OK
,FALSE
},
1236 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1238 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1239 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1242 /* Window's doesn't normalize IP address for unknown schemes. */
1243 { "1234://127.001/", 0, S_OK
, FALSE
,
1245 {"1234://127.001/",S_OK
,FALSE
},
1246 {"127.001",S_OK
,FALSE
},
1247 {"1234://127.001/",S_OK
,FALSE
},
1251 {"127.001",S_OK
,FALSE
},
1256 {"1234://127.001/",S_OK
,FALSE
},
1257 {"1234",S_OK
,FALSE
},
1262 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1264 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1265 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1268 { "http://[FEDC:BA98::3210]", 0, S_OK
, FALSE
,
1270 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
1271 {"[fedc:ba98::3210]",S_OK
,FALSE
},
1272 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
1276 {"fedc:ba98::3210",S_OK
,FALSE
},
1281 {"http://[FEDC:BA98::3210]",S_OK
,FALSE
},
1282 {"http",S_OK
,FALSE
},
1287 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1289 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1290 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1293 { "http://[::]", 0, S_OK
, FALSE
,
1295 {"http://[::]/",S_OK
,FALSE
},
1296 {"[::]",S_OK
,FALSE
},
1297 {"http://[::]/",S_OK
,FALSE
},
1306 {"http://[::]",S_OK
,FALSE
},
1307 {"http",S_OK
,FALSE
},
1312 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1314 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1315 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1318 { "http://[FEDC:BA98::]", 0, S_OK
, FALSE
,
1320 {"http://[fedc:ba98::]/",S_OK
,FALSE
},
1321 {"[fedc:ba98::]",S_OK
,FALSE
},
1322 {"http://[fedc:ba98::]/",S_OK
,FALSE
},
1326 {"fedc:ba98::",S_OK
,FALSE
},
1331 {"http://[FEDC:BA98::]",S_OK
,FALSE
},
1332 {"http",S_OK
,FALSE
},
1337 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1339 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1340 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1343 /* Valid even with 2 byte elision because it doesn't appear the beginning or end. */
1344 { "http://[1::3:4:5:6:7:8]", 0, S_OK
, FALSE
,
1346 {"http://[1:0:3:4:5:6:7:8]/",S_OK
,FALSE
},
1347 {"[1:0:3:4:5:6:7:8]",S_OK
,FALSE
},
1348 {"http://[1:0:3:4:5:6:7:8]/",S_OK
,FALSE
},
1352 {"1:0:3:4:5:6:7:8",S_OK
,FALSE
},
1357 {"http://[1::3:4:5:6:7:8]",S_OK
,FALSE
},
1358 {"http",S_OK
,FALSE
},
1363 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1365 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1366 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1369 { "http://[v2.34]/", 0, S_OK
, FALSE
,
1371 {"http://[v2.34]/",S_OK
,FALSE
},
1372 {"[v2.34]",S_OK
,FALSE
},
1373 {"http://[v2.34]/",S_OK
,FALSE
},
1377 {"[v2.34]",S_OK
,FALSE
},
1382 {"http://[v2.34]/",S_OK
,FALSE
},
1383 {"http",S_OK
,FALSE
},
1388 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
1390 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1391 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1394 /* Windows ignores ':' if they appear after a '[' on a non-IPLiteral host. */
1395 { "http://[xyz:12345.com/test", 0, S_OK
, FALSE
,
1397 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1398 {"[xyz:12345.com",S_OK
,FALSE
},
1399 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1400 {"[xyz:12345.com",S_OK
,FALSE
},
1403 {"[xyz:12345.com",S_OK
,FALSE
},
1405 {"/test",S_OK
,FALSE
},
1406 {"/test",S_OK
,FALSE
},
1408 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1409 {"http",S_OK
,FALSE
},
1414 {Uri_HOST_DNS
,S_OK
,FALSE
},
1416 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1417 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1420 /* Valid URI since the '[' and ']' don't appear at the beginning and end
1421 * of the host name (respectively).
1423 { "ftp://www.[works].com/", 0, S_OK
, FALSE
,
1425 {"ftp://www.[works].com/",S_OK
,FALSE
},
1426 {"www.[works].com",S_OK
,FALSE
},
1427 {"ftp://www.[works].com/",S_OK
,FALSE
},
1428 {"[works].com",S_OK
,FALSE
},
1431 {"www.[works].com",S_OK
,FALSE
},
1436 {"ftp://www.[works].com/",S_OK
,FALSE
},
1442 {Uri_HOST_DNS
,S_OK
,FALSE
},
1444 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1445 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1448 /* Considers ':' a delimiter since it appears after the ']'. */
1449 { "http://www.google.com]:12345/", 0, S_OK
, FALSE
,
1451 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1452 {"www.google.com]:12345",S_OK
,FALSE
},
1453 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1454 {"google.com]",S_OK
,FALSE
},
1457 {"www.google.com]",S_OK
,FALSE
},
1462 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1463 {"http",S_OK
,FALSE
},
1468 {Uri_HOST_DNS
,S_OK
,FALSE
},
1470 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1471 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1474 /* Unknown scheme types can have invalid % encoded data in the hostname. */
1475 { "zip://w%XXw%GEw.google.com/", 0, S_OK
, FALSE
,
1477 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1478 {"w%XXw%GEw.google.com",S_OK
,FALSE
},
1479 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1480 {"google.com",S_OK
,FALSE
},
1483 {"w%XXw%GEw.google.com",S_OK
,FALSE
},
1488 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1494 {Uri_HOST_DNS
,S_OK
,FALSE
},
1496 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1497 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1500 /* Unknown scheme types hostname doesn't get lower cased. */
1501 { "zip://GOOGLE.com/", 0, S_OK
, FALSE
,
1503 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1504 {"GOOGLE.com",S_OK
,FALSE
},
1505 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1506 {"GOOGLE.com",S_OK
,FALSE
},
1509 {"GOOGLE.com",S_OK
,FALSE
},
1514 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1520 {Uri_HOST_DNS
,S_OK
,FALSE
},
1522 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1523 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1526 /* Hostname gets lower-cased for known scheme types. */
1527 { "http://WWW.GOOGLE.com/", 0, S_OK
, FALSE
,
1529 {"http://www.google.com/",S_OK
,FALSE
},
1530 {"www.google.com",S_OK
,FALSE
},
1531 {"http://www.google.com/",S_OK
,FALSE
},
1532 {"google.com",S_OK
,FALSE
},
1535 {"www.google.com",S_OK
,FALSE
},
1540 {"http://WWW.GOOGLE.com/",S_OK
,FALSE
},
1541 {"http",S_OK
,FALSE
},
1546 {Uri_HOST_DNS
,S_OK
,FALSE
},
1548 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1549 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1552 /* Characters that get % encoded in the hostname also have their percent
1553 * encoded forms lower cased.
1555 { "http://www.%7Cgoogle|.com/", 0, S_OK
, FALSE
,
1557 {"http://www.%7cgoogle%7c.com/",S_OK
,FALSE
},
1558 {"www.%7cgoogle%7c.com",S_OK
,FALSE
},
1559 {"http://www.%7cgoogle%7c.com/",S_OK
,FALSE
},
1560 {"%7cgoogle%7c.com",S_OK
,FALSE
},
1563 {"www.%7cgoogle%7c.com",S_OK
,FALSE
},
1568 {"http://www.%7Cgoogle|.com/",S_OK
,FALSE
},
1569 {"http",S_OK
,FALSE
},
1574 {Uri_HOST_DNS
,S_OK
,FALSE
},
1576 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1577 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1580 /* IPv4 addresses attached to IPv6 can be included in elisions. */
1581 { "http://[1:2:3:4:5:6:0.0.0.0]", 0, S_OK
, FALSE
,
1583 {"http://[1:2:3:4:5:6::]/",S_OK
,FALSE
},
1584 {"[1:2:3:4:5:6::]",S_OK
,FALSE
},
1585 {"http://[1:2:3:4:5:6::]/",S_OK
,FALSE
},
1589 {"1:2:3:4:5:6::",S_OK
,FALSE
},
1594 {"http://[1:2:3:4:5:6:0.0.0.0]",S_OK
,FALSE
},
1595 {"http",S_OK
,FALSE
},
1600 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1602 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1603 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1606 /* IPv4 addresses get normalized. */
1607 { "http://[::001.002.003.000]", 0, S_OK
, FALSE
,
1609 {"http://[::1.2.3.0]/",S_OK
,FALSE
},
1610 {"[::1.2.3.0]",S_OK
,FALSE
},
1611 {"http://[::1.2.3.0]/",S_OK
,FALSE
},
1615 {"::1.2.3.0",S_OK
,FALSE
},
1620 {"http://[::001.002.003.000]",S_OK
,FALSE
},
1621 {"http",S_OK
,FALSE
},
1626 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1628 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1629 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1632 /* Windows doesn't do anything to IPv6's in unknown schemes. */
1633 { "zip://[0001:0:000:0004:0005:0006:001.002.003.000]", 0, S_OK
, FALSE
,
1635 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK
,FALSE
},
1636 {"[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK
,FALSE
},
1637 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK
,FALSE
},
1641 {"0001:0:000:0004:0005:0006:001.002.003.000",S_OK
,FALSE
},
1646 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK
,FALSE
},
1652 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1654 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1655 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1658 /* IPv4 address is converted into 2 h16 components. */
1659 { "http://[ffff::192.222.111.32]", 0, S_OK
, FALSE
,
1661 {"http://[ffff::c0de:6f20]/",S_OK
,FALSE
},
1662 {"[ffff::c0de:6f20]",S_OK
,FALSE
},
1663 {"http://[ffff::c0de:6f20]/",S_OK
,FALSE
},
1667 {"ffff::c0de:6f20",S_OK
,FALSE
},
1672 {"http://[ffff::192.222.111.32]",S_OK
,FALSE
},
1673 {"http",S_OK
,FALSE
},
1678 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1680 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1681 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1684 /* Max value for a port. */
1685 { "http://google.com:65535", 0, S_OK
, FALSE
,
1687 {"http://google.com:65535/",S_OK
,FALSE
},
1688 {"google.com:65535",S_OK
,FALSE
},
1689 {"http://google.com:65535/",S_OK
,FALSE
},
1690 {"google.com",S_OK
,FALSE
},
1693 {"google.com",S_OK
,FALSE
},
1698 {"http://google.com:65535",S_OK
,FALSE
},
1699 {"http",S_OK
,FALSE
},
1704 {Uri_HOST_DNS
,S_OK
,FALSE
},
1706 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1707 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1710 { "zip://google.com:65536", 0, S_OK
, FALSE
,
1712 {"zip://google.com:65536/",S_OK
,FALSE
},
1713 {"google.com:65536",S_OK
,FALSE
},
1714 {"zip://google.com:65536/",S_OK
,FALSE
},
1715 {"google.com:65536",S_OK
,FALSE
},
1718 {"google.com:65536",S_OK
,FALSE
},
1723 {"zip://google.com:65536",S_OK
,FALSE
},
1729 {Uri_HOST_DNS
,S_OK
,FALSE
},
1731 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1732 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1735 { "zip://google.com:65536:25", 0, S_OK
, FALSE
,
1737 {"zip://google.com:65536:25/",S_OK
,FALSE
},
1738 {"google.com:65536:25",S_OK
,FALSE
},
1739 {"zip://google.com:65536:25/",S_OK
,FALSE
},
1740 {"google.com:65536:25",S_OK
,FALSE
},
1743 {"google.com:65536:25",S_OK
,FALSE
},
1748 {"zip://google.com:65536:25",S_OK
,FALSE
},
1754 {Uri_HOST_DNS
,S_OK
,FALSE
},
1756 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1757 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1760 { "zip://[::ffff]:abcd", 0, S_OK
, FALSE
,
1762 {"zip://[::ffff]:abcd/",S_OK
,FALSE
},
1763 {"[::ffff]:abcd",S_OK
,FALSE
},
1764 {"zip://[::ffff]:abcd/",S_OK
,FALSE
},
1768 {"[::ffff]:abcd",S_OK
,FALSE
},
1773 {"zip://[::ffff]:abcd",S_OK
,FALSE
},
1779 {Uri_HOST_DNS
,S_OK
,FALSE
},
1781 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1782 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1785 { "zip://127.0.0.1:abcd", 0, S_OK
, FALSE
,
1787 {"zip://127.0.0.1:abcd/",S_OK
,FALSE
},
1788 {"127.0.0.1:abcd",S_OK
,FALSE
},
1789 {"zip://127.0.0.1:abcd/",S_OK
,FALSE
},
1790 {"0.1:abcd",S_OK
,FALSE
},
1793 {"127.0.0.1:abcd",S_OK
,FALSE
},
1798 {"zip://127.0.0.1:abcd",S_OK
,FALSE
},
1804 {Uri_HOST_DNS
,S_OK
,FALSE
},
1806 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1807 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1810 /* Port is just copied over. */
1811 { "http://google.com:00035", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
1813 {"http://google.com:00035",S_OK
,FALSE
},
1814 {"google.com:00035",S_OK
,FALSE
},
1815 {"http://google.com:00035",S_OK
,FALSE
,"http://google.com:35"},
1816 {"google.com",S_OK
,FALSE
},
1819 {"google.com",S_OK
,FALSE
},
1824 {"http://google.com:00035",S_OK
,FALSE
},
1825 {"http",S_OK
,FALSE
},
1830 {Uri_HOST_DNS
,S_OK
,FALSE
},
1832 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1833 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1836 /* Default port is copied over. */
1837 { "http://google.com:80", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
1839 {"http://google.com:80",S_OK
,FALSE
},
1840 {"google.com:80",S_OK
,FALSE
},
1841 {"http://google.com:80",S_OK
,FALSE
},
1842 {"google.com",S_OK
,FALSE
},
1845 {"google.com",S_OK
,FALSE
},
1850 {"http://google.com:80",S_OK
,FALSE
},
1851 {"http",S_OK
,FALSE
},
1856 {Uri_HOST_DNS
,S_OK
,FALSE
},
1858 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1859 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1862 { "http://google.com.uk", 0, S_OK
, FALSE
,
1864 {"http://google.com.uk/",S_OK
,FALSE
},
1865 {"google.com.uk",S_OK
,FALSE
},
1866 {"http://google.com.uk/",S_OK
,FALSE
},
1867 {"google.com.uk",S_OK
,FALSE
},
1870 {"google.com.uk",S_OK
,FALSE
},
1875 {"http://google.com.uk",S_OK
,FALSE
},
1876 {"http",S_OK
,FALSE
},
1881 {Uri_HOST_DNS
,S_OK
,FALSE
},
1883 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1884 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1887 { "http://google.com.com", 0, S_OK
, FALSE
,
1889 {"http://google.com.com/",S_OK
,FALSE
},
1890 {"google.com.com",S_OK
,FALSE
},
1891 {"http://google.com.com/",S_OK
,FALSE
},
1892 {"com.com",S_OK
,FALSE
},
1895 {"google.com.com",S_OK
,FALSE
},
1900 {"http://google.com.com",S_OK
,FALSE
},
1901 {"http",S_OK
,FALSE
},
1906 {Uri_HOST_DNS
,S_OK
,FALSE
},
1908 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1909 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1912 { "http://google.uk.1", 0, S_OK
, FALSE
,
1914 {"http://google.uk.1/",S_OK
,FALSE
},
1915 {"google.uk.1",S_OK
,FALSE
},
1916 {"http://google.uk.1/",S_OK
,FALSE
},
1917 {"google.uk.1",S_OK
,FALSE
},
1920 {"google.uk.1",S_OK
,FALSE
},
1925 {"http://google.uk.1",S_OK
,FALSE
},
1926 {"http",S_OK
,FALSE
},
1931 {Uri_HOST_DNS
,S_OK
,FALSE
},
1933 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1934 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1937 /* Since foo isn't a recognized 3 character TLD it's considered the domain name. */
1938 { "http://google.foo.uk", 0, S_OK
, FALSE
,
1940 {"http://google.foo.uk/",S_OK
,FALSE
},
1941 {"google.foo.uk",S_OK
,FALSE
},
1942 {"http://google.foo.uk/",S_OK
,FALSE
},
1943 {"foo.uk",S_OK
,FALSE
},
1946 {"google.foo.uk",S_OK
,FALSE
},
1951 {"http://google.foo.uk",S_OK
,FALSE
},
1952 {"http",S_OK
,FALSE
},
1957 {Uri_HOST_DNS
,S_OK
,FALSE
},
1959 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1960 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1963 { "http://.com", 0, S_OK
, FALSE
,
1965 {"http://.com/",S_OK
,FALSE
},
1966 {".com",S_OK
,FALSE
},
1967 {"http://.com/",S_OK
,FALSE
},
1968 {".com",S_OK
,FALSE
},
1971 {".com",S_OK
,FALSE
},
1976 {"http://.com",S_OK
,FALSE
},
1977 {"http",S_OK
,FALSE
},
1982 {Uri_HOST_DNS
,S_OK
,FALSE
},
1984 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1985 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1988 { "http://.uk", 0, S_OK
, FALSE
,
1990 {"http://.uk/",S_OK
,FALSE
},
1992 {"http://.uk/",S_OK
,FALSE
},
2001 {"http://.uk",S_OK
,FALSE
},
2002 {"http",S_OK
,FALSE
},
2007 {Uri_HOST_DNS
,S_OK
,FALSE
},
2009 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2010 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2013 { "http://www.co.google.com.[]", 0, S_OK
, FALSE
,
2015 {"http://www.co.google.com.[]/",S_OK
,FALSE
},
2016 {"www.co.google.com.[]",S_OK
,FALSE
},
2017 {"http://www.co.google.com.[]/",S_OK
,FALSE
},
2018 {"google.com.[]",S_OK
,FALSE
},
2021 {"www.co.google.com.[]",S_OK
,FALSE
},
2026 {"http://www.co.google.com.[]",S_OK
,FALSE
},
2027 {"http",S_OK
,FALSE
},
2032 {Uri_HOST_DNS
,S_OK
,FALSE
},
2034 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2035 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2038 { "http://co.uk", 0, S_OK
, FALSE
,
2040 {"http://co.uk/",S_OK
,FALSE
},
2041 {"co.uk",S_OK
,FALSE
},
2042 {"http://co.uk/",S_OK
,FALSE
},
2046 {"co.uk",S_OK
,FALSE
},
2051 {"http://co.uk",S_OK
,FALSE
},
2052 {"http",S_OK
,FALSE
},
2057 {Uri_HOST_DNS
,S_OK
,FALSE
},
2059 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2060 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2063 { "http://www.co.google.us.test", 0, S_OK
, FALSE
,
2065 {"http://www.co.google.us.test/",S_OK
,FALSE
},
2066 {"www.co.google.us.test",S_OK
,FALSE
},
2067 {"http://www.co.google.us.test/",S_OK
,FALSE
},
2068 {"us.test",S_OK
,FALSE
},
2071 {"www.co.google.us.test",S_OK
,FALSE
},
2076 {"http://www.co.google.us.test",S_OK
,FALSE
},
2077 {"http",S_OK
,FALSE
},
2082 {Uri_HOST_DNS
,S_OK
,FALSE
},
2084 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2085 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2088 { "http://gov.uk", 0, S_OK
, FALSE
,
2090 {"http://gov.uk/",S_OK
,FALSE
},
2091 {"gov.uk",S_OK
,FALSE
},
2092 {"http://gov.uk/",S_OK
,FALSE
},
2096 {"gov.uk",S_OK
,FALSE
},
2101 {"http://gov.uk",S_OK
,FALSE
},
2102 {"http",S_OK
,FALSE
},
2107 {Uri_HOST_DNS
,S_OK
,FALSE
},
2109 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2110 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2113 { "zip://www.google.com\\test", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2115 {"zip://www.google.com\\test",S_OK
,FALSE
},
2116 {"www.google.com\\test",S_OK
,FALSE
},
2117 {"zip://www.google.com\\test",S_OK
,FALSE
},
2118 {"google.com\\test",S_OK
,FALSE
},
2121 {"www.google.com\\test",S_OK
,FALSE
},
2126 {"zip://www.google.com\\test",S_OK
,FALSE
},
2132 {Uri_HOST_DNS
,S_OK
,FALSE
},
2134 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2135 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2138 { "urn:excepts:bad:%XY:encoded", 0, S_OK
, FALSE
,
2140 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2142 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2148 {"excepts:bad:%XY:encoded",S_OK
,FALSE
},
2149 {"excepts:bad:%XY:encoded",S_OK
,FALSE
},
2151 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2157 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2159 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2160 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2163 /* Since the original URI doesn't contain an extra '/' before the path no % encoded values
2164 * are decoded and all '%' are encoded.
2166 { "file://C:/te%3Es%2Et/tes%t.mp3", 0, S_OK
, FALSE
,
2168 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2170 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2172 {".mp3",S_OK
,FALSE
},
2176 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2177 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2179 {"file://C:/te%3Es%2Et/tes%t.mp3",S_OK
,FALSE
},
2180 {"file",S_OK
,FALSE
},
2185 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2187 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2188 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2191 /* Since there's a '/' in front of the drive letter, any percent encoded, non-forbidden character
2192 * is decoded and only %'s in front of invalid hex digits are encoded.
2194 { "file:///C:/te%3Es%2Et/t%23es%t.mp3", 0, S_OK
, FALSE
,
2196 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2198 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2200 {".mp3",S_OK
,FALSE
},
2204 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2205 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2207 {"file:///C:/te%3Es%2Et/t%23es%t.mp3",S_OK
,FALSE
},
2208 {"file",S_OK
,FALSE
},
2213 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2215 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2216 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2219 /* Only unreserved percent encoded characters are decoded for known schemes that aren't file. */
2220 { "http://[::001.002.003.000]/%3F%23%2E%54/test", 0, S_OK
, FALSE
,
2222 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK
,FALSE
},
2223 {"[::1.2.3.0]",S_OK
,FALSE
},
2224 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK
,FALSE
},
2228 {"::1.2.3.0",S_OK
,FALSE
},
2230 {"/%3F%23.T/test",S_OK
,FALSE
},
2231 {"/%3F%23.T/test",S_OK
,FALSE
},
2233 {"http://[::001.002.003.000]/%3F%23%2E%54/test",S_OK
,FALSE
},
2234 {"http",S_OK
,FALSE
},
2239 {Uri_HOST_IPV6
,S_OK
,FALSE
},
2241 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2242 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2245 /* Forbidden characters are always encoded for file URIs. */
2246 { "file:///C:/\"test\"/test.mp3", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2248 {"file:///C:/%22test%22/test.mp3",S_OK
,FALSE
},
2250 {"file:///C:/%22test%22/test.mp3",S_OK
,FALSE
},
2252 {".mp3",S_OK
,FALSE
},
2256 {"/C:/%22test%22/test.mp3",S_OK
,FALSE
},
2257 {"/C:/%22test%22/test.mp3",S_OK
,FALSE
},
2259 {"file:///C:/\"test\"/test.mp3",S_OK
,FALSE
},
2260 {"file",S_OK
,FALSE
},
2265 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2267 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2268 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2271 /* Forbidden characters are never encoded for unknown scheme types. */
2272 { "1234://4294967295/<|>\" test<|>", 0, S_OK
, FALSE
,
2274 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2275 {"4294967295",S_OK
,FALSE
},
2276 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2280 {"4294967295",S_OK
,FALSE
},
2282 {"/<|>\" test<|>",S_OK
,FALSE
},
2283 {"/<|>\" test<|>",S_OK
,FALSE
},
2285 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2286 {"1234",S_OK
,FALSE
},
2291 {Uri_HOST_IPV4
,S_OK
,FALSE
},
2293 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2294 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2297 /* Make sure forbidden characters are percent encoded. */
2298 { "http://gov.uk/<|> test<|>", 0, S_OK
, FALSE
,
2300 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2301 {"gov.uk",S_OK
,FALSE
},
2302 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2306 {"gov.uk",S_OK
,FALSE
},
2308 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2309 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2311 {"http://gov.uk/<|> test<|>",S_OK
,FALSE
},
2312 {"http",S_OK
,FALSE
},
2317 {Uri_HOST_DNS
,S_OK
,FALSE
},
2319 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2320 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2323 { "http://gov.uk/test/../test2/././../test3/.././././", 0, S_OK
, FALSE
,
2325 {"http://gov.uk/",S_OK
,FALSE
},
2326 {"gov.uk",S_OK
,FALSE
},
2327 {"http://gov.uk/",S_OK
,FALSE
},
2331 {"gov.uk",S_OK
,FALSE
},
2336 {"http://gov.uk/test/../test2/././../test3/.././././",S_OK
,FALSE
},
2337 {"http",S_OK
,FALSE
},
2342 {Uri_HOST_DNS
,S_OK
,FALSE
},
2344 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2345 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2348 { "http://gov.uk/test/test2/../../..", 0, S_OK
, FALSE
,
2350 {"http://gov.uk/",S_OK
,FALSE
},
2351 {"gov.uk",S_OK
,FALSE
},
2352 {"http://gov.uk/",S_OK
,FALSE
},
2356 {"gov.uk",S_OK
,FALSE
},
2361 {"http://gov.uk/test/test2/../../..",S_OK
,FALSE
},
2362 {"http",S_OK
,FALSE
},
2367 {Uri_HOST_DNS
,S_OK
,FALSE
},
2369 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2370 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2373 { "http://gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2375 {"http://gov.uk/",S_OK
,FALSE
},
2376 {"gov.uk",S_OK
,FALSE
},
2377 {"http://gov.uk/",S_OK
,FALSE
},
2381 {"gov.uk",S_OK
,FALSE
},
2386 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2387 {"http",S_OK
,FALSE
},
2392 {Uri_HOST_DNS
,S_OK
,FALSE
},
2394 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2395 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2398 { "file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3", 0, S_OK
, FALSE
,
2400 {"file:///c:/foo%2520bar.mp3",S_OK
,FALSE
},
2402 {"file:///c:/foo%2520bar.mp3",S_OK
,FALSE
},
2404 {".mp3",S_OK
,FALSE
},
2408 {"/c:/foo%2520bar.mp3",S_OK
,FALSE
},
2409 {"/c:/foo%2520bar.mp3",S_OK
,FALSE
},
2411 {"file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3",S_OK
,FALSE
},
2412 {"file",S_OK
,FALSE
},
2417 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2419 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2420 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2423 /* Dot removal happens for unknown scheme types. */
2424 { "zip://gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2426 {"zip://gov.uk/",S_OK
,FALSE
},
2427 {"gov.uk",S_OK
,FALSE
},
2428 {"zip://gov.uk/",S_OK
,FALSE
},
2432 {"gov.uk",S_OK
,FALSE
},
2437 {"zip://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2443 {Uri_HOST_DNS
,S_OK
,FALSE
},
2445 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2446 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2449 /* Dot removal doesn't happen if NO_CANONICALIZE is set. */
2450 { "http://gov.uk/test/test2/../../.", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2452 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2453 {"gov.uk",S_OK
,FALSE
},
2454 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2458 {"gov.uk",S_OK
,FALSE
},
2460 {"/test/test2/../../.",S_OK
,FALSE
},
2461 {"/test/test2/../../.",S_OK
,FALSE
},
2463 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2464 {"http",S_OK
,FALSE
},
2469 {Uri_HOST_DNS
,S_OK
,FALSE
},
2471 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2472 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2475 /* Dot removal doesn't happen for wildcard scheme types. */
2476 { "*:gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2478 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2479 {"gov.uk",S_OK
,FALSE
},
2480 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2484 {"gov.uk",S_OK
,FALSE
},
2486 {"/test/test2/../../.",S_OK
,FALSE
},
2487 {"/test/test2/../../.",S_OK
,FALSE
},
2489 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2495 {Uri_HOST_DNS
,S_OK
,FALSE
},
2497 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
2498 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2501 /* Forbidden characters are encoded for opaque known scheme types. */
2502 { "mailto:\"acco<|>unt@example.com\"", 0, S_OK
, FALSE
,
2504 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2506 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2508 {".com%22",S_OK
,FALSE
},
2512 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2513 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2515 {"mailto:\"acco<|>unt@example.com\"",S_OK
,FALSE
},
2516 {"mailto",S_OK
,FALSE
},
2521 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2523 {URL_SCHEME_MAILTO
,S_OK
,FALSE
},
2524 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2527 { "news:test.tes<|>t.com", 0, S_OK
, FALSE
,
2529 {"news:test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2531 {"news:test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2533 {".com",S_OK
,FALSE
},
2537 {"test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2538 {"test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2540 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2541 {"news",S_OK
,FALSE
},
2546 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2548 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2549 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2552 /* Don't encode forbidden characters. */
2553 { "news:test.tes<|>t.com", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2555 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2557 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2559 {".com",S_OK
,FALSE
},
2563 {"test.tes<|>t.com",S_OK
,FALSE
},
2564 {"test.tes<|>t.com",S_OK
,FALSE
},
2566 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2567 {"news",S_OK
,FALSE
},
2572 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2574 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2575 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2578 /* Forbidden characters aren't encoded for unknown, opaque URIs. */
2579 { "urn:test.tes<|>t.com", 0, S_OK
, FALSE
,
2581 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2583 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2585 {".com",S_OK
,FALSE
},
2589 {"test.tes<|>t.com",S_OK
,FALSE
},
2590 {"test.tes<|>t.com",S_OK
,FALSE
},
2592 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2598 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2600 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2601 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2604 /* Percent encoded unreserved characters are decoded for known opaque URIs. */
2605 { "news:test.%74%65%73%74.com", 0, S_OK
, FALSE
,
2607 {"news:test.test.com",S_OK
,FALSE
},
2609 {"news:test.test.com",S_OK
,FALSE
},
2611 {".com",S_OK
,FALSE
},
2615 {"test.test.com",S_OK
,FALSE
},
2616 {"test.test.com",S_OK
,FALSE
},
2618 {"news:test.%74%65%73%74.com",S_OK
,FALSE
},
2619 {"news",S_OK
,FALSE
},
2624 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2626 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2627 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2630 /* Percent encoded characters are still decoded for known scheme types. */
2631 { "news:test.%74%65%73%74.com", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2633 {"news:test.test.com",S_OK
,FALSE
},
2635 {"news:test.test.com",S_OK
,FALSE
},
2637 {".com",S_OK
,FALSE
},
2641 {"test.test.com",S_OK
,FALSE
},
2642 {"test.test.com",S_OK
,FALSE
},
2644 {"news:test.%74%65%73%74.com",S_OK
,FALSE
},
2645 {"news",S_OK
,FALSE
},
2650 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2652 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2653 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2656 /* Percent encoded characters aren't decoded for unknown scheme types. */
2657 { "urn:test.%74%65%73%74.com", 0, S_OK
, FALSE
,
2659 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2661 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2663 {".com",S_OK
,FALSE
},
2667 {"test.%74%65%73%74.com",S_OK
,FALSE
},
2668 {"test.%74%65%73%74.com",S_OK
,FALSE
},
2670 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2676 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2678 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2679 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2682 /* Unknown scheme types can have invalid % encoded data in query string. */
2683 { "zip://www.winehq.org/tests/..?query=%xx&return=y", 0, S_OK
, FALSE
,
2685 {"zip://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2686 {"www.winehq.org",S_OK
,FALSE
},
2687 {"zip://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2688 {"winehq.org",S_OK
,FALSE
},
2691 {"www.winehq.org",S_OK
,FALSE
},
2694 {"/?query=%xx&return=y",S_OK
,FALSE
},
2695 {"?query=%xx&return=y",S_OK
,FALSE
},
2696 {"zip://www.winehq.org/tests/..?query=%xx&return=y",S_OK
,FALSE
},
2702 {Uri_HOST_DNS
,S_OK
,FALSE
},
2704 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2705 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2708 /* Known scheme types can have invalid % encoded data with the right flags. */
2709 { "http://www.winehq.org/tests/..?query=%xx&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
2711 {"http://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2712 {"www.winehq.org",S_OK
,FALSE
},
2713 {"http://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2714 {"winehq.org",S_OK
,FALSE
},
2717 {"www.winehq.org",S_OK
,FALSE
},
2720 {"/?query=%xx&return=y",S_OK
,FALSE
},
2721 {"?query=%xx&return=y",S_OK
,FALSE
},
2722 {"http://www.winehq.org/tests/..?query=%xx&return=y",S_OK
,FALSE
},
2723 {"http",S_OK
,FALSE
},
2728 {Uri_HOST_DNS
,S_OK
,FALSE
},
2730 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2731 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2734 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2735 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
2737 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2738 {"www.winehq.org",S_OK
,FALSE
},
2739 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2740 {"winehq.org",S_OK
,FALSE
},
2743 {"www.winehq.org",S_OK
,FALSE
},
2746 {"/?query=<|>&return=y",S_OK
,FALSE
},
2747 {"?query=<|>&return=y",S_OK
,FALSE
},
2748 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2749 {"http",S_OK
,FALSE
},
2754 {Uri_HOST_DNS
,S_OK
,FALSE
},
2756 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2757 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2760 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2761 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2763 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2764 {"www.winehq.org",S_OK
,FALSE
},
2765 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2766 {"winehq.org",S_OK
,FALSE
},
2769 {"www.winehq.org",S_OK
,FALSE
},
2772 {"/?query=<|>&return=y",S_OK
,FALSE
},
2773 {"?query=<|>&return=y",S_OK
,FALSE
},
2774 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2775 {"http",S_OK
,FALSE
},
2780 {Uri_HOST_DNS
,S_OK
,FALSE
},
2782 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2783 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2786 /* Forbidden characters are encoded for known scheme types. */
2787 { "http://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK
, FALSE
,
2789 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2790 {"www.winehq.org",S_OK
,FALSE
},
2791 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2792 {"winehq.org",S_OK
,FALSE
},
2795 {"www.winehq.org",S_OK
,FALSE
},
2798 {"/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2799 {"?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2800 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2801 {"http",S_OK
,FALSE
},
2806 {Uri_HOST_DNS
,S_OK
,FALSE
},
2808 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2809 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2812 /* Forbidden characters are not encoded for unknown scheme types. */
2813 { "zip://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK
, FALSE
,
2815 {"zip://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2816 {"www.winehq.org",S_OK
,FALSE
},
2817 {"zip://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2818 {"winehq.org",S_OK
,FALSE
},
2821 {"www.winehq.org",S_OK
,FALSE
},
2824 {"/?query=<|>&return=y",S_OK
,FALSE
},
2825 {"?query=<|>&return=y",S_OK
,FALSE
},
2826 {"zip://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2832 {Uri_HOST_DNS
,S_OK
,FALSE
},
2834 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2835 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2838 /* Percent encoded, unreserved characters are decoded for known scheme types. */
2839 { "http://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK
, FALSE
,
2841 {"http://www.winehq.org/?query=01&return=y",S_OK
,FALSE
},
2842 {"www.winehq.org",S_OK
,FALSE
},
2843 {"http://www.winehq.org/?query=01&return=y",S_OK
,FALSE
},
2844 {"winehq.org",S_OK
,FALSE
},
2847 {"www.winehq.org",S_OK
,FALSE
},
2850 {"/?query=01&return=y",S_OK
,FALSE
},
2851 {"?query=01&return=y",S_OK
,FALSE
},
2852 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
2853 {"http",S_OK
,FALSE
},
2858 {Uri_HOST_DNS
,S_OK
,FALSE
},
2860 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2861 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2864 /* Percent encoded, unreserved characters aren't decoded for unknown scheme types. */
2865 { "zip://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK
, FALSE
,
2867 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
2868 {"www.winehq.org",S_OK
,FALSE
},
2869 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
2870 {"winehq.org",S_OK
,FALSE
},
2873 {"www.winehq.org",S_OK
,FALSE
},
2876 {"/?query=%30%31&return=y",S_OK
,FALSE
},
2877 {"?query=%30%31&return=y",S_OK
,FALSE
},
2878 {"zip://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
2884 {Uri_HOST_DNS
,S_OK
,FALSE
},
2886 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2887 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2890 /* Percent encoded characters aren't decoded when NO_DECODE_EXTRA_INFO is set. */
2891 { "http://www.winehq.org/tests/..?query=%30%31&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
2893 {"http://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
2894 {"www.winehq.org",S_OK
,FALSE
},
2895 {"http://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
2896 {"winehq.org",S_OK
,FALSE
},
2899 {"www.winehq.org",S_OK
,FALSE
},
2902 {"/?query=%30%31&return=y",S_OK
,FALSE
},
2903 {"?query=%30%31&return=y",S_OK
,FALSE
},
2904 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
2905 {"http",S_OK
,FALSE
},
2910 {Uri_HOST_DNS
,S_OK
,FALSE
},
2912 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2913 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2916 { "http://www.winehq.org?query=12&return=y", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2918 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
2919 {"www.winehq.org",S_OK
,FALSE
},
2920 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
2921 {"winehq.org",S_OK
,FALSE
},
2924 {"www.winehq.org",S_OK
,FALSE
},
2927 {"?query=12&return=y",S_OK
,FALSE
},
2928 {"?query=12&return=y",S_OK
,FALSE
},
2929 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
2930 {"http",S_OK
,FALSE
},
2935 {Uri_HOST_DNS
,S_OK
,FALSE
},
2937 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2938 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2941 /* Unknown scheme types can have invalid % encoded data in fragments. */
2942 { "zip://www.winehq.org/tests/#Te%xx", 0, S_OK
, FALSE
,
2944 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
2945 {"www.winehq.org",S_OK
,FALSE
},
2946 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
2947 {"winehq.org",S_OK
,FALSE
},
2949 {"#Te%xx",S_OK
,FALSE
},
2950 {"www.winehq.org",S_OK
,FALSE
},
2952 {"/tests/",S_OK
,FALSE
},
2953 {"/tests/",S_OK
,FALSE
},
2955 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
2961 {Uri_HOST_DNS
,S_OK
,FALSE
},
2963 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2964 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2967 /* Forbidden characters in fragment aren't encoded for unknown schemes. */
2968 { "zip://www.winehq.org/tests/#Te<|>", 0, S_OK
, FALSE
,
2970 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
2971 {"www.winehq.org",S_OK
,FALSE
},
2972 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
2973 {"winehq.org",S_OK
,FALSE
},
2975 {"#Te<|>",S_OK
,FALSE
},
2976 {"www.winehq.org",S_OK
,FALSE
},
2978 {"/tests/",S_OK
,FALSE
},
2979 {"/tests/",S_OK
,FALSE
},
2981 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
2987 {Uri_HOST_DNS
,S_OK
,FALSE
},
2989 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2990 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2993 /* Forbidden characters in the fragment are percent encoded for known schemes. */
2994 { "http://www.winehq.org/tests/#Te<|>", 0, S_OK
, FALSE
,
2996 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK
,FALSE
},
2997 {"www.winehq.org",S_OK
,FALSE
},
2998 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK
,FALSE
},
2999 {"winehq.org",S_OK
,FALSE
},
3001 {"#Te%3C%7C%3E",S_OK
,FALSE
},
3002 {"www.winehq.org",S_OK
,FALSE
},
3004 {"/tests/",S_OK
,FALSE
},
3005 {"/tests/",S_OK
,FALSE
},
3007 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3008 {"http",S_OK
,FALSE
},
3013 {Uri_HOST_DNS
,S_OK
,FALSE
},
3015 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3016 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3019 /* Forbidden characters aren't encoded in the fragment with this flag. */
3020 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
3022 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3023 {"www.winehq.org",S_OK
,FALSE
},
3024 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3025 {"winehq.org",S_OK
,FALSE
},
3027 {"#Te<|>",S_OK
,FALSE
},
3028 {"www.winehq.org",S_OK
,FALSE
},
3030 {"/tests/",S_OK
,FALSE
},
3031 {"/tests/",S_OK
,FALSE
},
3033 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3034 {"http",S_OK
,FALSE
},
3039 {Uri_HOST_DNS
,S_OK
,FALSE
},
3041 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3042 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3045 /* Forbidden characters aren't encoded in the fragment with this flag. */
3046 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
3048 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3049 {"www.winehq.org",S_OK
,FALSE
},
3050 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3051 {"winehq.org",S_OK
,FALSE
},
3053 {"#Te<|>",S_OK
,FALSE
},
3054 {"www.winehq.org",S_OK
,FALSE
},
3056 {"/tests/",S_OK
,FALSE
},
3057 {"/tests/",S_OK
,FALSE
},
3059 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3060 {"http",S_OK
,FALSE
},
3065 {Uri_HOST_DNS
,S_OK
,FALSE
},
3067 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3068 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3071 /* Percent encoded, unreserved characters aren't decoded for known scheme types. */
3072 { "zip://www.winehq.org/tests/#Te%30%31%32", 0, S_OK
, FALSE
,
3074 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3075 {"www.winehq.org",S_OK
,FALSE
},
3076 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3077 {"winehq.org",S_OK
,FALSE
},
3079 {"#Te%30%31%32",S_OK
,FALSE
},
3080 {"www.winehq.org",S_OK
,FALSE
},
3082 {"/tests/",S_OK
,FALSE
},
3083 {"/tests/",S_OK
,FALSE
},
3085 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3091 {Uri_HOST_DNS
,S_OK
,FALSE
},
3093 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3094 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3097 /* Percent encoded, unreserved characters are decoded for known schemes. */
3098 { "http://www.winehq.org/tests/#Te%30%31%32", 0, S_OK
, FALSE
,
3100 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3101 {"www.winehq.org",S_OK
,FALSE
},
3102 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3103 {"winehq.org",S_OK
,FALSE
},
3105 {"#Te012",S_OK
,FALSE
},
3106 {"www.winehq.org",S_OK
,FALSE
},
3108 {"/tests/",S_OK
,FALSE
},
3109 {"/tests/",S_OK
,FALSE
},
3111 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3112 {"http",S_OK
,FALSE
},
3117 {Uri_HOST_DNS
,S_OK
,FALSE
},
3119 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3120 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3123 /* Percent encoded, unreserved characters are decoded even if NO_CANONICALIZE is set. */
3124 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
3126 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3127 {"www.winehq.org",S_OK
,FALSE
},
3128 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3129 {"winehq.org",S_OK
,FALSE
},
3131 {"#Te012",S_OK
,FALSE
},
3132 {"www.winehq.org",S_OK
,FALSE
},
3134 {"/tests/",S_OK
,FALSE
},
3135 {"/tests/",S_OK
,FALSE
},
3137 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3138 {"http",S_OK
,FALSE
},
3143 {Uri_HOST_DNS
,S_OK
,FALSE
},
3145 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3146 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3149 /* Percent encoded, unreserved characters aren't decoded when NO_DECODE_EXTRA is set. */
3150 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
3152 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3153 {"www.winehq.org",S_OK
,FALSE
},
3154 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3155 {"winehq.org",S_OK
,FALSE
},
3157 {"#Te%30%31%32",S_OK
,FALSE
},
3158 {"www.winehq.org",S_OK
,FALSE
},
3160 {"/tests/",S_OK
,FALSE
},
3161 {"/tests/",S_OK
,FALSE
},
3163 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3164 {"http",S_OK
,FALSE
},
3169 {Uri_HOST_DNS
,S_OK
,FALSE
},
3171 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3172 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3175 /* Leading/Trailing whitespace is removed. */
3176 { " http://google.com/ ", 0, S_OK
, FALSE
,
3178 {"http://google.com/",S_OK
,FALSE
},
3179 {"google.com",S_OK
,FALSE
},
3180 {"http://google.com/",S_OK
,FALSE
},
3181 {"google.com",S_OK
,FALSE
},
3184 {"google.com",S_OK
,FALSE
},
3189 {"http://google.com/",S_OK
,FALSE
},
3190 {"http",S_OK
,FALSE
},
3195 {Uri_HOST_DNS
,S_OK
,FALSE
},
3197 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3198 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3201 { "\t\t\r\nhttp\n://g\noogle.co\rm/\n\n\n", 0, S_OK
, FALSE
,
3203 {"http://google.com/",S_OK
,FALSE
},
3204 {"google.com",S_OK
,FALSE
},
3205 {"http://google.com/",S_OK
,FALSE
},
3206 {"google.com",S_OK
,FALSE
},
3209 {"google.com",S_OK
,FALSE
},
3214 {"http://google.com/",S_OK
,FALSE
},
3215 {"http",S_OK
,FALSE
},
3220 {Uri_HOST_DNS
,S_OK
,FALSE
},
3222 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3223 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3226 { "http://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
3228 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK
,FALSE
},
3229 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3230 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK
,FALSE
},
3231 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3234 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3236 {"/%0A%0A%0A",S_OK
,FALSE
},
3237 {"/%0A%0A%0A",S_OK
,FALSE
},
3239 {"http://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3240 {"http",S_OK
,FALSE
},
3245 {Uri_HOST_DNS
,S_OK
,FALSE
},
3247 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3248 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3251 { "zip://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
3253 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3254 {"g\noogle.co\rm",S_OK
,FALSE
},
3255 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3256 {"g\noogle.co\rm",S_OK
,FALSE
},
3259 {"g\noogle.co\rm",S_OK
,FALSE
},
3261 {"/\n\n\n",S_OK
,FALSE
},
3262 {"/\n\n\n",S_OK
,FALSE
},
3264 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3270 {Uri_HOST_DNS
,S_OK
,FALSE
},
3272 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3273 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3276 /* Since file URLs are usually hierarchical, it returns an empty string
3277 * for the absolute URI property since it was declared as an opaque URI.
3279 { "file:index.html", 0, S_OK
, FALSE
,
3283 {"file:index.html",S_OK
,FALSE
},
3285 {".html",S_OK
,FALSE
},
3289 {"index.html",S_OK
,FALSE
},
3290 {"index.html",S_OK
,FALSE
},
3292 {"file:index.html",S_OK
,FALSE
},
3293 {"file",S_OK
,FALSE
},
3298 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3300 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3301 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3304 /* Doesn't have an absolute since it's opaque, but gets it port set. */
3305 { "http:test.com/index.html", 0, S_OK
, FALSE
,
3309 {"http:test.com/index.html",S_OK
,FALSE
},
3311 {".html",S_OK
,FALSE
},
3315 {"test.com/index.html",S_OK
,FALSE
},
3316 {"test.com/index.html",S_OK
,FALSE
},
3318 {"http:test.com/index.html",S_OK
,FALSE
},
3319 {"http",S_OK
,FALSE
},
3324 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3326 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3327 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3330 { "ftp:test.com/index.html", 0, S_OK
, FALSE
,
3334 {"ftp:test.com/index.html",S_OK
,FALSE
},
3336 {".html",S_OK
,FALSE
},
3340 {"test.com/index.html",S_OK
,FALSE
},
3341 {"test.com/index.html",S_OK
,FALSE
},
3343 {"ftp:test.com/index.html",S_OK
,FALSE
},
3349 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3351 {URL_SCHEME_FTP
,S_OK
,FALSE
},
3352 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3355 { "file://C|/test.mp3", 0, S_OK
, FALSE
,
3357 {"file:///C:/test.mp3",S_OK
,FALSE
},
3359 {"file:///C:/test.mp3",S_OK
,FALSE
},
3361 {".mp3",S_OK
,FALSE
},
3365 {"/C:/test.mp3",S_OK
,FALSE
},
3366 {"/C:/test.mp3",S_OK
,FALSE
},
3368 {"file://C|/test.mp3",S_OK
,FALSE
},
3369 {"file",S_OK
,FALSE
},
3374 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3376 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3377 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3380 { "file:///C|/test.mp3", 0, S_OK
, FALSE
,
3382 {"file:///C:/test.mp3",S_OK
,FALSE
},
3384 {"file:///C:/test.mp3",S_OK
,FALSE
},
3386 {".mp3",S_OK
,FALSE
},
3390 {"/C:/test.mp3",S_OK
,FALSE
},
3391 {"/C:/test.mp3",S_OK
,FALSE
},
3393 {"file:///C|/test.mp3",S_OK
,FALSE
},
3394 {"file",S_OK
,FALSE
},
3399 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3401 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3402 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3405 /* Extra '/' isn't added before "c:" since USE_DOS_PATH is set and '/' are converted
3408 { "file://c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3410 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3412 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3414 {".html",S_OK
,FALSE
},
3418 {"c:\\dir\\index.html",S_OK
,FALSE
},
3419 {"c:\\dir\\index.html",S_OK
,FALSE
},
3421 {"file://c:/dir/index.html",S_OK
,FALSE
},
3422 {"file",S_OK
,FALSE
},
3427 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3429 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3430 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3433 /* Extra '/' after "file://" is removed. */
3434 { "file:///c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3436 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3438 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3440 {".html",S_OK
,FALSE
},
3444 {"c:\\dir\\index.html",S_OK
,FALSE
},
3445 {"c:\\dir\\index.html",S_OK
,FALSE
},
3447 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3448 {"file",S_OK
,FALSE
},
3453 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3455 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3456 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3459 /* Allow more characters when Uri_CREATE_FILE_USE_DOS_PATH is specified */
3460 { "file:///c:/dir\\%%61%20%5Fname/file%2A.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3462 {"file://c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3464 {"file://c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3466 {".html",S_OK
,FALSE
},
3470 {"c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3471 {"c:\\dir\\%a _name\\file*.html",S_OK
,FALSE
},
3473 {"file:///c:/dir\\%%61%20%5Fname/file%2A.html",S_OK
,FALSE
},
3474 {"file",S_OK
,FALSE
},
3479 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3481 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3482 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3485 { "file://c|/dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3487 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3489 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3491 {".html",S_OK
,FALSE
},
3495 {"c:\\dir\\index.html",S_OK
,FALSE
},
3496 {"c:\\dir\\index.html",S_OK
,FALSE
},
3498 {"file://c|/dir\\index.html",S_OK
,FALSE
},
3499 {"file",S_OK
,FALSE
},
3504 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3506 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3507 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3510 /* The backslashes after the scheme name are converted to forward slashes. */
3511 { "file:\\\\c:\\dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3513 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3515 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3517 {".html",S_OK
,FALSE
},
3521 {"c:\\dir\\index.html",S_OK
,FALSE
},
3522 {"c:\\dir\\index.html",S_OK
,FALSE
},
3524 {"file:\\\\c:\\dir\\index.html",S_OK
,FALSE
},
3525 {"file",S_OK
,FALSE
},
3530 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3532 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3533 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3536 { "file:\\\\c:/dir/index.html", 0, S_OK
, FALSE
,
3538 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3540 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3542 {".html",S_OK
,FALSE
},
3546 {"/c:/dir/index.html",S_OK
,FALSE
},
3547 {"/c:/dir/index.html",S_OK
,FALSE
},
3549 {"file:\\\\c:/dir/index.html",S_OK
,FALSE
},
3550 {"file",S_OK
,FALSE
},
3555 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3557 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3558 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3561 { "http:\\\\google.com", 0, S_OK
, FALSE
,
3563 {"http://google.com/",S_OK
,FALSE
},
3564 {"google.com",S_OK
,FALSE
},
3565 {"http://google.com/",S_OK
,FALSE
},
3566 {"google.com",S_OK
,FALSE
},
3569 {"google.com",S_OK
,FALSE
},
3574 {"http:\\\\google.com",S_OK
,FALSE
},
3575 {"http",S_OK
,FALSE
},
3580 {Uri_HOST_DNS
,S_OK
,FALSE
},
3582 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3583 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3586 /* the "\\\\" aren't converted to "//" for unknown scheme types and it's considered opaque. */
3587 { "zip:\\\\google.com", 0, S_OK
, FALSE
,
3589 {"zip:\\\\google.com",S_OK
,FALSE
},
3591 {"zip:\\\\google.com",S_OK
,FALSE
},
3593 {".com",S_OK
,FALSE
},
3597 {"\\\\google.com",S_OK
,FALSE
},
3598 {"\\\\google.com",S_OK
,FALSE
},
3600 {"zip:\\\\google.com",S_OK
,FALSE
},
3606 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3608 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3609 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3612 /* Dot segments aren't removed. */
3613 { "file://c:\\dir\\../..\\./index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3615 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3617 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3619 {".html",S_OK
,FALSE
},
3623 {"c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3624 {"c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3626 {"file://c:\\dir\\../..\\./index.html",S_OK
,FALSE
},
3627 {"file",S_OK
,FALSE
},
3632 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3634 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3635 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3638 /* Forbidden characters aren't percent encoded. */
3639 { "file://c:\\dir\\i^|ndex.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3641 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3643 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3645 {".html",S_OK
,FALSE
},
3649 {"c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3650 {"c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3652 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3653 {"file",S_OK
,FALSE
},
3658 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3660 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3661 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3664 /* The '\' are still converted to '/' even though it's an opaque file URI. */
3665 { "file:c:\\dir\\../..\\index.html", 0, S_OK
, FALSE
,
3669 {"file:c:/dir/../../index.html",S_OK
,FALSE
},
3671 {".html",S_OK
,FALSE
},
3675 {"c:/dir/../../index.html",S_OK
,FALSE
},
3676 {"c:/dir/../../index.html",S_OK
,FALSE
},
3678 {"file:c:\\dir\\../..\\index.html",S_OK
,FALSE
},
3679 {"file",S_OK
,FALSE
},
3684 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3686 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3687 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3690 /* '/' are still converted to '\' even though it's an opaque URI. */
3691 { "file:c:/dir\\../..\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3695 {"file:c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3697 {".html",S_OK
,FALSE
},
3701 {"c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3702 {"c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3704 {"file:c:/dir\\../..\\index.html",S_OK
,FALSE
},
3705 {"file",S_OK
,FALSE
},
3710 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3712 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3713 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3716 /* Forbidden characters aren't percent encoded. */
3717 { "file:c:\\in^|dex.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3721 {"file:c:\\in^|dex.html",S_OK
,FALSE
},
3723 {".html",S_OK
,FALSE
},
3727 {"c:\\in^|dex.html",S_OK
,FALSE
},
3728 {"c:\\in^|dex.html",S_OK
,FALSE
},
3730 {"file:c:\\in^|dex.html",S_OK
,FALSE
},
3731 {"file",S_OK
,FALSE
},
3736 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3738 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3739 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3742 /* Doesn't have a UserName since the ':' appears at the beginning of the
3745 { "http://:password@gov.uk", 0, S_OK
, FALSE
,
3747 {"http://:password@gov.uk/",S_OK
,FALSE
},
3748 {":password@gov.uk",S_OK
,FALSE
},
3749 {"http://gov.uk/",S_OK
,FALSE
},
3753 {"gov.uk",S_OK
,FALSE
},
3754 {"password",S_OK
,FALSE
},
3758 {"http://:password@gov.uk",S_OK
,FALSE
},
3759 {"http",S_OK
,FALSE
},
3760 {":password",S_OK
,FALSE
},
3764 {Uri_HOST_DNS
,S_OK
,FALSE
},
3766 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3767 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3770 /* Has a UserName since the userinfo section doesn't contain a password. */
3771 { "http://@gov.uk", 0, S_OK
, FALSE
,
3773 {"http://gov.uk/",S_OK
,FALSE
,"http://@gov.uk/"},
3774 {"@gov.uk",S_OK
,FALSE
},
3775 {"http://gov.uk/",S_OK
,FALSE
},
3779 {"gov.uk",S_OK
,FALSE
},
3784 {"http://@gov.uk",S_OK
,FALSE
},
3785 {"http",S_OK
,FALSE
},
3790 {Uri_HOST_DNS
,S_OK
,FALSE
},
3792 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3793 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3796 /* ":@" not included in the absolute URI. */
3797 { "http://:@gov.uk", 0, S_OK
, FALSE
,
3799 {"http://gov.uk/",S_OK
,FALSE
,"http://:@gov.uk/"},
3800 {":@gov.uk",S_OK
,FALSE
},
3801 {"http://gov.uk/",S_OK
,FALSE
},
3805 {"gov.uk",S_OK
,FALSE
},
3810 {"http://:@gov.uk",S_OK
,FALSE
},
3811 {"http",S_OK
,FALSE
},
3816 {Uri_HOST_DNS
,S_OK
,FALSE
},
3818 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3819 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3822 /* '@' is included because it's an unknown scheme type. */
3823 { "zip://@gov.uk", 0, S_OK
, FALSE
,
3825 {"zip://@gov.uk/",S_OK
,FALSE
},
3826 {"@gov.uk",S_OK
,FALSE
},
3827 {"zip://@gov.uk/",S_OK
,FALSE
},
3831 {"gov.uk",S_OK
,FALSE
},
3836 {"zip://@gov.uk",S_OK
,FALSE
},
3842 {Uri_HOST_DNS
,S_OK
,FALSE
},
3844 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3845 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3848 /* ":@" are included because it's an unknown scheme type. */
3849 { "zip://:@gov.uk", 0, S_OK
, FALSE
,
3851 {"zip://:@gov.uk/",S_OK
,FALSE
},
3852 {":@gov.uk",S_OK
,FALSE
},
3853 {"zip://:@gov.uk/",S_OK
,FALSE
},
3857 {"gov.uk",S_OK
,FALSE
},
3862 {"zip://:@gov.uk",S_OK
,FALSE
},
3868 {Uri_HOST_DNS
,S_OK
,FALSE
},
3870 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3871 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3874 { "about:blank", 0, S_OK
, FALSE
,
3876 {"about:blank",S_OK
,FALSE
},
3878 {"about:blank",S_OK
,FALSE
},
3884 {"blank",S_OK
,FALSE
},
3885 {"blank",S_OK
,FALSE
},
3887 {"about:blank",S_OK
,FALSE
},
3888 {"about",S_OK
,FALSE
},
3893 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3895 {URL_SCHEME_ABOUT
,S_OK
,FALSE
},
3896 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3899 { "mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",0,S_OK
,FALSE
,
3901 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
3903 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
3905 {".htm",S_OK
,FALSE
},
3909 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
3910 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
3912 {"mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK
,FALSE
},
3918 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3920 {URL_SCHEME_MK
,S_OK
,FALSE
},
3921 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3924 { "mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",0,S_OK
,FALSE
,
3926 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
3928 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
3930 {".htm",S_OK
,FALSE
},
3934 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
3935 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
3937 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK
,FALSE
},
3943 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3945 {URL_SCHEME_MK
,S_OK
,FALSE
},
3946 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3949 /* Two '\' are added to the URI when USE_DOS_PATH is set, and it's a UNC path. */
3950 { "file://server/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3952 {"file://\\\\server\\dir\\index.html",S_OK
,FALSE
},
3953 {"server",S_OK
,FALSE
},
3954 {"file://\\\\server\\dir\\index.html",S_OK
,FALSE
},
3956 {".html",S_OK
,FALSE
},
3958 {"server",S_OK
,FALSE
},
3960 {"\\dir\\index.html",S_OK
,FALSE
},
3961 {"\\dir\\index.html",S_OK
,FALSE
},
3963 {"file://server/dir/index.html",S_OK
,FALSE
},
3964 {"file",S_OK
,FALSE
},
3969 {Uri_HOST_DNS
,S_OK
,FALSE
},
3971 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3972 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3975 /* When CreateUri generates an IUri, it still displays the default port in the
3978 { "http://google.com:80/", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
3980 {"http://google.com:80/",S_OK
,FALSE
},
3981 {"google.com:80",S_OK
,FALSE
},
3982 {"http://google.com:80/",S_OK
,FALSE
},
3983 {"google.com",S_OK
,FALSE
},
3986 {"google.com",S_OK
,FALSE
},
3991 {"http://google.com:80/",S_OK
,FALSE
},
3992 {"http",S_OK
,FALSE
},
3997 {Uri_HOST_DNS
,S_OK
,FALSE
},
3999 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
4000 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4003 /* For res URIs the host is everything up until the first '/'. */
4004 { "res://C:\\dir\\file.exe/DATA/test.html", 0, S_OK
, FALSE
,
4006 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK
,FALSE
},
4007 {"C:\\dir\\file.exe",S_OK
,FALSE
},
4008 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK
,FALSE
},
4010 {".html",S_OK
,FALSE
},
4012 {"C:\\dir\\file.exe",S_OK
,FALSE
},
4014 {"/DATA/test.html",S_OK
,FALSE
},
4015 {"/DATA/test.html",S_OK
,FALSE
},
4017 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK
,FALSE
},
4023 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4025 {URL_SCHEME_RES
,S_OK
,FALSE
},
4026 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4029 /* Res URI can contain a '|' in the host name. */
4030 { "res://c:\\di|r\\file.exe/test", 0, S_OK
, FALSE
,
4032 {"res://c:\\di|r\\file.exe/test",S_OK
,FALSE
},
4033 {"c:\\di|r\\file.exe",S_OK
,FALSE
},
4034 {"res://c:\\di|r\\file.exe/test",S_OK
,FALSE
},
4038 {"c:\\di|r\\file.exe",S_OK
,FALSE
},
4040 {"/test",S_OK
,FALSE
},
4041 {"/test",S_OK
,FALSE
},
4043 {"res://c:\\di|r\\file.exe/test",S_OK
,FALSE
},
4049 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4051 {URL_SCHEME_RES
,S_OK
,FALSE
},
4052 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
4055 /* Res URIs can have invalid percent encoded values. */
4056 { "res://c:\\dir%xx\\file.exe/test", 0, S_OK
, FALSE
,
4058 {"res://c:\\dir%xx\\file.exe/test",S_OK
,FALSE
},
4059 {"c:\\dir%xx\\file.exe",S_OK
,FALSE
},
4060 {"res://c:\\dir%xx\\file.exe/test",S_OK
,FALSE
},
4064 {"c:\\dir%xx\\file.exe",S_OK
,FALSE
},
4066 {"/test",S_OK
,FALSE
},
4067 {"/test",S_OK
,FALSE
},
4069 {"res://c:\\dir%xx\\file.exe/test",S_OK
,FALSE
},
4075 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4077 {URL_SCHEME_RES
,S_OK
,FALSE
},
4078 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4081 /* Res doesn't get forbidden characters percent encoded in its path. */
4082 { "res://c:\\test/tes<|>t", 0, S_OK
, FALSE
,
4084 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4085 {"c:\\test",S_OK
,FALSE
},
4086 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4090 {"c:\\test",S_OK
,FALSE
},
4092 {"/tes<|>t",S_OK
,FALSE
},
4093 {"/tes<|>t",S_OK
,FALSE
},
4095 {"res://c:\\test/tes<|>t",S_OK
,FALSE
},
4101 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4103 {URL_SCHEME_RES
,S_OK
,FALSE
},
4104 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4107 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK
, FALSE
,
4109 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4111 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4113 {".jpg",S_OK
,FALSE
},
4117 {"@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4118 {"@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK
,FALSE
},
4120 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4126 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4128 {URL_SCHEME_MK
,S_OK
,FALSE
},
4129 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4132 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4134 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4136 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4138 {".jpg",S_OK
,FALSE
},
4142 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4143 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4145 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4151 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4153 {URL_SCHEME_MK
,S_OK
,FALSE
},
4154 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4157 { "xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK
, FALSE
,
4159 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4161 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4163 {".jpg",S_OK
,FALSE
},
4167 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4168 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4170 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK
,FALSE
},
4176 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4178 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4179 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4182 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg", 0, S_OK
, FALSE
,
4184 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4186 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4188 {".jpg",S_OK
,FALSE
},
4192 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4193 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4195 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg",S_OK
,FALSE
},
4201 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4203 {URL_SCHEME_MK
,S_OK
,FALSE
},
4204 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4207 { "mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg", 0, S_OK
, FALSE
,
4209 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4211 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4213 {".jpg",S_OK
,FALSE
},
4217 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4218 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK
,FALSE
},
4220 {"mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg",S_OK
,FALSE
},
4226 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4228 {URL_SCHEME_MK
,S_OK
,FALSE
},
4229 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4232 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg", 0, S_OK
, FALSE
,
4234 {"mk:images/xxx.jpg",S_OK
,FALSE
},
4236 {"mk:images/xxx.jpg",S_OK
,FALSE
},
4238 {".jpg",S_OK
,FALSE
},
4242 {"images/xxx.jpg",S_OK
,FALSE
},
4243 {"images/xxx.jpg",S_OK
,FALSE
},
4245 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg",S_OK
,FALSE
},
4251 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4253 {URL_SCHEME_MK
,S_OK
,FALSE
},
4254 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4257 { "", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4276 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4278 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4279 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4282 { " \t ", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4301 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
4303 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
4304 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4307 { "javascript:void", 0, S_OK
, FALSE
,
4309 {"javascript:void",S_OK
},
4311 {"javascript:void",S_OK
},
4320 {"javascript:void",S_OK
},
4321 {"javascript",S_OK
},
4326 {Uri_HOST_UNKNOWN
,S_OK
},
4328 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4329 {URLZONE_INVALID
,E_NOTIMPL
}
4332 { "javascript://undefined", 0, S_OK
, FALSE
,
4334 {"javascript://undefined",S_OK
},
4336 {"javascript://undefined",S_OK
},
4342 {"//undefined",S_OK
},
4343 {"//undefined",S_OK
},
4345 {"javascript://undefined",S_OK
},
4346 {"javascript",S_OK
},
4351 {Uri_HOST_UNKNOWN
,S_OK
},
4353 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4354 {URLZONE_INVALID
,E_NOTIMPL
}
4357 { "JavaSCript:escape('/\\?#?')", 0, S_OK
, FALSE
,
4359 {"javascript:escape('/\\?#?')",S_OK
},
4361 {"javascript:escape('/\\?#?')",S_OK
},
4367 {"escape('/\\?#?')",S_OK
},
4368 {"escape('/\\?#?')",S_OK
},
4370 {"JavaSCript:escape('/\\?#?')",S_OK
},
4371 {"javascript",S_OK
},
4376 {Uri_HOST_UNKNOWN
,S_OK
},
4378 {URL_SCHEME_JAVASCRIPT
,S_OK
},
4379 {URLZONE_INVALID
,E_NOTIMPL
}
4382 { "*://google.com", 0, S_OK
, FALSE
,
4384 {"*:google.com/",S_OK
,FALSE
},
4385 {"google.com",S_OK
},
4386 {"*:google.com/",S_OK
,FALSE
},
4387 {"google.com",S_OK
,FALSE
},
4390 {"google.com",S_OK
,FALSE
},
4395 {"*://google.com",S_OK
,FALSE
},
4401 {Uri_HOST_DNS
,S_OK
,FALSE
},
4403 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
4404 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4407 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",0,S_OK
,FALSE
,
4409 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4411 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4417 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4418 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4420 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/file.txt",S_OK
},
4426 {Uri_HOST_UNKNOWN
,S_OK
},
4428 {URL_SCHEME_MK
,S_OK
},
4429 {URLZONE_INVALID
,E_NOTIMPL
}
4432 { "gopher://test.winehq.org:151/file.txt",0,S_OK
,FALSE
,
4434 {"gopher://test.winehq.org:151/file.txt",S_OK
},
4435 {"test.winehq.org:151",S_OK
},
4436 {"gopher://test.winehq.org:151/file.txt",S_OK
},
4437 {"winehq.org",S_OK
},
4440 {"test.winehq.org",S_OK
},
4445 {"gopher://test.winehq.org:151/file.txt",S_OK
},
4451 {Uri_HOST_DNS
,S_OK
},
4453 {URL_SCHEME_GOPHER
,S_OK
},
4454 {URLZONE_INVALID
,E_NOTIMPL
}
4457 { "//host.com/path/file.txt?query", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4459 {"//host.com/path/file.txt?query",S_OK
},
4461 {"//host.com/path/file.txt?query",S_OK
},
4467 {"/path/file.txt",S_OK
},
4468 {"/path/file.txt?query",S_OK
},
4470 {"//host.com/path/file.txt?query",S_OK
},
4476 {Uri_HOST_DNS
,S_OK
},
4478 {URL_SCHEME_UNKNOWN
,S_OK
},
4479 {URLZONE_INVALID
,E_NOTIMPL
}
4482 { "//host/path/file.txt?query", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4484 {"//host/path/file.txt?query",S_OK
},
4486 {"//host/path/file.txt?query",S_OK
},
4492 {"/path/file.txt",S_OK
},
4493 {"/path/file.txt?query",S_OK
},
4495 {"//host/path/file.txt?query",S_OK
},
4501 {Uri_HOST_DNS
,S_OK
},
4503 {URL_SCHEME_UNKNOWN
,S_OK
},
4504 {URLZONE_INVALID
,E_NOTIMPL
}
4507 { "//host", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
4526 {Uri_HOST_DNS
,S_OK
},
4528 {URL_SCHEME_UNKNOWN
,S_OK
},
4529 {URLZONE_INVALID
,E_NOTIMPL
}
4532 { "mailto://", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4545 {"mailto://",S_OK
,FALSE
,"mailto:"},
4551 {Uri_HOST_UNKNOWN
,S_OK
},
4553 {URL_SCHEME_MAILTO
,S_OK
},
4554 {URLZONE_INVALID
,E_NOTIMPL
}
4557 { "mailto://a@b.com", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
4559 {"mailto:a@b.com",S_OK
},
4561 {"mailto:a@b.com",S_OK
},
4570 {"mailto://a@b.com",S_OK
,FALSE
,"mailto:a@b.com"},
4576 {Uri_HOST_UNKNOWN
,S_OK
},
4578 {URL_SCHEME_MAILTO
,S_OK
},
4579 {URLZONE_INVALID
,E_NOTIMPL
}
4584 typedef struct _invalid_uri
{
4590 static const invalid_uri invalid_uri_tests
[] = {
4591 /* Has to have a scheme name. */
4592 {"://www.winehq.org",0,FALSE
},
4593 /* Window's doesn't like URI's which are implicitly file paths without the
4594 * ALLOW_IMPLICIT_FILE_SCHEME flag set.
4596 {"C:/test/test.mp3",0,FALSE
},
4597 {"\\\\Server/test/test.mp3",0,FALSE
},
4598 {"C:/test/test.mp3",Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
,FALSE
},
4599 {"\\\\Server/test/test.mp3",Uri_CREATE_ALLOW_RELATIVE
,FALSE
},
4600 /* Invalid schemes. */
4601 {"*abcd://not.valid.com",0,FALSE
},
4602 {"*a*b*c*d://not.valid.com",0,FALSE
},
4603 /* Not allowed to have invalid % encoded data. */
4604 {"ftp://google.co%XX/",0,FALSE
},
4605 /* Too many h16 components. */
4606 {"http://[1:2:3:4:5:6:7:8:9]",0,FALSE
},
4607 /* Not enough room for IPv4 address. */
4608 {"http://[1:2:3:4:5:6:7:192.0.1.0]",0,FALSE
},
4609 /* Not enough h16 components. */
4610 {"http://[1:2:3:4]",0,FALSE
},
4611 /* Not enough components including IPv4. */
4612 {"http://[1:192.0.1.0]",0,FALSE
},
4613 /* Not allowed to have partial IPv4 in IPv6. */
4614 {"http://[::192.0]",0,FALSE
},
4615 /* Can't have elision of 1 h16 at beginning of address. */
4616 {"http://[::2:3:4:5:6:7:8]",0,FALSE
},
4617 /* Expects a valid IP Literal. */
4618 {"ftp://[not.valid.uri]/",0,FALSE
},
4619 /* Expects valid port for a known scheme type. */
4620 {"ftp://www.winehq.org:123fgh",0,FALSE
},
4621 /* Port exceeds USHORT_MAX for known scheme type. */
4622 {"ftp://www.winehq.org:65536",0,FALSE
},
4623 /* Invalid port with IPv4 address. */
4624 {"http://www.winehq.org:1abcd",0,FALSE
},
4625 /* Invalid port with IPv6 address. */
4626 {"http://[::ffff]:32xy",0,FALSE
},
4627 /* Not allowed to have backslashes with NO_CANONICALIZE. */
4628 {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE
,FALSE
},
4629 /* Not allowed to have invalid % encoded data in opaque URI path. */
4630 {"news:test%XX",0,FALSE
},
4631 {"mailto:wine@winehq%G8.com",0,FALSE
},
4632 /* Known scheme types can't have invalid % encoded data in query string. */
4633 {"http://google.com/?query=te%xx",0,FALSE
},
4634 /* Invalid % encoded data in fragment of know scheme type. */
4635 {"ftp://google.com/#Test%xx",0,FALSE
},
4636 {" http://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
4637 {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
4638 {"file://c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4639 {"file://c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4640 {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4641 {"file:c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4642 {"file:c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4643 {"file:c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4644 /* res URIs aren't allowed to have forbidden dos path characters in the
4647 {"res://c:\\te<st\\test/test",0,FALSE
},
4648 {"res://c:\\te>st\\test/test",0,FALSE
},
4649 {"res://c:\\te\"st\\test/test",0,FALSE
},
4650 {"res://c:\\test/te%xxst",0,FALSE
}
4653 typedef struct _uri_equality
{
4655 DWORD create_flags_a
;
4657 DWORD create_flags_b
;
4662 static const uri_equality equality_tests
[] = {
4664 "HTTP://www.winehq.org/test dir/./",0,
4665 "http://www.winehq.org/test dir/../test dir/",0,
4669 /* http://www.winehq.org/test%20dir */
4670 "http://%77%77%77%2E%77%69%6E%65%68%71%2E%6F%72%67/%74%65%73%74%20%64%69%72",0,
4671 "http://www.winehq.org/test dir",0,
4675 "c:\\test.mp3",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
4676 "file:///c:/test.mp3",0,
4680 "ftp://ftp.winehq.org/",0,
4681 "ftp://ftp.winehq.org",0,
4685 "ftp://ftp.winehq.org/test/test2/../../testB/",0,
4686 "ftp://ftp.winehq.org/t%45stB/",0,
4690 "http://google.com/TEST",0,
4691 "http://google.com/test",0,
4695 "http://GOOGLE.com/",0,
4696 "http://google.com/",0,
4699 /* Performs case insensitive compare of host names (for known scheme types). */
4701 "ftp://GOOGLE.com/",Uri_CREATE_NO_CANONICALIZE
,
4702 "ftp://google.com/",0,
4706 "zip://GOOGLE.com/",0,
4707 "zip://google.com/",0,
4711 "file:///c:/TEST/TeST/",0,
4712 "file:///c:/test/test/",0,
4716 "file:///server/TEST",0,
4717 "file:///SERVER/TEST",0,
4721 "http://google.com",Uri_CREATE_NO_CANONICALIZE
,
4722 "http://google.com/",0,
4726 "ftp://google.com:21/",0,
4727 "ftp://google.com/",0,
4731 "http://google.com:80/",Uri_CREATE_NO_CANONICALIZE
,
4732 "http://google.com/",0,
4736 "http://google.com:70/",0,
4737 "http://google.com:71/",0,
4741 "file:///c:/dir/file.txt", 0,
4742 "file:///c:/dir/file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
4746 "file:///c:/dir/file.txt", 0,
4747 "file:///c:\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
4751 "file:///c:/dir/file.txt", 0,
4752 "file:///c:\\dir2\\..\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
4756 "file:///c:\\dir2\\..\\ dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
4757 "file:///c:/%20dir/file.txt", 0,
4761 "file:///c:/Dir/file.txt", 0,
4762 "file:///C:/dir/file.TXT", Uri_CREATE_FILE_USE_DOS_PATH
,
4766 "file:///c:/dir/file.txt", 0,
4767 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
4771 "file:///c:/dir/file.txt#a", 0,
4772 "file:///c:\\dir\\file.txt#b", Uri_CREATE_FILE_USE_DOS_PATH
,
4775 /* Tests of an empty hash/fragment part */
4777 "http://google.com/test",0,
4778 "http://google.com/test#",0,
4782 "ftp://ftp.winehq.org/",0,
4783 "ftp://ftp.winehq.org/#",0,
4787 "file:///c:/dir/file.txt#", 0,
4788 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
4793 typedef struct _uri_with_fragment
{
4795 const char* fragment
;
4797 HRESULT create_expected
;
4800 const char* expected_uri
;
4802 } uri_with_fragment
;
4804 static const uri_with_fragment uri_fragment_tests
[] = {
4806 "http://google.com/","#fragment",0,S_OK
,FALSE
,
4807 "http://google.com/#fragment",FALSE
4810 "http://google.com/","fragment",0,S_OK
,FALSE
,
4811 "http://google.com/#fragment",FALSE
4814 "zip://test.com/","?test",0,S_OK
,FALSE
,
4815 "zip://test.com/#?test",FALSE
4817 /* The fragment can be empty. */
4819 "ftp://ftp.google.com/","",0,S_OK
,FALSE
,
4820 "ftp://ftp.google.com/#",FALSE
4824 typedef struct _uri_builder_property
{
4827 const char *expected_value
;
4828 Uri_PROPERTY property
;
4831 } uri_builder_property
;
4833 typedef struct _uri_builder_port
{
4841 typedef struct _uri_builder_str_property
{
4842 const char* expected
;
4845 } uri_builder_str_property
;
4847 typedef struct _uri_builder_dword_property
{
4851 } uri_builder_dword_property
;
4853 typedef struct _uri_builder_test
{
4856 HRESULT create_builder_expected
;
4857 BOOL create_builder_todo
;
4859 uri_builder_property properties
[URI_BUILDER_STR_PROPERTY_COUNT
];
4861 uri_builder_port port_prop
;
4867 DWORD uri_simple_encode_flags
;
4868 HRESULT uri_simple_hres
;
4869 BOOL uri_simple_todo
;
4871 DWORD uri_with_flags
;
4872 DWORD uri_with_builder_flags
;
4873 DWORD uri_with_encode_flags
;
4874 HRESULT uri_with_hres
;
4877 uri_builder_str_property expected_str_props
[URI_STR_PROPERTY_COUNT
];
4878 uri_builder_dword_property expected_dword_props
[URI_DWORD_PROPERTY_COUNT
];
4881 static const uri_builder_test uri_builder_tests
[] = {
4882 { "http://google.com/",0,S_OK
,FALSE
,
4884 {TRUE
,"#fragment",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
4885 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
},
4886 {TRUE
,"?query=x",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
4887 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
4894 {"http://username:password@google.com/?query=x#fragment",S_OK
},
4895 {"username:password@google.com",S_OK
},
4896 {"http://google.com/?query=x#fragment",S_OK
},
4897 {"google.com",S_OK
},
4900 {"google.com",S_OK
},
4905 {"http://username:password@google.com/?query=x#fragment",S_OK
},
4907 {"username:password",S_OK
},
4911 {Uri_HOST_DNS
,S_OK
},
4913 {URL_SCHEME_HTTP
,S_OK
},
4914 {URLZONE_INVALID
,E_NOTIMPL
}
4917 { "http://google.com/",0,S_OK
,FALSE
,
4919 {TRUE
,"test",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
4921 {TRUE
,TRUE
,120,S_OK
,FALSE
},
4926 {"test://google.com:120/",S_OK
},
4927 {"google.com:120",S_OK
},
4928 {"test://google.com:120/",S_OK
},
4929 {"google.com",S_OK
},
4932 {"google.com",S_OK
},
4937 {"test://google.com:120/",S_OK
},
4943 {Uri_HOST_DNS
,S_OK
},
4945 {URL_SCHEME_UNKNOWN
,S_OK
},
4946 {URLZONE_INVALID
,E_NOTIMPL
}
4949 { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
4951 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
4952 {TRUE
,"::192.2.3.4",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
4953 {TRUE
,NULL
,NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
4960 {"http://[::192.2.3.4]/",S_OK
},
4961 {"[::192.2.3.4]",S_OK
},
4962 {"http://[::192.2.3.4]/",S_OK
},
4966 {"::192.2.3.4",S_OK
},
4971 {"http://[::192.2.3.4]/",S_OK
},
4977 {Uri_HOST_IPV6
,S_OK
},
4979 {URL_SCHEME_HTTP
,S_OK
},
4980 {URLZONE_INVALID
,E_NOTIMPL
}
4983 { "http://google.com/",0,S_OK
,FALSE
,
4985 {TRUE
,"Frag","#Frag",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
4992 {"http://google.com/#Frag",S_OK
},
4993 {"google.com",S_OK
},
4994 {"http://google.com/#Frag",S_OK
},
4995 {"google.com",S_OK
},
4998 {"google.com",S_OK
},
5003 {"http://google.com/#Frag",S_OK
},
5009 {Uri_HOST_DNS
,S_OK
},
5011 {URL_SCHEME_HTTP
,S_OK
},
5012 {URLZONE_INVALID
,E_NOTIMPL
}
5015 { "http://google.com/",0,S_OK
,FALSE
,
5017 {TRUE
,"","#",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
5024 {"http://google.com/#",S_OK
},
5025 {"google.com",S_OK
},
5026 {"http://google.com/#",S_OK
},
5027 {"google.com",S_OK
},
5030 {"google.com",S_OK
},
5035 {"http://google.com/#",S_OK
},
5041 {Uri_HOST_DNS
,S_OK
},
5043 {URL_SCHEME_HTTP
,S_OK
},
5044 {URLZONE_INVALID
,E_NOTIMPL
}
5047 { "http://google.com/",0,S_OK
,FALSE
,
5049 {TRUE
,":password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5056 {"http://::password@google.com/",S_OK
},
5057 {"::password@google.com",S_OK
},
5058 {"http://google.com/",S_OK
},
5059 {"google.com",S_OK
},
5062 {"google.com",S_OK
},
5067 {"http://::password@google.com/",S_OK
},
5069 {"::password",S_OK
},
5073 {Uri_HOST_DNS
,S_OK
},
5075 {URL_SCHEME_HTTP
,S_OK
},
5076 {URLZONE_INVALID
,E_NOTIMPL
}
5079 { "test/test",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5081 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5084 Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5086 Uri_CREATE_ALLOW_RELATIVE
,0,0,S_OK
,FALSE
,
5088 {":password@test/test",S_OK
},
5089 {":password@",S_OK
},
5090 {":password@test/test",S_OK
},
5099 {":password@test/test",S_OK
},
5105 {Uri_HOST_UNKNOWN
,S_OK
},
5107 {URL_SCHEME_UNKNOWN
,S_OK
},
5108 {URLZONE_INVALID
,E_NOTIMPL
}
5111 { "http://google.com/",0,S_OK
,FALSE
,
5113 {TRUE
,"test/test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5120 {"http://google.com/test/test",S_OK
},
5121 {"google.com",S_OK
},
5122 {"http://google.com/test/test",S_OK
},
5123 {"google.com",S_OK
},
5126 {"google.com",S_OK
},
5128 {"/test/test",S_OK
},
5129 {"/test/test",S_OK
},
5131 {"http://google.com/test/test",S_OK
},
5137 {Uri_HOST_DNS
,S_OK
},
5139 {URL_SCHEME_HTTP
,S_OK
},
5140 {URLZONE_INVALID
,E_NOTIMPL
}
5143 { "zip:testing/test",0,S_OK
,FALSE
,
5145 {TRUE
,"test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5169 {Uri_HOST_UNKNOWN
,S_OK
},
5171 {URL_SCHEME_UNKNOWN
,S_OK
},
5172 {URLZONE_INVALID
,E_NOTIMPL
}
5175 { "http://google.com/",0,S_OK
,FALSE
,
5179 /* 555 will be returned from GetPort even though FALSE was passed as the hasPort parameter. */
5180 {TRUE
,FALSE
,555,S_OK
,FALSE
},
5185 {"http://google.com/",S_OK
},
5186 {"google.com",S_OK
},
5187 {"http://google.com/",S_OK
},
5188 {"google.com",S_OK
},
5191 {"google.com",S_OK
},
5196 {"http://google.com/",S_OK
},
5202 {Uri_HOST_DNS
,S_OK
},
5203 /* Still returns 80, even though earlier the port was disabled. */
5205 {URL_SCHEME_HTTP
,S_OK
},
5206 {URLZONE_INVALID
,E_NOTIMPL
}
5209 { "http://google.com/",0,S_OK
,FALSE
,
5213 /* Instead of getting "TRUE" back as the "hasPort" parameter in GetPort,
5214 * you'll get 122345 instead.
5216 {TRUE
,122345,222,S_OK
,FALSE
},
5221 {"http://google.com:222/",S_OK
},
5222 {"google.com:222",S_OK
},
5223 {"http://google.com:222/",S_OK
},
5224 {"google.com",S_OK
},
5227 {"google.com",S_OK
},
5232 {"http://google.com:222/",S_OK
},
5238 {Uri_HOST_DNS
,S_OK
},
5240 {URL_SCHEME_HTTP
,S_OK
},
5241 {URLZONE_INVALID
,E_NOTIMPL
}
5244 /* IUri's created with the IUriBuilder can have ports that exceed USHORT_MAX. */
5245 { "http://google.com/",0,S_OK
,FALSE
,
5249 {TRUE
,TRUE
,999999,S_OK
,FALSE
},
5254 {"http://google.com:999999/",S_OK
},
5255 {"google.com:999999",S_OK
},
5256 {"http://google.com:999999/",S_OK
},
5257 {"google.com",S_OK
},
5260 {"google.com",S_OK
},
5265 {"http://google.com:999999/",S_OK
},
5271 {Uri_HOST_DNS
,S_OK
},
5273 {URL_SCHEME_HTTP
,S_OK
},
5274 {URLZONE_INVALID
,E_NOTIMPL
}
5277 { "http://google.com/",0,S_OK
,FALSE
,
5279 {TRUE
,"test","?test",Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
5287 {"http://google.com/?test",S_OK
},
5288 {"google.com",S_OK
},
5289 {"http://google.com/?test",S_OK
},
5290 {"google.com",S_OK
},
5293 {"google.com",S_OK
},
5298 {"http://google.com/?test",S_OK
},
5304 {Uri_HOST_DNS
,S_OK
},
5306 {URL_SCHEME_HTTP
,S_OK
},
5307 {URLZONE_INVALID
,E_NOTIMPL
}
5310 { "http://:password@google.com/",0,S_OK
,FALSE
,
5319 {"http://:password@google.com/",S_OK
},
5320 {":password@google.com",S_OK
},
5321 {"http://google.com/",S_OK
},
5322 {"google.com",S_OK
},
5325 {"google.com",S_OK
},
5330 {"http://:password@google.com/",S_OK
},
5336 {Uri_HOST_DNS
,S_OK
},
5338 {URL_SCHEME_HTTP
,S_OK
},
5339 {URLZONE_INVALID
,E_NOTIMPL
}
5342 /* IUriBuilder doesn't need a base IUri to build a IUri. */
5343 { NULL
,0,S_OK
,FALSE
,
5345 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
5346 {TRUE
,"google.com",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5353 {"http://google.com/",S_OK
},
5354 {"google.com",S_OK
},
5355 {"http://google.com/",S_OK
},
5356 {"google.com",S_OK
},
5359 {"google.com",S_OK
},
5364 {"http://google.com/",S_OK
},
5370 {Uri_HOST_DNS
,S_OK
},
5372 {URL_SCHEME_HTTP
,S_OK
},
5373 {URLZONE_INVALID
,E_NOTIMPL
}
5376 /* Can't set the scheme name to NULL. */
5377 { "zip://google.com/",0,S_OK
,FALSE
,
5379 {TRUE
,NULL
,"zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5386 {"zip://google.com/",S_OK
},
5387 {"google.com",S_OK
},
5388 {"zip://google.com/",S_OK
},
5389 {"google.com",S_OK
},
5392 {"google.com",S_OK
},
5397 {"zip://google.com/",S_OK
},
5403 {Uri_HOST_DNS
,S_OK
},
5405 {URL_SCHEME_UNKNOWN
,S_OK
},
5406 {URLZONE_INVALID
,E_NOTIMPL
}
5409 /* Can't set the scheme name to an empty string. */
5410 { "zip://google.com/",0,S_OK
,FALSE
,
5412 {TRUE
,"","zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5419 {"zip://google.com/",S_OK
},
5420 {"google.com",S_OK
},
5421 {"zip://google.com/",S_OK
},
5422 {"google.com",S_OK
},
5425 {"google.com",S_OK
},
5430 {"zip://google.com/",S_OK
},
5436 {Uri_HOST_DNS
,S_OK
},
5438 {URL_SCHEME_UNKNOWN
,S_OK
},
5439 {URLZONE_INVALID
,E_NOTIMPL
}
5442 /* -1 to CreateUri makes it use the same flags as the base IUri was created with.
5443 * CreateUriSimple always uses the flags the base IUri was created with (if any).
5445 { "http://google.com/../../",Uri_CREATE_NO_CANONICALIZE
,S_OK
,FALSE
,
5450 0,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5452 {"http://google.com/../../",S_OK
},
5453 {"google.com",S_OK
},
5454 {"http://google.com/../../",S_OK
},
5455 {"google.com",S_OK
},
5458 {"google.com",S_OK
},
5463 {"http://google.com/../../",S_OK
},
5469 {Uri_HOST_DNS
,S_OK
},
5471 {URL_SCHEME_HTTP
,S_OK
},
5472 {URLZONE_INVALID
,E_NOTIMPL
}
5475 { "http://google.com/",0,S_OK
,FALSE
,
5477 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5482 Uri_CREATE_NO_DECODE_EXTRA_INFO
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5484 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5485 {"google.com",S_OK
},
5486 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5487 {"google.com",S_OK
},
5489 {"#Fr%3C%7C%3Eg",S_OK
},
5490 {"google.com",S_OK
},
5495 {"http://google.com/#Fr<|>g",S_OK
},
5501 {Uri_HOST_DNS
,S_OK
},
5503 {URL_SCHEME_HTTP
,S_OK
},
5504 {URLZONE_INVALID
,E_NOTIMPL
}
5507 { "http://google.com/",0,S_OK
,FALSE
,
5509 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5512 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,E_INVALIDARG
,FALSE
,
5514 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5516 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5517 {"google.com",S_OK
},
5518 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5519 {"google.com",S_OK
},
5521 {"#Fr%3C%7C%3Eg",S_OK
},
5522 {"google.com",S_OK
},
5527 {"http://google.com/#Fr<|>g",S_OK
},
5533 {Uri_HOST_DNS
,S_OK
},
5535 {URL_SCHEME_HTTP
,S_OK
},
5536 {URLZONE_INVALID
,E_NOTIMPL
}
5539 { NULL
,0,S_OK
,FALSE
,
5541 {TRUE
,"/test/test/",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5542 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5545 0,INET_E_INVALID_URL
,FALSE
,
5546 0,INET_E_INVALID_URL
,FALSE
,
5547 0,0,0,INET_E_INVALID_URL
,FALSE
5549 { "http://google.com/",0,S_OK
,FALSE
,
5551 {TRUE
,"ht%xxtp",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
5554 0,INET_E_INVALID_URL
,FALSE
,
5555 0,INET_E_INVALID_URL
,FALSE
,
5556 0,0,0,INET_E_INVALID_URL
,FALSE
5558 /* File scheme's can't have a username set. */
5559 { "file://google.com/",0,S_OK
,FALSE
,
5561 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5564 0,INET_E_INVALID_URL
,FALSE
,
5565 0,INET_E_INVALID_URL
,FALSE
,
5566 0,0,0,INET_E_INVALID_URL
,FALSE
5568 /* File schemes can't have a password set. */
5569 { "file://google.com/",0,S_OK
,FALSE
,
5571 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5574 0,INET_E_INVALID_URL
,FALSE
,
5575 0,INET_E_INVALID_URL
,FALSE
,
5576 0,0,0,INET_E_INVALID_URL
,FALSE
5578 /* UserName can't contain any character that is a delimeter for another
5579 * component that appears after it in a normal URI.
5581 { "http://google.com/",0,S_OK
,FALSE
,
5583 {TRUE
,"user:pass",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5586 0,INET_E_INVALID_URL
,FALSE
,
5587 0,INET_E_INVALID_URL
,FALSE
,
5588 0,0,0,INET_E_INVALID_URL
,FALSE
5590 { "http://google.com/",0,S_OK
,FALSE
,
5592 {TRUE
,"user@google.com",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5595 0,INET_E_INVALID_URL
,FALSE
,
5596 0,INET_E_INVALID_URL
,FALSE
,
5597 0,0,0,INET_E_INVALID_URL
,FALSE
5599 { "http://google.com/",0,S_OK
,FALSE
,
5601 {TRUE
,"user/path",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5604 0,INET_E_INVALID_URL
,FALSE
,
5605 0,INET_E_INVALID_URL
,FALSE
,
5606 0,0,0,INET_E_INVALID_URL
,FALSE
5608 { "http://google.com/",0,S_OK
,FALSE
,
5610 {TRUE
,"user?Query",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5613 0,INET_E_INVALID_URL
,FALSE
,
5614 0,INET_E_INVALID_URL
,FALSE
,
5615 0,0,0,INET_E_INVALID_URL
,FALSE
5617 { "http://google.com/",0,S_OK
,FALSE
,
5619 {TRUE
,"user#Frag",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5622 0,INET_E_INVALID_URL
,FALSE
,
5623 0,INET_E_INVALID_URL
,FALSE
,
5624 0,0,0,INET_E_INVALID_URL
,FALSE
5626 { "http://google.com/",0,S_OK
,FALSE
,
5628 {TRUE
,"pass@google.com",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5631 0,INET_E_INVALID_URL
,FALSE
,
5632 0,INET_E_INVALID_URL
,FALSE
,
5633 0,0,0,INET_E_INVALID_URL
,FALSE
5635 { "http://google.com/",0,S_OK
,FALSE
,
5637 {TRUE
,"pass/path",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5640 0,INET_E_INVALID_URL
,FALSE
,
5641 0,INET_E_INVALID_URL
,FALSE
,
5642 0,0,0,INET_E_INVALID_URL
,FALSE
5644 { "http://google.com/",0,S_OK
,FALSE
,
5646 {TRUE
,"pass?query",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5649 0,INET_E_INVALID_URL
,FALSE
,
5650 0,INET_E_INVALID_URL
,FALSE
,
5651 0,0,0,INET_E_INVALID_URL
,FALSE
5653 { "http://google.com/",0,S_OK
,FALSE
,
5655 {TRUE
,"pass#frag",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5658 0,INET_E_INVALID_URL
,FALSE
,
5659 0,INET_E_INVALID_URL
,FALSE
,
5660 0,0,0,INET_E_INVALID_URL
,FALSE
5662 { "http://google.com/",0,S_OK
,FALSE
,
5664 {TRUE
,"winehq.org/test",NULL
,Uri_PROPERTY_HOST
,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 { "http://google.com/",0,S_OK
,FALSE
,
5673 {TRUE
,"winehq.org?test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5676 0,INET_E_INVALID_URL
,FALSE
,
5677 0,INET_E_INVALID_URL
,FALSE
,
5678 0,0,0,INET_E_INVALID_URL
,FALSE
5680 { "http://google.com/",0,S_OK
,FALSE
,
5682 {TRUE
,"winehq.org#test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5685 0,INET_E_INVALID_URL
,FALSE
,
5686 0,INET_E_INVALID_URL
,FALSE
,
5687 0,0,0,INET_E_INVALID_URL
,FALSE
5689 /* Hostname is allowed to contain a ':' (even for known scheme types). */
5690 { "http://google.com/",0,S_OK
,FALSE
,
5692 {TRUE
,"winehq.org:test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
5699 {"http://winehq.org:test/",S_OK
},
5700 {"winehq.org:test",S_OK
},
5701 {"http://winehq.org:test/",S_OK
},
5702 {"winehq.org:test",S_OK
},
5705 {"winehq.org:test",S_OK
},
5710 {"http://winehq.org:test/",S_OK
},
5716 {Uri_HOST_DNS
,S_OK
},
5718 {URL_SCHEME_HTTP
,S_OK
},
5719 {URLZONE_INVALID
,E_NOTIMPL
}
5722 /* Can't set the host name to NULL. */
5723 { "http://google.com/",0,S_OK
,FALSE
,
5725 {TRUE
,NULL
,"google.com",Uri_PROPERTY_HOST
,E_INVALIDARG
,FALSE
}
5732 {"http://google.com/",S_OK
},
5733 {"google.com",S_OK
},
5734 {"http://google.com/",S_OK
},
5735 {"google.com",S_OK
},
5738 {"google.com",S_OK
},
5743 {"http://google.com/",S_OK
},
5749 {Uri_HOST_DNS
,S_OK
},
5751 {URL_SCHEME_HTTP
,S_OK
},
5752 {URLZONE_INVALID
,E_NOTIMPL
}
5755 /* Can set the host name to an empty string. */
5756 { "http://google.com/",0,S_OK
,FALSE
,
5758 {TRUE
,"",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5782 {Uri_HOST_UNKNOWN
,S_OK
},
5784 {URL_SCHEME_HTTP
,S_OK
},
5785 {URLZONE_INVALID
,E_NOTIMPL
}
5788 { "http://google.com/",0,S_OK
,FALSE
,
5790 {TRUE
,"/path?query",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
5793 0,INET_E_INVALID_URL
,FALSE
,
5794 0,INET_E_INVALID_URL
,FALSE
,
5795 0,0,0,INET_E_INVALID_URL
,FALSE
5797 { "http://google.com/",0,S_OK
,FALSE
,
5799 {TRUE
,"/path#test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
5802 0,INET_E_INVALID_URL
,FALSE
,
5803 0,INET_E_INVALID_URL
,FALSE
,
5804 0,0,0,INET_E_INVALID_URL
,FALSE
5806 { "http://google.com/",0,S_OK
,FALSE
,
5808 {TRUE
,"?path#test",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
}
5811 0,INET_E_INVALID_URL
,FALSE
,
5812 0,INET_E_INVALID_URL
,FALSE
,
5813 0,0,0,INET_E_INVALID_URL
,FALSE
5815 { "file:///c:/dir/file.html",0,S_OK
,FALSE
,
5817 {TRUE
,NULL
,NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
},
5824 {"file:///c:/dir/file.html",S_OK
},
5826 {"file:///c:/dir/file.html",S_OK
},
5832 {"/c:/dir/file.html",S_OK
},
5833 {"/c:/dir/file.html",S_OK
},
5835 {"file:///c:/dir/file.html",S_OK
},
5841 {Uri_HOST_UNKNOWN
,S_OK
},
5843 {URL_SCHEME_FILE
,S_OK
},
5844 {URLZONE_INVALID
,E_NOTIMPL
}
5847 { "file:///c:/dir/file.html",0,S_OK
,FALSE
,
5849 {TRUE
,"#",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
},
5856 {"file:///c:/dir/file.html#",S_OK
},
5858 {"file:///c:/dir/file.html#",S_OK
},
5864 {"/c:/dir/file.html",S_OK
},
5865 {"/c:/dir/file.html",S_OK
},
5867 {"file:///c:/dir/file.html#",S_OK
},
5873 {Uri_HOST_UNKNOWN
,S_OK
},
5875 {URL_SCHEME_FILE
,S_OK
},
5876 {URLZONE_INVALID
,E_NOTIMPL
}
5881 typedef struct _uri_builder_remove_test
{
5884 HRESULT create_builder_expected
;
5885 BOOL create_builder_todo
;
5887 DWORD remove_properties
;
5888 HRESULT remove_expected
;
5891 const char *expected_uri
;
5892 DWORD expected_flags
;
5893 HRESULT expected_hres
;
5895 } uri_builder_remove_test
;
5897 static const uri_builder_remove_test uri_builder_remove_tests
[] = {
5898 { "http://google.com/test?test=y#Frag",0,S_OK
,FALSE
,
5899 Uri_HAS_FRAGMENT
|Uri_HAS_PATH
|Uri_HAS_QUERY
,S_OK
,FALSE
,
5900 "http://google.com/",0,S_OK
,FALSE
5902 { "http://user:pass@winehq.org/",0,S_OK
,FALSE
,
5903 Uri_HAS_USER_NAME
|Uri_HAS_PASSWORD
,S_OK
,FALSE
,
5904 "http://winehq.org/",0,S_OK
,FALSE
5906 { "zip://google.com?Test=x",0,S_OK
,FALSE
,
5907 Uri_HAS_HOST
,S_OK
,FALSE
,
5908 "zip:/?Test=x",0,S_OK
,FALSE
5910 /* Doesn't remove the whole userinfo component. */
5911 { "http://username:pass@google.com/",0,S_OK
,FALSE
,
5912 Uri_HAS_USER_INFO
,S_OK
,FALSE
,
5913 "http://username:pass@google.com/",0,S_OK
,FALSE
5915 /* Doesn't remove the domain. */
5916 { "http://google.com/",0,S_OK
,FALSE
,
5917 Uri_HAS_DOMAIN
,S_OK
,FALSE
,
5918 "http://google.com/",0,S_OK
,FALSE
5920 { "http://google.com:120/",0,S_OK
,FALSE
,
5921 Uri_HAS_AUTHORITY
,S_OK
,FALSE
,
5922 "http://google.com:120/",0,S_OK
,FALSE
5924 { "http://google.com/test.com/",0,S_OK
,FALSE
,
5925 Uri_HAS_EXTENSION
,S_OK
,FALSE
,
5926 "http://google.com/test.com/",0,S_OK
,FALSE
5928 { "http://google.com/?test=x",0,S_OK
,FALSE
,
5929 Uri_HAS_PATH_AND_QUERY
,S_OK
,FALSE
,
5930 "http://google.com/?test=x",0,S_OK
,FALSE
5932 /* Can't remove the scheme name. */
5933 { "http://google.com/?test=x",0,S_OK
,FALSE
,
5934 Uri_HAS_SCHEME_NAME
|Uri_HAS_QUERY
,E_INVALIDARG
,FALSE
,
5935 "http://google.com/?test=x",0,S_OK
,FALSE
5939 typedef struct _uri_combine_str_property
{
5943 const char *broken_value
;
5944 const char *value_ex
;
5945 } uri_combine_str_property
;
5947 typedef struct _uri_combine_test
{
5948 const char *base_uri
;
5949 DWORD base_create_flags
;
5950 const char *relative_uri
;
5951 DWORD relative_create_flags
;
5952 DWORD combine_flags
;
5956 uri_combine_str_property str_props
[URI_STR_PROPERTY_COUNT
];
5957 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
5960 static const uri_combine_test uri_combine_tests
[] = {
5961 { "http://google.com/fun/stuff",0,
5962 "../not/fun/stuff",Uri_CREATE_ALLOW_RELATIVE
,
5965 {"http://google.com/not/fun/stuff",S_OK
},
5966 {"google.com",S_OK
},
5967 {"http://google.com/not/fun/stuff",S_OK
},
5968 {"google.com",S_OK
},
5971 {"google.com",S_OK
},
5973 {"/not/fun/stuff",S_OK
},
5974 {"/not/fun/stuff",S_OK
},
5976 {"http://google.com/not/fun/stuff",S_OK
},
5982 {Uri_HOST_DNS
,S_OK
},
5984 {URL_SCHEME_HTTP
,S_OK
},
5985 {URLZONE_INVALID
,E_NOTIMPL
}
5988 { "http://google.com/test",0,
5989 "zip://test.com/cool",0,
5992 {"zip://test.com/cool",S_OK
},
5994 {"zip://test.com/cool",S_OK
},
6003 {"zip://test.com/cool",S_OK
},
6009 {Uri_HOST_DNS
,S_OK
},
6011 {URL_SCHEME_UNKNOWN
,S_OK
},
6012 {URLZONE_INVALID
,E_NOTIMPL
}
6015 { "http://google.com/use/base/path",0,
6016 "?relative",Uri_CREATE_ALLOW_RELATIVE
,
6019 {"http://google.com/use/base/path?relative",S_OK
},
6020 {"google.com",S_OK
},
6021 {"http://google.com/use/base/path?relative",S_OK
},
6022 {"google.com",S_OK
},
6025 {"google.com",S_OK
},
6027 {"/use/base/path",S_OK
},
6028 {"/use/base/path?relative",S_OK
},
6030 {"http://google.com/use/base/path?relative",S_OK
},
6036 {Uri_HOST_DNS
,S_OK
},
6038 {URL_SCHEME_HTTP
,S_OK
},
6039 {URLZONE_INVALID
,E_NOTIMPL
}
6042 { "http://google.com/path",0,
6043 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
6046 {"http://google.com/testing",S_OK
},
6047 {"google.com",S_OK
},
6048 {"http://google.com/testing",S_OK
},
6049 {"google.com",S_OK
},
6052 {"google.com",S_OK
},
6057 {"http://google.com/testing",S_OK
},
6063 {Uri_HOST_DNS
,S_OK
},
6065 {URL_SCHEME_HTTP
,S_OK
},
6066 {URLZONE_INVALID
,E_NOTIMPL
}
6069 { "http://google.com/path",0,
6070 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
6071 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6073 {"http://google.com:80/test/../test/.././testing",S_OK
},
6074 {"google.com",S_OK
},
6075 {"http://google.com:80/test/../test/.././testing",S_OK
},
6076 {"google.com",S_OK
},
6079 {"google.com",S_OK
},
6081 {"/test/../test/.././testing",S_OK
},
6082 {"/test/../test/.././testing",S_OK
},
6084 {"http://google.com:80/test/../test/.././testing",S_OK
},
6090 {Uri_HOST_DNS
,S_OK
},
6092 {URL_SCHEME_HTTP
,S_OK
},
6093 {URLZONE_INVALID
,E_NOTIMPL
}
6096 { "http://winehq.org/test/abc",0,
6097 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
6100 {"http://winehq.org/test/testing/test",S_OK
},
6101 {"winehq.org",S_OK
},
6102 {"http://winehq.org/test/testing/test",S_OK
},
6103 {"winehq.org",S_OK
},
6106 {"winehq.org",S_OK
},
6108 {"/test/testing/test",S_OK
},
6109 {"/test/testing/test",S_OK
},
6111 {"http://winehq.org/test/testing/test",S_OK
},
6117 {Uri_HOST_DNS
,S_OK
},
6119 {URL_SCHEME_HTTP
,S_OK
},
6120 {URLZONE_INVALID
,E_NOTIMPL
}
6123 { "http://winehq.org/test/abc",0,
6124 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
6125 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6127 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6128 /* Default port is hidden in the authority. */
6129 {"winehq.org",S_OK
},
6130 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6131 {"winehq.org",S_OK
},
6134 {"winehq.org",S_OK
},
6136 {"/test/testing/abc/../test",S_OK
},
6137 {"/test/testing/abc/../test",S_OK
},
6139 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6145 {Uri_HOST_DNS
,S_OK
},
6147 {URL_SCHEME_HTTP
,S_OK
},
6148 {URLZONE_INVALID
,E_NOTIMPL
}
6151 { "http://winehq.org/test?query",0,
6152 "testing",Uri_CREATE_ALLOW_RELATIVE
,
6155 {"http://winehq.org/testing",S_OK
},
6156 {"winehq.org",S_OK
},
6157 {"http://winehq.org/testing",S_OK
},
6158 {"winehq.org",S_OK
},
6161 {"winehq.org",S_OK
},
6166 {"http://winehq.org/testing",S_OK
},
6172 {Uri_HOST_DNS
,S_OK
},
6174 {URL_SCHEME_HTTP
,S_OK
},
6175 {URLZONE_INVALID
,E_NOTIMPL
}
6178 { "http://winehq.org/test#frag",0,
6179 "testing",Uri_CREATE_ALLOW_RELATIVE
,
6182 {"http://winehq.org/testing",S_OK
},
6183 {"winehq.org",S_OK
},
6184 {"http://winehq.org/testing",S_OK
},
6185 {"winehq.org",S_OK
},
6188 {"winehq.org",S_OK
},
6193 {"http://winehq.org/testing",S_OK
},
6199 {Uri_HOST_DNS
,S_OK
},
6201 {URL_SCHEME_HTTP
,S_OK
},
6202 {URLZONE_INVALID
,E_NOTIMPL
}
6205 { "testing?query#frag",Uri_CREATE_ALLOW_RELATIVE
,
6206 "test",Uri_CREATE_ALLOW_RELATIVE
,
6226 {Uri_HOST_UNKNOWN
,S_OK
},
6228 {URL_SCHEME_UNKNOWN
,S_OK
},
6229 {URLZONE_INVALID
,E_NOTIMPL
}
6232 { "file:///c:/test/test",0,
6233 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6234 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6236 {"file://c:\\testing.mp3",S_OK
},
6238 {"file://c:\\testing.mp3",S_OK
},
6244 {"c:\\testing.mp3",S_OK
},
6245 {"c:\\testing.mp3",S_OK
},
6247 {"file://c:\\testing.mp3",S_OK
},
6253 {Uri_HOST_UNKNOWN
,S_OK
},
6255 {URL_SCHEME_FILE
,S_OK
},
6256 {URLZONE_INVALID
,E_NOTIMPL
}
6259 { "file:///c:/test/test",0,
6260 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6263 {"file:///c:/testing.mp3",S_OK
},
6265 {"file:///c:/testing.mp3",S_OK
},
6271 {"/c:/testing.mp3",S_OK
},
6272 {"/c:/testing.mp3",S_OK
},
6274 {"file:///c:/testing.mp3",S_OK
},
6280 {Uri_HOST_UNKNOWN
,S_OK
},
6282 {URL_SCHEME_FILE
,S_OK
},
6283 {URLZONE_INVALID
,E_NOTIMPL
}
6286 { "file://test.com/test/test",0,
6287 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6288 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6290 {"file://\\\\test.com\\testing.mp3",S_OK
},
6292 {"file://\\\\test.com\\testing.mp3",S_OK
},
6298 {"\\testing.mp3",S_OK
},
6299 {"\\testing.mp3",S_OK
},
6301 {"file://\\\\test.com\\testing.mp3",S_OK
},
6307 {Uri_HOST_DNS
,S_OK
},
6309 {URL_SCHEME_FILE
,S_OK
},
6310 {URLZONE_INVALID
,E_NOTIMPL
}
6313 /* URL_DONT_SIMPLIFY has no effect. */
6314 { "http://google.com/test",0,
6315 "zip://test.com/cool/../cool/test",0,
6316 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6318 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
6320 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
6326 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
6327 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
6329 /* The resulting IUri has the same Raw URI as the relative URI (only IE 8).
6330 * On IE 7 it reduces the path in the Raw URI.
6332 {"zip://test.com/cool/../cool/test",S_OK
,FALSE
,"zip://test.com/cool/test"},
6338 {Uri_HOST_DNS
,S_OK
},
6340 {URL_SCHEME_UNKNOWN
,S_OK
},
6341 {URLZONE_INVALID
,E_NOTIMPL
}
6344 /* FILE_USE_PATHURL has no effect in IE 8, in IE 7 the
6345 * resulting URI is converted into a dos path.
6347 { "http://google.com/test",0,
6348 "file:///c:/test/",0,
6349 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6351 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6353 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6359 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
6360 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
6362 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6368 {Uri_HOST_UNKNOWN
,S_OK
},
6370 {URL_SCHEME_FILE
,S_OK
},
6371 {URLZONE_INVALID
,E_NOTIMPL
}
6374 { "http://google.com/test",0,
6375 "http://test.com/test#%30test",0,
6376 URL_DONT_UNESCAPE_EXTRA_INFO
,S_OK
,FALSE
,
6378 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
6380 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
6383 {"#0test",S_OK
,FALSE
,NULL
,"#%30test"},
6389 /* IE 7 decodes the %30 to a 0 in the Raw URI. */
6390 {"http://test.com/test#%30test",S_OK
,FALSE
,"http://test.com/test#0test"},
6396 {Uri_HOST_DNS
,S_OK
},
6398 {URL_SCHEME_HTTP
,S_OK
},
6399 {URLZONE_INVALID
,E_NOTIMPL
}
6402 /* Windows validates the path component from the relative Uri. */
6403 { "http://google.com/test",0,
6404 "/Te%XXst",Uri_CREATE_ALLOW_RELATIVE
,
6405 0,E_INVALIDARG
,FALSE
6407 /* Windows doesn't validate the query from the relative Uri. */
6408 { "http://google.com/test",0,
6409 "?Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6412 {"http://google.com/test?Tes%XXt",S_OK
},
6413 {"google.com",S_OK
},
6414 {"http://google.com/test?Tes%XXt",S_OK
},
6415 {"google.com",S_OK
},
6418 {"google.com",S_OK
},
6421 {"/test?Tes%XXt",S_OK
},
6423 {"http://google.com/test?Tes%XXt",S_OK
},
6429 {Uri_HOST_DNS
,S_OK
},
6431 {URL_SCHEME_HTTP
,S_OK
},
6432 {URLZONE_INVALID
,E_NOTIMPL
}
6435 /* Windows doesn't validate the fragment from the relative Uri. */
6436 { "http://google.com/test",0,
6437 "#Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6440 {"http://google.com/test#Tes%XXt",S_OK
},
6441 {"google.com",S_OK
},
6442 {"http://google.com/test#Tes%XXt",S_OK
},
6443 {"google.com",S_OK
},
6446 {"google.com",S_OK
},
6451 {"http://google.com/test#Tes%XXt",S_OK
},
6457 {Uri_HOST_DNS
,S_OK
},
6459 {URL_SCHEME_HTTP
,S_OK
},
6460 {URLZONE_INVALID
,E_NOTIMPL
}
6463 /* Creates an IUri which contains an invalid dos path char. */
6464 { "file:///c:/test",0,
6465 "/test<ing",Uri_CREATE_ALLOW_RELATIVE
,
6466 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6468 {"file://c:\\test<ing",S_OK
},
6470 {"file://c:\\test<ing",S_OK
},
6476 {"c:\\test<ing",S_OK
},
6477 {"c:\\test<ing",S_OK
},
6479 {"file://c:\\test<ing",S_OK
},
6485 {Uri_HOST_UNKNOWN
,S_OK
},
6487 {URL_SCHEME_FILE
,S_OK
},
6488 {URLZONE_INVALID
,E_NOTIMPL
}
6491 /* Appends the path after the drive letter (if any). */
6492 { "file:///c:/test",0,
6493 "/c:/testing",Uri_CREATE_ALLOW_RELATIVE
,
6496 {"file:///c:/c:/testing",S_OK
},
6498 {"file:///c:/c:/testing",S_OK
},
6504 {"/c:/c:/testing",S_OK
},
6505 {"/c:/c:/testing",S_OK
},
6507 {"file:///c:/c:/testing",S_OK
},
6513 {Uri_HOST_UNKNOWN
,S_OK
},
6515 {URL_SCHEME_FILE
,S_OK
},
6516 {URLZONE_INVALID
,E_NOTIMPL
}
6519 /* A '/' is added if the base URI doesn't have a path and the
6520 * relative URI doesn't contain a path (since the base URI is
6523 { "http://google.com",Uri_CREATE_NO_CANONICALIZE
,
6524 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6527 {"http://google.com/?test",S_OK
},
6528 {"google.com",S_OK
},
6529 {"http://google.com/?test",S_OK
},
6530 {"google.com",S_OK
},
6533 {"google.com",S_OK
},
6538 {"http://google.com/?test",S_OK
},
6544 {Uri_HOST_DNS
,S_OK
},
6546 {URL_SCHEME_HTTP
,S_OK
},
6547 {URLZONE_INVALID
,E_NOTIMPL
}
6550 { "zip://google.com",Uri_CREATE_NO_CANONICALIZE
,
6551 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6554 {"zip://google.com/?test",S_OK
},
6555 {"google.com",S_OK
},
6556 {"zip://google.com/?test",S_OK
},
6557 {"google.com",S_OK
},
6560 {"google.com",S_OK
},
6565 {"zip://google.com/?test",S_OK
},
6571 {Uri_HOST_DNS
,S_OK
},
6573 {URL_SCHEME_UNKNOWN
,S_OK
},
6574 {URLZONE_INVALID
,E_NOTIMPL
}
6577 /* No path is appended since the base URI is opaque. */
6579 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6599 {Uri_HOST_UNKNOWN
,S_OK
},
6601 {URL_SCHEME_UNKNOWN
,S_OK
},
6602 {URLZONE_INVALID
,E_NOTIMPL
}
6606 "../testing/test",Uri_CREATE_ALLOW_RELATIVE
,
6609 {"file:///c:/testing/test",S_OK
},
6611 {"file:///c:/testing/test",S_OK
},
6617 {"/c:/testing/test",S_OK
},
6618 {"/c:/testing/test",S_OK
},
6620 {"file:///c:/testing/test",S_OK
},
6626 {Uri_HOST_UNKNOWN
,S_OK
},
6628 {URL_SCHEME_FILE
,S_OK
},
6629 {URLZONE_INVALID
,E_NOTIMPL
}
6632 { "http://winehq.org/dir/testfile",0,
6633 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
6636 {"http://winehq.org/dir/test?querystring",S_OK
},
6637 {"winehq.org",S_OK
},
6638 {"http://winehq.org/dir/test?querystring",S_OK
},
6639 {"winehq.org",S_OK
},
6642 {"winehq.org",S_OK
},
6645 {"/dir/test?querystring",S_OK
},
6646 {"?querystring",S_OK
},
6647 {"http://winehq.org/dir/test?querystring",S_OK
},
6653 {Uri_HOST_DNS
,S_OK
},
6655 {URL_SCHEME_HTTP
,S_OK
},
6656 {URLZONE_INVALID
,E_NOTIMPL
}
6659 { "http://winehq.org/dir/test",0,
6660 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
6663 {"http://winehq.org/dir/test?querystring",S_OK
},
6664 {"winehq.org",S_OK
},
6665 {"http://winehq.org/dir/test?querystring",S_OK
},
6666 {"winehq.org",S_OK
},
6669 {"winehq.org",S_OK
},
6672 {"/dir/test?querystring",S_OK
},
6673 {"?querystring",S_OK
},
6674 {"http://winehq.org/dir/test?querystring",S_OK
},
6680 {Uri_HOST_DNS
,S_OK
},
6682 {URL_SCHEME_HTTP
,S_OK
},
6683 {URLZONE_INVALID
,E_NOTIMPL
}
6686 { "http://winehq.org/dir/test?querystring",0,
6687 "#hash",Uri_CREATE_ALLOW_RELATIVE
,
6690 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6691 {"winehq.org",S_OK
},
6692 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6693 {"winehq.org",S_OK
},
6696 {"winehq.org",S_OK
},
6699 {"/dir/test?querystring",S_OK
},
6700 {"?querystring",S_OK
},
6701 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6707 {Uri_HOST_DNS
,S_OK
},
6709 {URL_SCHEME_HTTP
,S_OK
},
6710 {URLZONE_INVALID
,E_NOTIMPL
}
6713 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir\\file.txt",0,
6714 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6717 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6719 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6725 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6726 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6728 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6734 {Uri_HOST_UNKNOWN
,S_OK
},
6736 {URL_SCHEME_MK
,S_OK
},
6737 {URLZONE_INVALID
,E_NOTIMPL
}
6740 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::\\subdir\\file.txt",0,
6741 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6744 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6746 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6752 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6753 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6755 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6761 {Uri_HOST_UNKNOWN
,S_OK
},
6763 {URL_SCHEME_MK
,S_OK
},
6764 {URLZONE_INVALID
,E_NOTIMPL
}
6767 { "mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir\\file.txt",0,
6768 "relative\\path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6771 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6773 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6779 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6780 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6782 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6788 {Uri_HOST_UNKNOWN
,S_OK
},
6790 {URL_SCHEME_MK
,S_OK
},
6791 {URLZONE_INVALID
,E_NOTIMPL
}
6794 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
6795 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6798 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6800 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6806 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6807 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6809 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6815 {Uri_HOST_UNKNOWN
,S_OK
},
6817 {URL_SCHEME_MK
,S_OK
},
6818 {URLZONE_INVALID
,E_NOTIMPL
}
6821 { "mk:MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
6822 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6825 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6827 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6833 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6834 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6836 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6842 {Uri_HOST_UNKNOWN
,S_OK
},
6844 {URL_SCHEME_MK
,S_OK
},
6845 {URLZONE_INVALID
,E_NOTIMPL
}
6848 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/../../file.txt",0,
6849 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6852 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
6854 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
6860 {"@MSITSTORE:/relative/path.txt",S_OK
},
6861 {"@MSITSTORE:/relative/path.txt",S_OK
},
6863 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
6869 {Uri_HOST_UNKNOWN
,S_OK
},
6871 {URL_SCHEME_MK
,S_OK
},
6872 {URLZONE_INVALID
,E_NOTIMPL
}
6875 { "mk:@xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
6876 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6879 {"mk:@xxx:/relative/path.txt",S_OK
},
6881 {"mk:@xxx:/relative/path.txt",S_OK
},
6887 {"@xxx:/relative/path.txt",S_OK
},
6888 {"@xxx:/relative/path.txt",S_OK
},
6890 {"mk:@xxx:/relative/path.txt",S_OK
},
6896 {Uri_HOST_UNKNOWN
,S_OK
},
6898 {URL_SCHEME_MK
,S_OK
},
6899 {URLZONE_INVALID
,E_NOTIMPL
}
6902 { "mk:xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
6903 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6906 {"mk:/relative/path.txt",S_OK
},
6908 {"mk:/relative/path.txt",S_OK
},
6914 {"/relative/path.txt",S_OK
},
6915 {"/relative/path.txt",S_OK
},
6917 {"mk:/relative/path.txt",S_OK
},
6923 {Uri_HOST_UNKNOWN
,S_OK
},
6925 {URL_SCHEME_MK
,S_OK
},
6926 {URLZONE_INVALID
,E_NOTIMPL
}
6929 { "ml:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
6930 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6933 {"ml:/relative/path.txt",S_OK
},
6935 {"ml:/relative/path.txt",S_OK
},
6941 {"/relative/path.txt",S_OK
},
6942 {"/relative/path.txt",S_OK
},
6944 {"ml:/relative/path.txt",S_OK
},
6950 {Uri_HOST_UNKNOWN
,S_OK
},
6952 {URL_SCHEME_UNKNOWN
,S_OK
},
6953 {URLZONE_INVALID
,E_NOTIMPL
}
6956 { "http://winehq.org/dir/test?querystring",0,
6957 "//winehq.com/#hash",Uri_CREATE_ALLOW_RELATIVE
,
6960 {"http://winehq.com/#hash",S_OK
},
6961 {"winehq.com",S_OK
},
6962 {"http://winehq.com/#hash",S_OK
},
6963 {"winehq.com",S_OK
},
6966 {"winehq.com",S_OK
},
6971 {"http://winehq.com/#hash",S_OK
},
6977 {Uri_HOST_DNS
,S_OK
},
6978 {80,S_OK
,FALSE
,TRUE
},
6979 {URL_SCHEME_HTTP
,S_OK
},
6980 {URLZONE_INVALID
,E_NOTIMPL
}
6983 { "http://winehq.org/dir/test?querystring",0,
6984 "//winehq.com/dir2/../dir/file.txt?query#hash",Uri_CREATE_ALLOW_RELATIVE
,
6987 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
6988 {"winehq.com",S_OK
},
6989 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
6990 {"winehq.com",S_OK
},
6993 {"winehq.com",S_OK
},
6995 {"/dir/file.txt",S_OK
},
6996 {"/dir/file.txt?query",S_OK
},
6998 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
7004 {Uri_HOST_DNS
,S_OK
},
7005 {80,S_OK
,FALSE
,TRUE
},
7006 {URL_SCHEME_HTTP
,S_OK
},
7007 {URLZONE_INVALID
,E_NOTIMPL
}
7010 { "http://google.com/test",0,
7011 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
7014 {"file:///c:/test/",S_OK
},
7016 {"file:///c:/test/",S_OK
},
7025 {"c:\\test\\",S_OK
,FALSE
,"file:///c:/test/"},
7031 {Uri_HOST_UNKNOWN
,S_OK
},
7033 {URL_SCHEME_FILE
,S_OK
},
7034 {URLZONE_INVALID
,E_NOTIMPL
}
7037 { "http://google.com/test",0,
7038 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
7041 {"file:///c:/test/",S_OK
},
7043 {"file:///c:/test/",S_OK
},
7052 {"c:\\test\\",S_OK
,FALSE
,"file:///c:/test/"},
7058 {Uri_HOST_UNKNOWN
,S_OK
},
7060 {URL_SCHEME_FILE
,S_OK
},
7061 {URLZONE_INVALID
,E_NOTIMPL
}
7064 { "http://winehq.org",0,
7065 "mailto://",Uri_CREATE_NO_CANONICALIZE
,
7079 {"mailto://",S_OK
,FALSE
,"mailto:"},
7085 {Uri_HOST_UNKNOWN
,S_OK
},
7087 {URL_SCHEME_MAILTO
,S_OK
},
7088 {URLZONE_INVALID
,E_NOTIMPL
}
7091 { "http://winehq.org",0,
7092 "mailto://a@b.com",Uri_CREATE_NO_CANONICALIZE
,
7095 {"mailto:a@b.com",S_OK
},
7097 {"mailto:a@b.com",S_OK
},
7106 {"mailto://a@b.com",S_OK
,FALSE
,"mailto:a@b.com"},
7112 {Uri_HOST_UNKNOWN
,S_OK
},
7114 {URL_SCHEME_MAILTO
,S_OK
},
7115 {URLZONE_INVALID
,E_NOTIMPL
}
7120 typedef struct _uri_parse_test
{
7125 const char *property
;
7130 static const uri_parse_test uri_parse_tests
[] = {
7131 /* PARSE_CANONICALIZE tests. */
7132 {"zip://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"zip://google.com/test<|>",S_OK
,FALSE
},
7133 {"http://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"http://google.com/test%3C%7C%3E",S_OK
,FALSE
},
7134 {"http://google.com/%30%23%3F",0,PARSE_CANONICALIZE
,URL_UNESCAPE
,"http://google.com/0#?",S_OK
,FALSE
},
7135 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_UNSAFE
,"test %3C%7C%3E",S_OK
,FALSE
},
7136 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_SPACES_ONLY
,"test%20<|>",S_OK
,FALSE
},
7137 {"test%20<|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_UNESCAPE
|URL_ESCAPE_UNSAFE
,"test%20%3C%7C%3E",S_OK
,FALSE
},
7138 {"http://google.com/%20",0,PARSE_CANONICALIZE
,URL_ESCAPE_PERCENT
,"http://google.com/%2520",S_OK
,FALSE
},
7139 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"http://google.com/test/../",S_OK
,FALSE
},
7140 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_NO_META
,"http://google.com/test/../",S_OK
,FALSE
},
7141 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"http://google.com/",S_OK
,FALSE
},
7142 {"zip://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"zip://google.com/",S_OK
,FALSE
},
7143 {"file:///c:/test/../test",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"file:///c:/test/../test",S_OK
,FALSE
},
7145 /* PARSE_FRIENDLY tests. */
7146 {"http://test@google.com/test#test",0,PARSE_FRIENDLY
,0,"http://google.com/test#test",S_OK
,FALSE
},
7147 {"zip://test@google.com/test",0,PARSE_FRIENDLY
,0,"zip://test@google.com/test",S_OK
,FALSE
},
7149 /* PARSE_ROOTDOCUMENT tests. */
7150 {"http://google.com:200/test/test",0,PARSE_ROOTDOCUMENT
,0,"http://google.com:200/",S_OK
,FALSE
},
7151 {"http://google.com",Uri_CREATE_NO_CANONICALIZE
,PARSE_ROOTDOCUMENT
,0,"http://google.com/",S_OK
,FALSE
},
7152 {"zip://google.com/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7153 {"file:///c:/testing/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7154 {"file://server/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7155 {"zip:test/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7157 /* PARSE_DOCUMENT tests. */
7158 {"http://test@google.com/test?query#frag",0,PARSE_DOCUMENT
,0,"http://test@google.com/test?query",S_OK
,FALSE
},
7159 {"http:testing#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7160 {"file:///c:/test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7161 {"zip://google.com/#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7162 {"zip:test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7163 {"testing#frag",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7165 /* PARSE_PATH_FROM_URL tests. */
7166 {"file:///c:/test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\test.mp3",S_OK
,FALSE
},
7167 {"file:///c:/t<|>est.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\t<|>est.mp3",S_OK
,FALSE
},
7168 {"file:///c:/te%XX t/",0,PARSE_PATH_FROM_URL
,0,"c:\\te%XX t\\",S_OK
,FALSE
},
7169 {"file://server/test",0,PARSE_PATH_FROM_URL
,0,"\\\\server\\test",S_OK
,FALSE
},
7170 {"http://google.com/",0,PARSE_PATH_FROM_URL
,0,"",E_INVALIDARG
,FALSE
},
7172 /* PARSE_URL_FROM_PATH tests. */
7173 /* This function almost seems to useless (just returns the absolute uri). */
7174 {"test.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"test.com",S_OK
,FALSE
},
7175 {"/test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"/test/test",S_OK
,FALSE
},
7176 {"file://c:\\test\\test",Uri_CREATE_FILE_USE_DOS_PATH
,PARSE_URL_FROM_PATH
,0,"file://c:\\test\\test",S_OK
,FALSE
},
7177 {"file:c:/test",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
7178 {"http:google.com/",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
7180 /* PARSE_SCHEMA tests. */
7181 {"http://google.com/test",0,PARSE_SCHEMA
,0,"http",S_OK
,FALSE
},
7182 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SCHEMA
,0,"",S_OK
,FALSE
},
7184 /* PARSE_SITE tests. */
7185 {"http://google.uk.com/",0,PARSE_SITE
,0,"google.uk.com",S_OK
,FALSE
},
7186 {"http://google.com.com/",0,PARSE_SITE
,0,"google.com.com",S_OK
,FALSE
},
7187 {"google.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SITE
,0,"",S_OK
,FALSE
},
7188 {"file://server/test",0,PARSE_SITE
,0,"server",S_OK
,FALSE
},
7190 /* PARSE_DOMAIN tests. */
7191 {"http://google.com.uk/",0,PARSE_DOMAIN
,0,"google.com.uk",S_OK
,FALSE
},
7192 {"http://google.com.com/",0,PARSE_DOMAIN
,0,"com.com",S_OK
,FALSE
},
7193 {"test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
7194 {"file://server/test",0,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
7196 /* PARSE_LOCATION and PARSE_ANCHOR tests. */
7197 {"http://google.com/test#Test",0,PARSE_ANCHOR
,0,"#Test",S_OK
,FALSE
},
7198 {"http://google.com/test#Test",0,PARSE_LOCATION
,0,"#Test",S_OK
,FALSE
},
7199 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_ANCHOR
,0,"",S_OK
,FALSE
},
7200 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_LOCATION
,0,"",S_OK
,FALSE
}
7203 static inline LPWSTR
a2w(LPCSTR str
) {
7207 DWORD len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
7208 ret
= HeapAlloc(GetProcessHeap(), 0, len
*sizeof(WCHAR
));
7209 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
7215 static inline BOOL
heap_free(void* mem
) {
7216 return HeapFree(GetProcessHeap(), 0, mem
);
7219 static inline DWORD
strcmp_aw(LPCSTR strA
, LPCWSTR strB
) {
7220 LPWSTR strAW
= a2w(strA
);
7221 DWORD ret
= lstrcmpW(strAW
, strB
);
7226 static inline ULONG
get_refcnt(IUri
*uri
) {
7228 return IUri_Release(uri
);
7231 static void change_property(IUriBuilder
*builder
, const uri_builder_property
*prop
,
7236 valueW
= a2w(prop
->value
);
7237 switch(prop
->property
) {
7238 case Uri_PROPERTY_FRAGMENT
:
7239 hr
= IUriBuilder_SetFragment(builder
, valueW
);
7242 ok(hr
== prop
->expected
,
7243 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7244 hr
, prop
->expected
, test_index
);
7247 ok(hr
== prop
->expected
,
7248 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7249 hr
, prop
->expected
, test_index
);
7252 case Uri_PROPERTY_HOST
:
7253 hr
= IUriBuilder_SetHost(builder
, valueW
);
7256 ok(hr
== prop
->expected
,
7257 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7258 hr
, prop
->expected
, test_index
);
7261 ok(hr
== prop
->expected
,
7262 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7263 hr
, prop
->expected
, test_index
);
7266 case Uri_PROPERTY_PASSWORD
:
7267 hr
= IUriBuilder_SetPassword(builder
, valueW
);
7270 ok(hr
== prop
->expected
,
7271 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7272 hr
, prop
->expected
, test_index
);
7275 ok(hr
== prop
->expected
,
7276 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7277 hr
, prop
->expected
, test_index
);
7280 case Uri_PROPERTY_PATH
:
7281 hr
= IUriBuilder_SetPath(builder
, valueW
);
7284 ok(hr
== prop
->expected
,
7285 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7286 hr
, prop
->expected
, test_index
);
7289 ok(hr
== prop
->expected
,
7290 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7291 hr
, prop
->expected
, test_index
);
7294 case Uri_PROPERTY_QUERY
:
7295 hr
= IUriBuilder_SetQuery(builder
, valueW
);
7298 ok(hr
== prop
->expected
,
7299 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7300 hr
, prop
->expected
, test_index
);
7303 ok(hr
== prop
->expected
,
7304 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7305 hr
, prop
->expected
, test_index
);
7308 case Uri_PROPERTY_SCHEME_NAME
:
7309 hr
= IUriBuilder_SetSchemeName(builder
, valueW
);
7312 ok(hr
== prop
->expected
,
7313 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7314 hr
, prop
->expected
, test_index
);
7317 ok(hr
== prop
->expected
,
7318 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7319 hr
, prop
->expected
, test_index
);
7322 case Uri_PROPERTY_USER_NAME
:
7323 hr
= IUriBuilder_SetUserName(builder
, valueW
);
7326 ok(hr
== prop
->expected
,
7327 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7328 hr
, prop
->expected
, test_index
);
7331 ok(hr
== prop
->expected
,
7332 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7333 hr
, prop
->expected
, test_index
);
7337 trace("Unsupported operation for %d on uri_builder_tests[%d].\n", prop
->property
, test_index
);
7344 * Simple tests to make sure the CreateUri function handles invalid flag combinations
7347 static void test_CreateUri_InvalidFlags(void) {
7350 for(i
= 0; i
< sizeof(invalid_flag_tests
)/sizeof(invalid_flag_tests
[0]); ++i
) {
7352 IUri
*uri
= (void*) 0xdeadbeef;
7354 hr
= pCreateUri(http_urlW
, invalid_flag_tests
[i
].flags
, 0, &uri
);
7355 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x\n",
7356 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
7357 ok(uri
== NULL
, "Error: expected the IUri to be NULL, but it was %p instead\n", uri
);
7361 static void test_CreateUri_InvalidArgs(void) {
7363 IUri
*uri
= (void*) 0xdeadbeef;
7365 const WCHAR invalidW
[] = {'i','n','v','a','l','i','d',0};
7366 static const WCHAR emptyW
[] = {0};
7368 hr
= pCreateUri(http_urlW
, 0, 0, NULL
);
7369 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
7371 hr
= pCreateUri(NULL
, 0, 0, &uri
);
7372 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
7373 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7375 uri
= (void*) 0xdeadbeef;
7376 hr
= pCreateUri(invalidW
, 0, 0, &uri
);
7377 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7378 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7380 uri
= (void*) 0xdeadbeef;
7381 hr
= pCreateUri(emptyW
, 0, 0, &uri
);
7382 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7383 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7386 static void test_CreateUri_InvalidUri(void) {
7389 for(i
= 0; i
< sizeof(invalid_uri_tests
)/sizeof(invalid_uri_tests
[0]); ++i
) {
7390 invalid_uri test
= invalid_uri_tests
[i
];
7395 uriW
= a2w(test
.uri
);
7396 hr
= pCreateUri(uriW
, test
.flags
, 0, &uri
);
7399 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
7400 hr
, E_INVALIDARG
, i
);
7403 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
7404 hr
, E_INVALIDARG
, i
);
7406 if(uri
) IUri_Release(uri
);
7412 static void test_IUri_GetPropertyBSTR(void) {
7417 /* Make sure GetPropertyBSTR handles invalid args correctly. */
7418 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7419 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7421 BSTR received
= NULL
;
7423 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, NULL
, 0);
7424 ok(hr
== E_POINTER
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7426 /* Make sure it handles an invalid Uri_PROPERTY correctly. */
7427 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_PORT
, &received
, 0);
7428 ok(hr
== E_INVALIDARG
/* IE10 */ || broken(hr
== S_OK
), "Error: GetPropertyBSTR returned 0x%08x, expected E_INVALIDARG or S_OK.\n", hr
);
7430 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
7431 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
7432 SysFreeString(received
);
7434 ok(!received
, "received = %s\n", wine_dbgstr_w(received
));
7437 /* Make sure it handles the ZONE property correctly. */
7439 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_ZONE
, &received
, 0);
7440 ok(hr
== S_FALSE
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, S_FALSE
);
7441 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
7442 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
7443 SysFreeString(received
);
7445 if(uri
) IUri_Release(uri
);
7447 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7448 uri_properties test
= uri_tests
[i
];
7452 uriW
= a2w(test
.uri
);
7453 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7454 if(test
.create_todo
) {
7456 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7457 hr
, test
.create_expected
, i
);
7460 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7461 hr
, test
.create_expected
, i
);
7467 /* Checks all the string properties of the uri. */
7468 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
7469 BSTR received
= NULL
;
7470 uri_str_property prop
= test
.str_props
[j
];
7472 hr
= IUri_GetPropertyBSTR(uri
, j
, &received
, 0);
7475 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
7476 hr
, prop
.expected
, i
, j
);
7479 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7480 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
7481 prop
.value
, wine_dbgstr_w(received
), i
, j
);
7484 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
7485 hr
, prop
.expected
, i
, j
);
7486 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7487 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
7488 prop
.value
, wine_dbgstr_w(received
), i
, j
);
7491 SysFreeString(received
);
7495 if(uri
) IUri_Release(uri
);
7501 static void test_IUri_GetPropertyDWORD(void) {
7506 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7507 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7509 DWORD received
= 0xdeadbeef;
7511 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_DWORD_START
, NULL
, 0);
7512 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7514 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_ABSOLUTE_URI
, &received
, 0);
7515 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7516 ok(received
== 0, "Error: Expected received=%d but instead received=%d.\n", 0, received
);
7518 if(uri
) IUri_Release(uri
);
7520 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7521 uri_properties test
= uri_tests
[i
];
7525 uriW
= a2w(test
.uri
);
7526 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7527 if(test
.create_todo
) {
7529 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7530 hr
, test
.create_expected
, i
);
7533 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7534 hr
, test
.create_expected
, i
);
7540 /* Checks all the DWORD properties of the uri. */
7541 for(j
= 0; j
< sizeof(test
.dword_props
)/sizeof(test
.dword_props
[0]); ++j
) {
7543 uri_dword_property prop
= test
.dword_props
[j
];
7545 hr
= IUri_GetPropertyDWORD(uri
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
7548 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
7549 hr
, prop
.expected
, i
, j
);
7552 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
7553 prop
.value
, received
, i
, j
);
7556 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
7557 hr
, prop
.expected
, i
, j
);
7558 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
7559 prop
.value
, received
, i
, j
);
7564 if(uri
) IUri_Release(uri
);
7570 /* Tests all the 'Get*' property functions which deal with strings. */
7571 static void test_IUri_GetStrProperties(void) {
7576 /* Make sure all the 'Get*' string property functions handle invalid args correctly. */
7577 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7578 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7580 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
7581 ok(hr
== E_POINTER
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7583 hr
= IUri_GetAuthority(uri
, NULL
);
7584 ok(hr
== E_POINTER
, "Error: GetAuthority returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7586 hr
= IUri_GetDisplayUri(uri
, NULL
);
7587 ok(hr
== E_POINTER
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7589 hr
= IUri_GetDomain(uri
, NULL
);
7590 ok(hr
== E_POINTER
, "Error: GetDomain returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7592 hr
= IUri_GetExtension(uri
, NULL
);
7593 ok(hr
== E_POINTER
, "Error: GetExtension returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7595 hr
= IUri_GetFragment(uri
, NULL
);
7596 ok(hr
== E_POINTER
, "Error: GetFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7598 hr
= IUri_GetHost(uri
, NULL
);
7599 ok(hr
== E_POINTER
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7601 hr
= IUri_GetPassword(uri
, NULL
);
7602 ok(hr
== E_POINTER
, "Error: GetPassword returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7604 hr
= IUri_GetPath(uri
, NULL
);
7605 ok(hr
== E_POINTER
, "Error: GetPath returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7607 hr
= IUri_GetPathAndQuery(uri
, NULL
);
7608 ok(hr
== E_POINTER
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7610 hr
= IUri_GetQuery(uri
, NULL
);
7611 ok(hr
== E_POINTER
, "Error: GetQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7613 hr
= IUri_GetRawUri(uri
, NULL
);
7614 ok(hr
== E_POINTER
, "Error: GetRawUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7616 hr
= IUri_GetSchemeName(uri
, NULL
);
7617 ok(hr
== E_POINTER
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7619 hr
= IUri_GetUserInfo(uri
, NULL
);
7620 ok(hr
== E_POINTER
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7622 hr
= IUri_GetUserName(uri
, NULL
);
7623 ok(hr
== E_POINTER
, "Error: GetUserName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7625 if(uri
) IUri_Release(uri
);
7627 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7628 uri_properties test
= uri_tests
[i
];
7632 uriW
= a2w(test
.uri
);
7633 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7634 if(test
.create_todo
) {
7636 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7637 hr
, test
.create_expected
, i
);
7640 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7641 hr
, test
.create_expected
, i
);
7645 uri_str_property prop
;
7646 BSTR received
= NULL
;
7648 /* GetAbsoluteUri() tests. */
7649 prop
= test
.str_props
[Uri_PROPERTY_ABSOLUTE_URI
];
7650 hr
= IUri_GetAbsoluteUri(uri
, &received
);
7653 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7654 hr
, prop
.expected
, i
);
7657 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7658 "Error: Expected %s but got %s on uri_tests[%d].\n",
7659 prop
.value
, wine_dbgstr_w(received
), i
);
7662 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7663 hr
, prop
.expected
, i
);
7664 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7665 "Error: Expected %s but got %s on uri_tests[%d].\n",
7666 prop
.value
, wine_dbgstr_w(received
), i
);
7668 SysFreeString(received
);
7671 /* GetAuthority() tests. */
7672 prop
= test
.str_props
[Uri_PROPERTY_AUTHORITY
];
7673 hr
= IUri_GetAuthority(uri
, &received
);
7676 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7677 hr
, prop
.expected
, i
);
7680 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7681 prop
.value
, wine_dbgstr_w(received
), i
);
7684 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7685 hr
, prop
.expected
, i
);
7686 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7687 prop
.value
, wine_dbgstr_w(received
), i
);
7689 SysFreeString(received
);
7692 /* GetDisplayUri() tests. */
7693 prop
= test
.str_props
[Uri_PROPERTY_DISPLAY_URI
];
7694 hr
= IUri_GetDisplayUri(uri
, &received
);
7697 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7698 hr
, prop
.expected
, i
);
7701 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7702 "Error: Expected %s but got %s on uri_test[%d].\n",
7703 prop
.value
, wine_dbgstr_w(received
), i
);
7706 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7707 hr
, prop
.expected
, i
);
7708 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7709 "Error: Expected %s but got %s on uri_tests[%d].\n",
7710 prop
.value
, wine_dbgstr_w(received
), i
);
7712 SysFreeString(received
);
7715 /* GetDomain() tests. */
7716 prop
= test
.str_props
[Uri_PROPERTY_DOMAIN
];
7717 hr
= IUri_GetDomain(uri
, &received
);
7720 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7721 hr
, prop
.expected
, i
);
7724 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7725 prop
.value
, wine_dbgstr_w(received
), i
);
7728 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7729 hr
, prop
.expected
, i
);
7730 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7731 prop
.value
, wine_dbgstr_w(received
), i
);
7733 SysFreeString(received
);
7736 /* GetExtension() tests. */
7737 prop
= test
.str_props
[Uri_PROPERTY_EXTENSION
];
7738 hr
= IUri_GetExtension(uri
, &received
);
7741 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7742 hr
, prop
.expected
, i
);
7745 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7746 prop
.value
, wine_dbgstr_w(received
), i
);
7749 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7750 hr
, prop
.expected
, i
);
7751 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7752 prop
.value
, wine_dbgstr_w(received
), i
);
7754 SysFreeString(received
);
7757 /* GetFragment() tests. */
7758 prop
= test
.str_props
[Uri_PROPERTY_FRAGMENT
];
7759 hr
= IUri_GetFragment(uri
, &received
);
7762 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7763 hr
, prop
.expected
, i
);
7766 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7767 prop
.value
, wine_dbgstr_w(received
), i
);
7770 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7771 hr
, prop
.expected
, i
);
7772 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7773 prop
.value
, wine_dbgstr_w(received
), i
);
7775 SysFreeString(received
);
7778 /* GetHost() tests. */
7779 prop
= test
.str_props
[Uri_PROPERTY_HOST
];
7780 hr
= IUri_GetHost(uri
, &received
);
7783 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7784 hr
, prop
.expected
, i
);
7787 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7788 prop
.value
, wine_dbgstr_w(received
), i
);
7791 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7792 hr
, prop
.expected
, i
);
7793 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7794 prop
.value
, wine_dbgstr_w(received
), i
);
7796 SysFreeString(received
);
7799 /* GetPassword() tests. */
7800 prop
= test
.str_props
[Uri_PROPERTY_PASSWORD
];
7801 hr
= IUri_GetPassword(uri
, &received
);
7804 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7805 hr
, prop
.expected
, i
);
7808 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7809 prop
.value
, wine_dbgstr_w(received
), i
);
7812 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7813 hr
, prop
.expected
, i
);
7814 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7815 prop
.value
, wine_dbgstr_w(received
), i
);
7817 SysFreeString(received
);
7820 /* GetPath() tests. */
7821 prop
= test
.str_props
[Uri_PROPERTY_PATH
];
7822 hr
= IUri_GetPath(uri
, &received
);
7825 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7826 hr
, prop
.expected
, i
);
7829 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7830 prop
.value
, wine_dbgstr_w(received
), i
);
7833 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7834 hr
, prop
.expected
, i
);
7835 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7836 prop
.value
, wine_dbgstr_w(received
), i
);
7838 SysFreeString(received
);
7841 /* GetPathAndQuery() tests. */
7842 prop
= test
.str_props
[Uri_PROPERTY_PATH_AND_QUERY
];
7843 hr
= IUri_GetPathAndQuery(uri
, &received
);
7846 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7847 hr
, prop
.expected
, i
);
7850 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7851 prop
.value
, wine_dbgstr_w(received
), i
);
7854 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7855 hr
, prop
.expected
, i
);
7856 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7857 prop
.value
, wine_dbgstr_w(received
), i
);
7859 SysFreeString(received
);
7862 /* GetQuery() tests. */
7863 prop
= test
.str_props
[Uri_PROPERTY_QUERY
];
7864 hr
= IUri_GetQuery(uri
, &received
);
7867 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7868 hr
, prop
.expected
, i
);
7871 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7872 prop
.value
, wine_dbgstr_w(received
), i
);
7875 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7876 hr
, prop
.expected
, i
);
7877 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7878 prop
.value
, wine_dbgstr_w(received
), i
);
7880 SysFreeString(received
);
7883 /* GetRawUri() tests. */
7884 prop
= test
.str_props
[Uri_PROPERTY_RAW_URI
];
7885 hr
= IUri_GetRawUri(uri
, &received
);
7888 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7889 hr
, prop
.expected
, i
);
7892 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7893 prop
.value
, wine_dbgstr_w(received
), i
);
7896 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7897 hr
, prop
.expected
, i
);
7898 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7899 prop
.value
, wine_dbgstr_w(received
), i
);
7901 SysFreeString(received
);
7904 /* GetSchemeName() tests. */
7905 prop
= test
.str_props
[Uri_PROPERTY_SCHEME_NAME
];
7906 hr
= IUri_GetSchemeName(uri
, &received
);
7909 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7910 hr
, prop
.expected
, i
);
7913 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7914 prop
.value
, wine_dbgstr_w(received
), i
);
7917 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7918 hr
, prop
.expected
, i
);
7919 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7920 prop
.value
, wine_dbgstr_w(received
), i
);
7922 SysFreeString(received
);
7925 /* GetUserInfo() tests. */
7926 prop
= test
.str_props
[Uri_PROPERTY_USER_INFO
];
7927 hr
= IUri_GetUserInfo(uri
, &received
);
7930 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7931 hr
, prop
.expected
, i
);
7934 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7935 prop
.value
, wine_dbgstr_w(received
), i
);
7938 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7939 hr
, prop
.expected
, i
);
7940 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7941 prop
.value
, wine_dbgstr_w(received
), i
);
7943 SysFreeString(received
);
7946 /* GetUserName() tests. */
7947 prop
= test
.str_props
[Uri_PROPERTY_USER_NAME
];
7948 hr
= IUri_GetUserName(uri
, &received
);
7951 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7952 hr
, prop
.expected
, i
);
7955 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7956 prop
.value
, wine_dbgstr_w(received
), i
);
7959 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7960 hr
, prop
.expected
, i
);
7961 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7962 prop
.value
, wine_dbgstr_w(received
), i
);
7964 SysFreeString(received
);
7967 if(uri
) IUri_Release(uri
);
7973 static void test_IUri_GetDwordProperties(void) {
7978 /* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
7979 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7980 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7982 hr
= IUri_GetHostType(uri
, NULL
);
7983 ok(hr
== E_INVALIDARG
, "Error: GetHostType returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7985 hr
= IUri_GetPort(uri
, NULL
);
7986 ok(hr
== E_INVALIDARG
, "Error: GetPort returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7988 hr
= IUri_GetScheme(uri
, NULL
);
7989 ok(hr
== E_INVALIDARG
, "Error: GetScheme returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7991 hr
= IUri_GetZone(uri
, NULL
);
7992 ok(hr
== E_INVALIDARG
, "Error: GetZone returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7994 if(uri
) IUri_Release(uri
);
7996 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7997 uri_properties test
= uri_tests
[i
];
8001 uriW
= a2w(test
.uri
);
8002 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8003 if(test
.create_todo
) {
8005 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8006 hr
, test
.create_expected
, i
);
8009 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8010 hr
, test
.create_expected
, i
);
8014 uri_dword_property prop
;
8017 /* Assign an insane value so tests don't accidentally pass when
8020 received
= -9999999;
8022 /* GetHostType() tests. */
8023 prop
= test
.dword_props
[Uri_PROPERTY_HOST_TYPE
-Uri_PROPERTY_DWORD_START
];
8024 hr
= IUri_GetHostType(uri
, &received
);
8027 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8028 hr
, prop
.expected
, i
);
8031 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8034 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8035 hr
, prop
.expected
, i
);
8036 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8038 received
= -9999999;
8040 /* GetPort() tests. */
8041 prop
= test
.dword_props
[Uri_PROPERTY_PORT
-Uri_PROPERTY_DWORD_START
];
8042 hr
= IUri_GetPort(uri
, &received
);
8045 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8046 hr
, prop
.expected
, i
);
8049 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8052 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8053 hr
, prop
.expected
, i
);
8054 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8056 received
= -9999999;
8058 /* GetScheme() tests. */
8059 prop
= test
.dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
];
8060 hr
= IUri_GetScheme(uri
, &received
);
8063 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8064 hr
, prop
.expected
, i
);
8067 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8070 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8071 hr
, prop
.expected
, i
);
8072 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8074 received
= -9999999;
8076 /* GetZone() tests. */
8077 prop
= test
.dword_props
[Uri_PROPERTY_ZONE
-Uri_PROPERTY_DWORD_START
];
8078 hr
= IUri_GetZone(uri
, &received
);
8081 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8082 hr
, prop
.expected
, i
);
8085 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8088 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8089 hr
, prop
.expected
, i
);
8090 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8094 if(uri
) IUri_Release(uri
);
8100 static void test_IUri_GetPropertyLength(void) {
8105 /* Make sure it handles invalid args correctly. */
8106 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8107 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8109 DWORD received
= 0xdeadbeef;
8111 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_STRING_START
, NULL
, 0);
8112 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8114 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_DWORD_START
, &received
, 0);
8115 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength return 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8116 ok(received
== 0xdeadbeef, "Error: Expected 0xdeadbeef but got 0x%08x.\n", received
);
8118 if(uri
) IUri_Release(uri
);
8120 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
8121 uri_properties test
= uri_tests
[i
];
8125 uriW
= a2w(test
.uri
);
8126 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8127 if(test
.create_todo
) {
8129 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8130 hr
, test
.create_expected
, i
);
8133 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_test[%d].\n",
8134 hr
, test
.create_expected
, i
);
8140 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
8141 DWORD expectedLen
, receivedLen
;
8142 uri_str_property prop
= test
.str_props
[j
];
8144 expectedLen
= lstrlenA(prop
.value
);
8146 /* This won't be necessary once GetPropertyLength is implemented. */
8149 hr
= IUri_GetPropertyLength(uri
, j
, &receivedLen
, 0);
8152 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
8153 hr
, prop
.expected
, i
, j
);
8156 ok(receivedLen
== expectedLen
|| broken(prop
.broken_value
&& receivedLen
== lstrlenA(prop
.broken_value
)),
8157 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
8158 expectedLen
, receivedLen
, i
, j
);
8161 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
8162 hr
, prop
.expected
, i
, j
);
8163 ok(receivedLen
== expectedLen
|| broken(prop
.broken_value
&& receivedLen
== lstrlenA(prop
.broken_value
)),
8164 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
8165 expectedLen
, receivedLen
, i
, j
);
8170 if(uri
) IUri_Release(uri
);
8176 static DWORD
compute_expected_props(uri_properties
*test
)
8180 for(i
=Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_STRING_LAST
; i
++) {
8181 if(test
->str_props
[i
-Uri_PROPERTY_STRING_START
].expected
== S_OK
)
8185 for(i
=Uri_PROPERTY_DWORD_START
; i
<= Uri_PROPERTY_DWORD_LAST
; i
++) {
8186 if(test
->dword_props
[i
-Uri_PROPERTY_DWORD_START
].expected
== S_OK
)
8193 static void test_IUri_GetProperties(void) {
8198 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8199 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8201 hr
= IUri_GetProperties(uri
, NULL
);
8202 ok(hr
== E_INVALIDARG
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8204 if(uri
) IUri_Release(uri
);
8206 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
8207 uri_properties test
= uri_tests
[i
];
8211 uriW
= a2w(test
.uri
);
8212 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8213 if(test
.create_todo
) {
8215 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8218 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8222 DWORD received
= 0, expected_props
;
8225 hr
= IUri_GetProperties(uri
, &received
);
8226 ok(hr
== S_OK
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8228 expected_props
= compute_expected_props(&test
);
8230 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
8231 /* (1 << j) converts a Uri_PROPERTY to its corresponding Uri_HAS_* flag mask. */
8232 if(expected_props
& (1 << j
))
8233 ok(received
& (1 << j
), "Error: Expected flag for property %d on uri_tests[%d].\n", j
, i
);
8235 ok(!(received
& (1 << j
)), "Error: Received flag for property %d when not expected on uri_tests[%d].\n", j
, i
);
8239 if(uri
) IUri_Release(uri
);
8245 static void test_IUri_HasProperty(void) {
8250 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8251 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8253 hr
= IUri_HasProperty(uri
, Uri_PROPERTY_RAW_URI
, NULL
);
8254 ok(hr
== E_INVALIDARG
, "Error: HasProperty returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8256 if(uri
) IUri_Release(uri
);
8258 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
8259 uri_properties test
= uri_tests
[i
];
8263 uriW
= a2w(test
.uri
);
8265 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8266 if(test
.create_todo
) {
8268 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8271 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8275 DWORD expected_props
, j
;
8277 expected_props
= compute_expected_props(&test
);
8279 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
8280 /* Assign -1, then explicitly test for TRUE or FALSE later. */
8283 hr
= IUri_HasProperty(uri
, j
, &received
);
8284 ok(hr
== S_OK
, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
8287 if(expected_props
& (1 << j
)) {
8288 ok(received
== TRUE
, "Error: Expected to have property %d on uri_tests[%d].\n", j
, i
);
8290 ok(received
== FALSE
, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j
, i
);
8295 if(uri
) IUri_Release(uri
);
8301 static void test_IUri_IsEqual(void) {
8309 /* Make sure IsEqual handles invalid args correctly. */
8310 hres
= pCreateUri(http_urlW
, 0, 0, &uriA
);
8311 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8312 hres
= pCreateUri(http_urlW
, 0, 0, &uriB
);
8313 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8316 hres
= IUri_IsEqual(uriA
, NULL
, &equal
);
8317 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8318 ok(!equal
, "Error: Expected equal to be FALSE, but was %d instead.\n", equal
);
8320 hres
= IUri_IsEqual(uriA
, uriB
, NULL
);
8321 ok(hres
== E_POINTER
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hres
, E_POINTER
);
8326 for(i
= 0; i
< sizeof(equality_tests
)/sizeof(equality_tests
[0]); ++i
) {
8327 uri_equality test
= equality_tests
[i
];
8328 LPWSTR uriA_W
, uriB_W
;
8332 uriA_W
= a2w(test
.a
);
8333 uriB_W
= a2w(test
.b
);
8335 hres
= pCreateUri(uriA_W
, test
.create_flags_a
, 0, &uriA
);
8336 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n", hres
, S_OK
, i
);
8338 hres
= pCreateUri(uriB_W
, test
.create_flags_b
, 0, &uriB
);
8339 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n", hres
, S_OK
, i
);
8342 hres
= IUri_IsEqual(uriA
, uriB
, &equal
);
8343 if(test
.todo
) todo_wine
{
8344 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hres
, S_OK
, i
);
8345 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
8347 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hres
, S_OK
, i
);
8348 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
8350 if(uriA
) IUri_Release(uriA
);
8351 if(uriB
) IUri_Release(uriB
);
8358 static void test_CreateUriWithFragment_InvalidArgs(void) {
8360 IUri
*uri
= (void*) 0xdeadbeef;
8361 const WCHAR fragmentW
[] = {'#','f','r','a','g','m','e','n','t',0};
8363 hr
= pCreateUriWithFragment(NULL
, fragmentW
, 0, 0, &uri
);
8364 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8365 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8367 hr
= pCreateUriWithFragment(http_urlW
, fragmentW
, 0, 0, NULL
);
8368 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8370 /* Original URI can't already contain a fragment component. */
8371 uri
= (void*) 0xdeadbeef;
8372 hr
= pCreateUriWithFragment(http_url_fragW
, fragmentW
, 0, 0, &uri
);
8373 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8374 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8377 /* CreateUriWithFragment has the same invalid flag combinations as CreateUri. */
8378 static void test_CreateUriWithFragment_InvalidFlags(void) {
8381 for(i
= 0; i
< sizeof(invalid_flag_tests
)/sizeof(invalid_flag_tests
[0]); ++i
) {
8383 IUri
*uri
= (void*) 0xdeadbeef;
8385 hr
= pCreateUriWithFragment(http_urlW
, NULL
, invalid_flag_tests
[i
].flags
, 0, &uri
);
8386 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x. flags=0x%08x.\n",
8387 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
8388 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8392 static void test_CreateUriWithFragment(void) {
8395 for(i
= 0; i
< sizeof(uri_fragment_tests
)/sizeof(uri_fragment_tests
[0]); ++i
) {
8399 uri_with_fragment test
= uri_fragment_tests
[i
];
8401 uriW
= a2w(test
.uri
);
8402 fragW
= a2w(test
.fragment
);
8404 hr
= pCreateUriWithFragment(uriW
, fragW
, test
.create_flags
, 0, &uri
);
8405 if(test
.expected_todo
) {
8407 ok(hr
== test
.create_expected
,
8408 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8409 hr
, test
.create_expected
, i
);
8412 ok(hr
== test
.create_expected
,
8413 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8414 hr
, test
.create_expected
, i
);
8417 BSTR received
= NULL
;
8419 hr
= IUri_GetAbsoluteUri(uri
, &received
);
8420 if(test
.expected_todo
) {
8423 "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8427 ok(!strcmp_aw(test
.expected_uri
, received
),
8428 "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
8429 test
.expected_uri
, wine_dbgstr_w(received
), i
);
8432 ok(hr
== S_OK
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8434 ok(!strcmp_aw(test
.expected_uri
, received
), "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
8435 test
.expected_uri
, wine_dbgstr_w(received
), i
);
8438 SysFreeString(received
);
8441 if(uri
) IUri_Release(uri
);
8447 static void test_CreateIUriBuilder(void) {
8449 IUriBuilder
*builder
= NULL
;
8452 hr
= pCreateIUriBuilder(NULL
, 0, 0, NULL
);
8453 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x\n",
8456 /* CreateIUriBuilder increases the ref count of the IUri it receives. */
8457 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8458 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8460 ULONG cur_count
, orig_count
;
8462 orig_count
= get_refcnt(uri
);
8463 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
8464 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8465 ok(builder
!= NULL
, "Error: Expecting builder not to be NULL\n");
8467 cur_count
= get_refcnt(uri
);
8468 ok(cur_count
== orig_count
+1, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
+1, cur_count
);
8470 if(builder
) IUriBuilder_Release(builder
);
8471 cur_count
= get_refcnt(uri
);
8472 ok(cur_count
== orig_count
, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
, cur_count
);
8474 if(uri
) IUri_Release(uri
);
8477 static void test_IUriBuilder_CreateUri(IUriBuilder
*builder
, const uri_builder_test
*test
,
8482 hr
= IUriBuilder_CreateUri(builder
, test
->uri_flags
, 0, 0, &uri
);
8483 if(test
->uri_todo
) {
8485 ok(hr
== test
->uri_hres
,
8486 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8487 hr
, test
->uri_hres
, test_index
);
8490 ok(hr
== test
->uri_hres
,
8491 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8492 hr
, test
->uri_hres
, test_index
);
8498 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
8499 uri_builder_str_property prop
= test
->expected_str_props
[i
];
8500 BSTR received
= NULL
;
8502 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
8505 ok(hr
== prop
.result
,
8506 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8507 hr
, prop
.result
, test_index
, i
);
8510 ok(hr
== prop
.result
,
8511 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8512 hr
, prop
.result
, test_index
, i
);
8517 ok(!strcmp_aw(prop
.expected
, received
),
8518 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8519 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8522 ok(!strcmp_aw(prop
.expected
, received
),
8523 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8524 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8527 SysFreeString(received
);
8530 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
8531 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
8532 DWORD received
= -2;
8534 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
8537 ok(hr
== prop
.result
,
8538 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8539 hr
, prop
.result
, test_index
, i
);
8542 ok(hr
== prop
.result
,
8543 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8544 hr
, prop
.result
, test_index
, i
);
8549 ok(received
== prop
.expected
,
8550 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8551 prop
.expected
, received
, test_index
, i
);
8554 ok(received
== prop
.expected
,
8555 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8556 prop
.expected
, received
, test_index
, i
);
8561 if(uri
) IUri_Release(uri
);
8564 static void test_IUriBuilder_CreateUriSimple(IUriBuilder
*builder
, const uri_builder_test
*test
,
8569 hr
= IUriBuilder_CreateUriSimple(builder
, test
->uri_simple_encode_flags
, 0, &uri
);
8570 if(test
->uri_simple_todo
) {
8572 ok(hr
== test
->uri_simple_hres
,
8573 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8574 hr
, test
->uri_simple_hres
, test_index
);
8577 ok(hr
== test
->uri_simple_hres
,
8578 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8579 hr
, test
->uri_simple_hres
, test_index
);
8585 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
8586 uri_builder_str_property prop
= test
->expected_str_props
[i
];
8587 BSTR received
= NULL
;
8589 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
8592 ok(hr
== prop
.result
,
8593 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8594 hr
, prop
.result
, test_index
, i
);
8597 ok(hr
== prop
.result
,
8598 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8599 hr
, prop
.result
, test_index
, i
);
8604 ok(!strcmp_aw(prop
.expected
, received
),
8605 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8606 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8609 ok(!strcmp_aw(prop
.expected
, received
),
8610 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8611 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8614 SysFreeString(received
);
8617 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
8618 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
8619 DWORD received
= -2;
8621 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
8624 ok(hr
== prop
.result
,
8625 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8626 hr
, prop
.result
, test_index
, i
);
8629 ok(hr
== prop
.result
,
8630 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8631 hr
, prop
.result
, test_index
, i
);
8636 ok(received
== prop
.expected
,
8637 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8638 prop
.expected
, received
, test_index
, i
);
8641 ok(received
== prop
.expected
,
8642 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8643 prop
.expected
, received
, test_index
, i
);
8648 if(uri
) IUri_Release(uri
);
8651 static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder
*builder
, const uri_builder_test
*test
,
8656 hr
= IUriBuilder_CreateUriWithFlags(builder
, test
->uri_with_flags
, test
->uri_with_builder_flags
,
8657 test
->uri_with_encode_flags
, 0, &uri
);
8658 if(test
->uri_with_todo
) {
8660 ok(hr
== test
->uri_with_hres
,
8661 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8662 hr
, test
->uri_with_hres
, test_index
);
8665 ok(hr
== test
->uri_with_hres
,
8666 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8667 hr
, test
->uri_with_hres
, test_index
);
8673 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
8674 uri_builder_str_property prop
= test
->expected_str_props
[i
];
8675 BSTR received
= NULL
;
8677 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
8680 ok(hr
== prop
.result
,
8681 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8682 hr
, prop
.result
, test_index
, i
);
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
);
8692 ok(!strcmp_aw(prop
.expected
, received
),
8693 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8694 prop
.expected
, wine_dbgstr_w(received
), 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 SysFreeString(received
);
8705 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
8706 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
8707 DWORD received
= -2;
8709 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
8712 ok(hr
== prop
.result
,
8713 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8714 hr
, prop
.result
, test_index
, i
);
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
);
8724 ok(received
== prop
.expected
,
8725 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8726 prop
.expected
, received
, 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
);
8736 if(uri
) IUri_Release(uri
);
8739 static void test_IUriBuilder_CreateInvalidArgs(void) {
8740 IUriBuilder
*builder
;
8743 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
8744 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8746 IUri
*test
= NULL
, *uri
= (void*) 0xdeadbeef;
8748 /* Test what happens if the IUriBuilder doesn't have a IUri set. */
8749 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, NULL
);
8750 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8752 uri
= (void*) 0xdeadbeef;
8753 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8754 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_NOTIMPL
);
8755 ok(uri
== NULL
, "Error: expected uri to be NULL, but was %p instead.\n", uri
);
8757 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, NULL
);
8758 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8761 uri
= (void*) 0xdeadbeef;
8762 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
8763 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8765 ok(!uri
, "Error: Expected uri to NULL, but was %p instead.\n", uri
);
8767 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, NULL
);
8768 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8771 uri
= (void*) 0xdeadbeef;
8772 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8773 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8775 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8777 hr
= pCreateUri(http_urlW
, 0, 0, &test
);
8778 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8780 hr
= IUriBuilder_SetIUri(builder
, test
);
8781 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8783 /* No longer returns E_NOTIMPL, since a IUri has been set and hasn't been modified. */
8785 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8786 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8787 ok(uri
!= NULL
, "Error: The uri was NULL.\n");
8788 if(uri
) IUri_Release(uri
);
8791 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
8792 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8794 ok(uri
!= NULL
, "Error: uri was NULL.\n");
8795 if(uri
) IUri_Release(uri
);
8798 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &uri
);
8799 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8801 ok(uri
!= NULL
, "Error: uri was NULL.\n");
8802 if(uri
) IUri_Release(uri
);
8804 hr
= IUriBuilder_SetFragment(builder
, NULL
);
8805 ok(hr
== S_OK
, "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8807 /* The IUriBuilder is changed, so it returns E_NOTIMPL again. */
8808 uri
= (void*) 0xdeadbeef;
8809 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8810 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8811 ok(!uri
, "Error: Expected uri to be NULL but was %p instead.\n", uri
);
8813 uri
= (void*) 0xdeadbeef;
8814 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
8815 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8817 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8819 uri
= (void*) 0xdeadbeef;
8820 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8821 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8823 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8825 if(test
) IUri_Release(test
);
8827 if(builder
) IUriBuilder_Release(builder
);
8830 /* Tests invalid args to the "Get*" functions. */
8831 static void test_IUriBuilder_GetInvalidArgs(void) {
8832 IUriBuilder
*builder
= NULL
;
8835 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
8836 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8838 LPCWSTR received
= (void*) 0xdeadbeef;
8839 DWORD len
= -1, port
= -1;
8842 hr
= IUriBuilder_GetFragment(builder
, NULL
, NULL
);
8843 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8845 hr
= IUriBuilder_GetFragment(builder
, NULL
, &received
);
8846 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8848 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8849 hr
= IUriBuilder_GetFragment(builder
, &len
, NULL
);
8850 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8852 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8854 hr
= IUriBuilder_GetHost(builder
, NULL
, NULL
);
8855 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8857 received
= (void*) 0xdeadbeef;
8858 hr
= IUriBuilder_GetHost(builder
, NULL
, &received
);
8859 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8861 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8863 hr
= IUriBuilder_GetHost(builder
, &len
, NULL
);
8864 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8866 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8868 hr
= IUriBuilder_GetPassword(builder
, NULL
, NULL
);
8869 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8871 received
= (void*) 0xdeadbeef;
8872 hr
= IUriBuilder_GetPassword(builder
, NULL
, &received
);
8873 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8875 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8877 hr
= IUriBuilder_GetPassword(builder
, &len
, NULL
);
8878 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8880 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8882 hr
= IUriBuilder_GetPath(builder
, NULL
, NULL
);
8883 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8885 received
= (void*) 0xdeadbeef;
8886 hr
= IUriBuilder_GetPath(builder
, NULL
, &received
);
8887 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8889 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8891 hr
= IUriBuilder_GetPath(builder
, &len
, NULL
);
8892 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8894 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8896 hr
= IUriBuilder_GetPort(builder
, NULL
, NULL
);
8897 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8899 hr
= IUriBuilder_GetPort(builder
, NULL
, &port
);
8900 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8902 ok(!port
, "Error: Expected port to be 0, but was %d instead.\n", port
);
8903 hr
= IUriBuilder_GetPort(builder
, &set
, NULL
);
8904 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8906 ok(!set
, "Error: Expected set to be FALSE, but was %d instead.\n", set
);
8908 hr
= IUriBuilder_GetQuery(builder
, NULL
, NULL
);
8909 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8911 received
= (void*) 0xdeadbeef;
8912 hr
= IUriBuilder_GetQuery(builder
, NULL
, &received
);
8913 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8915 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8917 hr
= IUriBuilder_GetQuery(builder
, &len
, NULL
);
8918 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8920 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8922 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, NULL
);
8923 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8925 received
= (void*) 0xdeadbeef;
8926 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, &received
);
8927 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8929 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8931 hr
= IUriBuilder_GetSchemeName(builder
, &len
, NULL
);
8932 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8934 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8936 hr
= IUriBuilder_GetUserName(builder
, NULL
, NULL
);
8937 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8939 received
= (void*) 0xdeadbeef;
8940 hr
= IUriBuilder_GetUserName(builder
, NULL
, &received
);
8941 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8943 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8945 hr
= IUriBuilder_GetUserName(builder
, &len
, NULL
);
8946 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8948 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8950 if(builder
) IUriBuilder_Release(builder
);
8953 static void test_IUriBuilder_GetFragment(IUriBuilder
*builder
, const uri_builder_test
*test
,
8957 LPCWSTR received
= NULL
;
8959 const uri_builder_property
*prop
= NULL
;
8961 /* Check if the property was set earlier. */
8962 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
8963 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_FRAGMENT
)
8964 prop
= &(test
->properties
[i
]);
8968 /* Use expected_value unless it's NULL, then use value. */
8969 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
8970 DWORD expected_len
= expected
? strlen(expected
) : 0;
8971 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
8974 ok(hr
== (expected
? S_OK
: S_FALSE
),
8975 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8976 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8980 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8981 expected
, wine_dbgstr_w(received
), test_index
);
8984 ok(expected_len
== len
,
8985 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8986 expected_len
, len
, test_index
);
8990 ok(hr
== (expected
? S_OK
: S_FALSE
),
8991 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8992 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8993 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8994 expected
, wine_dbgstr_w(received
), test_index
);
8995 ok(expected_len
== len
,
8996 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8997 expected_len
, len
, test_index
);
9000 /* The property wasn't set earlier, so it should return whatever
9001 * the base IUri contains (if anything).
9004 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9006 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9007 hr
, S_OK
, test_index
);
9010 received
= (void*) 0xdeadbeef;
9013 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9015 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9016 hr
, S_FALSE
, test_index
);
9018 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9020 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9021 received
, test_index
);
9024 BOOL has_prop
= FALSE
;
9025 BSTR expected
= NULL
;
9027 hr
= IUri_GetFragment(uri
, &expected
);
9029 "Error: Expected IUri_GetFragment to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9031 has_prop
= hr
== S_OK
;
9033 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9036 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9037 hr
, S_OK
, test_index
);
9039 ok(!lstrcmpW(expected
, received
),
9040 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9041 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9042 ok(lstrlenW(expected
) == len
,
9043 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9044 lstrlenW(expected
), len
, test_index
);
9048 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9049 hr
, S_FALSE
, test_index
);
9051 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9052 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9056 SysFreeString(expected
);
9059 if(uri
) IUri_Release(uri
);
9063 static void test_IUriBuilder_GetHost(IUriBuilder
*builder
, const uri_builder_test
*test
,
9067 LPCWSTR received
= NULL
;
9069 const uri_builder_property
*prop
= NULL
;
9071 /* Check if the property was set earlier. */
9072 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9073 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_HOST
)
9074 prop
= &(test
->properties
[i
]);
9078 /* Use expected_value unless it's NULL, then use value. */
9079 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9080 DWORD expected_len
= expected
? strlen(expected
) : 0;
9081 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9084 ok(hr
== (expected
? S_OK
: S_FALSE
),
9085 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9086 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9090 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9091 expected
, wine_dbgstr_w(received
), test_index
);
9094 ok(expected_len
== len
,
9095 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9096 expected_len
, len
, test_index
);
9100 ok(hr
== (expected
? S_OK
: S_FALSE
),
9101 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9102 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9103 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9104 expected
, wine_dbgstr_w(received
), test_index
);
9105 ok(expected_len
== len
,
9106 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9107 expected_len
, len
, test_index
);
9110 /* The property wasn't set earlier, so it should return whatever
9111 * the base IUri contains (if anything).
9114 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9116 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9117 hr
, S_OK
, test_index
);
9120 received
= (void*) 0xdeadbeef;
9123 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9125 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9126 hr
, S_FALSE
, test_index
);
9128 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9130 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9131 received
, test_index
);
9134 BOOL has_prop
= FALSE
;
9135 BSTR expected
= NULL
;
9137 hr
= IUri_GetHost(uri
, &expected
);
9139 "Error: Expected IUri_GetHost to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9141 has_prop
= hr
== S_OK
;
9143 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9146 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9147 hr
, S_OK
, test_index
);
9149 ok(!lstrcmpW(expected
, received
),
9150 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9151 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9152 ok(lstrlenW(expected
) == len
,
9153 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9154 lstrlenW(expected
), len
, test_index
);
9158 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9159 hr
, S_FALSE
, test_index
);
9161 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9162 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9166 SysFreeString(expected
);
9169 if(uri
) IUri_Release(uri
);
9173 static void test_IUriBuilder_GetPassword(IUriBuilder
*builder
, const uri_builder_test
*test
,
9177 LPCWSTR received
= NULL
;
9179 const uri_builder_property
*prop
= NULL
;
9181 /* Check if the property was set earlier. */
9182 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9183 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PASSWORD
)
9184 prop
= &(test
->properties
[i
]);
9188 /* Use expected_value unless it's NULL, then use value. */
9189 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9190 DWORD expected_len
= expected
? strlen(expected
) : 0;
9191 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9194 ok(hr
== (expected
? S_OK
: S_FALSE
),
9195 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9196 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9200 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9201 expected
, wine_dbgstr_w(received
), test_index
);
9204 ok(expected_len
== len
,
9205 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9206 expected_len
, len
, test_index
);
9210 ok(hr
== (expected
? S_OK
: S_FALSE
),
9211 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9212 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9213 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9214 expected
, wine_dbgstr_w(received
), test_index
);
9215 ok(expected_len
== len
,
9216 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9217 expected_len
, len
, test_index
);
9220 /* The property wasn't set earlier, so it should return whatever
9221 * the base IUri contains (if anything).
9224 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9226 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9227 hr
, S_OK
, test_index
);
9230 received
= (void*) 0xdeadbeef;
9233 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9235 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9236 hr
, S_FALSE
, test_index
);
9238 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9240 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9241 received
, test_index
);
9244 BOOL has_prop
= FALSE
;
9245 BSTR expected
= NULL
;
9247 hr
= IUri_GetPassword(uri
, &expected
);
9249 "Error: Expected IUri_GetPassword to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9251 has_prop
= hr
== S_OK
;
9253 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9256 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9257 hr
, S_OK
, test_index
);
9259 ok(!lstrcmpW(expected
, received
),
9260 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9261 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9262 ok(lstrlenW(expected
) == len
,
9263 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9264 lstrlenW(expected
), len
, test_index
);
9268 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9269 hr
, S_FALSE
, test_index
);
9271 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9272 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9276 SysFreeString(expected
);
9279 if(uri
) IUri_Release(uri
);
9283 static void test_IUriBuilder_GetPath(IUriBuilder
*builder
, const uri_builder_test
*test
,
9287 LPCWSTR received
= NULL
;
9289 const uri_builder_property
*prop
= NULL
;
9291 /* Check if the property was set earlier. */
9292 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9293 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PATH
)
9294 prop
= &(test
->properties
[i
]);
9298 /* Use expected_value unless it's NULL, then use value. */
9299 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9300 DWORD expected_len
= expected
? strlen(expected
) : 0;
9301 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9304 ok(hr
== (expected
? S_OK
: S_FALSE
),
9305 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9306 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9310 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9311 expected
, wine_dbgstr_w(received
), test_index
);
9314 ok(expected_len
== len
,
9315 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9316 expected_len
, len
, test_index
);
9320 ok(hr
== (expected
? S_OK
: S_FALSE
),
9321 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9322 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9323 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9324 expected
, wine_dbgstr_w(received
), test_index
);
9325 ok(expected_len
== len
,
9326 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9327 expected_len
, len
, test_index
);
9330 /* The property wasn't set earlier, so it should return whatever
9331 * the base IUri contains (if anything).
9334 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9336 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9337 hr
, S_OK
, test_index
);
9340 received
= (void*) 0xdeadbeef;
9343 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9345 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9346 hr
, S_FALSE
, test_index
);
9348 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9350 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9351 received
, test_index
);
9354 BOOL has_prop
= FALSE
;
9355 BSTR expected
= NULL
;
9357 hr
= IUri_GetPath(uri
, &expected
);
9359 "Error: Expected IUri_GetPath to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9361 has_prop
= hr
== S_OK
;
9363 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9366 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9367 hr
, S_OK
, test_index
);
9369 ok(!lstrcmpW(expected
, received
),
9370 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9371 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9372 ok(lstrlenW(expected
) == len
,
9373 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9374 lstrlenW(expected
), len
, test_index
);
9378 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9379 hr
, S_FALSE
, test_index
);
9381 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9382 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9386 SysFreeString(expected
);
9389 if(uri
) IUri_Release(uri
);
9393 static void test_IUriBuilder_GetPort(IUriBuilder
*builder
, const uri_builder_test
*test
,
9396 BOOL has_port
= FALSE
;
9397 DWORD received
= -1;
9399 if(test
->port_prop
.change
) {
9400 DWORD expected
= test
->port_prop
.value
;
9402 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9403 if(test
->port_prop
.todo
) {
9406 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9407 hr
, S_OK
, test_index
);
9411 ok(has_port
== test
->port_prop
.set
,
9412 "Error: Expected has_port to be %d but was %d instead on uri_builder_tests[%d].\n",
9413 test
->port_prop
.set
, has_port
, test_index
);
9416 ok(received
== expected
,
9417 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
9418 expected
, received
, test_index
);
9423 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9424 hr
, S_OK
, test_index
);
9425 ok(has_port
== test
->port_prop
.set
,
9426 "Error: Expected has_port to be %d, but was %d instead on uri_builder_tests[%d].\n",
9427 test
->port_prop
.set
, has_port
, test_index
);
9428 ok(received
== test
->port_prop
.value
,
9429 "Error: Expected port to be %d, but was %d instead on uri_builder_tests[%d].\n",
9430 test
->port_prop
.value
, received
, test_index
);
9435 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9437 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9438 hr
, S_OK
, test_index
);
9441 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9443 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9444 hr
, S_OK
, test_index
);
9446 ok(has_port
== FALSE
,
9447 "Error: Expected has_port to be FALSE, but was %d instead on uri_builder_tests[%d].\n",
9448 has_port
, test_index
);
9449 ok(!received
, "Error: Expected received to be 0, but was %d instead on uri_builder_tests[%d].\n",
9450 received
, test_index
);
9455 hr
= IUri_GetPort(uri
, &expected
);
9457 "Error: Expected IUri_Port to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9460 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9462 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9463 hr
, S_OK
, test_index
);
9466 "Error: Expected has_port to be FALSE but was TRUE instead on uri_builder_tests[%d].\n",
9468 ok(received
== expected
,
9469 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
9470 expected
, received
, test_index
);
9474 if(uri
) IUri_Release(uri
);
9478 static void test_IUriBuilder_GetQuery(IUriBuilder
*builder
, const uri_builder_test
*test
,
9482 LPCWSTR received
= NULL
;
9484 const uri_builder_property
*prop
= NULL
;
9486 /* Check if the property was set earlier. */
9487 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9488 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_QUERY
)
9489 prop
= &(test
->properties
[i
]);
9493 /* Use expected_value unless it's NULL, then use value. */
9494 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9495 DWORD expected_len
= expected
? strlen(expected
) : 0;
9496 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9499 ok(hr
== (expected
? S_OK
: S_FALSE
),
9500 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9501 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9505 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9506 expected
, wine_dbgstr_w(received
), test_index
);
9509 ok(expected_len
== len
,
9510 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9511 expected_len
, len
, test_index
);
9515 ok(hr
== (expected
? S_OK
: S_FALSE
),
9516 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9517 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9518 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9519 expected
, wine_dbgstr_w(received
), test_index
);
9520 ok(expected_len
== len
,
9521 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9522 expected_len
, len
, test_index
);
9525 /* The property wasn't set earlier, so it should return whatever
9526 * the base IUri contains (if anything).
9529 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9531 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9532 hr
, S_OK
, test_index
);
9535 received
= (void*) 0xdeadbeef;
9538 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9540 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9541 hr
, S_FALSE
, test_index
);
9543 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9545 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9546 received
, test_index
);
9549 BOOL has_prop
= FALSE
;
9550 BSTR expected
= NULL
;
9552 hr
= IUri_GetQuery(uri
, &expected
);
9554 "Error: Expected IUri_GetQuery to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9556 has_prop
= hr
== S_OK
;
9558 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9561 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9562 hr
, S_OK
, test_index
);
9564 ok(!lstrcmpW(expected
, received
),
9565 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9566 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9567 ok(lstrlenW(expected
) == len
,
9568 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9569 lstrlenW(expected
), len
, test_index
);
9573 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9574 hr
, S_FALSE
, test_index
);
9576 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9577 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9581 SysFreeString(expected
);
9584 if(uri
) IUri_Release(uri
);
9588 static void test_IUriBuilder_GetSchemeName(IUriBuilder
*builder
, const uri_builder_test
*test
,
9592 LPCWSTR received
= NULL
;
9594 const uri_builder_property
*prop
= NULL
;
9596 /* Check if the property was set earlier. */
9597 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9598 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_SCHEME_NAME
)
9599 prop
= &(test
->properties
[i
]);
9603 /* Use expected_value unless it's NULL, then use value. */
9604 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9605 DWORD expected_len
= expected
? strlen(expected
) : 0;
9606 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9609 ok(hr
== (expected
? S_OK
: S_FALSE
),
9610 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9611 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9615 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9616 expected
, wine_dbgstr_w(received
), test_index
);
9619 ok(expected_len
== len
,
9620 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9621 expected_len
, len
, test_index
);
9625 ok(hr
== (expected
? S_OK
: S_FALSE
),
9626 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9627 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9628 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9629 expected
, wine_dbgstr_w(received
), test_index
);
9630 ok(expected_len
== len
,
9631 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9632 expected_len
, len
, test_index
);
9635 /* The property wasn't set earlier, so it should return whatever
9636 * the base IUri contains (if anything).
9639 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9641 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9642 hr
, S_OK
, test_index
);
9645 received
= (void*) 0xdeadbeef;
9648 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9650 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9651 hr
, S_FALSE
, test_index
);
9653 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9655 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9656 received
, test_index
);
9659 BOOL has_prop
= FALSE
;
9660 BSTR expected
= NULL
;
9662 hr
= IUri_GetSchemeName(uri
, &expected
);
9664 "Error: Expected IUri_GetSchemeName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9666 has_prop
= hr
== S_OK
;
9668 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9671 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9672 hr
, S_OK
, test_index
);
9674 ok(!lstrcmpW(expected
, received
),
9675 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9676 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9677 ok(lstrlenW(expected
) == len
,
9678 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9679 lstrlenW(expected
), len
, test_index
);
9683 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9684 hr
, S_FALSE
, test_index
);
9686 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9687 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9691 SysFreeString(expected
);
9694 if(uri
) IUri_Release(uri
);
9698 static void test_IUriBuilder_GetUserName(IUriBuilder
*builder
, const uri_builder_test
*test
,
9702 LPCWSTR received
= NULL
;
9704 const uri_builder_property
*prop
= NULL
;
9706 /* Check if the property was set earlier. */
9707 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9708 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_USER_NAME
)
9709 prop
= &(test
->properties
[i
]);
9712 if(prop
&& prop
->value
&& *prop
->value
) {
9713 /* Use expected_value unless it's NULL, then use value. */
9714 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9715 DWORD expected_len
= expected
? strlen(expected
) : 0;
9716 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
9719 ok(hr
== (expected
? S_OK
: S_FALSE
),
9720 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9721 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9725 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9726 expected
, wine_dbgstr_w(received
), test_index
);
9729 ok(expected_len
== len
,
9730 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9731 expected_len
, len
, test_index
);
9735 ok(hr
== (expected
? S_OK
: S_FALSE
),
9736 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9737 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9738 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9739 expected
, wine_dbgstr_w(received
), test_index
);
9740 ok(expected_len
== len
,
9741 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9742 expected_len
, len
, test_index
);
9745 /* The property wasn't set earlier, so it should return whatever
9746 * the base IUri contains (if anything).
9749 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9751 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9752 hr
, S_OK
, test_index
);
9755 received
= (void*) 0xdeadbeef;
9758 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
9760 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9761 hr
, S_FALSE
, test_index
);
9763 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9765 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9766 received
, test_index
);
9769 BSTR expected
= NULL
;
9770 BOOL has_prop
= FALSE
;
9772 hr
= IUri_GetUserName(uri
, &expected
);
9774 "Error: Expected IUri_GetUserName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9776 has_prop
= hr
== S_OK
;
9778 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
9781 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9782 hr
, S_OK
, test_index
);
9784 ok(!lstrcmpW(expected
, received
),
9785 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9786 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9787 ok(lstrlenW(expected
) == len
,
9788 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9789 lstrlenW(expected
), len
, test_index
);
9793 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9794 hr
, S_FALSE
, test_index
);
9796 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9797 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9801 SysFreeString(expected
);
9804 if(uri
) IUri_Release(uri
);
9808 /* Tests IUriBuilder functions. */
9809 static void test_IUriBuilder(void) {
9811 IUriBuilder
*builder
;
9814 for(i
= 0; i
< sizeof(uri_builder_tests
)/sizeof(uri_builder_tests
[0]); ++i
) {
9816 uri_builder_test test
= uri_builder_tests
[i
];
9820 uriW
= a2w(test
.uri
);
9821 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
9822 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9824 if(FAILED(hr
)) continue;
9826 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
9827 if(test
.create_builder_todo
) {
9829 ok(hr
== test
.create_builder_expected
,
9830 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9831 hr
, test
.create_builder_expected
, i
);
9834 ok(hr
== test
.create_builder_expected
,
9835 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9836 hr
, test
.create_builder_expected
, i
);
9840 BOOL modified
= FALSE
, received
= FALSE
;
9842 /* Perform all the string property changes. */
9843 for(j
= 0; j
< URI_BUILDER_STR_PROPERTY_COUNT
; ++j
) {
9844 uri_builder_property prop
= test
.properties
[j
];
9846 change_property(builder
, &prop
, i
);
9847 if(prop
.property
!= Uri_PROPERTY_SCHEME_NAME
&&
9848 prop
.property
!= Uri_PROPERTY_HOST
)
9850 else if(prop
.value
&& *prop
.value
)
9852 else if(prop
.value
&& !*prop
.value
&& prop
.property
== Uri_PROPERTY_HOST
)
9853 /* Host name property can't be NULL, but it can be empty. */
9858 if(test
.port_prop
.change
) {
9859 hr
= IUriBuilder_SetPort(builder
, test
.port_prop
.set
, test
.port_prop
.value
);
9861 if(test
.port_prop
.todo
) {
9863 ok(hr
== test
.port_prop
.expected
,
9864 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9865 hr
, test
.port_prop
.expected
, i
);
9868 ok(hr
== test
.port_prop
.expected
,
9869 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9870 hr
, test
.port_prop
.expected
, i
);
9874 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9876 "Error IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9879 ok(received
== modified
,
9880 "Error: Expected received to be %d but was %d instead on uri_builder_tests[%d].\n",
9881 modified
, received
, i
);
9883 /* Test the "Get*" functions. */
9884 test_IUriBuilder_GetFragment(builder
, &test
, i
);
9885 test_IUriBuilder_GetHost(builder
, &test
, i
);
9886 test_IUriBuilder_GetPassword(builder
, &test
, i
);
9887 test_IUriBuilder_GetPath(builder
, &test
, i
);
9888 test_IUriBuilder_GetPort(builder
, &test
, i
);
9889 test_IUriBuilder_GetQuery(builder
, &test
, i
);
9890 test_IUriBuilder_GetSchemeName(builder
, &test
, i
);
9891 test_IUriBuilder_GetUserName(builder
, &test
, i
);
9893 test_IUriBuilder_CreateUri(builder
, &test
, i
);
9894 test_IUriBuilder_CreateUriSimple(builder
, &test
, i
);
9895 test_IUriBuilder_CreateUriWithFlags(builder
, &test
, i
);
9897 if(builder
) IUriBuilder_Release(builder
);
9898 if(uri
) IUri_Release(uri
);
9903 static void test_IUriBuilder_HasBeenModified(void) {
9905 IUriBuilder
*builder
= NULL
;
9907 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
9908 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9910 static const WCHAR hostW
[] = {'g','o','o','g','l','e','.','c','o','m',0};
9914 hr
= IUriBuilder_HasBeenModified(builder
, NULL
);
9915 ok(hr
== E_POINTER
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9918 hr
= IUriBuilder_SetHost(builder
, hostW
);
9919 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n",
9922 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9923 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9926 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9928 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
9929 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9934 hr
= IUriBuilder_SetIUri(builder
, uri
);
9935 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n",
9938 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9939 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9942 ok(received
== FALSE
, "Error: Expected received to be FALSE.\n");
9944 /* Test what happens with you call SetIUri with the same IUri again. */
9945 hr
= IUriBuilder_SetHost(builder
, hostW
);
9946 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9948 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9949 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9952 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9954 hr
= IUriBuilder_SetIUri(builder
, uri
);
9955 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9957 /* IUriBuilder already had 'uri' as its IUri property and so Windows doesn't
9958 * reset any of the changes that were made to the IUriBuilder.
9960 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9961 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9963 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9965 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
9966 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9968 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
9969 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
9970 ok(len
== lstrlenW(hostW
), "Error: Expected len to be %d, but was %d instead.\n",
9971 lstrlenW(hostW
), len
);
9974 hr
= IUriBuilder_SetIUri(builder
, NULL
);
9975 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9977 hr
= IUriBuilder_SetHost(builder
, hostW
);
9978 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9979 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9980 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9983 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9985 hr
= IUriBuilder_SetIUri(builder
, NULL
);
9986 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%09x.\n", hr
, S_OK
);
9988 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9989 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9992 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9994 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
9995 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9997 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
9998 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
9999 ok(len
== lstrlenW(hostW
), "Error: Expected len to %d, but was %d instead.\n",
10000 lstrlenW(hostW
), len
);
10003 if(uri
) IUri_Release(uri
);
10005 if(builder
) IUriBuilder_Release(builder
);
10008 /* Test IUriBuilder {Get,Set}IUri functions. */
10009 static void test_IUriBuilder_IUriProperty(void) {
10010 IUriBuilder
*builder
= NULL
;
10013 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10014 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10015 if(SUCCEEDED(hr
)) {
10018 hr
= IUriBuilder_GetIUri(builder
, NULL
);
10019 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x.\n",
10022 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10023 if(SUCCEEDED(hr
)) {
10025 ULONG cur_count
, orig_count
;
10027 /* IUriBuilder doesn't clone the IUri, it use the same IUri. */
10028 orig_count
= get_refcnt(uri
);
10029 hr
= IUriBuilder_SetIUri(builder
, uri
);
10030 cur_count
= get_refcnt(uri
);
10032 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10033 orig_count
+1, cur_count
);
10035 hr
= IUriBuilder_SetIUri(builder
, NULL
);
10036 cur_count
= get_refcnt(uri
);
10038 ok(cur_count
== orig_count
, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10039 orig_count
, cur_count
);
10041 /* CreateUri* functions will return back the same IUri if nothing has changed. */
10042 hr
= IUriBuilder_SetIUri(builder
, uri
);
10043 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10044 orig_count
= get_refcnt(uri
);
10046 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, &test
);
10047 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10048 if(SUCCEEDED(hr
)) {
10049 cur_count
= get_refcnt(uri
);
10050 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10051 orig_count
+1, cur_count
);
10052 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n",
10055 if(test
) IUri_Release(test
);
10058 hr
= IUriBuilder_CreateUri(builder
, -1, 0, 0, &test
);
10059 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10060 if(SUCCEEDED(hr
)) {
10061 cur_count
= get_refcnt(uri
);
10062 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10063 orig_count
+1, cur_count
);
10064 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10066 if(test
) IUri_Release(test
);
10068 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10072 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, &test
);
10073 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10075 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
10077 if(test
) IUri_Release(test
);
10079 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10080 * explicitly set (because it's a default flag).
10083 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_CANONICALIZE
, 0, 0, &test
);
10084 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10085 if(SUCCEEDED(hr
)) {
10086 cur_count
= get_refcnt(uri
);
10087 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10088 orig_count
+1, cur_count
);
10089 ok(test
== uri
, "Error: Expected 'test' to be %p, but was %p instead.\n", uri
, test
);
10091 if(test
) IUri_Release(test
);
10094 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, &test
);
10095 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10096 if(SUCCEEDED(hr
)) {
10097 cur_count
= get_refcnt(uri
);
10098 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10099 orig_count
+1, cur_count
);
10100 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10102 if(test
) IUri_Release(test
);
10105 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &test
);
10106 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
10108 if(SUCCEEDED(hr
)) {
10109 cur_count
= get_refcnt(uri
);
10110 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10111 orig_count
+1, cur_count
);
10112 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10114 if(test
) IUri_Release(test
);
10116 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10120 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, 0, &test
);
10121 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10123 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
10125 if(test
) IUri_Release(test
);
10127 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10128 * explicitly set (because it's a default flag).
10131 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_CANONICALIZE
, 0, 0, 0, &test
);
10132 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10133 if(SUCCEEDED(hr
)) {
10134 cur_count
= get_refcnt(uri
);
10135 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10136 orig_count
+1, cur_count
);
10137 ok(test
== uri
, "Error: Expected 'test' to be %p, but was %p instead.\n", uri
, test
);
10139 if(test
) IUri_Release(test
);
10141 if(uri
) IUri_Release(uri
);
10143 if(builder
) IUriBuilder_Release(builder
);
10146 static void test_IUriBuilder_RemoveProperties(void) {
10147 IUriBuilder
*builder
= NULL
;
10151 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10152 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10153 if(SUCCEEDED(hr
)) {
10154 /* Properties that can't be removed. */
10155 const DWORD invalid
= Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_RAW_URI
|Uri_HAS_HOST_TYPE
|
10156 Uri_HAS_SCHEME
|Uri_HAS_ZONE
;
10158 for(i
= Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_DWORD_LAST
; ++i
) {
10159 hr
= IUriBuilder_RemoveProperties(builder
, i
<< 1);
10160 if((i
<< 1) & invalid
) {
10161 ok(hr
== E_INVALIDARG
,
10162 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
10163 hr
, E_INVALIDARG
, i
);
10166 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
10171 /* Also doesn't accept anything that's outside the range of the
10174 hr
= IUriBuilder_RemoveProperties(builder
, (Uri_PROPERTY_DWORD_LAST
+1) << 1);
10175 ok(hr
== E_INVALIDARG
, "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x.\n",
10178 if(builder
) IUriBuilder_Release(builder
);
10180 for(i
= 0; i
< sizeof(uri_builder_remove_tests
)/sizeof(uri_builder_remove_tests
[0]); ++i
) {
10181 uri_builder_remove_test test
= uri_builder_remove_tests
[i
];
10185 uriW
= a2w(test
.uri
);
10186 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
10187 if(SUCCEEDED(hr
)) {
10190 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10191 if(test
.create_builder_todo
) {
10193 ok(hr
== test
.create_builder_expected
,
10194 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
10195 hr
, test
.create_builder_expected
, i
);
10198 ok(hr
== test
.create_builder_expected
,
10199 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
10200 hr
, test
.create_builder_expected
, i
);
10202 if(SUCCEEDED(hr
)) {
10203 hr
= IUriBuilder_RemoveProperties(builder
, test
.remove_properties
);
10204 if(test
.remove_todo
) {
10206 ok(hr
== test
.remove_expected
,
10207 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x on test %d.\n",
10208 hr
, test
.remove_expected
, i
);
10211 ok(hr
== test
.remove_expected
,
10212 "Error: IUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
10213 hr
, test
.remove_expected
, i
);
10215 if(SUCCEEDED(hr
)) {
10216 IUri
*result
= NULL
;
10218 hr
= IUriBuilder_CreateUri(builder
, test
.expected_flags
, 0, 0, &result
);
10219 if(test
.expected_todo
) {
10221 ok(hr
== test
.expected_hres
,
10222 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
10223 hr
, test
.expected_hres
, i
);
10226 ok(hr
== test
.expected_hres
,
10227 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
10228 hr
, test
.expected_hres
, i
);
10230 if(SUCCEEDED(hr
)) {
10231 BSTR received
= NULL
;
10233 hr
= IUri_GetAbsoluteUri(result
, &received
);
10234 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10235 ok(!strcmp_aw(test
.expected_uri
, received
),
10236 "Error: Expected %s but got %s instead on test %d.\n",
10237 test
.expected_uri
, wine_dbgstr_w(received
), i
);
10238 SysFreeString(received
);
10240 if(result
) IUri_Release(result
);
10243 if(builder
) IUriBuilder_Release(builder
);
10245 if(uri
) IUri_Release(uri
);
10250 static void test_IUriBuilder_Misc(void) {
10254 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10255 if(SUCCEEDED(hr
)) {
10256 IUriBuilder
*builder
;
10258 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10259 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10260 if(SUCCEEDED(hr
)) {
10264 hr
= IUriBuilder_GetPort(builder
, &has
, &port
);
10265 ok(hr
== S_OK
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10266 if(SUCCEEDED(hr
)) {
10267 /* 'has' will be set to FALSE, even though uri had a port. */
10268 ok(has
== FALSE
, "Error: Expected 'has' to be FALSE, was %d instead.\n", has
);
10269 /* Still sets 'port' to 80. */
10270 ok(port
== 80, "Error: Expected the port to be 80, but, was %d instead.\n", port
);
10273 if(builder
) IUriBuilder_Release(builder
);
10275 if(uri
) IUri_Release(uri
);
10278 static void test_IUriBuilderFactory(void) {
10281 IUriBuilderFactory
*factory
;
10282 IUriBuilder
*builder
;
10284 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10285 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10286 if(SUCCEEDED(hr
)) {
10288 hr
= IUri_QueryInterface(uri
, &IID_IUriBuilderFactory
, (void**)&factory
);
10289 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x.\n", hr
);
10290 ok(factory
!= NULL
, "Error: Expected 'factory' to not be NULL.\n");
10292 if(SUCCEEDED(hr
)) {
10293 builder
= (void*) 0xdeadbeef;
10294 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 10, 0, &builder
);
10295 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10297 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10299 builder
= (void*) 0xdeadbeef;
10300 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 10, &builder
);
10301 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10303 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10305 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, NULL
);
10306 ok(hr
== E_POINTER
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10310 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, &builder
);
10311 ok(hr
== S_OK
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10313 if(SUCCEEDED(hr
)) {
10314 IUri
*tmp
= (void*) 0xdeadbeef;
10318 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
10319 ok(hr
== S_OK
, "Error: GetIUri returned 0x%08x, expected 0x%08x.\n",
10321 ok(!tmp
, "Error: Expected 'tmp' to be NULL, but was %p instead.\n", tmp
);
10323 hr
= IUriBuilder_GetHost(builder
, &result_len
, &result
);
10324 ok(hr
== S_FALSE
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n",
10327 if(builder
) IUriBuilder_Release(builder
);
10329 builder
= (void*) 0xdeadbeef;
10330 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 10, 0, &builder
);
10331 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10333 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10335 builder
= (void*) 0xdeadbeef;
10336 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 10, &builder
);
10337 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10339 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10341 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, NULL
);
10342 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10346 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, &builder
);
10347 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10349 if(SUCCEEDED(hr
)) {
10352 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
10353 ok(hr
== S_OK
, "Error: GetIUri return 0x%08x, expected 0x%08x.\n",
10355 ok(tmp
== uri
, "Error: Expected tmp to be %p, but was %p.\n", uri
, tmp
);
10356 if(uri
) IUri_Release(uri
);
10358 if(builder
) IUriBuilder_Release(builder
);
10360 if(factory
) IUriBuilderFactory_Release(factory
);
10362 if(uri
) IUri_Release(uri
);
10365 static void test_CoInternetCombineIUri(void) {
10367 IUri
*base
, *relative
, *result
;
10371 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
10372 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr
);
10373 if(SUCCEEDED(hr
)) {
10374 result
= (void*) 0xdeadbeef;
10375 hr
= pCoInternetCombineIUri(base
, NULL
, 0, &result
, 0);
10376 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10377 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
10381 hr
= pCreateUri(http_urlW
, 0, 0, &relative
);
10382 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr
);
10383 if(SUCCEEDED(hr
)) {
10384 result
= (void*) 0xdeadbeef;
10385 hr
= pCoInternetCombineIUri(NULL
, relative
, 0, &result
, 0);
10386 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10387 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
10390 hr
= pCoInternetCombineIUri(base
, relative
, 0, NULL
, 0);
10391 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10393 if(base
) IUri_Release(base
);
10394 if(relative
) IUri_Release(relative
);
10396 for(i
= 0; i
< sizeof(uri_combine_tests
)/sizeof(uri_combine_tests
[0]); ++i
) {
10397 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
10399 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
10400 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10401 if(SUCCEEDED(hr
)) {
10402 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
10404 hr
= pCreateUri(relativeW
, uri_combine_tests
[i
].relative_create_flags
, 0, &relative
);
10405 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10406 if(SUCCEEDED(hr
)) {
10409 hr
= pCoInternetCombineIUri(base
, relative
, uri_combine_tests
[i
].combine_flags
, &result
, 0);
10410 if(uri_combine_tests
[i
].todo
) {
10412 ok(hr
== uri_combine_tests
[i
].expected
,
10413 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10414 hr
, uri_combine_tests
[i
].expected
, i
);
10417 ok(hr
== uri_combine_tests
[i
].expected
,
10418 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10419 hr
, uri_combine_tests
[i
]. expected
, i
);
10421 if(SUCCEEDED(hr
)) {
10424 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].str_props
)/sizeof(uri_combine_tests
[i
].str_props
[0]); ++j
) {
10425 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
10428 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
10431 ok(hr
== prop
.expected
,
10432 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10433 hr
, prop
.expected
, i
, j
);
10436 ok(!strcmp_aw(prop
.value
, received
) ||
10437 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10438 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10439 prop
.value
, wine_dbgstr_w(received
), i
, j
);
10442 ok(hr
== prop
.expected
,
10443 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10444 hr
, prop
.expected
, i
, j
);
10445 ok(!strcmp_aw(prop
.value
, received
) ||
10446 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10447 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10448 prop
.value
, wine_dbgstr_w(received
), i
, j
);
10450 SysFreeString(received
);
10453 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].dword_props
)/sizeof(uri_combine_tests
[i
].dword_props
[0]); ++j
) {
10454 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
10457 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
10460 ok(hr
== prop
.expected
,
10461 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10462 hr
, prop
.expected
, i
, j
);
10465 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10466 prop
.value
, received
, i
, j
);
10469 ok(hr
== prop
.expected
|| broken(prop
.broken_combine_hres
&& hr
== S_FALSE
),
10470 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10471 hr
, prop
.expected
, i
, j
);
10472 if(!prop
.broken_combine_hres
|| hr
!= S_FALSE
)
10473 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10474 prop
.value
, received
, i
, j
);
10478 if(result
) IUri_Release(result
);
10480 if(relative
) IUri_Release(relative
);
10481 heap_free(relativeW
);
10483 if(base
) IUri_Release(base
);
10488 static HRESULT WINAPI
InternetProtocolInfo_QueryInterface(IInternetProtocolInfo
*iface
,
10489 REFIID riid
, void **ppv
)
10491 ok(0, "unexpected call\n");
10492 return E_NOINTERFACE
;
10495 static ULONG WINAPI
InternetProtocolInfo_AddRef(IInternetProtocolInfo
*iface
)
10500 static ULONG WINAPI
InternetProtocolInfo_Release(IInternetProtocolInfo
*iface
)
10505 static HRESULT WINAPI
InternetProtocolInfo_ParseUrl(IInternetProtocolInfo
*iface
, LPCWSTR pwzUrl
,
10506 PARSEACTION ParseAction
, DWORD dwParseFlags
, LPWSTR pwzResult
, DWORD cchResult
,
10507 DWORD
*pcchResult
, DWORD dwReserved
)
10509 CHECK_EXPECT(ParseUrl
);
10510 ok(!lstrcmpW(pwzUrl
, parse_urlW
), "Error: Expected %s, but got %s instead.\n",
10511 wine_dbgstr_w(parse_urlW
), wine_dbgstr_w(pwzUrl
));
10512 ok(ParseAction
== parse_action
, "Error: Expected %d, but got %d.\n", parse_action
, ParseAction
);
10513 ok(dwParseFlags
== parse_flags
, "Error: Expected 0x%08x, but got 0x%08x.\n", parse_flags
, dwParseFlags
);
10514 ok(cchResult
== 200, "Error: Got %d.\n", cchResult
);
10516 memcpy(pwzResult
, parse_resultW
, sizeof(parse_resultW
));
10517 *pcchResult
= lstrlenW(parse_resultW
);
10522 static HRESULT WINAPI
InternetProtocolInfo_CombineUrl(IInternetProtocolInfo
*iface
,
10523 LPCWSTR pwzBaseUrl
, LPCWSTR pwzRelativeUrl
, DWORD dwCombineFlags
,
10524 LPWSTR pwzResult
, DWORD cchResult
, DWORD
*pcchResult
, DWORD dwReserved
)
10526 CHECK_EXPECT(CombineUrl
);
10527 ok(!lstrcmpW(pwzBaseUrl
, combine_baseW
), "Error: Expected %s, but got %s instead.\n",
10528 wine_dbgstr_w(combine_baseW
), wine_dbgstr_w(pwzBaseUrl
));
10529 ok(!lstrcmpW(pwzRelativeUrl
, combine_relativeW
), "Error: Expected %s, but got %s instead.\n",
10530 wine_dbgstr_w(combine_relativeW
), wine_dbgstr_w(pwzRelativeUrl
));
10531 ok(dwCombineFlags
== (URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
),
10532 "Error: Expected 0, but got 0x%08x.\n", dwCombineFlags
);
10533 ok(cchResult
== INTERNET_MAX_URL_LENGTH
+1, "Error: Got %d.\n", cchResult
);
10535 memcpy(pwzResult
, combine_resultW
, sizeof(combine_resultW
));
10536 *pcchResult
= lstrlenW(combine_resultW
);
10541 static HRESULT WINAPI
InternetProtocolInfo_CompareUrl(IInternetProtocolInfo
*iface
,
10542 LPCWSTR pwzUrl1
, LPCWSTR pwzUrl2
, DWORD dwCompareFlags
)
10544 ok(0, "unexpected call\n");
10548 static HRESULT WINAPI
InternetProtocolInfo_QueryInfo(IInternetProtocolInfo
*iface
,
10549 LPCWSTR pwzUrl
, QUERYOPTION OueryOption
, DWORD dwQueryFlags
, LPVOID pBuffer
,
10550 DWORD cbBuffer
, DWORD
*pcbBuf
, DWORD dwReserved
)
10552 ok(0, "unexpected call\n");
10556 static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
= {
10557 InternetProtocolInfo_QueryInterface
,
10558 InternetProtocolInfo_AddRef
,
10559 InternetProtocolInfo_Release
,
10560 InternetProtocolInfo_ParseUrl
,
10561 InternetProtocolInfo_CombineUrl
,
10562 InternetProtocolInfo_CompareUrl
,
10563 InternetProtocolInfo_QueryInfo
10566 static IInternetProtocolInfo protocol_info
= { &InternetProtocolInfoVtbl
};
10568 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFIID riid
, void **ppv
)
10570 if(IsEqualGUID(&IID_IInternetProtocolInfo
, riid
)) {
10571 *ppv
= &protocol_info
;
10575 ok(0, "unexpected call\n");
10576 return E_NOINTERFACE
;
10579 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
10584 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
10589 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
, IUnknown
*pOuter
,
10590 REFIID riid
, void **ppv
)
10592 ok(0, "unexpected call\n");
10596 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL dolock
)
10598 ok(0, "unexpected call\n");
10602 static const IClassFactoryVtbl ClassFactoryVtbl
= {
10603 ClassFactory_QueryInterface
,
10604 ClassFactory_AddRef
,
10605 ClassFactory_Release
,
10606 ClassFactory_CreateInstance
,
10607 ClassFactory_LockServer
10610 static IClassFactory protocol_cf
= { &ClassFactoryVtbl
};
10612 static void register_protocols(void)
10614 IInternetSession
*session
;
10617 hres
= pCoInternetGetSession(0, &session
, 0);
10618 ok(hres
== S_OK
, "CoInternetGetSession failed: %08x\n", hres
);
10622 hres
= IInternetSession_RegisterNameSpace(session
, &protocol_cf
, &IID_NULL
,
10623 winetestW
, 0, NULL
, 0);
10624 ok(hres
== S_OK
, "RegisterNameSpace failed: %08x\n", hres
);
10626 IInternetSession_Release(session
);
10629 static void unregister_protocols(void) {
10630 IInternetSession
*session
;
10633 hr
= pCoInternetGetSession(0, &session
, 0);
10634 ok(hr
== S_OK
, "CoInternetGetSession failed: 0x%08x\n", hr
);
10638 hr
= IInternetSession_UnregisterNameSpace(session
, &protocol_cf
, winetestW
);
10639 ok(hr
== S_OK
, "UnregisterNameSpace failed: 0x%08x\n", hr
);
10641 IInternetSession_Release(session
);
10644 static void test_CoInternetCombineIUri_Pluggable(void) {
10648 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
10649 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10650 if(SUCCEEDED(hr
)) {
10651 IUri
*relative
= NULL
;
10653 hr
= pCreateUri(combine_relativeW
, Uri_CREATE_ALLOW_RELATIVE
, 0, &relative
);
10654 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10655 if(SUCCEEDED(hr
)) {
10656 IUri
*result
= NULL
;
10658 SET_EXPECT(CombineUrl
);
10660 hr
= pCoInternetCombineIUri(base
, relative
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
10662 ok(hr
== S_OK
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10664 CHECK_CALLED(CombineUrl
);
10666 if(SUCCEEDED(hr
)) {
10667 BSTR received
= NULL
;
10668 hr
= IUri_GetAbsoluteUri(result
, &received
);
10669 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10670 if(SUCCEEDED(hr
)) {
10671 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
10672 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
10674 SysFreeString(received
);
10676 if(result
) IUri_Release(result
);
10678 if(relative
) IUri_Release(relative
);
10680 if(base
) IUri_Release(base
);
10683 static void test_CoInternetCombineUrlEx(void) {
10685 IUri
*base
, *result
;
10689 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
10690 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10691 if(SUCCEEDED(hr
)) {
10692 result
= (void*) 0xdeadbeef;
10693 hr
= pCoInternetCombineUrlEx(base
, NULL
, 0, &result
, 0);
10694 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10696 ok(!result
, "Error: Expected 'result' to be NULL was %p instead.\n", result
);
10699 result
= (void*) 0xdeadbeef;
10700 hr
= pCoInternetCombineUrlEx(NULL
, http_urlW
, 0, &result
, 0);
10701 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10703 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
10705 result
= (void*) 0xdeadbeef;
10706 hr
= pCoInternetCombineUrlEx(NULL
, NULL
, 0, &result
, 0);
10707 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10709 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
10711 hr
= pCoInternetCombineUrlEx(base
, http_urlW
, 0, NULL
, 0);
10712 ok(hr
== E_POINTER
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10714 if(base
) IUri_Release(base
);
10716 for(i
= 0; i
< sizeof(uri_combine_tests
)/sizeof(uri_combine_tests
[0]); ++i
) {
10717 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
10719 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
10720 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10721 if(SUCCEEDED(hr
)) {
10722 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
10724 hr
= pCoInternetCombineUrlEx(base
, relativeW
, uri_combine_tests
[i
].combine_flags
,
10726 if(uri_combine_tests
[i
].todo
) {
10728 ok(hr
== uri_combine_tests
[i
].expected
,
10729 "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10730 hr
, uri_combine_tests
[i
].expected
, i
);
10733 ok(hr
== uri_combine_tests
[i
].expected
,
10734 "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10735 hr
, uri_combine_tests
[i
]. expected
, i
);
10737 if(SUCCEEDED(hr
)) {
10740 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].str_props
)/sizeof(uri_combine_tests
[i
].str_props
[0]); ++j
) {
10741 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
10743 LPCSTR value
= (prop
.value_ex
) ? prop
.value_ex
: prop
.value
;
10745 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
10748 ok(hr
== prop
.expected
,
10749 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10750 hr
, prop
.expected
, i
, j
);
10753 ok(!strcmp_aw(value
, received
) ||
10754 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10755 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10756 value
, wine_dbgstr_w(received
), i
, j
);
10759 ok(hr
== prop
.expected
,
10760 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10761 hr
, prop
.expected
, i
, j
);
10762 ok(!strcmp_aw(value
, received
) ||
10763 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10764 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10765 value
, wine_dbgstr_w(received
), i
, j
);
10767 SysFreeString(received
);
10770 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].dword_props
)/sizeof(uri_combine_tests
[i
].dword_props
[0]); ++j
) {
10771 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
10774 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
10777 ok(hr
== prop
.expected
,
10778 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10779 hr
, prop
.expected
, i
, j
);
10782 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10783 prop
.value
, received
, i
, j
);
10786 ok(hr
== prop
.expected
|| broken(prop
.broken_combine_hres
&& hr
== S_FALSE
),
10787 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10788 hr
, prop
.expected
, i
, j
);
10789 if(!prop
.broken_combine_hres
|| hr
!= S_FALSE
)
10790 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10791 prop
.value
, received
, i
, j
);
10795 if(result
) IUri_Release(result
);
10796 heap_free(relativeW
);
10798 if(base
) IUri_Release(base
);
10803 static void test_CoInternetCombineUrlEx_Pluggable(void) {
10807 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
10808 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10809 if(SUCCEEDED(hr
)) {
10810 IUri
*result
= NULL
;
10812 SET_EXPECT(CombineUrl
);
10814 hr
= pCoInternetCombineUrlEx(base
, combine_relativeW
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
10816 ok(hr
== S_OK
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10818 CHECK_CALLED(CombineUrl
);
10820 if(SUCCEEDED(hr
)) {
10821 BSTR received
= NULL
;
10822 hr
= IUri_GetAbsoluteUri(result
, &received
);
10823 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10824 if(SUCCEEDED(hr
)) {
10825 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
10826 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
10828 SysFreeString(received
);
10830 if(result
) IUri_Release(result
);
10832 if(base
) IUri_Release(base
);
10835 static void test_CoInternetParseIUri_InvalidArgs(void) {
10841 hr
= pCoInternetParseIUri(NULL
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
10842 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10844 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10846 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10847 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10848 if(SUCCEEDED(hr
)) {
10849 DWORD expected_len
;
10852 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, NULL
, 0, &result
, 0);
10853 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10855 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10857 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, NULL
, 0);
10858 ok(hr
== E_POINTER
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10862 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_URL
, 0, tmp
, 3, &result
, 0);
10863 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x expected 0x%08x.\n",
10865 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10868 hr
= pCoInternetParseIUri(uri
, PARSE_MIME
, 0, tmp
, 3, &result
, 0);
10869 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10871 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10874 hr
= pCoInternetParseIUri(uri
, PARSE_SERVER
, 0, tmp
, 3, &result
, 0);
10875 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10877 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10880 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_DOMAIN
, 0, tmp
, 3, &result
, 0);
10881 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10883 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10885 expected_len
= lstrlenW(http_urlW
);
10887 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
10888 ok(hr
== STRSAFE_E_INSUFFICIENT_BUFFER
,
10889 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10890 hr
, STRSAFE_E_INSUFFICIENT_BUFFER
);
10891 ok(result
== expected_len
, "Error: Expected 'result' to be %d, but was %d instead.\n",
10892 expected_len
, result
);
10894 if(uri
) IUri_Release(uri
);
10897 static void test_CoInternetParseIUri(void) {
10900 for(i
= 0; i
< sizeof(uri_parse_tests
)/sizeof(uri_parse_tests
[0]); ++i
) {
10904 uri_parse_test test
= uri_parse_tests
[i
];
10906 uriW
= a2w(test
.uri
);
10907 hr
= pCreateUri(uriW
, test
.uri_flags
, 0, &uri
);
10908 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x on uri_parse_tests[%d].\n", hr
, i
);
10909 if(SUCCEEDED(hr
)) {
10910 WCHAR result
[INTERNET_MAX_URL_LENGTH
+1];
10911 DWORD result_len
= -1;
10913 hr
= pCoInternetParseIUri(uri
, test
.action
, test
.flags
, result
, INTERNET_MAX_URL_LENGTH
+1, &result_len
, 0);
10916 ok(hr
== test
.expected
,
10917 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x on uri_parse_tests[%d].\n",
10918 hr
, test
.expected
, i
);
10921 ok(hr
== test
.expected
,
10922 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x on uri_parse_tests[%d].\n",
10923 hr
, test
.expected
, i
);
10925 if(SUCCEEDED(hr
)) {
10926 DWORD len
= lstrlenA(test
.property
);
10927 ok(!strcmp_aw(test
.property
, result
),
10928 "Error: Expected %s but got %s instead on uri_parse_tests[%d].\n",
10929 test
.property
, wine_dbgstr_w(result
), i
);
10930 ok(len
== result_len
,
10931 "Error: Expected %d, but got %d instead on uri_parse_tests[%d].\n",
10932 len
, result_len
, i
);
10935 "Error: Expected 'result_len' to be 0, but was %d on uri_parse_tests[%d].\n",
10939 if(uri
) IUri_Release(uri
);
10944 static void test_CoInternetParseIUri_Pluggable(void) {
10948 hr
= pCreateUri(parse_urlW
, 0, 0, &uri
);
10949 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, but got 0x%08x.\n", hr
);
10950 if(SUCCEEDED(hr
)) {
10954 SET_EXPECT(ParseUrl
);
10956 parse_action
= PARSE_CANONICALIZE
;
10957 parse_flags
= URL_UNESCAPE
|URL_ESCAPE_UNSAFE
;
10959 hr
= pCoInternetParseIUri(uri
, parse_action
, parse_flags
, result
, 200, &result_len
, 0);
10960 ok(hr
== S_OK
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10962 CHECK_CALLED(ParseUrl
);
10964 if(SUCCEEDED(hr
)) {
10965 ok(result_len
== lstrlenW(parse_resultW
), "Error: Expected %d, but got %d.\n",
10966 lstrlenW(parse_resultW
), result_len
);
10967 ok(!lstrcmpW(result
, parse_resultW
), "Error: Expected %s, but got %s.\n",
10968 wine_dbgstr_w(parse_resultW
), wine_dbgstr_w(result
));
10971 if(uri
) IUri_Release(uri
);
10977 const char *base_url
;
10978 DWORD base_uri_flags
;
10979 const char *legacy_url
;
10980 const char *uniform_url
;
10981 const char *no_canon_url
;
10982 const char *uri_url
;
10983 } create_urlmon_test_t
;
10985 static const create_urlmon_test_t create_urlmon_tests
[] = {
10987 "http://www.winehq.org",Uri_CREATE_NO_CANONICALIZE
,
10989 "http://www.winehq.org/",
10990 "http://www.winehq.org/",
10991 "http://www.winehq.org",
10992 "http://www.winehq.org"
10995 "file://c:\\dir\\file.txt",Uri_CREATE_NO_CANONICALIZE
,
10997 "file://c:\\dir\\file.txt",
10998 "file:///c:/dir/file.txt",
10999 "file:///c:/dir/file.txt",
11000 "file:///c:/dir/file.txt"
11003 "file://c:\\dir\\file.txt",Uri_CREATE_FILE_USE_DOS_PATH
,
11005 "file://c:\\dir\\file.txt",
11006 "file:///c:/dir/file.txt",
11007 "file:///c:/dir/file.txt",
11008 "file://c:\\dir\\file.txt"
11011 "dat%61",Uri_CREATE_ALLOW_RELATIVE
,
11012 "http://www.winehq.org",0,
11013 "http://www.winehq.org/data",
11014 "http://www.winehq.org/data",
11015 "http://www.winehq.org:80/data",
11018 "file.txt",Uri_CREATE_ALLOW_RELATIVE
,
11019 "file://c:\\dir\\x.txt",Uri_CREATE_NO_CANONICALIZE
,
11020 "file://c:\\dir\\file.txt",
11021 "file:///c:/dir/file.txt",
11022 "file:///c:/dir/file.txt",
11025 "",Uri_CREATE_ALLOW_RELATIVE
,
11033 "test",Uri_CREATE_ALLOW_RELATIVE
,
11041 "c:\\dir\\file.txt",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
11043 "file://c:\\dir\\file.txt",
11044 "file:///c:/dir/file.txt",
11045 "file:///c:/dir/file.txt",
11046 "file:///c:/dir/file.txt",
11050 #define test_urlmon_display_name(a,b) _test_urlmon_display_name(__LINE__,a,b)
11051 static void _test_urlmon_display_name(unsigned line
, IMoniker
*mon
, const char *exurl
)
11053 WCHAR
*display_name
;
11056 hres
= IMoniker_GetDisplayName(mon
, NULL
, NULL
, &display_name
);
11057 ok_(__FILE__
,line
)(hres
== S_OK
, "GetDisplayName failed: %08x\n", hres
);
11058 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_name
), "unexpected display name: %s, expected %s\n",
11059 wine_dbgstr_w(display_name
), exurl
);
11061 CoTaskMemFree(display_name
);
11064 #define test_display_uri(a,b) _test_display_uri(__LINE__,a,b)
11065 static void _test_display_uri(unsigned line
, IMoniker
*mon
, const char *exurl
)
11067 IUriContainer
*uri_container
;
11072 hres
= IMoniker_QueryInterface(mon
, &IID_IUriContainer
, (void**)&uri_container
);
11073 ok(hres
== S_OK
, "Could not get IUriContainer iface: %08x\n", hres
);
11076 hres
= IUriContainer_GetIUri(uri_container
, &uri
);
11077 IUriContainer_Release(uri_container
);
11078 ok(hres
== S_OK
, "GetIUri failed: %08x\n", hres
);
11079 ok(uri
!= NULL
, "uri == NULL\n");
11081 hres
= IUri_GetDisplayUri(uri
, &display_uri
);
11083 ok(hres
== S_OK
, "GetDisplayUri failed: %08x\n", hres
);
11084 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_uri
), "unexpected display uri: %s, expected %s\n",
11085 wine_dbgstr_w(display_uri
), exurl
);
11086 SysFreeString(display_uri
);
11089 static void test_CreateURLMoniker(void)
11091 const create_urlmon_test_t
*test
;
11092 IMoniker
*mon
, *base_mon
;
11093 WCHAR
*url
, *base_url
;
11094 IUri
*uri
, *base_uri
;
11097 for(test
= create_urlmon_tests
; test
< create_urlmon_tests
+ sizeof(create_urlmon_tests
)/sizeof(*create_urlmon_tests
); test
++) {
11098 url
= a2w(test
->url
);
11099 base_url
= a2w(test
->base_url
);
11102 hres
= pCreateUri(base_url
, test
->base_uri_flags
, 0, &base_uri
);
11103 ok(hres
== S_OK
, "CreateUri failed: %08x\n", hres
);
11105 hres
= pCreateURLMonikerEx2(NULL
, base_uri
, &base_mon
, URL_MK_NO_CANONICALIZE
);
11106 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11112 hres
= CreateURLMoniker(base_mon
, url
, &mon
);
11113 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11114 test_urlmon_display_name(mon
, test
->legacy_url
);
11115 test_display_uri(mon
, test
->legacy_url
);
11116 IMoniker_Release(mon
);
11118 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_LEGACY
);
11119 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11120 test_urlmon_display_name(mon
, test
->legacy_url
);
11121 test_display_uri(mon
, test
->legacy_url
);
11122 IMoniker_Release(mon
);
11124 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_UNIFORM
);
11125 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11126 test_urlmon_display_name(mon
, test
->uniform_url
);
11127 test_display_uri(mon
, test
->uniform_url
);
11128 IMoniker_Release(mon
);
11130 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_NO_CANONICALIZE
);
11131 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11132 test_urlmon_display_name(mon
, test
->no_canon_url
);
11133 test_display_uri(mon
, test
->no_canon_url
);
11134 IMoniker_Release(mon
);
11136 hres
= pCreateUri(url
, test
->uri_flags
, 0, &uri
);
11137 ok(hres
== S_OK
, "CreateUri failed: %08x\n", hres
);
11139 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_LEGACY
);
11140 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11141 test_urlmon_display_name(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
11142 test_display_uri(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
11143 IMoniker_Release(mon
);
11145 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_UNIFORM
);
11146 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11147 test_urlmon_display_name(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
11148 test_display_uri(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
11149 IMoniker_Release(mon
);
11151 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_NO_CANONICALIZE
);
11152 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11153 test_urlmon_display_name(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
11154 test_display_uri(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
11155 IMoniker_Release(mon
);
11159 heap_free(base_url
);
11161 IUri_Release(base_uri
);
11163 IMoniker_Release(base_mon
);
11167 static int add_default_flags(DWORD flags
) {
11168 if(!(flags
& Uri_CREATE_NO_CANONICALIZE
))
11169 flags
|= Uri_CREATE_CANONICALIZE
;
11170 if(!(flags
& Uri_CREATE_NO_DECODE_EXTRA_INFO
))
11171 flags
|= Uri_CREATE_DECODE_EXTRA_INFO
;
11172 if(!(flags
& Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
))
11173 flags
|= Uri_CREATE_CRACK_UNKNOWN_SCHEMES
;
11174 if(!(flags
& Uri_CREATE_NO_PRE_PROCESS_HTML_URI
))
11175 flags
|= Uri_CREATE_PRE_PROCESS_HTML_URI
;
11176 if(!(flags
& Uri_CREATE_IE_SETTINGS
))
11177 flags
|= Uri_CREATE_NO_IE_SETTINGS
;
11182 static void test_IPersistStream(void)
11184 int i
, props_order
[Uri_PROPERTY_DWORD_LAST
+1] = { 0 };
11186 props_order
[Uri_PROPERTY_RAW_URI
] = 1;
11187 props_order
[Uri_PROPERTY_FRAGMENT
] = 2;
11188 props_order
[Uri_PROPERTY_HOST
] = 3;
11189 props_order
[Uri_PROPERTY_PASSWORD
] = 4;
11190 props_order
[Uri_PROPERTY_PATH
] = 5;
11191 props_order
[Uri_PROPERTY_PORT
] = 6;
11192 props_order
[Uri_PROPERTY_QUERY
] = 7;
11193 props_order
[Uri_PROPERTY_SCHEME_NAME
] = 8;
11194 props_order
[Uri_PROPERTY_USER_NAME
] = 9;
11196 for(i
=0; i
<sizeof(uri_tests
)/sizeof(*uri_tests
); i
++) {
11197 const uri_properties
*test
= uri_tests
+i
;
11200 IPersistStream
*persist_stream
;
11203 DWORD props
, props_no
, dw_data
[6];
11204 WCHAR str_data
[1024];
11205 ULARGE_INTEGER size
, max_size
;
11206 LARGE_INTEGER no_off
;
11211 if(test
->create_todo
|| test
->create_expected
!=S_OK
)
11214 uriW
= a2w(test
->uri
);
11215 hr
= pCreateUri(uriW
, test
->create_flags
, 0, &uri
);
11216 ok(hr
== S_OK
, "%d) CreateUri failed 0x%08x, expected S_OK..\n", i
, hr
);
11218 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&persist_stream
);
11219 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11221 hr
= CreateStreamOnHGlobal(NULL
, TRUE
, &stream
);
11222 ok(hr
== S_OK
, "CreateStreamOnHGlobal failed 0x%08x.\n", hr
);
11223 hr
= IPersistStream_IsDirty(persist_stream
);
11224 ok(hr
== S_FALSE
, "%d) IsDirty returned 0x%08x, expected S_FALSE.\n", i
, hr
);
11225 hr
= IPersistStream_Save(persist_stream
, stream
, FALSE
);
11226 ok(hr
== S_OK
, "%d) Save failed 0x%08x, expected S_OK.\n", i
, hr
);
11227 hr
= IPersistStream_IsDirty(persist_stream
);
11228 ok(hr
== S_FALSE
, "%d) IsDirty returned 0x%08x, expected S_FALSE.\n", i
, hr
);
11229 no_off
.QuadPart
= 0;
11230 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_CUR
, &size
);
11231 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11232 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11233 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11234 hr
= IPersistStream_GetSizeMax(persist_stream
, &max_size
);
11235 ok(hr
== S_OK
, "%d) GetSizeMax failed 0x%08x, expected S_OK.\n", i
, hr
);
11236 ok(U(size
).LowPart
+2 == U(max_size
).LowPart
,
11237 "%d) Written data size is %d, max_size %d.\n",
11238 i
, U(size
).LowPart
, U(max_size
).LowPart
);
11240 hr
= IStream_Read(stream
, (void*)dw_data
, sizeof(DWORD
), NULL
);
11241 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11242 ok(dw_data
[0]-2 == U(size
).LowPart
, "%d) Structure size is %d, expected %d\n",
11243 i
, dw_data
[0]-2, U(size
).LowPart
);
11244 hr
= IStream_Read(stream
, (void*)dw_data
, 6*sizeof(DWORD
), NULL
);
11245 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11246 ok(dw_data
[0] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[0]);
11247 ok(dw_data
[1] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[1]);
11248 ok(dw_data
[2] == add_default_flags(test
->create_flags
),
11249 "%d) Incorrect value %x, expected %x (creation flags).\n",
11250 i
, dw_data
[2], add_default_flags(test
->create_flags
));
11251 ok(dw_data
[3] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[3]);
11252 ok(dw_data
[4] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[4]);
11253 ok(dw_data
[5] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[5]);
11256 for(props
=0; props
<=Uri_PROPERTY_DWORD_LAST
; props
++) {
11257 if(!props_order
[props
])
11260 if(props
<= Uri_PROPERTY_STRING_LAST
) {
11261 if(test
->str_props
[props
].expected
== S_OK
)
11264 if(test
->dword_props
[props
-Uri_PROPERTY_DWORD_START
].expected
== S_OK
)
11268 if(test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_HTTP
11269 && test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_FTP
11270 && test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_HTTPS
)
11273 hr
= IStream_Read(stream
, (void*)&props
, sizeof(DWORD
), NULL
);
11274 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11275 ok(props
== props_no
, "%d) Properties no is %d, expected %d.\n", i
, props
, props_no
);
11280 hr
= IStream_Read(stream
, (void*)dw_data
, 2*sizeof(DWORD
), NULL
);
11281 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11283 ok(dw_data
[2]<props_order
[dw_data
[0]],
11284 "%d) Incorrect properties order (%d, %d)\n",
11285 i
, dw_data
[0], dw_data
[3]);
11286 dw_data
[2] = props_order
[dw_data
[0]];
11287 dw_data
[3] = dw_data
[0];
11289 if(dw_data
[0]<=Uri_PROPERTY_STRING_LAST
) {
11290 const uri_str_property
*prop
= test
->str_props
+dw_data
[0];
11291 hr
= IStream_Read(stream
, (void*)str_data
, dw_data
[1], NULL
);
11292 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11293 ok(!strcmp_aw(prop
->value
, str_data
) || broken(prop
->broken_value
&& !strcmp_aw(prop
->broken_value
, str_data
)),
11294 "%d) Expected %s but got %s (%d).\n", i
, prop
->value
, wine_dbgstr_w(str_data
), dw_data
[0]);
11295 } else if(dw_data
[0]>=Uri_PROPERTY_DWORD_START
&& dw_data
[0]<=Uri_PROPERTY_DWORD_LAST
) {
11296 const uri_dword_property
*prop
= test
->dword_props
+dw_data
[0]-Uri_PROPERTY_DWORD_START
;
11297 ok(dw_data
[1] == sizeof(DWORD
), "%d) Size of dword property is %d (%d)\n", i
, dw_data
[1], dw_data
[0]);
11298 hr
= IStream_Read(stream
, (void*)&dw_data
[1], sizeof(DWORD
), NULL
);
11299 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11300 ok(prop
->value
== dw_data
[1], "%d) Expected %d but got %d (%d).\n", i
, prop
->value
, dw_data
[1], dw_data
[0]);
11302 ok(FALSE
, "%d) Incorrect property type (%d)\n", i
, dw_data
[0]);
11306 ok(props
== 0, "%d) Not all properties were processed %d. Next property type: %d\n",
11307 i
, props
, dw_data
[0]);
11311 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11312 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11313 hr
= IPersistStream_GetClassID(persist_stream
, &curi
);
11314 ok(hr
== S_OK
, "%d) GetClassID failed 0x%08x, expected S_OK.\n", i
, hr
);
11315 ok(IsEqualCLSID(&curi
, &CLSID_CUri
), "%d) GetClassID returned incorrect CLSID.\n", i
);
11316 IPersistStream_Release(persist_stream
);
11318 hr
= CoCreateInstance(&curi
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11319 &IID_IUri
, (void**)&uri
);
11320 ok(hr
== S_OK
, "%d) Error creating uninitialized Uri: 0x%08x.\n", i
, hr
);
11321 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&persist_stream
);
11322 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11323 hr
= IPersistStream_Load(persist_stream
, stream
);
11324 ok(hr
== S_OK
, "%d) Load failed 0x%08x, expected S_OK.\n", i
, hr
);
11325 hr
= IUri_GetRawUri(uri
, &raw_uri
);
11326 ok(hr
== S_OK
, "%d) GetRawUri failed 0x%08x, expected S_OK.\n", i
, hr
);
11327 ok(!strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].value
, raw_uri
)
11328 || broken(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
11329 && !strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
, raw_uri
)),
11330 "%d) Expected %s but got %s.\n", i
, test
->str_props
[Uri_PROPERTY_RAW_URI
].value
,
11331 wine_dbgstr_w(raw_uri
));
11332 SysFreeString(raw_uri
);
11333 IPersistStream_Release(persist_stream
);
11335 hr
= IUri_QueryInterface(uri
, &IID_IMarshal
, (void**)&marshal
);
11336 ok(hr
== S_OK
, "%d) QueryInterface(IID_IMarshal) failed 0x%08x, expected S_OK.\n", i
, hr
);
11337 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11338 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11339 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11340 MSHCTX_DIFFERENTMACHINE
, NULL
, MSHLFLAGS_NORMAL
);
11341 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11342 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11343 MSHCTX_CROSSCTX
, NULL
, MSHLFLAGS_NORMAL
);
11344 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11345 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11346 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_TABLESTRONG
);
11347 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11348 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11349 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_TABLEWEAK
);
11350 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11351 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11352 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_NOPING
);
11353 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11354 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11355 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_NORMAL
);
11356 ok(hr
== S_OK
, "%d) MarshalInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11357 hr
= IMarshal_GetUnmarshalClass(marshal
, &IID_IUri
, (void*)uri
,
11358 MSHCTX_CROSSCTX
, NULL
, MSHLFLAGS_NORMAL
, &curi
);
11359 ok(hr
== E_INVALIDARG
, "%d) GetUnmarshalClass returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11360 hr
= IMarshal_GetUnmarshalClass(marshal
, &IID_IUri
, (void*)uri
,
11361 MSHCTX_INPROC
, NULL
, MSHLFLAGS_NORMAL
, &curi
);
11362 ok(hr
== S_OK
, "%d) GetUnmarshalClass failed 0x%08x, expected S_OK.\n", i
, hr
);
11363 ok(IsEqualCLSID(&curi
, &CLSID_CUri
), "%d) GetUnmarshalClass returned incorrect CLSID.\n", i
);
11365 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_CUR
, &size
);
11366 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11367 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11368 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11369 hr
= IStream_Read(stream
, (void*)dw_data
, 3*sizeof(DWORD
), NULL
);
11370 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11371 ok(dw_data
[0]-2 == U(size
).LowPart
, "%d) Structure size is %d, expected %d\n",
11372 i
, dw_data
[0]-2, U(size
).LowPart
);
11373 ok(dw_data
[1] == MSHCTX_LOCAL
, "%d) Incorrect value %d, expected MSHCTX_LOCAL.\n",
11375 ok(dw_data
[2] == dw_data
[0]-8, "%d) Incorrect value %d, expected %d (PersistStream size).\n",
11376 i
, dw_data
[2], dw_data
[0]-8);
11377 if(!test
->str_props
[Uri_PROPERTY_PATH
].value
[0] &&
11378 (test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_HTTP
11379 || test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_FTP
11380 || test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_HTTPS
))
11381 U(max_size
).LowPart
+= 3*sizeof(DWORD
);
11382 ok(dw_data
[2] == U(max_size
).LowPart
, "%d) Incorrect value %d, expected %d (PersistStream size).\n",
11383 i
, dw_data
[2], U(max_size
).LowPart
);
11384 IMarshal_Release(marshal
);
11387 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11388 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11389 hr
= CoCreateInstance(&curi
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11390 &IID_IUri
, (void**)&uri
);
11391 ok(hr
== S_OK
, "%d) Error creating uninitialized Uri: 0x%08x.\n", i
, hr
);
11392 hr
= IUri_QueryInterface(uri
, &IID_IMarshal
, (void**)&marshal
);
11393 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11394 hr
= IMarshal_UnmarshalInterface(marshal
, stream
, &IID_IUri
, (void**)&uri
);
11395 ok(hr
== S_OK
, "%d) UnmarshalInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11396 hr
= IUri_GetRawUri(uri
, &raw_uri
);
11397 ok(hr
== S_OK
, "%d) GetRawUri failed 0x%08x, expected S_OK.\n", i
, hr
);
11398 ok(!strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].value
, raw_uri
)
11399 || broken(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
11400 && !strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
, raw_uri
)),
11401 "%d) Expected %s but got %s.\n", i
, test
->str_props
[Uri_PROPERTY_RAW_URI
].value
,
11402 wine_dbgstr_w(raw_uri
));
11403 SysFreeString(raw_uri
);
11405 IMarshal_Release(marshal
);
11406 IStream_Release(stream
);
11412 static void test_UninitializedUri(void)
11415 IUriBuilderFactory
*ubf
;
11416 IPersistStream
*ps
;
11424 hr
= CoCreateInstance(&CLSID_CUri
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11425 &IID_IUri
, (void**)&uri
);
11427 win_skip("Skipping uninitialized Uri tests.\n");
11431 hr
= IUri_QueryInterface(uri
, &IID_IUriBuilderFactory
, (void**)&ubf
);
11432 ok(hr
== S_OK
, "QueryInterface(IID_IUriBuillderFactory) failed: %x.\n", hr
);
11433 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&ps
);
11434 ok(hr
== S_OK
, "QueryInterface(IID_IPersistStream) failed: %x.\n", hr
);
11436 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
11437 ok(hr
== E_UNEXPECTED
, "GetAbsoluteUri returned %x, expected E_UNEXPECTED.\n", hr
);
11438 hr
= IUri_GetAbsoluteUri(uri
, &bstr
);
11439 ok(hr
== E_UNEXPECTED
, "GetAbsoluteUri returned %x, expected E_UNEXPECTED.\n", hr
);
11440 hr
= IUri_GetAuthority(uri
, &bstr
);
11441 ok(hr
== E_UNEXPECTED
, "GetAuthority returned %x, expected E_UNEXPECTED.\n", hr
);
11442 hr
= IUri_GetDisplayUri(uri
, &bstr
);
11443 ok(hr
== E_UNEXPECTED
, "GetDisplayUri returned %x, expected E_UNEXPECTED.\n", hr
);
11444 hr
= IUri_GetDomain(uri
, &bstr
);
11445 ok(hr
== E_UNEXPECTED
, "GetDomain returned %x, expected E_UNEXPECTED.\n", hr
);
11446 hr
= IUri_GetExtension(uri
, &bstr
);
11447 ok(hr
== E_UNEXPECTED
, "GetExtension returned %x, expected E_UNEXPECTED.\n", hr
);
11448 hr
= IUri_GetFragment(uri
, &bstr
);
11449 ok(hr
== E_UNEXPECTED
, "GetFragment returned %x, expected E_UNEXPECTED.\n", hr
);
11450 hr
= IUri_GetHost(uri
, &bstr
);
11451 ok(hr
== E_UNEXPECTED
, "GetHost returned %x, expected E_UNEXPECTED.\n", hr
);
11452 hr
= IUri_GetHostType(uri
, &dword
);
11453 ok(hr
== E_UNEXPECTED
, "GetHostType returned %x, expected E_UNEXPECTED.\n", hr
);
11454 hr
= IUri_GetPassword(uri
, &bstr
);
11455 ok(hr
== E_UNEXPECTED
, "GetPassword returned %x, expected E_UNEXPECTED.\n", hr
);
11456 hr
= IUri_GetPassword(uri
, &bstr
);
11457 ok(hr
== E_UNEXPECTED
, "GetPassword returned %x, expected E_UNEXPECTED.\n", hr
);
11458 hr
= IUri_GetPathAndQuery(uri
, &bstr
);
11459 ok(hr
== E_UNEXPECTED
, "GetPathAndQuery returned %x, expected E_UNEXPECTED.\n", hr
);
11460 hr
= IUri_GetPort(uri
, &dword
);
11461 ok(hr
== E_UNEXPECTED
, "GetPort returned %x, expected E_UNEXPECTED.\n", hr
);
11462 hr
= IUri_GetProperties(uri
, &dword
);
11463 ok(hr
== E_UNEXPECTED
, "GetProperties returned %x, expected E_UNEXPECTED.\n", hr
);
11464 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, &bstr
, 0);
11465 ok(hr
== E_UNEXPECTED
, "GetPropertyBSTR returned %x, expected E_UNEXPECTED.\n", hr
);
11466 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_PORT
, &dword
, 0);
11467 ok(hr
== E_UNEXPECTED
, "GetPropertyDWORD returned %x, expected E_UNEXPECTED.\n", hr
);
11468 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_RAW_URI
, &dword
, 0);
11469 ok(hr
== E_UNEXPECTED
, "GetPropertyLength returned %x, expected E_UNEXPECTED.\n", hr
);
11470 hr
= IUri_GetQuery(uri
, &bstr
);
11471 ok(hr
== E_UNEXPECTED
, "GetQuery returned %x, expected E_UNEXPECTED.\n", hr
);
11472 hr
= IUri_GetRawUri(uri
, &bstr
);
11473 ok(hr
== E_UNEXPECTED
, "GetRawUri returned %x, expected E_UNEXPECTED.\n", hr
);
11474 hr
= IUri_GetScheme(uri
, &dword
);
11475 ok(hr
== E_UNEXPECTED
, "GetScheme returned %x, expected E_UNEXPECTED.\n", hr
);
11476 hr
= IUri_GetSchemeName(uri
, &bstr
);
11477 ok(hr
== E_UNEXPECTED
, "GetSchemeName returned %x, expected E_UNEXPECTED.\n", hr
);
11478 hr
= IUri_GetUserInfo(uri
, &bstr
);
11479 ok(hr
== E_UNEXPECTED
, "GetUserInfo returned %x, expected E_UNEXPECTED.\n", hr
);
11480 hr
= IUri_GetUserName(uri
, &bstr
);
11481 ok(hr
== E_UNEXPECTED
, "GetUserName returned %x, expected E_UNEXPECTED.\n", hr
);
11482 hr
= IUri_GetZone(uri
, &dword
);
11483 ok(hr
== E_UNEXPECTED
, "GetZone returned %x, expected E_UNEXPECTED.\n", hr
);
11484 hr
= IUri_IsEqual(uri
, uri
, &eq
);
11485 ok(hr
== E_UNEXPECTED
, "IsEqual returned %x, expected E_UNEXPECTED.\n", hr
);
11487 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(ubf
, 0, 0, &ub
);
11488 ok(hr
== E_UNEXPECTED
, "CreateInitializedIUriBuilder returned %x, expected E_UNEXPECTED.\n", hr
);
11489 hr
= IUriBuilderFactory_CreateIUriBuilder(ubf
, 0, 0, &ub
);
11490 ok(hr
== S_OK
, "CreateIUriBuilder returned %x, expected S_OK.\n", hr
);
11491 IUriBuilder_Release(ub
);
11493 hr
= IPersistStream_GetSizeMax(ps
, &ui
);
11494 ok(hr
== S_OK
, "GetSizeMax returned %x, expected S_OK.\n", hr
);
11495 ok(ui
.u
.LowPart
== 34, "ui.LowPart = %d, expected 34.\n", ui
.u
.LowPart
);
11496 hr
= IPersistStream_IsDirty(ps
);
11497 ok(hr
== S_FALSE
, "IsDirty returned %x, expected S_FALSE.\n", hr
);
11499 IPersistStream_Release(ps
);
11500 IUriBuilderFactory_Release(ubf
);
11507 hurlmon
= GetModuleHandleA("urlmon.dll");
11508 pCoInternetGetSession
= (void*) GetProcAddress(hurlmon
, "CoInternetGetSession");
11509 pCreateUri
= (void*) GetProcAddress(hurlmon
, "CreateUri");
11510 pCreateUriWithFragment
= (void*) GetProcAddress(hurlmon
, "CreateUriWithFragment");
11511 pCreateIUriBuilder
= (void*) GetProcAddress(hurlmon
, "CreateIUriBuilder");
11512 pCoInternetCombineIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineIUri");
11513 pCoInternetCombineUrlEx
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineUrlEx");
11514 pCoInternetParseIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetParseIUri");
11515 pCreateURLMonikerEx
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx");
11516 pCreateURLMonikerEx2
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx2");
11519 win_skip("CreateUri is not present, skipping tests.\n");
11523 trace("test CreateUri invalid flags...\n");
11524 test_CreateUri_InvalidFlags();
11526 trace("test CreateUri invalid args...\n");
11527 test_CreateUri_InvalidArgs();
11529 trace("test CreateUri invalid URIs...\n");
11530 test_CreateUri_InvalidUri();
11532 trace("test IUri_GetPropertyBSTR...\n");
11533 test_IUri_GetPropertyBSTR();
11535 trace("test IUri_GetPropertyDWORD...\n");
11536 test_IUri_GetPropertyDWORD();
11538 trace("test IUri_GetStrProperties...\n");
11539 test_IUri_GetStrProperties();
11541 trace("test IUri_GetDwordProperties...\n");
11542 test_IUri_GetDwordProperties();
11544 trace("test IUri_GetPropertyLength...\n");
11545 test_IUri_GetPropertyLength();
11547 trace("test IUri_GetProperties...\n");
11548 test_IUri_GetProperties();
11550 trace("test IUri_HasProperty...\n");
11551 test_IUri_HasProperty();
11553 trace("test IUri_IsEqual...\n");
11554 test_IUri_IsEqual();
11556 trace("test CreateUriWithFragment invalid args...\n");
11557 test_CreateUriWithFragment_InvalidArgs();
11559 trace("test CreateUriWithFragment invalid flags...\n");
11560 test_CreateUriWithFragment_InvalidFlags();
11562 trace("test CreateUriWithFragment...\n");
11563 test_CreateUriWithFragment();
11565 trace("test CreateIUriBuilder...\n");
11566 test_CreateIUriBuilder();
11568 trace("test IUriBuilder_CreateInvalidArgs...\n");
11569 test_IUriBuilder_CreateInvalidArgs();
11571 trace("test IUriBuilder...\n");
11572 test_IUriBuilder();
11574 trace("test IUriBuilder_GetInvalidArgs...\n");
11575 test_IUriBuilder_GetInvalidArgs();
11577 trace("test IUriBuilder_HasBeenModified...\n");
11578 test_IUriBuilder_HasBeenModified();
11580 trace("test IUriBuilder_IUriProperty...\n");
11581 test_IUriBuilder_IUriProperty();
11583 trace("test IUriBuilder_RemoveProperties...\n");
11584 test_IUriBuilder_RemoveProperties();
11586 trace("test IUriBuilder miscellaneous...\n");
11587 test_IUriBuilder_Misc();
11589 trace("test IUriBuilderFactory...\n");
11590 test_IUriBuilderFactory();
11592 trace("test CoInternetCombineIUri...\n");
11593 test_CoInternetCombineIUri();
11595 trace("test CoInternetCombineUrlEx...\n");
11596 test_CoInternetCombineUrlEx();
11598 trace("test CoInternetParseIUri Invalid Args...\n");
11599 test_CoInternetParseIUri_InvalidArgs();
11601 trace("test CoInternetParseIUri...\n");
11602 test_CoInternetParseIUri();
11604 register_protocols();
11606 trace("test CoInternetCombineIUri pluggable...\n");
11607 test_CoInternetCombineIUri_Pluggable();
11609 trace("test CoInternetCombineUrlEx Pluggable...\n");
11610 test_CoInternetCombineUrlEx_Pluggable();
11612 trace("test CoInternetParseIUri pluggable...\n");
11613 test_CoInternetParseIUri_Pluggable();
11615 trace("test CreateURLMoniker...\n");
11616 test_CreateURLMoniker();
11618 CoInitialize(NULL
);
11620 trace("test IPersistStream...\n");
11621 test_IPersistStream();
11623 trace("test uninitialized Uri...\n");
11624 test_UninitializedUri();
11627 unregister_protocols();