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 its 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 its 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 its 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 it's 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 /* To 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 /* Can't have elision of 1 h16 at end of address. */
4618 {"http://[1:2:3:4:5:6:7::]",0,FALSE
},
4619 /* Expects a valid IP Literal. */
4620 {"ftp://[not.valid.uri]/",0,FALSE
},
4621 /* Expects valid port for a known scheme type. */
4622 {"ftp://www.winehq.org:123fgh",0,FALSE
},
4623 /* Port exceeds USHORT_MAX for known scheme type. */
4624 {"ftp://www.winehq.org:65536",0,FALSE
},
4625 /* Invalid port with IPv4 address. */
4626 {"http://www.winehq.org:1abcd",0,FALSE
},
4627 /* Invalid port with IPv6 address. */
4628 {"http://[::ffff]:32xy",0,FALSE
},
4629 /* Not allowed to have backslashes with NO_CANONICALIZE. */
4630 {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE
,FALSE
},
4631 /* Not allowed to have invalid % encoded data in opaque URI path. */
4632 {"news:test%XX",0,FALSE
},
4633 {"mailto:wine@winehq%G8.com",0,FALSE
},
4634 /* Known scheme types can't have invalid % encoded data in query string. */
4635 {"http://google.com/?query=te%xx",0,FALSE
},
4636 /* Invalid % encoded data in fragment of know scheme type. */
4637 {"ftp://google.com/#Test%xx",0,FALSE
},
4638 {" http://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
4639 {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,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 {"file:c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4645 {"file:c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4646 /* res URIs aren't allowed to have forbidden dos path characters in the
4649 {"res://c:\\te<st\\test/test",0,FALSE
},
4650 {"res://c:\\te>st\\test/test",0,FALSE
},
4651 {"res://c:\\te\"st\\test/test",0,FALSE
},
4652 {"res://c:\\test/te%xxst",0,FALSE
}
4655 typedef struct _uri_equality
{
4657 DWORD create_flags_a
;
4659 DWORD create_flags_b
;
4664 static const uri_equality equality_tests
[] = {
4666 "HTTP://www.winehq.org/test dir/./",0,
4667 "http://www.winehq.org/test dir/../test dir/",0,
4671 /* http://www.winehq.org/test%20dir */
4672 "http://%77%77%77%2E%77%69%6E%65%68%71%2E%6F%72%67/%74%65%73%74%20%64%69%72",0,
4673 "http://www.winehq.org/test dir",0,
4677 "c:\\test.mp3",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
4678 "file:///c:/test.mp3",0,
4682 "ftp://ftp.winehq.org/",0,
4683 "ftp://ftp.winehq.org",0,
4687 "ftp://ftp.winehq.org/test/test2/../../testB/",0,
4688 "ftp://ftp.winehq.org/t%45stB/",0,
4692 "http://google.com/TEST",0,
4693 "http://google.com/test",0,
4697 "http://GOOGLE.com/",0,
4698 "http://google.com/",0,
4701 /* Performs case insensitive compare of host names (for known scheme types). */
4703 "ftp://GOOGLE.com/",Uri_CREATE_NO_CANONICALIZE
,
4704 "ftp://google.com/",0,
4708 "zip://GOOGLE.com/",0,
4709 "zip://google.com/",0,
4713 "file:///c:/TEST/TeST/",0,
4714 "file:///c:/test/test/",0,
4718 "file:///server/TEST",0,
4719 "file:///SERVER/TEST",0,
4723 "http://google.com",Uri_CREATE_NO_CANONICALIZE
,
4724 "http://google.com/",0,
4728 "ftp://google.com:21/",0,
4729 "ftp://google.com/",0,
4733 "http://google.com:80/",Uri_CREATE_NO_CANONICALIZE
,
4734 "http://google.com/",0,
4738 "http://google.com:70/",0,
4739 "http://google.com:71/",0,
4743 "file:///c:/dir/file.txt", 0,
4744 "file:///c:/dir/file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
4748 "file:///c:/dir/file.txt", 0,
4749 "file:///c:\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
4753 "file:///c:/dir/file.txt", 0,
4754 "file:///c:\\dir2\\..\\dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
4758 "file:///c:\\dir2\\..\\ dir\\file.txt", Uri_CREATE_NO_CANONICALIZE
,
4759 "file:///c:/%20dir/file.txt", 0,
4763 "file:///c:/Dir/file.txt", 0,
4764 "file:///C:/dir/file.TXT", Uri_CREATE_FILE_USE_DOS_PATH
,
4768 "file:///c:/dir/file.txt", 0,
4769 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
4773 "file:///c:/dir/file.txt#a", 0,
4774 "file:///c:\\dir\\file.txt#b", Uri_CREATE_FILE_USE_DOS_PATH
,
4777 /* Tests of an empty hash/fragment part */
4779 "http://google.com/test",0,
4780 "http://google.com/test#",0,
4784 "ftp://ftp.winehq.org/",0,
4785 "ftp://ftp.winehq.org/#",0,
4789 "file:///c:/dir/file.txt#", 0,
4790 "file:///c:\\dir\\file.txt", Uri_CREATE_FILE_USE_DOS_PATH
,
4795 typedef struct _uri_with_fragment
{
4797 const char* fragment
;
4799 HRESULT create_expected
;
4802 const char* expected_uri
;
4804 } uri_with_fragment
;
4806 static const uri_with_fragment uri_fragment_tests
[] = {
4808 "http://google.com/","#fragment",0,S_OK
,FALSE
,
4809 "http://google.com/#fragment",FALSE
4812 "http://google.com/","fragment",0,S_OK
,FALSE
,
4813 "http://google.com/#fragment",FALSE
4816 "zip://test.com/","?test",0,S_OK
,FALSE
,
4817 "zip://test.com/#?test",FALSE
4819 /* The fragment can be empty. */
4821 "ftp://ftp.google.com/","",0,S_OK
,FALSE
,
4822 "ftp://ftp.google.com/#",FALSE
4826 typedef struct _uri_builder_property
{
4829 const char *expected_value
;
4830 Uri_PROPERTY property
;
4833 } uri_builder_property
;
4835 typedef struct _uri_builder_port
{
4843 typedef struct _uri_builder_str_property
{
4844 const char* expected
;
4847 } uri_builder_str_property
;
4849 typedef struct _uri_builder_dword_property
{
4853 } uri_builder_dword_property
;
4855 typedef struct _uri_builder_test
{
4858 HRESULT create_builder_expected
;
4859 BOOL create_builder_todo
;
4861 uri_builder_property properties
[URI_BUILDER_STR_PROPERTY_COUNT
];
4863 uri_builder_port port_prop
;
4869 DWORD uri_simple_encode_flags
;
4870 HRESULT uri_simple_hres
;
4871 BOOL uri_simple_todo
;
4873 DWORD uri_with_flags
;
4874 DWORD uri_with_builder_flags
;
4875 DWORD uri_with_encode_flags
;
4876 HRESULT uri_with_hres
;
4879 uri_builder_str_property expected_str_props
[URI_STR_PROPERTY_COUNT
];
4880 uri_builder_dword_property expected_dword_props
[URI_DWORD_PROPERTY_COUNT
];
4883 static const uri_builder_test uri_builder_tests
[] = {
4884 { "http://google.com/",0,S_OK
,FALSE
,
4886 {TRUE
,"#fragment",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
4887 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
},
4888 {TRUE
,"?query=x",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
4889 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
4896 {"http://username:password@google.com/?query=x#fragment",S_OK
},
4897 {"username:password@google.com",S_OK
},
4898 {"http://google.com/?query=x#fragment",S_OK
},
4899 {"google.com",S_OK
},
4902 {"google.com",S_OK
},
4907 {"http://username:password@google.com/?query=x#fragment",S_OK
},
4909 {"username:password",S_OK
},
4913 {Uri_HOST_DNS
,S_OK
},
4915 {URL_SCHEME_HTTP
,S_OK
},
4916 {URLZONE_INVALID
,E_NOTIMPL
}
4919 { "http://google.com/",0,S_OK
,FALSE
,
4921 {TRUE
,"test",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
4923 {TRUE
,TRUE
,120,S_OK
,FALSE
},
4928 {"test://google.com:120/",S_OK
},
4929 {"google.com:120",S_OK
},
4930 {"test://google.com:120/",S_OK
},
4931 {"google.com",S_OK
},
4934 {"google.com",S_OK
},
4939 {"test://google.com:120/",S_OK
},
4945 {Uri_HOST_DNS
,S_OK
},
4947 {URL_SCHEME_UNKNOWN
,S_OK
},
4948 {URLZONE_INVALID
,E_NOTIMPL
}
4951 { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
4953 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
4954 {TRUE
,"::192.2.3.4",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
4955 {TRUE
,NULL
,NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
4962 {"http://[::192.2.3.4]/",S_OK
},
4963 {"[::192.2.3.4]",S_OK
},
4964 {"http://[::192.2.3.4]/",S_OK
},
4968 {"::192.2.3.4",S_OK
},
4973 {"http://[::192.2.3.4]/",S_OK
},
4979 {Uri_HOST_IPV6
,S_OK
},
4981 {URL_SCHEME_HTTP
,S_OK
},
4982 {URLZONE_INVALID
,E_NOTIMPL
}
4985 { "http://google.com/",0,S_OK
,FALSE
,
4987 {TRUE
,"Frag","#Frag",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
4994 {"http://google.com/#Frag",S_OK
},
4995 {"google.com",S_OK
},
4996 {"http://google.com/#Frag",S_OK
},
4997 {"google.com",S_OK
},
5000 {"google.com",S_OK
},
5005 {"http://google.com/#Frag",S_OK
},
5011 {Uri_HOST_DNS
,S_OK
},
5013 {URL_SCHEME_HTTP
,S_OK
},
5014 {URLZONE_INVALID
,E_NOTIMPL
}
5017 { "http://google.com/",0,S_OK
,FALSE
,
5019 {TRUE
,"","#",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
5026 {"http://google.com/#",S_OK
},
5027 {"google.com",S_OK
},
5028 {"http://google.com/#",S_OK
},
5029 {"google.com",S_OK
},
5032 {"google.com",S_OK
},
5037 {"http://google.com/#",S_OK
},
5043 {Uri_HOST_DNS
,S_OK
},
5045 {URL_SCHEME_HTTP
,S_OK
},
5046 {URLZONE_INVALID
,E_NOTIMPL
}
5049 { "http://google.com/",0,S_OK
,FALSE
,
5051 {TRUE
,":password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5058 {"http://::password@google.com/",S_OK
},
5059 {"::password@google.com",S_OK
},
5060 {"http://google.com/",S_OK
},
5061 {"google.com",S_OK
},
5064 {"google.com",S_OK
},
5069 {"http://::password@google.com/",S_OK
},
5071 {"::password",S_OK
},
5075 {Uri_HOST_DNS
,S_OK
},
5077 {URL_SCHEME_HTTP
,S_OK
},
5078 {URLZONE_INVALID
,E_NOTIMPL
}
5081 { "test/test",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5083 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5086 Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
5088 Uri_CREATE_ALLOW_RELATIVE
,0,0,S_OK
,FALSE
,
5090 {":password@test/test",S_OK
},
5091 {":password@",S_OK
},
5092 {":password@test/test",S_OK
},
5101 {":password@test/test",S_OK
},
5107 {Uri_HOST_UNKNOWN
,S_OK
},
5109 {URL_SCHEME_UNKNOWN
,S_OK
},
5110 {URLZONE_INVALID
,E_NOTIMPL
}
5113 { "http://google.com/",0,S_OK
,FALSE
,
5115 {TRUE
,"test/test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5122 {"http://google.com/test/test",S_OK
},
5123 {"google.com",S_OK
},
5124 {"http://google.com/test/test",S_OK
},
5125 {"google.com",S_OK
},
5128 {"google.com",S_OK
},
5130 {"/test/test",S_OK
},
5131 {"/test/test",S_OK
},
5133 {"http://google.com/test/test",S_OK
},
5139 {Uri_HOST_DNS
,S_OK
},
5141 {URL_SCHEME_HTTP
,S_OK
},
5142 {URLZONE_INVALID
,E_NOTIMPL
}
5145 { "zip:testing/test",0,S_OK
,FALSE
,
5147 {TRUE
,"test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5171 {Uri_HOST_UNKNOWN
,S_OK
},
5173 {URL_SCHEME_UNKNOWN
,S_OK
},
5174 {URLZONE_INVALID
,E_NOTIMPL
}
5177 { "http://google.com/",0,S_OK
,FALSE
,
5181 /* 555 will be returned from GetPort even though FALSE was passed as the hasPort parameter. */
5182 {TRUE
,FALSE
,555,S_OK
,FALSE
},
5187 {"http://google.com/",S_OK
},
5188 {"google.com",S_OK
},
5189 {"http://google.com/",S_OK
},
5190 {"google.com",S_OK
},
5193 {"google.com",S_OK
},
5198 {"http://google.com/",S_OK
},
5204 {Uri_HOST_DNS
,S_OK
},
5205 /* Still returns 80, even though earlier the port was disabled. */
5207 {URL_SCHEME_HTTP
,S_OK
},
5208 {URLZONE_INVALID
,E_NOTIMPL
}
5211 { "http://google.com/",0,S_OK
,FALSE
,
5215 /* Instead of getting "TRUE" back as the "hasPort" parameter in GetPort,
5216 * you'll get 122345 instead.
5218 {TRUE
,122345,222,S_OK
,FALSE
},
5223 {"http://google.com:222/",S_OK
},
5224 {"google.com:222",S_OK
},
5225 {"http://google.com:222/",S_OK
},
5226 {"google.com",S_OK
},
5229 {"google.com",S_OK
},
5234 {"http://google.com:222/",S_OK
},
5240 {Uri_HOST_DNS
,S_OK
},
5242 {URL_SCHEME_HTTP
,S_OK
},
5243 {URLZONE_INVALID
,E_NOTIMPL
}
5246 /* IUri's created with the IUriBuilder can have ports that exceed USHORT_MAX. */
5247 { "http://google.com/",0,S_OK
,FALSE
,
5251 {TRUE
,TRUE
,999999,S_OK
,FALSE
},
5256 {"http://google.com:999999/",S_OK
},
5257 {"google.com:999999",S_OK
},
5258 {"http://google.com:999999/",S_OK
},
5259 {"google.com",S_OK
},
5262 {"google.com",S_OK
},
5267 {"http://google.com:999999/",S_OK
},
5273 {Uri_HOST_DNS
,S_OK
},
5275 {URL_SCHEME_HTTP
,S_OK
},
5276 {URLZONE_INVALID
,E_NOTIMPL
}
5279 { "http://google.com/",0,S_OK
,FALSE
,
5281 {TRUE
,"test","?test",Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
5289 {"http://google.com/?test",S_OK
},
5290 {"google.com",S_OK
},
5291 {"http://google.com/?test",S_OK
},
5292 {"google.com",S_OK
},
5295 {"google.com",S_OK
},
5300 {"http://google.com/?test",S_OK
},
5306 {Uri_HOST_DNS
,S_OK
},
5308 {URL_SCHEME_HTTP
,S_OK
},
5309 {URLZONE_INVALID
,E_NOTIMPL
}
5312 { "http://:password@google.com/",0,S_OK
,FALSE
,
5321 {"http://:password@google.com/",S_OK
},
5322 {":password@google.com",S_OK
},
5323 {"http://google.com/",S_OK
},
5324 {"google.com",S_OK
},
5327 {"google.com",S_OK
},
5332 {"http://:password@google.com/",S_OK
},
5338 {Uri_HOST_DNS
,S_OK
},
5340 {URL_SCHEME_HTTP
,S_OK
},
5341 {URLZONE_INVALID
,E_NOTIMPL
}
5344 /* IUriBuilder doesn't need a base IUri to build a IUri. */
5345 { NULL
,0,S_OK
,FALSE
,
5347 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
5348 {TRUE
,"google.com",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5355 {"http://google.com/",S_OK
},
5356 {"google.com",S_OK
},
5357 {"http://google.com/",S_OK
},
5358 {"google.com",S_OK
},
5361 {"google.com",S_OK
},
5366 {"http://google.com/",S_OK
},
5372 {Uri_HOST_DNS
,S_OK
},
5374 {URL_SCHEME_HTTP
,S_OK
},
5375 {URLZONE_INVALID
,E_NOTIMPL
}
5378 /* Can't set the scheme name to NULL. */
5379 { "zip://google.com/",0,S_OK
,FALSE
,
5381 {TRUE
,NULL
,"zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5388 {"zip://google.com/",S_OK
},
5389 {"google.com",S_OK
},
5390 {"zip://google.com/",S_OK
},
5391 {"google.com",S_OK
},
5394 {"google.com",S_OK
},
5399 {"zip://google.com/",S_OK
},
5405 {Uri_HOST_DNS
,S_OK
},
5407 {URL_SCHEME_UNKNOWN
,S_OK
},
5408 {URLZONE_INVALID
,E_NOTIMPL
}
5411 /* Can't set the scheme name to an empty string. */
5412 { "zip://google.com/",0,S_OK
,FALSE
,
5414 {TRUE
,"","zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5421 {"zip://google.com/",S_OK
},
5422 {"google.com",S_OK
},
5423 {"zip://google.com/",S_OK
},
5424 {"google.com",S_OK
},
5427 {"google.com",S_OK
},
5432 {"zip://google.com/",S_OK
},
5438 {Uri_HOST_DNS
,S_OK
},
5440 {URL_SCHEME_UNKNOWN
,S_OK
},
5441 {URLZONE_INVALID
,E_NOTIMPL
}
5444 /* -1 to CreateUri makes it use the same flags as the base IUri was created with.
5445 * CreateUriSimple always uses the flags the base IUri was created with (if any).
5447 { "http://google.com/../../",Uri_CREATE_NO_CANONICALIZE
,S_OK
,FALSE
,
5452 0,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5454 {"http://google.com/../../",S_OK
},
5455 {"google.com",S_OK
},
5456 {"http://google.com/../../",S_OK
},
5457 {"google.com",S_OK
},
5460 {"google.com",S_OK
},
5465 {"http://google.com/../../",S_OK
},
5471 {Uri_HOST_DNS
,S_OK
},
5473 {URL_SCHEME_HTTP
,S_OK
},
5474 {URLZONE_INVALID
,E_NOTIMPL
}
5477 { "http://google.com/",0,S_OK
,FALSE
,
5479 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5484 Uri_CREATE_NO_DECODE_EXTRA_INFO
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5486 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5487 {"google.com",S_OK
},
5488 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5489 {"google.com",S_OK
},
5491 {"#Fr%3C%7C%3Eg",S_OK
},
5492 {"google.com",S_OK
},
5497 {"http://google.com/#Fr<|>g",S_OK
},
5503 {Uri_HOST_DNS
,S_OK
},
5505 {URL_SCHEME_HTTP
,S_OK
},
5506 {URLZONE_INVALID
,E_NOTIMPL
}
5509 { "http://google.com/",0,S_OK
,FALSE
,
5511 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5514 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,E_INVALIDARG
,FALSE
,
5516 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5518 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5519 {"google.com",S_OK
},
5520 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5521 {"google.com",S_OK
},
5523 {"#Fr%3C%7C%3Eg",S_OK
},
5524 {"google.com",S_OK
},
5529 {"http://google.com/#Fr<|>g",S_OK
},
5535 {Uri_HOST_DNS
,S_OK
},
5537 {URL_SCHEME_HTTP
,S_OK
},
5538 {URLZONE_INVALID
,E_NOTIMPL
}
5541 { NULL
,0,S_OK
,FALSE
,
5543 {TRUE
,"/test/test/",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5544 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5547 0,INET_E_INVALID_URL
,FALSE
,
5548 0,INET_E_INVALID_URL
,FALSE
,
5549 0,0,0,INET_E_INVALID_URL
,FALSE
5551 { "http://google.com/",0,S_OK
,FALSE
,
5553 {TRUE
,"ht%xxtp",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
5556 0,INET_E_INVALID_URL
,FALSE
,
5557 0,INET_E_INVALID_URL
,FALSE
,
5558 0,0,0,INET_E_INVALID_URL
,FALSE
5560 /* File scheme's can't have a username set. */
5561 { "file://google.com/",0,S_OK
,FALSE
,
5563 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5566 0,INET_E_INVALID_URL
,FALSE
,
5567 0,INET_E_INVALID_URL
,FALSE
,
5568 0,0,0,INET_E_INVALID_URL
,FALSE
5570 /* File schemes can't have a password set. */
5571 { "file://google.com/",0,S_OK
,FALSE
,
5573 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5576 0,INET_E_INVALID_URL
,FALSE
,
5577 0,INET_E_INVALID_URL
,FALSE
,
5578 0,0,0,INET_E_INVALID_URL
,FALSE
5580 /* UserName can't contain any character that is a delimeter for another
5581 * component that appears after it in a normal URI.
5583 { "http://google.com/",0,S_OK
,FALSE
,
5585 {TRUE
,"user:pass",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5588 0,INET_E_INVALID_URL
,FALSE
,
5589 0,INET_E_INVALID_URL
,FALSE
,
5590 0,0,0,INET_E_INVALID_URL
,FALSE
5592 { "http://google.com/",0,S_OK
,FALSE
,
5594 {TRUE
,"user@google.com",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5597 0,INET_E_INVALID_URL
,FALSE
,
5598 0,INET_E_INVALID_URL
,FALSE
,
5599 0,0,0,INET_E_INVALID_URL
,FALSE
5601 { "http://google.com/",0,S_OK
,FALSE
,
5603 {TRUE
,"user/path",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5606 0,INET_E_INVALID_URL
,FALSE
,
5607 0,INET_E_INVALID_URL
,FALSE
,
5608 0,0,0,INET_E_INVALID_URL
,FALSE
5610 { "http://google.com/",0,S_OK
,FALSE
,
5612 {TRUE
,"user?Query",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5615 0,INET_E_INVALID_URL
,FALSE
,
5616 0,INET_E_INVALID_URL
,FALSE
,
5617 0,0,0,INET_E_INVALID_URL
,FALSE
5619 { "http://google.com/",0,S_OK
,FALSE
,
5621 {TRUE
,"user#Frag",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5624 0,INET_E_INVALID_URL
,FALSE
,
5625 0,INET_E_INVALID_URL
,FALSE
,
5626 0,0,0,INET_E_INVALID_URL
,FALSE
5628 { "http://google.com/",0,S_OK
,FALSE
,
5630 {TRUE
,"pass@google.com",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5633 0,INET_E_INVALID_URL
,FALSE
,
5634 0,INET_E_INVALID_URL
,FALSE
,
5635 0,0,0,INET_E_INVALID_URL
,FALSE
5637 { "http://google.com/",0,S_OK
,FALSE
,
5639 {TRUE
,"pass/path",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5642 0,INET_E_INVALID_URL
,FALSE
,
5643 0,INET_E_INVALID_URL
,FALSE
,
5644 0,0,0,INET_E_INVALID_URL
,FALSE
5646 { "http://google.com/",0,S_OK
,FALSE
,
5648 {TRUE
,"pass?query",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5651 0,INET_E_INVALID_URL
,FALSE
,
5652 0,INET_E_INVALID_URL
,FALSE
,
5653 0,0,0,INET_E_INVALID_URL
,FALSE
5655 { "http://google.com/",0,S_OK
,FALSE
,
5657 {TRUE
,"pass#frag",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5660 0,INET_E_INVALID_URL
,FALSE
,
5661 0,INET_E_INVALID_URL
,FALSE
,
5662 0,0,0,INET_E_INVALID_URL
,FALSE
5664 { "http://google.com/",0,S_OK
,FALSE
,
5666 {TRUE
,"winehq.org/test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5669 0,INET_E_INVALID_URL
,FALSE
,
5670 0,INET_E_INVALID_URL
,FALSE
,
5671 0,0,0,INET_E_INVALID_URL
,FALSE
5673 { "http://google.com/",0,S_OK
,FALSE
,
5675 {TRUE
,"winehq.org?test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5678 0,INET_E_INVALID_URL
,FALSE
,
5679 0,INET_E_INVALID_URL
,FALSE
,
5680 0,0,0,INET_E_INVALID_URL
,FALSE
5682 { "http://google.com/",0,S_OK
,FALSE
,
5684 {TRUE
,"winehq.org#test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5687 0,INET_E_INVALID_URL
,FALSE
,
5688 0,INET_E_INVALID_URL
,FALSE
,
5689 0,0,0,INET_E_INVALID_URL
,FALSE
5691 /* Hostname is allowed to contain a ':' (even for known scheme types). */
5692 { "http://google.com/",0,S_OK
,FALSE
,
5694 {TRUE
,"winehq.org:test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
5701 {"http://winehq.org:test/",S_OK
},
5702 {"winehq.org:test",S_OK
},
5703 {"http://winehq.org:test/",S_OK
},
5704 {"winehq.org:test",S_OK
},
5707 {"winehq.org:test",S_OK
},
5712 {"http://winehq.org:test/",S_OK
},
5718 {Uri_HOST_DNS
,S_OK
},
5720 {URL_SCHEME_HTTP
,S_OK
},
5721 {URLZONE_INVALID
,E_NOTIMPL
}
5724 /* Can't set the host name to NULL. */
5725 { "http://google.com/",0,S_OK
,FALSE
,
5727 {TRUE
,NULL
,"google.com",Uri_PROPERTY_HOST
,E_INVALIDARG
,FALSE
}
5734 {"http://google.com/",S_OK
},
5735 {"google.com",S_OK
},
5736 {"http://google.com/",S_OK
},
5737 {"google.com",S_OK
},
5740 {"google.com",S_OK
},
5745 {"http://google.com/",S_OK
},
5751 {Uri_HOST_DNS
,S_OK
},
5753 {URL_SCHEME_HTTP
,S_OK
},
5754 {URLZONE_INVALID
,E_NOTIMPL
}
5757 /* Can set the host name to an empty string. */
5758 { "http://google.com/",0,S_OK
,FALSE
,
5760 {TRUE
,"",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5784 {Uri_HOST_UNKNOWN
,S_OK
},
5786 {URL_SCHEME_HTTP
,S_OK
},
5787 {URLZONE_INVALID
,E_NOTIMPL
}
5790 { "http://google.com/",0,S_OK
,FALSE
,
5792 {TRUE
,"/path?query",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
5795 0,INET_E_INVALID_URL
,FALSE
,
5796 0,INET_E_INVALID_URL
,FALSE
,
5797 0,0,0,INET_E_INVALID_URL
,FALSE
5799 { "http://google.com/",0,S_OK
,FALSE
,
5801 {TRUE
,"/path#test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
5804 0,INET_E_INVALID_URL
,FALSE
,
5805 0,INET_E_INVALID_URL
,FALSE
,
5806 0,0,0,INET_E_INVALID_URL
,FALSE
5808 { "http://google.com/",0,S_OK
,FALSE
,
5810 {TRUE
,"?path#test",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
}
5813 0,INET_E_INVALID_URL
,FALSE
,
5814 0,INET_E_INVALID_URL
,FALSE
,
5815 0,0,0,INET_E_INVALID_URL
,FALSE
5817 { "file:///c:/dir/file.html",0,S_OK
,FALSE
,
5819 {TRUE
,NULL
,NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
},
5826 {"file:///c:/dir/file.html",S_OK
},
5828 {"file:///c:/dir/file.html",S_OK
},
5834 {"/c:/dir/file.html",S_OK
},
5835 {"/c:/dir/file.html",S_OK
},
5837 {"file:///c:/dir/file.html",S_OK
},
5843 {Uri_HOST_UNKNOWN
,S_OK
},
5845 {URL_SCHEME_FILE
,S_OK
},
5846 {URLZONE_INVALID
,E_NOTIMPL
}
5849 { "file:///c:/dir/file.html",0,S_OK
,FALSE
,
5851 {TRUE
,"#",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
},
5858 {"file:///c:/dir/file.html#",S_OK
},
5860 {"file:///c:/dir/file.html#",S_OK
},
5866 {"/c:/dir/file.html",S_OK
},
5867 {"/c:/dir/file.html",S_OK
},
5869 {"file:///c:/dir/file.html#",S_OK
},
5875 {Uri_HOST_UNKNOWN
,S_OK
},
5877 {URL_SCHEME_FILE
,S_OK
},
5878 {URLZONE_INVALID
,E_NOTIMPL
}
5883 typedef struct _uri_builder_remove_test
{
5886 HRESULT create_builder_expected
;
5887 BOOL create_builder_todo
;
5889 DWORD remove_properties
;
5890 HRESULT remove_expected
;
5893 const char *expected_uri
;
5894 DWORD expected_flags
;
5895 HRESULT expected_hres
;
5897 } uri_builder_remove_test
;
5899 static const uri_builder_remove_test uri_builder_remove_tests
[] = {
5900 { "http://google.com/test?test=y#Frag",0,S_OK
,FALSE
,
5901 Uri_HAS_FRAGMENT
|Uri_HAS_PATH
|Uri_HAS_QUERY
,S_OK
,FALSE
,
5902 "http://google.com/",0,S_OK
,FALSE
5904 { "http://user:pass@winehq.org/",0,S_OK
,FALSE
,
5905 Uri_HAS_USER_NAME
|Uri_HAS_PASSWORD
,S_OK
,FALSE
,
5906 "http://winehq.org/",0,S_OK
,FALSE
5908 { "zip://google.com?Test=x",0,S_OK
,FALSE
,
5909 Uri_HAS_HOST
,S_OK
,FALSE
,
5910 "zip:/?Test=x",0,S_OK
,FALSE
5912 /* Doesn't remove the whole userinfo component. */
5913 { "http://username:pass@google.com/",0,S_OK
,FALSE
,
5914 Uri_HAS_USER_INFO
,S_OK
,FALSE
,
5915 "http://username:pass@google.com/",0,S_OK
,FALSE
5917 /* Doesn't remove the domain. */
5918 { "http://google.com/",0,S_OK
,FALSE
,
5919 Uri_HAS_DOMAIN
,S_OK
,FALSE
,
5920 "http://google.com/",0,S_OK
,FALSE
5922 { "http://google.com:120/",0,S_OK
,FALSE
,
5923 Uri_HAS_AUTHORITY
,S_OK
,FALSE
,
5924 "http://google.com:120/",0,S_OK
,FALSE
5926 { "http://google.com/test.com/",0,S_OK
,FALSE
,
5927 Uri_HAS_EXTENSION
,S_OK
,FALSE
,
5928 "http://google.com/test.com/",0,S_OK
,FALSE
5930 { "http://google.com/?test=x",0,S_OK
,FALSE
,
5931 Uri_HAS_PATH_AND_QUERY
,S_OK
,FALSE
,
5932 "http://google.com/?test=x",0,S_OK
,FALSE
5934 /* Can't remove the scheme name. */
5935 { "http://google.com/?test=x",0,S_OK
,FALSE
,
5936 Uri_HAS_SCHEME_NAME
|Uri_HAS_QUERY
,E_INVALIDARG
,FALSE
,
5937 "http://google.com/?test=x",0,S_OK
,FALSE
5941 typedef struct _uri_combine_str_property
{
5945 const char *broken_value
;
5946 const char *value_ex
;
5947 } uri_combine_str_property
;
5949 typedef struct _uri_combine_test
{
5950 const char *base_uri
;
5951 DWORD base_create_flags
;
5952 const char *relative_uri
;
5953 DWORD relative_create_flags
;
5954 DWORD combine_flags
;
5958 uri_combine_str_property str_props
[URI_STR_PROPERTY_COUNT
];
5959 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
5962 static const uri_combine_test uri_combine_tests
[] = {
5963 { "http://google.com/fun/stuff",0,
5964 "../not/fun/stuff",Uri_CREATE_ALLOW_RELATIVE
,
5967 {"http://google.com/not/fun/stuff",S_OK
},
5968 {"google.com",S_OK
},
5969 {"http://google.com/not/fun/stuff",S_OK
},
5970 {"google.com",S_OK
},
5973 {"google.com",S_OK
},
5975 {"/not/fun/stuff",S_OK
},
5976 {"/not/fun/stuff",S_OK
},
5978 {"http://google.com/not/fun/stuff",S_OK
},
5984 {Uri_HOST_DNS
,S_OK
},
5986 {URL_SCHEME_HTTP
,S_OK
},
5987 {URLZONE_INVALID
,E_NOTIMPL
}
5990 { "http://google.com/test",0,
5991 "zip://test.com/cool",0,
5994 {"zip://test.com/cool",S_OK
},
5996 {"zip://test.com/cool",S_OK
},
6005 {"zip://test.com/cool",S_OK
},
6011 {Uri_HOST_DNS
,S_OK
},
6013 {URL_SCHEME_UNKNOWN
,S_OK
},
6014 {URLZONE_INVALID
,E_NOTIMPL
}
6017 { "http://google.com/use/base/path",0,
6018 "?relative",Uri_CREATE_ALLOW_RELATIVE
,
6021 {"http://google.com/use/base/path?relative",S_OK
},
6022 {"google.com",S_OK
},
6023 {"http://google.com/use/base/path?relative",S_OK
},
6024 {"google.com",S_OK
},
6027 {"google.com",S_OK
},
6029 {"/use/base/path",S_OK
},
6030 {"/use/base/path?relative",S_OK
},
6032 {"http://google.com/use/base/path?relative",S_OK
},
6038 {Uri_HOST_DNS
,S_OK
},
6040 {URL_SCHEME_HTTP
,S_OK
},
6041 {URLZONE_INVALID
,E_NOTIMPL
}
6044 { "http://google.com/path",0,
6045 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
6048 {"http://google.com/testing",S_OK
},
6049 {"google.com",S_OK
},
6050 {"http://google.com/testing",S_OK
},
6051 {"google.com",S_OK
},
6054 {"google.com",S_OK
},
6059 {"http://google.com/testing",S_OK
},
6065 {Uri_HOST_DNS
,S_OK
},
6067 {URL_SCHEME_HTTP
,S_OK
},
6068 {URLZONE_INVALID
,E_NOTIMPL
}
6071 { "http://google.com/path",0,
6072 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
6073 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6075 {"http://google.com:80/test/../test/.././testing",S_OK
},
6076 {"google.com",S_OK
},
6077 {"http://google.com:80/test/../test/.././testing",S_OK
},
6078 {"google.com",S_OK
},
6081 {"google.com",S_OK
},
6083 {"/test/../test/.././testing",S_OK
},
6084 {"/test/../test/.././testing",S_OK
},
6086 {"http://google.com:80/test/../test/.././testing",S_OK
},
6092 {Uri_HOST_DNS
,S_OK
},
6094 {URL_SCHEME_HTTP
,S_OK
},
6095 {URLZONE_INVALID
,E_NOTIMPL
}
6098 { "http://winehq.org/test/abc",0,
6099 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
6102 {"http://winehq.org/test/testing/test",S_OK
},
6103 {"winehq.org",S_OK
},
6104 {"http://winehq.org/test/testing/test",S_OK
},
6105 {"winehq.org",S_OK
},
6108 {"winehq.org",S_OK
},
6110 {"/test/testing/test",S_OK
},
6111 {"/test/testing/test",S_OK
},
6113 {"http://winehq.org/test/testing/test",S_OK
},
6119 {Uri_HOST_DNS
,S_OK
},
6121 {URL_SCHEME_HTTP
,S_OK
},
6122 {URLZONE_INVALID
,E_NOTIMPL
}
6125 { "http://winehq.org/test/abc",0,
6126 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
6127 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6129 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6130 /* Default port is hidden in the authority. */
6131 {"winehq.org",S_OK
},
6132 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6133 {"winehq.org",S_OK
},
6136 {"winehq.org",S_OK
},
6138 {"/test/testing/abc/../test",S_OK
},
6139 {"/test/testing/abc/../test",S_OK
},
6141 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
6147 {Uri_HOST_DNS
,S_OK
},
6149 {URL_SCHEME_HTTP
,S_OK
},
6150 {URLZONE_INVALID
,E_NOTIMPL
}
6153 { "http://winehq.org/test?query",0,
6154 "testing",Uri_CREATE_ALLOW_RELATIVE
,
6157 {"http://winehq.org/testing",S_OK
},
6158 {"winehq.org",S_OK
},
6159 {"http://winehq.org/testing",S_OK
},
6160 {"winehq.org",S_OK
},
6163 {"winehq.org",S_OK
},
6168 {"http://winehq.org/testing",S_OK
},
6174 {Uri_HOST_DNS
,S_OK
},
6176 {URL_SCHEME_HTTP
,S_OK
},
6177 {URLZONE_INVALID
,E_NOTIMPL
}
6180 { "http://winehq.org/test#frag",0,
6181 "testing",Uri_CREATE_ALLOW_RELATIVE
,
6184 {"http://winehq.org/testing",S_OK
},
6185 {"winehq.org",S_OK
},
6186 {"http://winehq.org/testing",S_OK
},
6187 {"winehq.org",S_OK
},
6190 {"winehq.org",S_OK
},
6195 {"http://winehq.org/testing",S_OK
},
6201 {Uri_HOST_DNS
,S_OK
},
6203 {URL_SCHEME_HTTP
,S_OK
},
6204 {URLZONE_INVALID
,E_NOTIMPL
}
6207 { "testing?query#frag",Uri_CREATE_ALLOW_RELATIVE
,
6208 "test",Uri_CREATE_ALLOW_RELATIVE
,
6228 {Uri_HOST_UNKNOWN
,S_OK
},
6230 {URL_SCHEME_UNKNOWN
,S_OK
},
6231 {URLZONE_INVALID
,E_NOTIMPL
}
6234 { "file:///c:/test/test",0,
6235 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6236 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6238 {"file://c:\\testing.mp3",S_OK
},
6240 {"file://c:\\testing.mp3",S_OK
},
6246 {"c:\\testing.mp3",S_OK
},
6247 {"c:\\testing.mp3",S_OK
},
6249 {"file://c:\\testing.mp3",S_OK
},
6255 {Uri_HOST_UNKNOWN
,S_OK
},
6257 {URL_SCHEME_FILE
,S_OK
},
6258 {URLZONE_INVALID
,E_NOTIMPL
}
6261 { "file:///c:/test/test",0,
6262 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6265 {"file:///c:/testing.mp3",S_OK
},
6267 {"file:///c:/testing.mp3",S_OK
},
6273 {"/c:/testing.mp3",S_OK
},
6274 {"/c:/testing.mp3",S_OK
},
6276 {"file:///c:/testing.mp3",S_OK
},
6282 {Uri_HOST_UNKNOWN
,S_OK
},
6284 {URL_SCHEME_FILE
,S_OK
},
6285 {URLZONE_INVALID
,E_NOTIMPL
}
6288 { "file://test.com/test/test",0,
6289 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
6290 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6292 {"file://\\\\test.com\\testing.mp3",S_OK
},
6294 {"file://\\\\test.com\\testing.mp3",S_OK
},
6300 {"\\testing.mp3",S_OK
},
6301 {"\\testing.mp3",S_OK
},
6303 {"file://\\\\test.com\\testing.mp3",S_OK
},
6309 {Uri_HOST_DNS
,S_OK
},
6311 {URL_SCHEME_FILE
,S_OK
},
6312 {URLZONE_INVALID
,E_NOTIMPL
}
6315 /* URL_DONT_SIMPLIFY has no effect. */
6316 { "http://google.com/test",0,
6317 "zip://test.com/cool/../cool/test",0,
6318 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
6320 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
6322 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
6328 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
6329 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
6331 /* The resulting IUri has the same Raw URI as the relative URI (only IE 8).
6332 * On IE 7 it reduces the path in the Raw URI.
6334 {"zip://test.com/cool/../cool/test",S_OK
,FALSE
,"zip://test.com/cool/test"},
6340 {Uri_HOST_DNS
,S_OK
},
6342 {URL_SCHEME_UNKNOWN
,S_OK
},
6343 {URLZONE_INVALID
,E_NOTIMPL
}
6346 /* FILE_USE_PATHURL has no effect in IE 8, in IE 7 the
6347 * resulting URI is converted into a dos path.
6349 { "http://google.com/test",0,
6350 "file:///c:/test/",0,
6351 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6353 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6355 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6361 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
6362 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
6364 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
6370 {Uri_HOST_UNKNOWN
,S_OK
},
6372 {URL_SCHEME_FILE
,S_OK
},
6373 {URLZONE_INVALID
,E_NOTIMPL
}
6376 { "http://google.com/test",0,
6377 "http://test.com/test#%30test",0,
6378 URL_DONT_UNESCAPE_EXTRA_INFO
,S_OK
,FALSE
,
6380 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
6382 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
6385 {"#0test",S_OK
,FALSE
,NULL
,"#%30test"},
6391 /* IE 7 decodes the %30 to a 0 in the Raw URI. */
6392 {"http://test.com/test#%30test",S_OK
,FALSE
,"http://test.com/test#0test"},
6398 {Uri_HOST_DNS
,S_OK
},
6400 {URL_SCHEME_HTTP
,S_OK
},
6401 {URLZONE_INVALID
,E_NOTIMPL
}
6404 /* Windows validates the path component from the relative Uri. */
6405 { "http://google.com/test",0,
6406 "/Te%XXst",Uri_CREATE_ALLOW_RELATIVE
,
6407 0,E_INVALIDARG
,FALSE
6409 /* Windows doesn't validate the query from the relative Uri. */
6410 { "http://google.com/test",0,
6411 "?Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6414 {"http://google.com/test?Tes%XXt",S_OK
},
6415 {"google.com",S_OK
},
6416 {"http://google.com/test?Tes%XXt",S_OK
},
6417 {"google.com",S_OK
},
6420 {"google.com",S_OK
},
6423 {"/test?Tes%XXt",S_OK
},
6425 {"http://google.com/test?Tes%XXt",S_OK
},
6431 {Uri_HOST_DNS
,S_OK
},
6433 {URL_SCHEME_HTTP
,S_OK
},
6434 {URLZONE_INVALID
,E_NOTIMPL
}
6437 /* Windows doesn't validate the fragment from the relative Uri. */
6438 { "http://google.com/test",0,
6439 "#Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6442 {"http://google.com/test#Tes%XXt",S_OK
},
6443 {"google.com",S_OK
},
6444 {"http://google.com/test#Tes%XXt",S_OK
},
6445 {"google.com",S_OK
},
6448 {"google.com",S_OK
},
6453 {"http://google.com/test#Tes%XXt",S_OK
},
6459 {Uri_HOST_DNS
,S_OK
},
6461 {URL_SCHEME_HTTP
,S_OK
},
6462 {URLZONE_INVALID
,E_NOTIMPL
}
6465 /* Creates an IUri which contains an invalid dos path char. */
6466 { "file:///c:/test",0,
6467 "/test<ing",Uri_CREATE_ALLOW_RELATIVE
,
6468 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6470 {"file://c:\\test<ing",S_OK
},
6472 {"file://c:\\test<ing",S_OK
},
6478 {"c:\\test<ing",S_OK
},
6479 {"c:\\test<ing",S_OK
},
6481 {"file://c:\\test<ing",S_OK
},
6487 {Uri_HOST_UNKNOWN
,S_OK
},
6489 {URL_SCHEME_FILE
,S_OK
},
6490 {URLZONE_INVALID
,E_NOTIMPL
}
6493 /* Appends the path after the drive letter (if any). */
6494 { "file:///c:/test",0,
6495 "/c:/testing",Uri_CREATE_ALLOW_RELATIVE
,
6498 {"file:///c:/c:/testing",S_OK
},
6500 {"file:///c:/c:/testing",S_OK
},
6506 {"/c:/c:/testing",S_OK
},
6507 {"/c:/c:/testing",S_OK
},
6509 {"file:///c:/c:/testing",S_OK
},
6515 {Uri_HOST_UNKNOWN
,S_OK
},
6517 {URL_SCHEME_FILE
,S_OK
},
6518 {URLZONE_INVALID
,E_NOTIMPL
}
6521 /* A '/' is added if the base URI doesn't have a path and the
6522 * relative URI doesn't contain a path (since the base URI is
6525 { "http://google.com",Uri_CREATE_NO_CANONICALIZE
,
6526 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6529 {"http://google.com/?test",S_OK
},
6530 {"google.com",S_OK
},
6531 {"http://google.com/?test",S_OK
},
6532 {"google.com",S_OK
},
6535 {"google.com",S_OK
},
6540 {"http://google.com/?test",S_OK
},
6546 {Uri_HOST_DNS
,S_OK
},
6548 {URL_SCHEME_HTTP
,S_OK
},
6549 {URLZONE_INVALID
,E_NOTIMPL
}
6552 { "zip://google.com",Uri_CREATE_NO_CANONICALIZE
,
6553 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6556 {"zip://google.com/?test",S_OK
},
6557 {"google.com",S_OK
},
6558 {"zip://google.com/?test",S_OK
},
6559 {"google.com",S_OK
},
6562 {"google.com",S_OK
},
6567 {"zip://google.com/?test",S_OK
},
6573 {Uri_HOST_DNS
,S_OK
},
6575 {URL_SCHEME_UNKNOWN
,S_OK
},
6576 {URLZONE_INVALID
,E_NOTIMPL
}
6579 /* No path is appended since the base URI is opaque. */
6581 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6601 {Uri_HOST_UNKNOWN
,S_OK
},
6603 {URL_SCHEME_UNKNOWN
,S_OK
},
6604 {URLZONE_INVALID
,E_NOTIMPL
}
6608 "../testing/test",Uri_CREATE_ALLOW_RELATIVE
,
6611 {"file:///c:/testing/test",S_OK
},
6613 {"file:///c:/testing/test",S_OK
},
6619 {"/c:/testing/test",S_OK
},
6620 {"/c:/testing/test",S_OK
},
6622 {"file:///c:/testing/test",S_OK
},
6628 {Uri_HOST_UNKNOWN
,S_OK
},
6630 {URL_SCHEME_FILE
,S_OK
},
6631 {URLZONE_INVALID
,E_NOTIMPL
}
6634 { "http://winehq.org/dir/testfile",0,
6635 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
6638 {"http://winehq.org/dir/test?querystring",S_OK
},
6639 {"winehq.org",S_OK
},
6640 {"http://winehq.org/dir/test?querystring",S_OK
},
6641 {"winehq.org",S_OK
},
6644 {"winehq.org",S_OK
},
6647 {"/dir/test?querystring",S_OK
},
6648 {"?querystring",S_OK
},
6649 {"http://winehq.org/dir/test?querystring",S_OK
},
6655 {Uri_HOST_DNS
,S_OK
},
6657 {URL_SCHEME_HTTP
,S_OK
},
6658 {URLZONE_INVALID
,E_NOTIMPL
}
6661 { "http://winehq.org/dir/test",0,
6662 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
6665 {"http://winehq.org/dir/test?querystring",S_OK
},
6666 {"winehq.org",S_OK
},
6667 {"http://winehq.org/dir/test?querystring",S_OK
},
6668 {"winehq.org",S_OK
},
6671 {"winehq.org",S_OK
},
6674 {"/dir/test?querystring",S_OK
},
6675 {"?querystring",S_OK
},
6676 {"http://winehq.org/dir/test?querystring",S_OK
},
6682 {Uri_HOST_DNS
,S_OK
},
6684 {URL_SCHEME_HTTP
,S_OK
},
6685 {URLZONE_INVALID
,E_NOTIMPL
}
6688 { "http://winehq.org/dir/test?querystring",0,
6689 "#hash",Uri_CREATE_ALLOW_RELATIVE
,
6692 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6693 {"winehq.org",S_OK
},
6694 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6695 {"winehq.org",S_OK
},
6698 {"winehq.org",S_OK
},
6701 {"/dir/test?querystring",S_OK
},
6702 {"?querystring",S_OK
},
6703 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6709 {Uri_HOST_DNS
,S_OK
},
6711 {URL_SCHEME_HTTP
,S_OK
},
6712 {URLZONE_INVALID
,E_NOTIMPL
}
6715 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir\\file.txt",0,
6716 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6719 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6721 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6727 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6728 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6730 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6736 {Uri_HOST_UNKNOWN
,S_OK
},
6738 {URL_SCHEME_MK
,S_OK
},
6739 {URLZONE_INVALID
,E_NOTIMPL
}
6742 { "mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::\\subdir\\file.txt",0,
6743 "relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6746 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6748 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6754 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6755 {"@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6757 {"mk:@MSITSTORE:C:\\Some\\Bogus\\Path.chm::/subdir/relative/path.txt",S_OK
},
6763 {Uri_HOST_UNKNOWN
,S_OK
},
6765 {URL_SCHEME_MK
,S_OK
},
6766 {URLZONE_INVALID
,E_NOTIMPL
}
6769 { "mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir\\file.txt",0,
6770 "relative\\path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6773 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6775 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6781 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6782 {"@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6784 {"mk:@MSITSTORE:C:/Some\\Bogus/Path.chm::/subdir/relative/path.txt",S_OK
},
6790 {Uri_HOST_UNKNOWN
,S_OK
},
6792 {URL_SCHEME_MK
,S_OK
},
6793 {URLZONE_INVALID
,E_NOTIMPL
}
6796 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
6797 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6800 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6802 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6808 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6809 {"@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6811 {"mk:@MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6817 {Uri_HOST_UNKNOWN
,S_OK
},
6819 {URL_SCHEME_MK
,S_OK
},
6820 {URLZONE_INVALID
,E_NOTIMPL
}
6823 { "mk:MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
6824 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6827 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6829 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6835 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6836 {"MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6838 {"mk:MSITSTORE:C:\\dir\\file.chm::/relative/path.txt",S_OK
},
6844 {Uri_HOST_UNKNOWN
,S_OK
},
6846 {URL_SCHEME_MK
,S_OK
},
6847 {URLZONE_INVALID
,E_NOTIMPL
}
6850 { "mk:@MSITSTORE:C:\\dir\\file.chm::/subdir/../../file.txt",0,
6851 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6854 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
6856 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
6862 {"@MSITSTORE:/relative/path.txt",S_OK
},
6863 {"@MSITSTORE:/relative/path.txt",S_OK
},
6865 {"mk:@MSITSTORE:/relative/path.txt",S_OK
},
6871 {Uri_HOST_UNKNOWN
,S_OK
},
6873 {URL_SCHEME_MK
,S_OK
},
6874 {URLZONE_INVALID
,E_NOTIMPL
}
6877 { "mk:@xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
6878 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6881 {"mk:@xxx:/relative/path.txt",S_OK
},
6883 {"mk:@xxx:/relative/path.txt",S_OK
},
6889 {"@xxx:/relative/path.txt",S_OK
},
6890 {"@xxx:/relative/path.txt",S_OK
},
6892 {"mk:@xxx:/relative/path.txt",S_OK
},
6898 {Uri_HOST_UNKNOWN
,S_OK
},
6900 {URL_SCHEME_MK
,S_OK
},
6901 {URLZONE_INVALID
,E_NOTIMPL
}
6904 { "mk:xxx:C:\\dir\\file.chm::/subdir/../../file.txt",0,
6905 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6908 {"mk:/relative/path.txt",S_OK
},
6910 {"mk:/relative/path.txt",S_OK
},
6916 {"/relative/path.txt",S_OK
},
6917 {"/relative/path.txt",S_OK
},
6919 {"mk:/relative/path.txt",S_OK
},
6925 {Uri_HOST_UNKNOWN
,S_OK
},
6927 {URL_SCHEME_MK
,S_OK
},
6928 {URLZONE_INVALID
,E_NOTIMPL
}
6931 { "ml:@MSITSTORE:C:\\dir\\file.chm::/subdir/file.txt",0,
6932 "/relative/path.txt",Uri_CREATE_ALLOW_RELATIVE
,
6935 {"ml:/relative/path.txt",S_OK
},
6937 {"ml:/relative/path.txt",S_OK
},
6943 {"/relative/path.txt",S_OK
},
6944 {"/relative/path.txt",S_OK
},
6946 {"ml:/relative/path.txt",S_OK
},
6952 {Uri_HOST_UNKNOWN
,S_OK
},
6954 {URL_SCHEME_UNKNOWN
,S_OK
},
6955 {URLZONE_INVALID
,E_NOTIMPL
}
6958 { "http://winehq.org/dir/test?querystring",0,
6959 "//winehq.com/#hash",Uri_CREATE_ALLOW_RELATIVE
,
6962 {"http://winehq.com/#hash",S_OK
},
6963 {"winehq.com",S_OK
},
6964 {"http://winehq.com/#hash",S_OK
},
6965 {"winehq.com",S_OK
},
6968 {"winehq.com",S_OK
},
6973 {"http://winehq.com/#hash",S_OK
},
6979 {Uri_HOST_DNS
,S_OK
},
6980 {80,S_OK
,FALSE
,TRUE
},
6981 {URL_SCHEME_HTTP
,S_OK
},
6982 {URLZONE_INVALID
,E_NOTIMPL
}
6985 { "http://winehq.org/dir/test?querystring",0,
6986 "//winehq.com/dir2/../dir/file.txt?query#hash",Uri_CREATE_ALLOW_RELATIVE
,
6989 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
6990 {"winehq.com",S_OK
},
6991 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
6992 {"winehq.com",S_OK
},
6995 {"winehq.com",S_OK
},
6997 {"/dir/file.txt",S_OK
},
6998 {"/dir/file.txt?query",S_OK
},
7000 {"http://winehq.com/dir/file.txt?query#hash",S_OK
},
7006 {Uri_HOST_DNS
,S_OK
},
7007 {80,S_OK
,FALSE
,TRUE
},
7008 {URL_SCHEME_HTTP
,S_OK
},
7009 {URLZONE_INVALID
,E_NOTIMPL
}
7012 { "http://google.com/test",0,
7013 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
7016 {"file:///c:/test/",S_OK
},
7018 {"file:///c:/test/",S_OK
},
7027 {"c:\\test\\",S_OK
,FALSE
,"file:///c:/test/"},
7033 {Uri_HOST_UNKNOWN
,S_OK
},
7035 {URL_SCHEME_FILE
,S_OK
},
7036 {URLZONE_INVALID
,E_NOTIMPL
}
7039 { "http://google.com/test",0,
7040 "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
7043 {"file:///c:/test/",S_OK
},
7045 {"file:///c:/test/",S_OK
},
7054 {"c:\\test\\",S_OK
,FALSE
,"file:///c:/test/"},
7060 {Uri_HOST_UNKNOWN
,S_OK
},
7062 {URL_SCHEME_FILE
,S_OK
},
7063 {URLZONE_INVALID
,E_NOTIMPL
}
7066 { "http://winehq.org",0,
7067 "mailto://",Uri_CREATE_NO_CANONICALIZE
,
7081 {"mailto://",S_OK
,FALSE
,"mailto:"},
7087 {Uri_HOST_UNKNOWN
,S_OK
},
7089 {URL_SCHEME_MAILTO
,S_OK
},
7090 {URLZONE_INVALID
,E_NOTIMPL
}
7093 { "http://winehq.org",0,
7094 "mailto://a@b.com",Uri_CREATE_NO_CANONICALIZE
,
7097 {"mailto:a@b.com",S_OK
},
7099 {"mailto:a@b.com",S_OK
},
7108 {"mailto://a@b.com",S_OK
,FALSE
,"mailto:a@b.com"},
7114 {Uri_HOST_UNKNOWN
,S_OK
},
7116 {URL_SCHEME_MAILTO
,S_OK
},
7117 {URLZONE_INVALID
,E_NOTIMPL
}
7122 typedef struct _uri_parse_test
{
7127 const char *property
;
7132 static const uri_parse_test uri_parse_tests
[] = {
7133 /* PARSE_CANONICALIZE tests. */
7134 {"zip://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"zip://google.com/test<|>",S_OK
,FALSE
},
7135 {"http://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"http://google.com/test%3C%7C%3E",S_OK
,FALSE
},
7136 {"http://google.com/%30%23%3F",0,PARSE_CANONICALIZE
,URL_UNESCAPE
,"http://google.com/0#?",S_OK
,FALSE
},
7137 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_UNSAFE
,"test %3C%7C%3E",S_OK
,FALSE
},
7138 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_SPACES_ONLY
,"test%20<|>",S_OK
,FALSE
},
7139 {"test%20<|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_UNESCAPE
|URL_ESCAPE_UNSAFE
,"test%20%3C%7C%3E",S_OK
,FALSE
},
7140 {"http://google.com/%20",0,PARSE_CANONICALIZE
,URL_ESCAPE_PERCENT
,"http://google.com/%2520",S_OK
,FALSE
},
7141 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"http://google.com/test/../",S_OK
,FALSE
},
7142 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_NO_META
,"http://google.com/test/../",S_OK
,FALSE
},
7143 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"http://google.com/",S_OK
,FALSE
},
7144 {"zip://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"zip://google.com/",S_OK
,FALSE
},
7145 {"file:///c:/test/../test",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"file:///c:/test/../test",S_OK
,FALSE
},
7147 /* PARSE_FRIENDLY tests. */
7148 {"http://test@google.com/test#test",0,PARSE_FRIENDLY
,0,"http://google.com/test#test",S_OK
,FALSE
},
7149 {"zip://test@google.com/test",0,PARSE_FRIENDLY
,0,"zip://test@google.com/test",S_OK
,FALSE
},
7151 /* PARSE_ROOTDOCUMENT tests. */
7152 {"http://google.com:200/test/test",0,PARSE_ROOTDOCUMENT
,0,"http://google.com:200/",S_OK
,FALSE
},
7153 {"http://google.com",Uri_CREATE_NO_CANONICALIZE
,PARSE_ROOTDOCUMENT
,0,"http://google.com/",S_OK
,FALSE
},
7154 {"zip://google.com/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7155 {"file:///c:/testing/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7156 {"file://server/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7157 {"zip:test/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
7159 /* PARSE_DOCUMENT tests. */
7160 {"http://test@google.com/test?query#frag",0,PARSE_DOCUMENT
,0,"http://test@google.com/test?query",S_OK
,FALSE
},
7161 {"http:testing#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7162 {"file:///c:/test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7163 {"zip://google.com/#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7164 {"zip:test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7165 {"testing#frag",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
7167 /* PARSE_PATH_FROM_URL tests. */
7168 {"file:///c:/test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\test.mp3",S_OK
,FALSE
},
7169 {"file:///c:/t<|>est.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\t<|>est.mp3",S_OK
,FALSE
},
7170 {"file:///c:/te%XX t/",0,PARSE_PATH_FROM_URL
,0,"c:\\te%XX t\\",S_OK
,FALSE
},
7171 {"file://server/test",0,PARSE_PATH_FROM_URL
,0,"\\\\server\\test",S_OK
,FALSE
},
7172 {"http://google.com/",0,PARSE_PATH_FROM_URL
,0,"",E_INVALIDARG
,FALSE
},
7174 /* PARSE_URL_FROM_PATH tests. */
7175 /* This function almost seems to useless (just returns the absolute uri). */
7176 {"test.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"test.com",S_OK
,FALSE
},
7177 {"/test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"/test/test",S_OK
,FALSE
},
7178 {"file://c:\\test\\test",Uri_CREATE_FILE_USE_DOS_PATH
,PARSE_URL_FROM_PATH
,0,"file://c:\\test\\test",S_OK
,FALSE
},
7179 {"file:c:/test",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
7180 {"http:google.com/",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
7182 /* PARSE_SCHEMA tests. */
7183 {"http://google.com/test",0,PARSE_SCHEMA
,0,"http",S_OK
,FALSE
},
7184 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SCHEMA
,0,"",S_OK
,FALSE
},
7186 /* PARSE_SITE tests. */
7187 {"http://google.uk.com/",0,PARSE_SITE
,0,"google.uk.com",S_OK
,FALSE
},
7188 {"http://google.com.com/",0,PARSE_SITE
,0,"google.com.com",S_OK
,FALSE
},
7189 {"google.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SITE
,0,"",S_OK
,FALSE
},
7190 {"file://server/test",0,PARSE_SITE
,0,"server",S_OK
,FALSE
},
7192 /* PARSE_DOMAIN tests. */
7193 {"http://google.com.uk/",0,PARSE_DOMAIN
,0,"google.com.uk",S_OK
,FALSE
},
7194 {"http://google.com.com/",0,PARSE_DOMAIN
,0,"com.com",S_OK
,FALSE
},
7195 {"test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
7196 {"file://server/test",0,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
7198 /* PARSE_LOCATION and PARSE_ANCHOR tests. */
7199 {"http://google.com/test#Test",0,PARSE_ANCHOR
,0,"#Test",S_OK
,FALSE
},
7200 {"http://google.com/test#Test",0,PARSE_LOCATION
,0,"#Test",S_OK
,FALSE
},
7201 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_ANCHOR
,0,"",S_OK
,FALSE
},
7202 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_LOCATION
,0,"",S_OK
,FALSE
}
7205 static inline LPWSTR
a2w(LPCSTR str
) {
7209 DWORD len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
7210 ret
= HeapAlloc(GetProcessHeap(), 0, len
*sizeof(WCHAR
));
7211 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
7217 static inline BOOL
heap_free(void* mem
) {
7218 return HeapFree(GetProcessHeap(), 0, mem
);
7221 static inline DWORD
strcmp_aw(LPCSTR strA
, LPCWSTR strB
) {
7222 LPWSTR strAW
= a2w(strA
);
7223 DWORD ret
= lstrcmpW(strAW
, strB
);
7228 static inline ULONG
get_refcnt(IUri
*uri
) {
7230 return IUri_Release(uri
);
7233 static void change_property(IUriBuilder
*builder
, const uri_builder_property
*prop
,
7238 valueW
= a2w(prop
->value
);
7239 switch(prop
->property
) {
7240 case Uri_PROPERTY_FRAGMENT
:
7241 hr
= IUriBuilder_SetFragment(builder
, valueW
);
7244 ok(hr
== prop
->expected
,
7245 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7246 hr
, prop
->expected
, test_index
);
7249 ok(hr
== prop
->expected
,
7250 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7251 hr
, prop
->expected
, test_index
);
7254 case Uri_PROPERTY_HOST
:
7255 hr
= IUriBuilder_SetHost(builder
, valueW
);
7258 ok(hr
== prop
->expected
,
7259 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7260 hr
, prop
->expected
, test_index
);
7263 ok(hr
== prop
->expected
,
7264 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7265 hr
, prop
->expected
, test_index
);
7268 case Uri_PROPERTY_PASSWORD
:
7269 hr
= IUriBuilder_SetPassword(builder
, valueW
);
7272 ok(hr
== prop
->expected
,
7273 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7274 hr
, prop
->expected
, test_index
);
7277 ok(hr
== prop
->expected
,
7278 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7279 hr
, prop
->expected
, test_index
);
7282 case Uri_PROPERTY_PATH
:
7283 hr
= IUriBuilder_SetPath(builder
, valueW
);
7286 ok(hr
== prop
->expected
,
7287 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7288 hr
, prop
->expected
, test_index
);
7291 ok(hr
== prop
->expected
,
7292 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7293 hr
, prop
->expected
, test_index
);
7296 case Uri_PROPERTY_QUERY
:
7297 hr
= IUriBuilder_SetQuery(builder
, valueW
);
7300 ok(hr
== prop
->expected
,
7301 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7302 hr
, prop
->expected
, test_index
);
7305 ok(hr
== prop
->expected
,
7306 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7307 hr
, prop
->expected
, test_index
);
7310 case Uri_PROPERTY_SCHEME_NAME
:
7311 hr
= IUriBuilder_SetSchemeName(builder
, valueW
);
7314 ok(hr
== prop
->expected
,
7315 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7316 hr
, prop
->expected
, test_index
);
7319 ok(hr
== prop
->expected
,
7320 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7321 hr
, prop
->expected
, test_index
);
7324 case Uri_PROPERTY_USER_NAME
:
7325 hr
= IUriBuilder_SetUserName(builder
, valueW
);
7328 ok(hr
== prop
->expected
,
7329 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7330 hr
, prop
->expected
, test_index
);
7333 ok(hr
== prop
->expected
,
7334 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7335 hr
, prop
->expected
, test_index
);
7339 trace("Unsupported operation for %d on uri_builder_tests[%d].\n", prop
->property
, test_index
);
7346 * Simple tests to make sure the CreateUri function handles invalid flag combinations
7349 static void test_CreateUri_InvalidFlags(void) {
7352 for(i
= 0; i
< sizeof(invalid_flag_tests
)/sizeof(invalid_flag_tests
[0]); ++i
) {
7354 IUri
*uri
= (void*) 0xdeadbeef;
7356 hr
= pCreateUri(http_urlW
, invalid_flag_tests
[i
].flags
, 0, &uri
);
7357 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x\n",
7358 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
7359 ok(uri
== NULL
, "Error: expected the IUri to be NULL, but it was %p instead\n", uri
);
7363 static void test_CreateUri_InvalidArgs(void) {
7365 IUri
*uri
= (void*) 0xdeadbeef;
7367 const WCHAR invalidW
[] = {'i','n','v','a','l','i','d',0};
7368 static const WCHAR emptyW
[] = {0};
7370 hr
= pCreateUri(http_urlW
, 0, 0, NULL
);
7371 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
7373 hr
= pCreateUri(NULL
, 0, 0, &uri
);
7374 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
7375 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7377 uri
= (void*) 0xdeadbeef;
7378 hr
= pCreateUri(invalidW
, 0, 0, &uri
);
7379 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7380 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7382 uri
= (void*) 0xdeadbeef;
7383 hr
= pCreateUri(emptyW
, 0, 0, &uri
);
7384 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7385 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
7388 static void test_CreateUri_InvalidUri(void) {
7391 for(i
= 0; i
< sizeof(invalid_uri_tests
)/sizeof(invalid_uri_tests
[0]); ++i
) {
7392 invalid_uri test
= invalid_uri_tests
[i
];
7397 uriW
= a2w(test
.uri
);
7398 hr
= pCreateUri(uriW
, test
.flags
, 0, &uri
);
7401 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
7402 hr
, E_INVALIDARG
, i
);
7405 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
7406 hr
, E_INVALIDARG
, i
);
7408 if(uri
) IUri_Release(uri
);
7414 static void test_IUri_GetPropertyBSTR(void) {
7419 /* Make sure GetPropertyBSTR handles invalid args correctly. */
7420 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7421 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7423 BSTR received
= NULL
;
7425 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, NULL
, 0);
7426 ok(hr
== E_POINTER
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7428 /* Make sure it handles a invalid Uri_PROPERTY's correctly. */
7429 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_PORT
, &received
, 0);
7430 ok(hr
== S_OK
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7431 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
7432 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
7433 SysFreeString(received
);
7435 /* Make sure it handles the ZONE property correctly. */
7437 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_ZONE
, &received
, 0);
7438 ok(hr
== S_FALSE
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, S_FALSE
);
7439 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
7440 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
7441 SysFreeString(received
);
7443 if(uri
) IUri_Release(uri
);
7445 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7446 uri_properties test
= uri_tests
[i
];
7450 uriW
= a2w(test
.uri
);
7451 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7452 if(test
.create_todo
) {
7454 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7455 hr
, test
.create_expected
, i
);
7458 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7459 hr
, test
.create_expected
, i
);
7465 /* Checks all the string properties of the uri. */
7466 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
7467 BSTR received
= NULL
;
7468 uri_str_property prop
= test
.str_props
[j
];
7470 hr
= IUri_GetPropertyBSTR(uri
, j
, &received
, 0);
7473 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
7474 hr
, prop
.expected
, i
, j
);
7477 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7478 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
7479 prop
.value
, wine_dbgstr_w(received
), i
, j
);
7482 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
7483 hr
, prop
.expected
, i
, j
);
7484 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7485 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
7486 prop
.value
, wine_dbgstr_w(received
), i
, j
);
7489 SysFreeString(received
);
7493 if(uri
) IUri_Release(uri
);
7499 static void test_IUri_GetPropertyDWORD(void) {
7504 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7505 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7507 DWORD received
= 0xdeadbeef;
7509 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_DWORD_START
, NULL
, 0);
7510 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7512 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_ABSOLUTE_URI
, &received
, 0);
7513 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7514 ok(received
== 0, "Error: Expected received=%d but instead received=%d.\n", 0, received
);
7516 if(uri
) IUri_Release(uri
);
7518 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7519 uri_properties test
= uri_tests
[i
];
7523 uriW
= a2w(test
.uri
);
7524 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7525 if(test
.create_todo
) {
7527 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7528 hr
, test
.create_expected
, i
);
7531 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
7532 hr
, test
.create_expected
, i
);
7538 /* Checks all the DWORD properties of the uri. */
7539 for(j
= 0; j
< sizeof(test
.dword_props
)/sizeof(test
.dword_props
[0]); ++j
) {
7541 uri_dword_property prop
= test
.dword_props
[j
];
7543 hr
= IUri_GetPropertyDWORD(uri
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
7546 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
7547 hr
, prop
.expected
, i
, j
);
7550 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
7551 prop
.value
, received
, i
, j
);
7554 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
7555 hr
, prop
.expected
, i
, j
);
7556 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
7557 prop
.value
, received
, i
, j
);
7562 if(uri
) IUri_Release(uri
);
7568 /* Tests all the 'Get*' property functions which deal with strings. */
7569 static void test_IUri_GetStrProperties(void) {
7574 /* Make sure all the 'Get*' string property functions handle invalid args correctly. */
7575 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7576 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7578 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
7579 ok(hr
== E_POINTER
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7581 hr
= IUri_GetAuthority(uri
, NULL
);
7582 ok(hr
== E_POINTER
, "Error: GetAuthority returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7584 hr
= IUri_GetDisplayUri(uri
, NULL
);
7585 ok(hr
== E_POINTER
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7587 hr
= IUri_GetDomain(uri
, NULL
);
7588 ok(hr
== E_POINTER
, "Error: GetDomain returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7590 hr
= IUri_GetExtension(uri
, NULL
);
7591 ok(hr
== E_POINTER
, "Error: GetExtension returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7593 hr
= IUri_GetFragment(uri
, NULL
);
7594 ok(hr
== E_POINTER
, "Error: GetFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7596 hr
= IUri_GetHost(uri
, NULL
);
7597 ok(hr
== E_POINTER
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7599 hr
= IUri_GetPassword(uri
, NULL
);
7600 ok(hr
== E_POINTER
, "Error: GetPassword returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7602 hr
= IUri_GetPath(uri
, NULL
);
7603 ok(hr
== E_POINTER
, "Error: GetPath returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7605 hr
= IUri_GetPathAndQuery(uri
, NULL
);
7606 ok(hr
== E_POINTER
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7608 hr
= IUri_GetQuery(uri
, NULL
);
7609 ok(hr
== E_POINTER
, "Error: GetQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7611 hr
= IUri_GetRawUri(uri
, NULL
);
7612 ok(hr
== E_POINTER
, "Error: GetRawUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7614 hr
= IUri_GetSchemeName(uri
, NULL
);
7615 ok(hr
== E_POINTER
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7617 hr
= IUri_GetUserInfo(uri
, NULL
);
7618 ok(hr
== E_POINTER
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7620 hr
= IUri_GetUserName(uri
, NULL
);
7621 ok(hr
== E_POINTER
, "Error: GetUserName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7623 if(uri
) IUri_Release(uri
);
7625 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7626 uri_properties test
= uri_tests
[i
];
7630 uriW
= a2w(test
.uri
);
7631 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7632 if(test
.create_todo
) {
7634 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7635 hr
, test
.create_expected
, i
);
7638 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7639 hr
, test
.create_expected
, i
);
7643 uri_str_property prop
;
7644 BSTR received
= NULL
;
7646 /* GetAbsoluteUri() tests. */
7647 prop
= test
.str_props
[Uri_PROPERTY_ABSOLUTE_URI
];
7648 hr
= IUri_GetAbsoluteUri(uri
, &received
);
7651 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7652 hr
, prop
.expected
, i
);
7655 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7656 "Error: Expected %s but got %s on uri_tests[%d].\n",
7657 prop
.value
, wine_dbgstr_w(received
), i
);
7660 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7661 hr
, prop
.expected
, i
);
7662 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7663 "Error: Expected %s but got %s on uri_tests[%d].\n",
7664 prop
.value
, wine_dbgstr_w(received
), i
);
7666 SysFreeString(received
);
7669 /* GetAuthority() tests. */
7670 prop
= test
.str_props
[Uri_PROPERTY_AUTHORITY
];
7671 hr
= IUri_GetAuthority(uri
, &received
);
7674 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7675 hr
, prop
.expected
, i
);
7678 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7679 prop
.value
, wine_dbgstr_w(received
), i
);
7682 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7683 hr
, prop
.expected
, i
);
7684 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7685 prop
.value
, wine_dbgstr_w(received
), i
);
7687 SysFreeString(received
);
7690 /* GetDisplayUri() tests. */
7691 prop
= test
.str_props
[Uri_PROPERTY_DISPLAY_URI
];
7692 hr
= IUri_GetDisplayUri(uri
, &received
);
7695 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7696 hr
, prop
.expected
, i
);
7699 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7700 "Error: Expected %s but got %s on uri_test[%d].\n",
7701 prop
.value
, wine_dbgstr_w(received
), i
);
7704 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7705 hr
, prop
.expected
, i
);
7706 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
7707 "Error: Expected %s but got %s on uri_tests[%d].\n",
7708 prop
.value
, wine_dbgstr_w(received
), i
);
7710 SysFreeString(received
);
7713 /* GetDomain() tests. */
7714 prop
= test
.str_props
[Uri_PROPERTY_DOMAIN
];
7715 hr
= IUri_GetDomain(uri
, &received
);
7718 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7719 hr
, prop
.expected
, i
);
7722 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7723 prop
.value
, wine_dbgstr_w(received
), i
);
7726 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7727 hr
, prop
.expected
, i
);
7728 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7729 prop
.value
, wine_dbgstr_w(received
), i
);
7731 SysFreeString(received
);
7734 /* GetExtension() tests. */
7735 prop
= test
.str_props
[Uri_PROPERTY_EXTENSION
];
7736 hr
= IUri_GetExtension(uri
, &received
);
7739 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7740 hr
, prop
.expected
, i
);
7743 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7744 prop
.value
, wine_dbgstr_w(received
), i
);
7747 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7748 hr
, prop
.expected
, i
);
7749 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7750 prop
.value
, wine_dbgstr_w(received
), i
);
7752 SysFreeString(received
);
7755 /* GetFragment() tests. */
7756 prop
= test
.str_props
[Uri_PROPERTY_FRAGMENT
];
7757 hr
= IUri_GetFragment(uri
, &received
);
7760 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7761 hr
, prop
.expected
, i
);
7764 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7765 prop
.value
, wine_dbgstr_w(received
), i
);
7768 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7769 hr
, prop
.expected
, i
);
7770 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7771 prop
.value
, wine_dbgstr_w(received
), i
);
7773 SysFreeString(received
);
7776 /* GetHost() tests. */
7777 prop
= test
.str_props
[Uri_PROPERTY_HOST
];
7778 hr
= IUri_GetHost(uri
, &received
);
7781 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7782 hr
, prop
.expected
, i
);
7785 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7786 prop
.value
, wine_dbgstr_w(received
), i
);
7789 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7790 hr
, prop
.expected
, i
);
7791 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7792 prop
.value
, wine_dbgstr_w(received
), i
);
7794 SysFreeString(received
);
7797 /* GetPassword() tests. */
7798 prop
= test
.str_props
[Uri_PROPERTY_PASSWORD
];
7799 hr
= IUri_GetPassword(uri
, &received
);
7802 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7803 hr
, prop
.expected
, i
);
7806 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7807 prop
.value
, wine_dbgstr_w(received
), i
);
7810 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7811 hr
, prop
.expected
, i
);
7812 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7813 prop
.value
, wine_dbgstr_w(received
), i
);
7815 SysFreeString(received
);
7818 /* GetPath() tests. */
7819 prop
= test
.str_props
[Uri_PROPERTY_PATH
];
7820 hr
= IUri_GetPath(uri
, &received
);
7823 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7824 hr
, prop
.expected
, i
);
7827 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7828 prop
.value
, wine_dbgstr_w(received
), i
);
7831 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7832 hr
, prop
.expected
, i
);
7833 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7834 prop
.value
, wine_dbgstr_w(received
), i
);
7836 SysFreeString(received
);
7839 /* GetPathAndQuery() tests. */
7840 prop
= test
.str_props
[Uri_PROPERTY_PATH_AND_QUERY
];
7841 hr
= IUri_GetPathAndQuery(uri
, &received
);
7844 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7845 hr
, prop
.expected
, i
);
7848 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7849 prop
.value
, wine_dbgstr_w(received
), i
);
7852 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7853 hr
, prop
.expected
, i
);
7854 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7855 prop
.value
, wine_dbgstr_w(received
), i
);
7857 SysFreeString(received
);
7860 /* GetQuery() tests. */
7861 prop
= test
.str_props
[Uri_PROPERTY_QUERY
];
7862 hr
= IUri_GetQuery(uri
, &received
);
7865 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7866 hr
, prop
.expected
, i
);
7869 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7870 prop
.value
, wine_dbgstr_w(received
), i
);
7873 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7874 hr
, prop
.expected
, i
);
7875 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7876 prop
.value
, wine_dbgstr_w(received
), i
);
7878 SysFreeString(received
);
7881 /* GetRawUri() tests. */
7882 prop
= test
.str_props
[Uri_PROPERTY_RAW_URI
];
7883 hr
= IUri_GetRawUri(uri
, &received
);
7886 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7887 hr
, prop
.expected
, i
);
7890 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7891 prop
.value
, wine_dbgstr_w(received
), i
);
7894 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7895 hr
, prop
.expected
, i
);
7896 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7897 prop
.value
, wine_dbgstr_w(received
), i
);
7899 SysFreeString(received
);
7902 /* GetSchemeName() tests. */
7903 prop
= test
.str_props
[Uri_PROPERTY_SCHEME_NAME
];
7904 hr
= IUri_GetSchemeName(uri
, &received
);
7907 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7908 hr
, prop
.expected
, i
);
7911 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7912 prop
.value
, wine_dbgstr_w(received
), i
);
7915 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7916 hr
, prop
.expected
, i
);
7917 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7918 prop
.value
, wine_dbgstr_w(received
), i
);
7920 SysFreeString(received
);
7923 /* GetUserInfo() tests. */
7924 prop
= test
.str_props
[Uri_PROPERTY_USER_INFO
];
7925 hr
= IUri_GetUserInfo(uri
, &received
);
7928 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7929 hr
, prop
.expected
, i
);
7932 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7933 prop
.value
, wine_dbgstr_w(received
), i
);
7936 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7937 hr
, prop
.expected
, i
);
7938 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7939 prop
.value
, wine_dbgstr_w(received
), i
);
7941 SysFreeString(received
);
7944 /* GetUserName() tests. */
7945 prop
= test
.str_props
[Uri_PROPERTY_USER_NAME
];
7946 hr
= IUri_GetUserName(uri
, &received
);
7949 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7950 hr
, prop
.expected
, i
);
7953 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7954 prop
.value
, wine_dbgstr_w(received
), i
);
7957 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7958 hr
, prop
.expected
, i
);
7959 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7960 prop
.value
, wine_dbgstr_w(received
), i
);
7962 SysFreeString(received
);
7965 if(uri
) IUri_Release(uri
);
7971 static void test_IUri_GetDwordProperties(void) {
7976 /* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
7977 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7978 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7980 hr
= IUri_GetHostType(uri
, NULL
);
7981 ok(hr
== E_INVALIDARG
, "Error: GetHostType returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7983 hr
= IUri_GetPort(uri
, NULL
);
7984 ok(hr
== E_INVALIDARG
, "Error: GetPort returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7986 hr
= IUri_GetScheme(uri
, NULL
);
7987 ok(hr
== E_INVALIDARG
, "Error: GetScheme returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7989 hr
= IUri_GetZone(uri
, NULL
);
7990 ok(hr
== E_INVALIDARG
, "Error: GetZone returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7992 if(uri
) IUri_Release(uri
);
7994 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7995 uri_properties test
= uri_tests
[i
];
7999 uriW
= a2w(test
.uri
);
8000 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8001 if(test
.create_todo
) {
8003 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8004 hr
, test
.create_expected
, i
);
8007 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8008 hr
, test
.create_expected
, i
);
8012 uri_dword_property prop
;
8015 /* Assign an insane value so tests don't accidentally pass when
8018 received
= -9999999;
8020 /* GetHostType() tests. */
8021 prop
= test
.dword_props
[Uri_PROPERTY_HOST_TYPE
-Uri_PROPERTY_DWORD_START
];
8022 hr
= IUri_GetHostType(uri
, &received
);
8025 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8026 hr
, prop
.expected
, i
);
8029 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8032 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8033 hr
, prop
.expected
, i
);
8034 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8036 received
= -9999999;
8038 /* GetPort() tests. */
8039 prop
= test
.dword_props
[Uri_PROPERTY_PORT
-Uri_PROPERTY_DWORD_START
];
8040 hr
= IUri_GetPort(uri
, &received
);
8043 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8044 hr
, prop
.expected
, i
);
8047 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8050 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8051 hr
, prop
.expected
, i
);
8052 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8054 received
= -9999999;
8056 /* GetScheme() tests. */
8057 prop
= test
.dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
];
8058 hr
= IUri_GetScheme(uri
, &received
);
8061 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8062 hr
, prop
.expected
, i
);
8065 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8068 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8069 hr
, prop
.expected
, i
);
8070 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8072 received
= -9999999;
8074 /* GetZone() tests. */
8075 prop
= test
.dword_props
[Uri_PROPERTY_ZONE
-Uri_PROPERTY_DWORD_START
];
8076 hr
= IUri_GetZone(uri
, &received
);
8079 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8080 hr
, prop
.expected
, i
);
8083 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8086 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8087 hr
, prop
.expected
, i
);
8088 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
8092 if(uri
) IUri_Release(uri
);
8098 static void test_IUri_GetPropertyLength(void) {
8103 /* Make sure it handles invalid args correctly. */
8104 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8105 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8107 DWORD received
= 0xdeadbeef;
8109 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_STRING_START
, NULL
, 0);
8110 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8112 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_DWORD_START
, &received
, 0);
8113 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength return 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8114 ok(received
== 0xdeadbeef, "Error: Expected 0xdeadbeef but got 0x%08x.\n", received
);
8116 if(uri
) IUri_Release(uri
);
8118 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
8119 uri_properties test
= uri_tests
[i
];
8123 uriW
= a2w(test
.uri
);
8124 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8125 if(test
.create_todo
) {
8127 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
8128 hr
, test
.create_expected
, i
);
8131 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_test[%d].\n",
8132 hr
, test
.create_expected
, i
);
8138 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
8139 DWORD expectedLen
, brokenLen
, receivedLen
;
8140 uri_str_property prop
= test
.str_props
[j
];
8142 expectedLen
= lstrlen(prop
.value
);
8143 brokenLen
= lstrlen(prop
.broken_value
);
8145 /* This won't be necessary once GetPropertyLength is implemented. */
8148 hr
= IUri_GetPropertyLength(uri
, j
, &receivedLen
, 0);
8151 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
8152 hr
, prop
.expected
, i
, j
);
8155 ok(receivedLen
== expectedLen
|| broken(receivedLen
== brokenLen
),
8156 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
8157 expectedLen
, receivedLen
, i
, j
);
8160 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
8161 hr
, prop
.expected
, i
, j
);
8162 ok(receivedLen
== expectedLen
|| broken(receivedLen
== brokenLen
),
8163 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
8164 expectedLen
, receivedLen
, i
, j
);
8169 if(uri
) IUri_Release(uri
);
8175 static DWORD
compute_expected_props(uri_properties
*test
)
8179 for(i
=Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_STRING_LAST
; i
++) {
8180 if(test
->str_props
[i
-Uri_PROPERTY_STRING_START
].expected
== S_OK
)
8184 for(i
=Uri_PROPERTY_DWORD_START
; i
<= Uri_PROPERTY_DWORD_LAST
; i
++) {
8185 if(test
->dword_props
[i
-Uri_PROPERTY_DWORD_START
].expected
== S_OK
)
8192 static void test_IUri_GetProperties(void) {
8197 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8198 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8200 hr
= IUri_GetProperties(uri
, NULL
);
8201 ok(hr
== E_INVALIDARG
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8203 if(uri
) IUri_Release(uri
);
8205 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
8206 uri_properties test
= uri_tests
[i
];
8210 uriW
= a2w(test
.uri
);
8211 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8212 if(test
.create_todo
) {
8214 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8217 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8221 DWORD received
= 0, expected_props
;
8224 hr
= IUri_GetProperties(uri
, &received
);
8225 ok(hr
== S_OK
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8227 expected_props
= compute_expected_props(&test
);
8229 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
8230 /* (1 << j) converts a Uri_PROPERTY to its corresponding Uri_HAS_* flag mask. */
8231 if(expected_props
& (1 << j
))
8232 ok(received
& (1 << j
), "Error: Expected flag for property %d on uri_tests[%d].\n", j
, i
);
8234 ok(!(received
& (1 << j
)), "Error: Received flag for property %d when not expected on uri_tests[%d].\n", j
, i
);
8238 if(uri
) IUri_Release(uri
);
8244 static void test_IUri_HasProperty(void) {
8249 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8250 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8252 hr
= IUri_HasProperty(uri
, Uri_PROPERTY_RAW_URI
, NULL
);
8253 ok(hr
== E_INVALIDARG
, "Error: HasProperty returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8255 if(uri
) IUri_Release(uri
);
8257 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
8258 uri_properties test
= uri_tests
[i
];
8262 uriW
= a2w(test
.uri
);
8264 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
8265 if(test
.create_todo
) {
8267 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8270 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
8274 DWORD expected_props
, j
;
8276 expected_props
= compute_expected_props(&test
);
8278 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
8279 /* Assign -1, then explicitly test for TRUE or FALSE later. */
8282 hr
= IUri_HasProperty(uri
, j
, &received
);
8283 ok(hr
== S_OK
, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
8286 if(expected_props
& (1 << j
)) {
8287 ok(received
== TRUE
, "Error: Expected to have property %d on uri_tests[%d].\n", j
, i
);
8289 ok(received
== FALSE
, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j
, i
);
8294 if(uri
) IUri_Release(uri
);
8300 static void test_IUri_IsEqual(void) {
8308 /* Make sure IsEqual handles invalid args correctly. */
8309 hres
= pCreateUri(http_urlW
, 0, 0, &uriA
);
8310 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8311 hres
= pCreateUri(http_urlW
, 0, 0, &uriB
);
8312 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8315 hres
= IUri_IsEqual(uriA
, NULL
, &equal
);
8316 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hres
, S_OK
);
8317 ok(!equal
, "Error: Expected equal to be FALSE, but was %d instead.\n", equal
);
8319 hres
= IUri_IsEqual(uriA
, uriB
, NULL
);
8320 ok(hres
== E_POINTER
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hres
, E_POINTER
);
8325 for(i
= 0; i
< sizeof(equality_tests
)/sizeof(equality_tests
[0]); ++i
) {
8326 uri_equality test
= equality_tests
[i
];
8327 LPWSTR uriA_W
, uriB_W
;
8331 uriA_W
= a2w(test
.a
);
8332 uriB_W
= a2w(test
.b
);
8334 hres
= pCreateUri(uriA_W
, test
.create_flags_a
, 0, &uriA
);
8335 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n", hres
, S_OK
, i
);
8337 hres
= pCreateUri(uriB_W
, test
.create_flags_b
, 0, &uriB
);
8338 ok(hres
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n", hres
, S_OK
, i
);
8341 hres
= IUri_IsEqual(uriA
, uriB
, &equal
);
8342 if(test
.todo
) todo_wine
{
8343 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hres
, S_OK
, i
);
8344 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
8346 ok(hres
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hres
, S_OK
, i
);
8347 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
8349 if(uriA
) IUri_Release(uriA
);
8350 if(uriB
) IUri_Release(uriB
);
8357 static void test_CreateUriWithFragment_InvalidArgs(void) {
8359 IUri
*uri
= (void*) 0xdeadbeef;
8360 const WCHAR fragmentW
[] = {'#','f','r','a','g','m','e','n','t',0};
8362 hr
= pCreateUriWithFragment(NULL
, fragmentW
, 0, 0, &uri
);
8363 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8364 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8366 hr
= pCreateUriWithFragment(http_urlW
, fragmentW
, 0, 0, NULL
);
8367 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8369 /* Original URI can't already contain a fragment component. */
8370 uri
= (void*) 0xdeadbeef;
8371 hr
= pCreateUriWithFragment(http_url_fragW
, fragmentW
, 0, 0, &uri
);
8372 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
8373 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8376 /* CreateUriWithFragment has the same invalid flag combinations as CreateUri. */
8377 static void test_CreateUriWithFragment_InvalidFlags(void) {
8380 for(i
= 0; i
< sizeof(invalid_flag_tests
)/sizeof(invalid_flag_tests
[0]); ++i
) {
8382 IUri
*uri
= (void*) 0xdeadbeef;
8384 hr
= pCreateUriWithFragment(http_urlW
, NULL
, invalid_flag_tests
[i
].flags
, 0, &uri
);
8385 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x. flags=0x%08x.\n",
8386 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
8387 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8391 static void test_CreateUriWithFragment(void) {
8394 for(i
= 0; i
< sizeof(uri_fragment_tests
)/sizeof(uri_fragment_tests
[0]); ++i
) {
8398 uri_with_fragment test
= uri_fragment_tests
[i
];
8400 uriW
= a2w(test
.uri
);
8401 fragW
= a2w(test
.fragment
);
8403 hr
= pCreateUriWithFragment(uriW
, fragW
, test
.create_flags
, 0, &uri
);
8404 if(test
.expected_todo
) {
8406 ok(hr
== test
.create_expected
,
8407 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8408 hr
, test
.create_expected
, i
);
8411 ok(hr
== test
.create_expected
,
8412 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8413 hr
, test
.create_expected
, i
);
8416 BSTR received
= NULL
;
8418 hr
= IUri_GetAbsoluteUri(uri
, &received
);
8419 if(test
.expected_todo
) {
8422 "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8426 ok(!strcmp_aw(test
.expected_uri
, received
),
8427 "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
8428 test
.expected_uri
, wine_dbgstr_w(received
), i
);
8431 ok(hr
== S_OK
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
8433 ok(!strcmp_aw(test
.expected_uri
, received
), "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
8434 test
.expected_uri
, wine_dbgstr_w(received
), i
);
8437 SysFreeString(received
);
8440 if(uri
) IUri_Release(uri
);
8446 static void test_CreateIUriBuilder(void) {
8448 IUriBuilder
*builder
= NULL
;
8451 hr
= pCreateIUriBuilder(NULL
, 0, 0, NULL
);
8452 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x\n",
8455 /* CreateIUriBuilder increases the ref count of the IUri it receives. */
8456 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
8457 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8459 ULONG cur_count
, orig_count
;
8461 orig_count
= get_refcnt(uri
);
8462 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
8463 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8464 ok(builder
!= NULL
, "Error: Expecting builder not to be NULL\n");
8466 cur_count
= get_refcnt(uri
);
8467 ok(cur_count
== orig_count
+1, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
+1, cur_count
);
8469 if(builder
) IUriBuilder_Release(builder
);
8470 cur_count
= get_refcnt(uri
);
8471 ok(cur_count
== orig_count
, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
, cur_count
);
8473 if(uri
) IUri_Release(uri
);
8476 static void test_IUriBuilder_CreateUri(IUriBuilder
*builder
, const uri_builder_test
*test
,
8481 hr
= IUriBuilder_CreateUri(builder
, test
->uri_flags
, 0, 0, &uri
);
8482 if(test
->uri_todo
) {
8484 ok(hr
== test
->uri_hres
,
8485 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8486 hr
, test
->uri_hres
, test_index
);
8489 ok(hr
== test
->uri_hres
,
8490 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8491 hr
, test
->uri_hres
, test_index
);
8497 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
8498 uri_builder_str_property prop
= test
->expected_str_props
[i
];
8499 BSTR received
= NULL
;
8501 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
8504 ok(hr
== prop
.result
,
8505 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8506 hr
, prop
.result
, test_index
, i
);
8509 ok(hr
== prop
.result
,
8510 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8511 hr
, prop
.result
, test_index
, i
);
8516 ok(!strcmp_aw(prop
.expected
, received
),
8517 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8518 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8521 ok(!strcmp_aw(prop
.expected
, received
),
8522 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8523 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8526 SysFreeString(received
);
8529 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
8530 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
8531 DWORD received
= -2;
8533 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
8536 ok(hr
== prop
.result
,
8537 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8538 hr
, prop
.result
, test_index
, i
);
8541 ok(hr
== prop
.result
,
8542 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8543 hr
, prop
.result
, test_index
, i
);
8548 ok(received
== prop
.expected
,
8549 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8550 prop
.expected
, received
, test_index
, i
);
8553 ok(received
== prop
.expected
,
8554 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8555 prop
.expected
, received
, test_index
, i
);
8560 if(uri
) IUri_Release(uri
);
8563 static void test_IUriBuilder_CreateUriSimple(IUriBuilder
*builder
, const uri_builder_test
*test
,
8568 hr
= IUriBuilder_CreateUriSimple(builder
, test
->uri_simple_encode_flags
, 0, &uri
);
8569 if(test
->uri_simple_todo
) {
8571 ok(hr
== test
->uri_simple_hres
,
8572 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8573 hr
, test
->uri_simple_hres
, test_index
);
8576 ok(hr
== test
->uri_simple_hres
,
8577 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8578 hr
, test
->uri_simple_hres
, test_index
);
8584 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
8585 uri_builder_str_property prop
= test
->expected_str_props
[i
];
8586 BSTR received
= NULL
;
8588 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
8591 ok(hr
== prop
.result
,
8592 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8593 hr
, prop
.result
, test_index
, i
);
8596 ok(hr
== prop
.result
,
8597 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8598 hr
, prop
.result
, test_index
, i
);
8603 ok(!strcmp_aw(prop
.expected
, received
),
8604 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8605 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8608 ok(!strcmp_aw(prop
.expected
, received
),
8609 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8610 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8613 SysFreeString(received
);
8616 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
8617 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
8618 DWORD received
= -2;
8620 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
8623 ok(hr
== prop
.result
,
8624 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8625 hr
, prop
.result
, test_index
, i
);
8628 ok(hr
== prop
.result
,
8629 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8630 hr
, prop
.result
, test_index
, i
);
8635 ok(received
== prop
.expected
,
8636 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8637 prop
.expected
, received
, test_index
, i
);
8640 ok(received
== prop
.expected
,
8641 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8642 prop
.expected
, received
, test_index
, i
);
8647 if(uri
) IUri_Release(uri
);
8650 static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder
*builder
, const uri_builder_test
*test
,
8655 hr
= IUriBuilder_CreateUriWithFlags(builder
, test
->uri_with_flags
, test
->uri_with_builder_flags
,
8656 test
->uri_with_encode_flags
, 0, &uri
);
8657 if(test
->uri_with_todo
) {
8659 ok(hr
== test
->uri_with_hres
,
8660 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8661 hr
, test
->uri_with_hres
, test_index
);
8664 ok(hr
== test
->uri_with_hres
,
8665 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8666 hr
, test
->uri_with_hres
, test_index
);
8672 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
8673 uri_builder_str_property prop
= test
->expected_str_props
[i
];
8674 BSTR received
= NULL
;
8676 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
8679 ok(hr
== prop
.result
,
8680 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8681 hr
, prop
.result
, test_index
, i
);
8684 ok(hr
== prop
.result
,
8685 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
8686 hr
, prop
.result
, test_index
, i
);
8691 ok(!strcmp_aw(prop
.expected
, received
),
8692 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8693 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8696 ok(!strcmp_aw(prop
.expected
, received
),
8697 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
8698 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
8701 SysFreeString(received
);
8704 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
8705 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
8706 DWORD received
= -2;
8708 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
8711 ok(hr
== prop
.result
,
8712 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8713 hr
, prop
.result
, test_index
, i
);
8716 ok(hr
== prop
.result
,
8717 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
8718 hr
, prop
.result
, test_index
, i
);
8723 ok(received
== prop
.expected
,
8724 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8725 prop
.expected
, received
, test_index
, i
);
8728 ok(received
== prop
.expected
,
8729 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
8730 prop
.expected
, received
, test_index
, i
);
8735 if(uri
) IUri_Release(uri
);
8738 static void test_IUriBuilder_CreateInvalidArgs(void) {
8739 IUriBuilder
*builder
;
8742 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
8743 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8745 IUri
*test
= NULL
, *uri
= (void*) 0xdeadbeef;
8747 /* Test what happens if the IUriBuilder doesn't have a IUri set. */
8748 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, NULL
);
8749 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
8751 uri
= (void*) 0xdeadbeef;
8752 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8753 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_NOTIMPL
);
8754 ok(uri
== NULL
, "Error: expected uri to be NULL, but was %p instead.\n", uri
);
8756 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, NULL
);
8757 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8760 uri
= (void*) 0xdeadbeef;
8761 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
8762 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8764 ok(!uri
, "Error: Expected uri to NULL, but was %p instead.\n", uri
);
8766 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, NULL
);
8767 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8770 uri
= (void*) 0xdeadbeef;
8771 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8772 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8774 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8776 hr
= pCreateUri(http_urlW
, 0, 0, &test
);
8777 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8779 hr
= IUriBuilder_SetIUri(builder
, test
);
8780 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8782 /* No longer returns E_NOTIMPL, since a IUri has been set and hasn't been modified. */
8784 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8785 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8786 ok(uri
!= NULL
, "Error: The uri was NULL.\n");
8787 if(uri
) IUri_Release(uri
);
8790 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
8791 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8793 ok(uri
!= NULL
, "Error: uri was NULL.\n");
8794 if(uri
) IUri_Release(uri
);
8797 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &uri
);
8798 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8800 ok(uri
!= NULL
, "Error: uri was NULL.\n");
8801 if(uri
) IUri_Release(uri
);
8803 hr
= IUriBuilder_SetFragment(builder
, NULL
);
8804 ok(hr
== S_OK
, "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8806 /* The IUriBuilder is changed, so it returns E_NOTIMPL again. */
8807 uri
= (void*) 0xdeadbeef;
8808 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8809 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8810 ok(!uri
, "Error: Expected uri to be NULL but was %p instead.\n", uri
);
8812 uri
= (void*) 0xdeadbeef;
8813 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
8814 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8816 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8818 uri
= (void*) 0xdeadbeef;
8819 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8820 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8822 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8824 if(test
) IUri_Release(test
);
8826 if(builder
) IUriBuilder_Release(builder
);
8829 /* Tests invalid args to the "Get*" functions. */
8830 static void test_IUriBuilder_GetInvalidArgs(void) {
8831 IUriBuilder
*builder
= NULL
;
8834 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
8835 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8837 LPCWSTR received
= (void*) 0xdeadbeef;
8838 DWORD len
= -1, port
= -1;
8841 hr
= IUriBuilder_GetFragment(builder
, NULL
, NULL
);
8842 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8844 hr
= IUriBuilder_GetFragment(builder
, NULL
, &received
);
8845 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8847 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8848 hr
= IUriBuilder_GetFragment(builder
, &len
, NULL
);
8849 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8851 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8853 hr
= IUriBuilder_GetHost(builder
, NULL
, NULL
);
8854 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8856 received
= (void*) 0xdeadbeef;
8857 hr
= IUriBuilder_GetHost(builder
, NULL
, &received
);
8858 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8860 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8862 hr
= IUriBuilder_GetHost(builder
, &len
, NULL
);
8863 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8865 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8867 hr
= IUriBuilder_GetPassword(builder
, NULL
, NULL
);
8868 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8870 received
= (void*) 0xdeadbeef;
8871 hr
= IUriBuilder_GetPassword(builder
, NULL
, &received
);
8872 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8874 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8876 hr
= IUriBuilder_GetPassword(builder
, &len
, NULL
);
8877 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8879 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8881 hr
= IUriBuilder_GetPath(builder
, NULL
, NULL
);
8882 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8884 received
= (void*) 0xdeadbeef;
8885 hr
= IUriBuilder_GetPath(builder
, NULL
, &received
);
8886 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8888 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8890 hr
= IUriBuilder_GetPath(builder
, &len
, NULL
);
8891 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8893 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8895 hr
= IUriBuilder_GetPort(builder
, NULL
, NULL
);
8896 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8898 hr
= IUriBuilder_GetPort(builder
, NULL
, &port
);
8899 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8901 ok(!port
, "Error: Expected port to be 0, but was %d instead.\n", port
);
8902 hr
= IUriBuilder_GetPort(builder
, &set
, NULL
);
8903 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8905 ok(!set
, "Error: Expected set to be FALSE, but was %d instead.\n", set
);
8907 hr
= IUriBuilder_GetQuery(builder
, NULL
, NULL
);
8908 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8910 received
= (void*) 0xdeadbeef;
8911 hr
= IUriBuilder_GetQuery(builder
, NULL
, &received
);
8912 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8914 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8916 hr
= IUriBuilder_GetQuery(builder
, &len
, NULL
);
8917 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8919 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8921 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, NULL
);
8922 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8924 received
= (void*) 0xdeadbeef;
8925 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, &received
);
8926 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8928 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8930 hr
= IUriBuilder_GetSchemeName(builder
, &len
, NULL
);
8931 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8933 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8935 hr
= IUriBuilder_GetUserName(builder
, NULL
, NULL
);
8936 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8938 received
= (void*) 0xdeadbeef;
8939 hr
= IUriBuilder_GetUserName(builder
, NULL
, &received
);
8940 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8942 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8944 hr
= IUriBuilder_GetUserName(builder
, &len
, NULL
);
8945 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8947 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8949 if(builder
) IUriBuilder_Release(builder
);
8952 static void test_IUriBuilder_GetFragment(IUriBuilder
*builder
, const uri_builder_test
*test
,
8956 LPCWSTR received
= NULL
;
8958 const uri_builder_property
*prop
= NULL
;
8960 /* Check if the property was set earlier. */
8961 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
8962 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_FRAGMENT
)
8963 prop
= &(test
->properties
[i
]);
8967 /* Use expected_value unless it's NULL, then use value. */
8968 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
8969 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
8972 ok(hr
== (expected
? S_OK
: S_FALSE
),
8973 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8974 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8978 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8979 expected
, wine_dbgstr_w(received
), test_index
);
8982 ok(lstrlen(expected
) == len
,
8983 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8984 lstrlen(expected
), len
, test_index
);
8988 ok(hr
== (expected
? S_OK
: S_FALSE
),
8989 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8990 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8991 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8992 expected
, wine_dbgstr_w(received
), test_index
);
8993 ok(lstrlen(expected
) == len
,
8994 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8995 lstrlen(expected
), len
, test_index
);
8998 /* The property wasn't set earlier, so it should return whatever
8999 * the base IUri contains (if anything).
9002 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9004 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9005 hr
, S_OK
, test_index
);
9008 received
= (void*) 0xdeadbeef;
9011 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9013 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9014 hr
, S_FALSE
, test_index
);
9016 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9018 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9019 received
, test_index
);
9022 BOOL has_prop
= FALSE
;
9023 BSTR expected
= NULL
;
9025 hr
= IUri_GetFragment(uri
, &expected
);
9027 "Error: Expected IUri_GetFragment to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9029 has_prop
= hr
== S_OK
;
9031 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
9034 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9035 hr
, S_OK
, test_index
);
9037 ok(!lstrcmpW(expected
, received
),
9038 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9039 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9040 ok(lstrlenW(expected
) == len
,
9041 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9042 lstrlenW(expected
), len
, test_index
);
9046 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9047 hr
, S_FALSE
, test_index
);
9049 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9050 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9054 SysFreeString(expected
);
9057 if(uri
) IUri_Release(uri
);
9061 static void test_IUriBuilder_GetHost(IUriBuilder
*builder
, const uri_builder_test
*test
,
9065 LPCWSTR received
= NULL
;
9067 const uri_builder_property
*prop
= NULL
;
9069 /* Check if the property was set earlier. */
9070 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9071 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_HOST
)
9072 prop
= &(test
->properties
[i
]);
9076 /* Use expected_value unless it's NULL, then use value. */
9077 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9078 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9081 ok(hr
== (expected
? S_OK
: S_FALSE
),
9082 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9083 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9087 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9088 expected
, wine_dbgstr_w(received
), test_index
);
9091 ok(lstrlen(expected
) == len
,
9092 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9093 lstrlen(expected
), len
, test_index
);
9097 ok(hr
== (expected
? S_OK
: S_FALSE
),
9098 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9099 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9100 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9101 expected
, wine_dbgstr_w(received
), test_index
);
9102 ok(lstrlen(expected
) == len
,
9103 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9104 lstrlen(expected
), len
, test_index
);
9107 /* The property wasn't set earlier, so it should return whatever
9108 * the base IUri contains (if anything).
9111 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9113 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9114 hr
, S_OK
, test_index
);
9117 received
= (void*) 0xdeadbeef;
9120 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9122 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9123 hr
, S_FALSE
, test_index
);
9125 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9127 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9128 received
, test_index
);
9131 BOOL has_prop
= FALSE
;
9132 BSTR expected
= NULL
;
9134 hr
= IUri_GetHost(uri
, &expected
);
9136 "Error: Expected IUri_GetHost to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9138 has_prop
= hr
== S_OK
;
9140 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
9143 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9144 hr
, S_OK
, test_index
);
9146 ok(!lstrcmpW(expected
, received
),
9147 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9148 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9149 ok(lstrlenW(expected
) == len
,
9150 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9151 lstrlenW(expected
), len
, test_index
);
9155 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9156 hr
, S_FALSE
, test_index
);
9158 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9159 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9163 SysFreeString(expected
);
9166 if(uri
) IUri_Release(uri
);
9170 static void test_IUriBuilder_GetPassword(IUriBuilder
*builder
, const uri_builder_test
*test
,
9174 LPCWSTR received
= NULL
;
9176 const uri_builder_property
*prop
= NULL
;
9178 /* Check if the property was set earlier. */
9179 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9180 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PASSWORD
)
9181 prop
= &(test
->properties
[i
]);
9185 /* Use expected_value unless it's NULL, then use value. */
9186 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9187 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9190 ok(hr
== (expected
? S_OK
: S_FALSE
),
9191 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9192 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9196 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9197 expected
, wine_dbgstr_w(received
), test_index
);
9200 ok(lstrlen(expected
) == len
,
9201 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9202 lstrlen(expected
), len
, test_index
);
9206 ok(hr
== (expected
? S_OK
: S_FALSE
),
9207 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9208 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9209 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9210 expected
, wine_dbgstr_w(received
), test_index
);
9211 ok(lstrlen(expected
) == len
,
9212 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9213 lstrlen(expected
), len
, test_index
);
9216 /* The property wasn't set earlier, so it should return whatever
9217 * the base IUri contains (if anything).
9220 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9222 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9223 hr
, S_OK
, test_index
);
9226 received
= (void*) 0xdeadbeef;
9229 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9231 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9232 hr
, S_FALSE
, test_index
);
9234 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9236 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9237 received
, test_index
);
9240 BOOL has_prop
= FALSE
;
9241 BSTR expected
= NULL
;
9243 hr
= IUri_GetPassword(uri
, &expected
);
9245 "Error: Expected IUri_GetPassword to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9247 has_prop
= hr
== S_OK
;
9249 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
9252 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9253 hr
, S_OK
, test_index
);
9255 ok(!lstrcmpW(expected
, received
),
9256 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9257 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9258 ok(lstrlenW(expected
) == len
,
9259 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9260 lstrlenW(expected
), len
, test_index
);
9264 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9265 hr
, S_FALSE
, test_index
);
9267 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9268 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9272 SysFreeString(expected
);
9275 if(uri
) IUri_Release(uri
);
9279 static void test_IUriBuilder_GetPath(IUriBuilder
*builder
, const uri_builder_test
*test
,
9283 LPCWSTR received
= NULL
;
9285 const uri_builder_property
*prop
= NULL
;
9287 /* Check if the property was set earlier. */
9288 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9289 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PATH
)
9290 prop
= &(test
->properties
[i
]);
9294 /* Use expected_value unless it's NULL, then use value. */
9295 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9296 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9299 ok(hr
== (expected
? S_OK
: S_FALSE
),
9300 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9301 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9305 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9306 expected
, wine_dbgstr_w(received
), test_index
);
9309 ok(lstrlen(expected
) == len
,
9310 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9311 lstrlen(expected
), len
, test_index
);
9315 ok(hr
== (expected
? S_OK
: S_FALSE
),
9316 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9317 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9318 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9319 expected
, wine_dbgstr_w(received
), test_index
);
9320 ok(lstrlen(expected
) == len
,
9321 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9322 lstrlen(expected
), len
, test_index
);
9325 /* The property wasn't set earlier, so it should return whatever
9326 * the base IUri contains (if anything).
9329 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9331 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9332 hr
, S_OK
, test_index
);
9335 received
= (void*) 0xdeadbeef;
9338 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9340 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9341 hr
, S_FALSE
, test_index
);
9343 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9345 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9346 received
, test_index
);
9349 BOOL has_prop
= FALSE
;
9350 BSTR expected
= NULL
;
9352 hr
= IUri_GetPath(uri
, &expected
);
9354 "Error: Expected IUri_GetPath to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9356 has_prop
= hr
== S_OK
;
9358 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
9361 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9362 hr
, S_OK
, test_index
);
9364 ok(!lstrcmpW(expected
, received
),
9365 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9366 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9367 ok(lstrlenW(expected
) == len
,
9368 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9369 lstrlenW(expected
), len
, test_index
);
9373 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9374 hr
, S_FALSE
, test_index
);
9376 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9377 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9381 SysFreeString(expected
);
9384 if(uri
) IUri_Release(uri
);
9388 static void test_IUriBuilder_GetPort(IUriBuilder
*builder
, const uri_builder_test
*test
,
9391 BOOL has_port
= FALSE
;
9392 DWORD received
= -1;
9394 if(test
->port_prop
.change
) {
9395 DWORD expected
= test
->port_prop
.value
;
9397 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9398 if(test
->port_prop
.todo
) {
9401 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9402 hr
, S_OK
, test_index
);
9406 ok(has_port
== test
->port_prop
.set
,
9407 "Error: Expected has_port to be %d but was %d instead on uri_builder_tests[%d].\n",
9408 test
->port_prop
.set
, has_port
, test_index
);
9411 ok(received
== expected
,
9412 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
9413 expected
, received
, test_index
);
9418 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9419 hr
, S_OK
, test_index
);
9420 ok(has_port
== test
->port_prop
.set
,
9421 "Error: Expected has_port to be %d, but was %d instead on uri_builder_tests[%d].\n",
9422 test
->port_prop
.set
, has_port
, test_index
);
9423 ok(received
== test
->port_prop
.value
,
9424 "Error: Expected port to be %d, but was %d instead on uri_builder_tests[%d].\n",
9425 test
->port_prop
.value
, received
, test_index
);
9430 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9432 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9433 hr
, S_OK
, test_index
);
9436 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9438 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9439 hr
, S_OK
, test_index
);
9441 ok(has_port
== FALSE
,
9442 "Error: Expected has_port to be FALSE, but was %d instead on uri_builder_tests[%d].\n",
9443 has_port
, test_index
);
9444 ok(!received
, "Error: Expected received to be 0, but was %d instead on uri_builder_tests[%d].\n",
9445 received
, test_index
);
9450 hr
= IUri_GetPort(uri
, &expected
);
9452 "Error: Expected IUri_Port to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9455 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
9457 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9458 hr
, S_OK
, test_index
);
9461 "Error: Expected has_port to be FALSE but was TRUE instead on uri_builder_tests[%d].\n",
9463 ok(received
== expected
,
9464 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
9465 expected
, received
, test_index
);
9469 if(uri
) IUri_Release(uri
);
9473 static void test_IUriBuilder_GetQuery(IUriBuilder
*builder
, const uri_builder_test
*test
,
9477 LPCWSTR received
= NULL
;
9479 const uri_builder_property
*prop
= NULL
;
9481 /* Check if the property was set earlier. */
9482 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9483 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_QUERY
)
9484 prop
= &(test
->properties
[i
]);
9488 /* Use expected_value unless it's NULL, then use value. */
9489 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9490 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9493 ok(hr
== (expected
? S_OK
: S_FALSE
),
9494 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9495 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9499 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9500 expected
, wine_dbgstr_w(received
), test_index
);
9503 ok(lstrlen(expected
) == len
,
9504 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9505 lstrlen(expected
), len
, test_index
);
9509 ok(hr
== (expected
? S_OK
: S_FALSE
),
9510 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9511 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9512 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9513 expected
, wine_dbgstr_w(received
), test_index
);
9514 ok(lstrlen(expected
) == len
,
9515 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9516 lstrlen(expected
), len
, test_index
);
9519 /* The property wasn't set earlier, so it should return whatever
9520 * the base IUri contains (if anything).
9523 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9525 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9526 hr
, S_OK
, test_index
);
9529 received
= (void*) 0xdeadbeef;
9532 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9534 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9535 hr
, S_FALSE
, test_index
);
9537 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9539 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9540 received
, test_index
);
9543 BOOL has_prop
= FALSE
;
9544 BSTR expected
= NULL
;
9546 hr
= IUri_GetQuery(uri
, &expected
);
9548 "Error: Expected IUri_GetQuery to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9550 has_prop
= hr
== S_OK
;
9552 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
9555 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9556 hr
, S_OK
, test_index
);
9558 ok(!lstrcmpW(expected
, received
),
9559 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9560 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9561 ok(lstrlenW(expected
) == len
,
9562 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9563 lstrlenW(expected
), len
, test_index
);
9567 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9568 hr
, S_FALSE
, test_index
);
9570 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9571 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9575 SysFreeString(expected
);
9578 if(uri
) IUri_Release(uri
);
9582 static void test_IUriBuilder_GetSchemeName(IUriBuilder
*builder
, const uri_builder_test
*test
,
9586 LPCWSTR received
= NULL
;
9588 const uri_builder_property
*prop
= NULL
;
9590 /* Check if the property was set earlier. */
9591 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9592 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_SCHEME_NAME
)
9593 prop
= &(test
->properties
[i
]);
9597 /* Use expected_value unless it's NULL, then use value. */
9598 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9599 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9602 ok(hr
== (expected
? S_OK
: S_FALSE
),
9603 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9604 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9608 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9609 expected
, wine_dbgstr_w(received
), test_index
);
9612 ok(lstrlen(expected
) == len
,
9613 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9614 lstrlen(expected
), len
, test_index
);
9618 ok(hr
== (expected
? S_OK
: S_FALSE
),
9619 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9620 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9621 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9622 expected
, wine_dbgstr_w(received
), test_index
);
9623 ok(lstrlen(expected
) == len
,
9624 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9625 lstrlen(expected
), len
, test_index
);
9628 /* The property wasn't set earlier, so it should return whatever
9629 * the base IUri contains (if anything).
9632 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9634 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9635 hr
, S_OK
, test_index
);
9638 received
= (void*) 0xdeadbeef;
9641 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9643 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9644 hr
, S_FALSE
, test_index
);
9646 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9648 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9649 received
, test_index
);
9652 BOOL has_prop
= FALSE
;
9653 BSTR expected
= NULL
;
9655 hr
= IUri_GetSchemeName(uri
, &expected
);
9657 "Error: Expected IUri_GetSchemeName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9659 has_prop
= hr
== S_OK
;
9661 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
9664 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9665 hr
, S_OK
, test_index
);
9667 ok(!lstrcmpW(expected
, received
),
9668 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9669 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9670 ok(lstrlenW(expected
) == len
,
9671 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9672 lstrlenW(expected
), len
, test_index
);
9676 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9677 hr
, S_FALSE
, test_index
);
9679 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9680 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9684 SysFreeString(expected
);
9687 if(uri
) IUri_Release(uri
);
9691 static void test_IUriBuilder_GetUserName(IUriBuilder
*builder
, const uri_builder_test
*test
,
9695 LPCWSTR received
= NULL
;
9697 const uri_builder_property
*prop
= NULL
;
9699 /* Check if the property was set earlier. */
9700 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
9701 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_USER_NAME
)
9702 prop
= &(test
->properties
[i
]);
9705 if(prop
&& prop
->value
&& *prop
->value
) {
9706 /* Use expected_value unless it's NULL, then use value. */
9707 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
9708 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
9711 ok(hr
== (expected
? S_OK
: S_FALSE
),
9712 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9713 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9717 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9718 expected
, wine_dbgstr_w(received
), test_index
);
9721 ok(lstrlen(expected
) == len
,
9722 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9723 lstrlen(expected
), len
, test_index
);
9727 ok(hr
== (expected
? S_OK
: S_FALSE
),
9728 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9729 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
9730 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
9731 expected
, wine_dbgstr_w(received
), test_index
);
9732 ok(lstrlen(expected
) == len
,
9733 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9734 lstrlen(expected
), len
, test_index
);
9737 /* The property wasn't set earlier, so it should return whatever
9738 * the base IUri contains (if anything).
9741 hr
= IUriBuilder_GetIUri(builder
, &uri
);
9743 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9744 hr
, S_OK
, test_index
);
9747 received
= (void*) 0xdeadbeef;
9750 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
9752 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9753 hr
, S_FALSE
, test_index
);
9755 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9757 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9758 received
, test_index
);
9761 BSTR expected
= NULL
;
9762 BOOL has_prop
= FALSE
;
9764 hr
= IUri_GetUserName(uri
, &expected
);
9766 "Error: Expected IUri_GetUserName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9768 has_prop
= hr
== S_OK
;
9770 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
9773 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9774 hr
, S_OK
, test_index
);
9776 ok(!lstrcmpW(expected
, received
),
9777 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9778 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
9779 ok(lstrlenW(expected
) == len
,
9780 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9781 lstrlenW(expected
), len
, test_index
);
9785 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9786 hr
, S_FALSE
, test_index
);
9788 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9789 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9793 SysFreeString(expected
);
9796 if(uri
) IUri_Release(uri
);
9800 /* Tests IUriBuilder functions. */
9801 static void test_IUriBuilder(void) {
9803 IUriBuilder
*builder
;
9806 for(i
= 0; i
< sizeof(uri_builder_tests
)/sizeof(uri_builder_tests
[0]); ++i
) {
9808 uri_builder_test test
= uri_builder_tests
[i
];
9812 uriW
= a2w(test
.uri
);
9813 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
9814 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9816 if(FAILED(hr
)) continue;
9818 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
9819 if(test
.create_builder_todo
) {
9821 ok(hr
== test
.create_builder_expected
,
9822 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9823 hr
, test
.create_builder_expected
, i
);
9826 ok(hr
== test
.create_builder_expected
,
9827 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9828 hr
, test
.create_builder_expected
, i
);
9832 BOOL modified
= FALSE
, received
= FALSE
;
9834 /* Perform all the string property changes. */
9835 for(j
= 0; j
< URI_BUILDER_STR_PROPERTY_COUNT
; ++j
) {
9836 uri_builder_property prop
= test
.properties
[j
];
9838 change_property(builder
, &prop
, i
);
9839 if(prop
.property
!= Uri_PROPERTY_SCHEME_NAME
&&
9840 prop
.property
!= Uri_PROPERTY_HOST
)
9842 else if(prop
.value
&& *prop
.value
)
9844 else if(prop
.value
&& !*prop
.value
&& prop
.property
== Uri_PROPERTY_HOST
)
9845 /* Host name property can't be NULL, but it can be empty. */
9850 if(test
.port_prop
.change
) {
9851 hr
= IUriBuilder_SetPort(builder
, test
.port_prop
.set
, test
.port_prop
.value
);
9853 if(test
.port_prop
.todo
) {
9855 ok(hr
== test
.port_prop
.expected
,
9856 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9857 hr
, test
.port_prop
.expected
, i
);
9860 ok(hr
== test
.port_prop
.expected
,
9861 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9862 hr
, test
.port_prop
.expected
, i
);
9866 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9868 "Error IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9871 ok(received
== modified
,
9872 "Error: Expected received to be %d but was %d instead on uri_builder_tests[%d].\n",
9873 modified
, received
, i
);
9875 /* Test the "Get*" functions. */
9876 test_IUriBuilder_GetFragment(builder
, &test
, i
);
9877 test_IUriBuilder_GetHost(builder
, &test
, i
);
9878 test_IUriBuilder_GetPassword(builder
, &test
, i
);
9879 test_IUriBuilder_GetPath(builder
, &test
, i
);
9880 test_IUriBuilder_GetPort(builder
, &test
, i
);
9881 test_IUriBuilder_GetQuery(builder
, &test
, i
);
9882 test_IUriBuilder_GetSchemeName(builder
, &test
, i
);
9883 test_IUriBuilder_GetUserName(builder
, &test
, i
);
9885 test_IUriBuilder_CreateUri(builder
, &test
, i
);
9886 test_IUriBuilder_CreateUriSimple(builder
, &test
, i
);
9887 test_IUriBuilder_CreateUriWithFlags(builder
, &test
, i
);
9889 if(builder
) IUriBuilder_Release(builder
);
9890 if(uri
) IUri_Release(uri
);
9895 static void test_IUriBuilder_HasBeenModified(void) {
9897 IUriBuilder
*builder
= NULL
;
9899 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
9900 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9902 static const WCHAR hostW
[] = {'g','o','o','g','l','e','.','c','o','m',0};
9906 hr
= IUriBuilder_HasBeenModified(builder
, NULL
);
9907 ok(hr
== E_POINTER
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9910 hr
= IUriBuilder_SetHost(builder
, hostW
);
9911 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n",
9914 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9915 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9918 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9920 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
9921 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9926 hr
= IUriBuilder_SetIUri(builder
, uri
);
9927 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n",
9930 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9931 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9934 ok(received
== FALSE
, "Error: Expected received to be FALSE.\n");
9936 /* Test what happens with you call SetIUri with the same IUri again. */
9937 hr
= IUriBuilder_SetHost(builder
, hostW
);
9938 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9940 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9941 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9944 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9946 hr
= IUriBuilder_SetIUri(builder
, uri
);
9947 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9949 /* IUriBuilder already had 'uri' as it's IUri property and so Windows doesn't
9950 * reset any of the changes that were made to the IUriBuilder.
9952 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9953 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9955 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9957 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
9958 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9960 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
9961 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
9962 ok(len
== lstrlenW(hostW
), "Error: Expected len to be %d, but was %d instead.\n",
9963 lstrlenW(hostW
), len
);
9966 hr
= IUriBuilder_SetIUri(builder
, NULL
);
9967 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9969 hr
= IUriBuilder_SetHost(builder
, hostW
);
9970 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9971 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9972 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9975 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9977 hr
= IUriBuilder_SetIUri(builder
, NULL
);
9978 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%09x.\n", hr
, S_OK
);
9980 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9981 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9984 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9986 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
9987 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9989 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
9990 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
9991 ok(len
== lstrlenW(hostW
), "Error: Expected len to %d, but was %d instead.\n",
9992 lstrlenW(hostW
), len
);
9995 if(uri
) IUri_Release(uri
);
9997 if(builder
) IUriBuilder_Release(builder
);
10000 /* Test IUriBuilder {Get,Set}IUri functions. */
10001 static void test_IUriBuilder_IUriProperty(void) {
10002 IUriBuilder
*builder
= NULL
;
10005 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10006 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10007 if(SUCCEEDED(hr
)) {
10010 hr
= IUriBuilder_GetIUri(builder
, NULL
);
10011 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x.\n",
10014 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10015 if(SUCCEEDED(hr
)) {
10017 ULONG cur_count
, orig_count
;
10019 /* IUriBuilder doesn't clone the IUri, it use the same IUri. */
10020 orig_count
= get_refcnt(uri
);
10021 hr
= IUriBuilder_SetIUri(builder
, uri
);
10022 cur_count
= get_refcnt(uri
);
10024 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10025 orig_count
+1, cur_count
);
10027 hr
= IUriBuilder_SetIUri(builder
, NULL
);
10028 cur_count
= get_refcnt(uri
);
10030 ok(cur_count
== orig_count
, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10031 orig_count
, cur_count
);
10033 /* CreateUri* functions will return back the same IUri if nothing has changed. */
10034 hr
= IUriBuilder_SetIUri(builder
, uri
);
10035 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10036 orig_count
= get_refcnt(uri
);
10038 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, &test
);
10039 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10040 if(SUCCEEDED(hr
)) {
10041 cur_count
= get_refcnt(uri
);
10042 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10043 orig_count
+1, cur_count
);
10044 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n",
10047 if(test
) IUri_Release(test
);
10050 hr
= IUriBuilder_CreateUri(builder
, -1, 0, 0, &test
);
10051 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10052 if(SUCCEEDED(hr
)) {
10053 cur_count
= get_refcnt(uri
);
10054 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10055 orig_count
+1, cur_count
);
10056 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10058 if(test
) IUri_Release(test
);
10060 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10064 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, &test
);
10065 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10067 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
10069 if(test
) IUri_Release(test
);
10071 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10072 * explicitly set (because it's a default flags).
10075 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_CANONICALIZE
, 0, 0, &test
);
10076 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10077 if(SUCCEEDED(hr
)) {
10078 cur_count
= get_refcnt(uri
);
10079 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10080 orig_count
+1, cur_count
);
10081 ok(test
== uri
, "Error: Expected 'test' to be %p, but was %p instead.\n", uri
, test
);
10083 if(test
) IUri_Release(test
);
10086 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, &test
);
10087 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10088 if(SUCCEEDED(hr
)) {
10089 cur_count
= get_refcnt(uri
);
10090 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10091 orig_count
+1, cur_count
);
10092 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10094 if(test
) IUri_Release(test
);
10097 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &test
);
10098 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
10100 if(SUCCEEDED(hr
)) {
10101 cur_count
= get_refcnt(uri
);
10102 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10103 orig_count
+1, cur_count
);
10104 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
10106 if(test
) IUri_Release(test
);
10108 /* Doesn't return the same IUri, if the flag combination is different then the one that created
10112 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, 0, &test
);
10113 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10115 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
10117 if(test
) IUri_Release(test
);
10119 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
10120 * explicitly set (because it's a default flags).
10123 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_CANONICALIZE
, 0, 0, 0, &test
);
10124 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10125 if(SUCCEEDED(hr
)) {
10126 cur_count
= get_refcnt(uri
);
10127 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
10128 orig_count
+1, cur_count
);
10129 ok(test
== uri
, "Error: Expected 'test' to be %p, but was %p instead.\n", uri
, test
);
10131 if(test
) IUri_Release(test
);
10133 if(uri
) IUri_Release(uri
);
10135 if(builder
) IUriBuilder_Release(builder
);
10138 static void test_IUriBuilder_RemoveProperties(void) {
10139 IUriBuilder
*builder
= NULL
;
10143 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
10144 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10145 if(SUCCEEDED(hr
)) {
10146 /* Properties that can't be removed. */
10147 const DWORD invalid
= Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_RAW_URI
|Uri_HAS_HOST_TYPE
|
10148 Uri_HAS_SCHEME
|Uri_HAS_ZONE
;
10150 for(i
= Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_DWORD_LAST
; ++i
) {
10151 hr
= IUriBuilder_RemoveProperties(builder
, i
<< 1);
10152 if((i
<< 1) & invalid
) {
10153 ok(hr
== E_INVALIDARG
,
10154 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
10155 hr
, E_INVALIDARG
, i
);
10158 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
10163 /* Also doesn't accept anything that's outside the range of the
10166 hr
= IUriBuilder_RemoveProperties(builder
, (Uri_PROPERTY_DWORD_LAST
+1) << 1);
10167 ok(hr
== E_INVALIDARG
, "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x.\n",
10170 if(builder
) IUriBuilder_Release(builder
);
10172 for(i
= 0; i
< sizeof(uri_builder_remove_tests
)/sizeof(uri_builder_remove_tests
[0]); ++i
) {
10173 uri_builder_remove_test test
= uri_builder_remove_tests
[i
];
10177 uriW
= a2w(test
.uri
);
10178 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
10179 if(SUCCEEDED(hr
)) {
10182 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10183 if(test
.create_builder_todo
) {
10185 ok(hr
== test
.create_builder_expected
,
10186 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
10187 hr
, test
.create_builder_expected
, i
);
10190 ok(hr
== test
.create_builder_expected
,
10191 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
10192 hr
, test
.create_builder_expected
, i
);
10194 if(SUCCEEDED(hr
)) {
10195 hr
= IUriBuilder_RemoveProperties(builder
, test
.remove_properties
);
10196 if(test
.remove_todo
) {
10198 ok(hr
== test
.remove_expected
,
10199 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x on test %d.\n",
10200 hr
, test
.remove_expected
, i
);
10203 ok(hr
== test
.remove_expected
,
10204 "Error: IUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
10205 hr
, test
.remove_expected
, i
);
10207 if(SUCCEEDED(hr
)) {
10208 IUri
*result
= NULL
;
10210 hr
= IUriBuilder_CreateUri(builder
, test
.expected_flags
, 0, 0, &result
);
10211 if(test
.expected_todo
) {
10213 ok(hr
== test
.expected_hres
,
10214 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
10215 hr
, test
.expected_hres
, i
);
10218 ok(hr
== test
.expected_hres
,
10219 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
10220 hr
, test
.expected_hres
, i
);
10222 if(SUCCEEDED(hr
)) {
10223 BSTR received
= NULL
;
10225 hr
= IUri_GetAbsoluteUri(result
, &received
);
10226 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10227 ok(!strcmp_aw(test
.expected_uri
, received
),
10228 "Error: Expected %s but got %s instead on test %d.\n",
10229 test
.expected_uri
, wine_dbgstr_w(received
), i
);
10230 SysFreeString(received
);
10232 if(result
) IUri_Release(result
);
10235 if(builder
) IUriBuilder_Release(builder
);
10237 if(uri
) IUri_Release(uri
);
10242 static void test_IUriBuilder_Misc(void) {
10246 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10247 if(SUCCEEDED(hr
)) {
10248 IUriBuilder
*builder
;
10250 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
10251 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10252 if(SUCCEEDED(hr
)) {
10256 hr
= IUriBuilder_GetPort(builder
, &has
, &port
);
10257 ok(hr
== S_OK
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10258 if(SUCCEEDED(hr
)) {
10259 /* 'has' will be set to FALSE, even though uri had a port. */
10260 ok(has
== FALSE
, "Error: Expected 'has' to be FALSE, was %d instead.\n", has
);
10261 /* Still sets 'port' to 80. */
10262 ok(port
== 80, "Error: Expected the port to be 80, but, was %d instead.\n", port
);
10265 if(builder
) IUriBuilder_Release(builder
);
10267 if(uri
) IUri_Release(uri
);
10270 static void test_IUriBuilderFactory(void) {
10273 IUriBuilderFactory
*factory
;
10274 IUriBuilder
*builder
;
10276 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10277 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10278 if(SUCCEEDED(hr
)) {
10280 hr
= IUri_QueryInterface(uri
, &IID_IUriBuilderFactory
, (void**)&factory
);
10281 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x.\n", hr
);
10282 ok(factory
!= NULL
, "Error: Expected 'factory' to not be NULL.\n");
10284 if(SUCCEEDED(hr
)) {
10285 builder
= (void*) 0xdeadbeef;
10286 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 10, 0, &builder
);
10287 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10289 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10291 builder
= (void*) 0xdeadbeef;
10292 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 10, &builder
);
10293 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10295 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10297 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, NULL
);
10298 ok(hr
== E_POINTER
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10302 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, &builder
);
10303 ok(hr
== S_OK
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10305 if(SUCCEEDED(hr
)) {
10306 IUri
*tmp
= (void*) 0xdeadbeef;
10310 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
10311 ok(hr
== S_OK
, "Error: GetIUri returned 0x%08x, expected 0x%08x.\n",
10313 ok(!tmp
, "Error: Expected 'tmp' to be NULL, but was %p instead.\n", tmp
);
10315 hr
= IUriBuilder_GetHost(builder
, &result_len
, &result
);
10316 ok(hr
== S_FALSE
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n",
10319 if(builder
) IUriBuilder_Release(builder
);
10321 builder
= (void*) 0xdeadbeef;
10322 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 10, 0, &builder
);
10323 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10325 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10327 builder
= (void*) 0xdeadbeef;
10328 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 10, &builder
);
10329 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10331 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
10333 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, NULL
);
10334 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10338 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, &builder
);
10339 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
10341 if(SUCCEEDED(hr
)) {
10344 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
10345 ok(hr
== S_OK
, "Error: GetIUri return 0x%08x, expected 0x%08x.\n",
10347 ok(tmp
== uri
, "Error: Expected tmp to be %p, but was %p.\n", uri
, tmp
);
10348 if(uri
) IUri_Release(uri
);
10350 if(builder
) IUriBuilder_Release(builder
);
10352 if(factory
) IUriBuilderFactory_Release(factory
);
10354 if(uri
) IUri_Release(uri
);
10357 static void test_CoInternetCombineIUri(void) {
10359 IUri
*base
, *relative
, *result
;
10363 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
10364 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr
);
10365 if(SUCCEEDED(hr
)) {
10366 result
= (void*) 0xdeadbeef;
10367 hr
= pCoInternetCombineIUri(base
, NULL
, 0, &result
, 0);
10368 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10369 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
10373 hr
= pCreateUri(http_urlW
, 0, 0, &relative
);
10374 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr
);
10375 if(SUCCEEDED(hr
)) {
10376 result
= (void*) 0xdeadbeef;
10377 hr
= pCoInternetCombineIUri(NULL
, relative
, 0, &result
, 0);
10378 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10379 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
10382 hr
= pCoInternetCombineIUri(base
, relative
, 0, NULL
, 0);
10383 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
10385 if(base
) IUri_Release(base
);
10386 if(relative
) IUri_Release(relative
);
10388 for(i
= 0; i
< sizeof(uri_combine_tests
)/sizeof(uri_combine_tests
[0]); ++i
) {
10389 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
10391 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
10392 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10393 if(SUCCEEDED(hr
)) {
10394 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
10396 hr
= pCreateUri(relativeW
, uri_combine_tests
[i
].relative_create_flags
, 0, &relative
);
10397 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10398 if(SUCCEEDED(hr
)) {
10401 hr
= pCoInternetCombineIUri(base
, relative
, uri_combine_tests
[i
].combine_flags
, &result
, 0);
10402 if(uri_combine_tests
[i
].todo
) {
10404 ok(hr
== uri_combine_tests
[i
].expected
,
10405 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10406 hr
, uri_combine_tests
[i
].expected
, i
);
10409 ok(hr
== uri_combine_tests
[i
].expected
,
10410 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10411 hr
, uri_combine_tests
[i
]. expected
, i
);
10413 if(SUCCEEDED(hr
)) {
10416 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].str_props
)/sizeof(uri_combine_tests
[i
].str_props
[0]); ++j
) {
10417 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
10420 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
10423 ok(hr
== prop
.expected
,
10424 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10425 hr
, prop
.expected
, i
, j
);
10428 ok(!strcmp_aw(prop
.value
, received
) ||
10429 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10430 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10431 prop
.value
, wine_dbgstr_w(received
), i
, j
);
10434 ok(hr
== prop
.expected
,
10435 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10436 hr
, prop
.expected
, i
, j
);
10437 ok(!strcmp_aw(prop
.value
, received
) ||
10438 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10439 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10440 prop
.value
, wine_dbgstr_w(received
), i
, j
);
10442 SysFreeString(received
);
10445 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].dword_props
)/sizeof(uri_combine_tests
[i
].dword_props
[0]); ++j
) {
10446 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
10449 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
10452 ok(hr
== prop
.expected
,
10453 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10454 hr
, prop
.expected
, i
, j
);
10457 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10458 prop
.value
, received
, i
, j
);
10461 ok(hr
== prop
.expected
|| broken(prop
.broken_combine_hres
&& hr
== S_FALSE
),
10462 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10463 hr
, prop
.expected
, i
, j
);
10464 if(!prop
.broken_combine_hres
|| hr
!= S_FALSE
)
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
);
10470 if(result
) IUri_Release(result
);
10472 if(relative
) IUri_Release(relative
);
10473 heap_free(relativeW
);
10475 if(base
) IUri_Release(base
);
10480 static HRESULT WINAPI
InternetProtocolInfo_QueryInterface(IInternetProtocolInfo
*iface
,
10481 REFIID riid
, void **ppv
)
10483 ok(0, "unexpected call\n");
10484 return E_NOINTERFACE
;
10487 static ULONG WINAPI
InternetProtocolInfo_AddRef(IInternetProtocolInfo
*iface
)
10492 static ULONG WINAPI
InternetProtocolInfo_Release(IInternetProtocolInfo
*iface
)
10497 static HRESULT WINAPI
InternetProtocolInfo_ParseUrl(IInternetProtocolInfo
*iface
, LPCWSTR pwzUrl
,
10498 PARSEACTION ParseAction
, DWORD dwParseFlags
, LPWSTR pwzResult
, DWORD cchResult
,
10499 DWORD
*pcchResult
, DWORD dwReserved
)
10501 CHECK_EXPECT(ParseUrl
);
10502 ok(!lstrcmpW(pwzUrl
, parse_urlW
), "Error: Expected %s, but got %s instead.\n",
10503 wine_dbgstr_w(parse_urlW
), wine_dbgstr_w(pwzUrl
));
10504 ok(ParseAction
== parse_action
, "Error: Expected %d, but got %d.\n", parse_action
, ParseAction
);
10505 ok(dwParseFlags
== parse_flags
, "Error: Expected 0x%08x, but got 0x%08x.\n", parse_flags
, dwParseFlags
);
10506 ok(cchResult
== 200, "Error: Got %d.\n", cchResult
);
10508 memcpy(pwzResult
, parse_resultW
, sizeof(parse_resultW
));
10509 *pcchResult
= lstrlenW(parse_resultW
);
10514 static HRESULT WINAPI
InternetProtocolInfo_CombineUrl(IInternetProtocolInfo
*iface
,
10515 LPCWSTR pwzBaseUrl
, LPCWSTR pwzRelativeUrl
, DWORD dwCombineFlags
,
10516 LPWSTR pwzResult
, DWORD cchResult
, DWORD
*pcchResult
, DWORD dwReserved
)
10518 CHECK_EXPECT(CombineUrl
);
10519 ok(!lstrcmpW(pwzBaseUrl
, combine_baseW
), "Error: Expected %s, but got %s instead.\n",
10520 wine_dbgstr_w(combine_baseW
), wine_dbgstr_w(pwzBaseUrl
));
10521 ok(!lstrcmpW(pwzRelativeUrl
, combine_relativeW
), "Error: Expected %s, but got %s instead.\n",
10522 wine_dbgstr_w(combine_relativeW
), wine_dbgstr_w(pwzRelativeUrl
));
10523 ok(dwCombineFlags
== (URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
),
10524 "Error: Expected 0, but got 0x%08x.\n", dwCombineFlags
);
10525 ok(cchResult
== INTERNET_MAX_URL_LENGTH
+1, "Error: Got %d.\n", cchResult
);
10527 memcpy(pwzResult
, combine_resultW
, sizeof(combine_resultW
));
10528 *pcchResult
= lstrlenW(combine_resultW
);
10533 static HRESULT WINAPI
InternetProtocolInfo_CompareUrl(IInternetProtocolInfo
*iface
,
10534 LPCWSTR pwzUrl1
, LPCWSTR pwzUrl2
, DWORD dwCompareFlags
)
10536 ok(0, "unexpected call\n");
10540 static HRESULT WINAPI
InternetProtocolInfo_QueryInfo(IInternetProtocolInfo
*iface
,
10541 LPCWSTR pwzUrl
, QUERYOPTION OueryOption
, DWORD dwQueryFlags
, LPVOID pBuffer
,
10542 DWORD cbBuffer
, DWORD
*pcbBuf
, DWORD dwReserved
)
10544 ok(0, "unexpected call\n");
10548 static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
= {
10549 InternetProtocolInfo_QueryInterface
,
10550 InternetProtocolInfo_AddRef
,
10551 InternetProtocolInfo_Release
,
10552 InternetProtocolInfo_ParseUrl
,
10553 InternetProtocolInfo_CombineUrl
,
10554 InternetProtocolInfo_CompareUrl
,
10555 InternetProtocolInfo_QueryInfo
10558 static IInternetProtocolInfo protocol_info
= { &InternetProtocolInfoVtbl
};
10560 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFIID riid
, void **ppv
)
10562 if(IsEqualGUID(&IID_IInternetProtocolInfo
, riid
)) {
10563 *ppv
= &protocol_info
;
10567 ok(0, "unexpected call\n");
10568 return E_NOINTERFACE
;
10571 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
10576 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
10581 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
, IUnknown
*pOuter
,
10582 REFIID riid
, void **ppv
)
10584 ok(0, "unexpected call\n");
10588 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL dolock
)
10590 ok(0, "unexpected call\n");
10594 static const IClassFactoryVtbl ClassFactoryVtbl
= {
10595 ClassFactory_QueryInterface
,
10596 ClassFactory_AddRef
,
10597 ClassFactory_Release
,
10598 ClassFactory_CreateInstance
,
10599 ClassFactory_LockServer
10602 static IClassFactory protocol_cf
= { &ClassFactoryVtbl
};
10604 static void register_protocols(void)
10606 IInternetSession
*session
;
10609 hres
= pCoInternetGetSession(0, &session
, 0);
10610 ok(hres
== S_OK
, "CoInternetGetSession failed: %08x\n", hres
);
10614 hres
= IInternetSession_RegisterNameSpace(session
, &protocol_cf
, &IID_NULL
,
10615 winetestW
, 0, NULL
, 0);
10616 ok(hres
== S_OK
, "RegisterNameSpace failed: %08x\n", hres
);
10618 IInternetSession_Release(session
);
10621 static void unregister_protocols(void) {
10622 IInternetSession
*session
;
10625 hr
= pCoInternetGetSession(0, &session
, 0);
10626 ok(hr
== S_OK
, "CoInternetGetSession failed: 0x%08x\n", hr
);
10630 hr
= IInternetSession_UnregisterNameSpace(session
, &protocol_cf
, winetestW
);
10631 ok(hr
== S_OK
, "UnregisterNameSpace failed: 0x%08x\n", hr
);
10633 IInternetSession_Release(session
);
10636 static void test_CoInternetCombineIUri_Pluggable(void) {
10640 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
10641 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10642 if(SUCCEEDED(hr
)) {
10643 IUri
*relative
= NULL
;
10645 hr
= pCreateUri(combine_relativeW
, Uri_CREATE_ALLOW_RELATIVE
, 0, &relative
);
10646 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10647 if(SUCCEEDED(hr
)) {
10648 IUri
*result
= NULL
;
10650 SET_EXPECT(CombineUrl
);
10652 hr
= pCoInternetCombineIUri(base
, relative
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
10654 ok(hr
== S_OK
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10656 CHECK_CALLED(CombineUrl
);
10658 if(SUCCEEDED(hr
)) {
10659 BSTR received
= NULL
;
10660 hr
= IUri_GetAbsoluteUri(result
, &received
);
10661 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10662 if(SUCCEEDED(hr
)) {
10663 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
10664 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
10666 SysFreeString(received
);
10668 if(result
) IUri_Release(result
);
10670 if(relative
) IUri_Release(relative
);
10672 if(base
) IUri_Release(base
);
10675 static void test_CoInternetCombineUrlEx(void) {
10677 IUri
*base
, *result
;
10681 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
10682 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10683 if(SUCCEEDED(hr
)) {
10684 result
= (void*) 0xdeadbeef;
10685 hr
= pCoInternetCombineUrlEx(base
, NULL
, 0, &result
, 0);
10686 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10688 ok(!result
, "Error: Expected 'result' to be NULL was %p instead.\n", result
);
10691 result
= (void*) 0xdeadbeef;
10692 hr
= pCoInternetCombineUrlEx(NULL
, http_urlW
, 0, &result
, 0);
10693 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10695 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
10697 result
= (void*) 0xdeadbeef;
10698 hr
= pCoInternetCombineUrlEx(NULL
, NULL
, 0, &result
, 0);
10699 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10701 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
10703 hr
= pCoInternetCombineUrlEx(base
, http_urlW
, 0, NULL
, 0);
10704 ok(hr
== E_POINTER
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
10706 if(base
) IUri_Release(base
);
10708 for(i
= 0; i
< sizeof(uri_combine_tests
)/sizeof(uri_combine_tests
[0]); ++i
) {
10709 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
10711 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
10712 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
10713 if(SUCCEEDED(hr
)) {
10714 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
10716 hr
= pCoInternetCombineUrlEx(base
, relativeW
, uri_combine_tests
[i
].combine_flags
,
10718 if(uri_combine_tests
[i
].todo
) {
10720 ok(hr
== uri_combine_tests
[i
].expected
,
10721 "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10722 hr
, uri_combine_tests
[i
].expected
, i
);
10725 ok(hr
== uri_combine_tests
[i
].expected
,
10726 "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
10727 hr
, uri_combine_tests
[i
]. expected
, i
);
10729 if(SUCCEEDED(hr
)) {
10732 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].str_props
)/sizeof(uri_combine_tests
[i
].str_props
[0]); ++j
) {
10733 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
10735 LPCSTR value
= (prop
.value_ex
) ? prop
.value_ex
: prop
.value
;
10737 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
10740 ok(hr
== prop
.expected
,
10741 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10742 hr
, prop
.expected
, i
, j
);
10745 ok(!strcmp_aw(value
, received
) ||
10746 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10747 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10748 value
, wine_dbgstr_w(received
), i
, j
);
10751 ok(hr
== prop
.expected
,
10752 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
10753 hr
, prop
.expected
, i
, j
);
10754 ok(!strcmp_aw(value
, received
) ||
10755 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
10756 "Error: Expected \"%s\" but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
10757 value
, wine_dbgstr_w(received
), i
, j
);
10759 SysFreeString(received
);
10762 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].dword_props
)/sizeof(uri_combine_tests
[i
].dword_props
[0]); ++j
) {
10763 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
10766 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
10769 ok(hr
== prop
.expected
,
10770 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10771 hr
, prop
.expected
, i
, j
);
10774 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10775 prop
.value
, received
, i
, j
);
10778 ok(hr
== prop
.expected
|| broken(prop
.broken_combine_hres
&& hr
== S_FALSE
),
10779 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10780 hr
, prop
.expected
, i
, j
);
10781 if(!prop
.broken_combine_hres
|| hr
!= S_FALSE
)
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
);
10787 if(result
) IUri_Release(result
);
10788 heap_free(relativeW
);
10790 if(base
) IUri_Release(base
);
10795 static void test_CoInternetCombineUrlEx_Pluggable(void) {
10799 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
10800 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10801 if(SUCCEEDED(hr
)) {
10802 IUri
*result
= NULL
;
10804 SET_EXPECT(CombineUrl
);
10806 hr
= pCoInternetCombineUrlEx(base
, combine_relativeW
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
10808 ok(hr
== S_OK
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10810 CHECK_CALLED(CombineUrl
);
10812 if(SUCCEEDED(hr
)) {
10813 BSTR received
= NULL
;
10814 hr
= IUri_GetAbsoluteUri(result
, &received
);
10815 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10816 if(SUCCEEDED(hr
)) {
10817 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
10818 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
10820 SysFreeString(received
);
10822 if(result
) IUri_Release(result
);
10824 if(base
) IUri_Release(base
);
10827 static void test_CoInternetParseIUri_InvalidArgs(void) {
10833 hr
= pCoInternetParseIUri(NULL
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
10834 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10836 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10838 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10839 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10840 if(SUCCEEDED(hr
)) {
10841 DWORD expected_len
;
10844 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, NULL
, 0, &result
, 0);
10845 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10847 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10849 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, NULL
, 0);
10850 ok(hr
== E_POINTER
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10854 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_URL
, 0, tmp
, 3, &result
, 0);
10855 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x expected 0x%08x.\n",
10857 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10860 hr
= pCoInternetParseIUri(uri
, PARSE_MIME
, 0, tmp
, 3, &result
, 0);
10861 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10863 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10866 hr
= pCoInternetParseIUri(uri
, PARSE_SERVER
, 0, tmp
, 3, &result
, 0);
10867 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10869 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10872 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_DOMAIN
, 0, tmp
, 3, &result
, 0);
10873 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10875 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10877 expected_len
= lstrlenW(http_urlW
);
10879 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
10880 ok(hr
== STRSAFE_E_INSUFFICIENT_BUFFER
,
10881 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10882 hr
, STRSAFE_E_INSUFFICIENT_BUFFER
);
10883 ok(result
== expected_len
, "Error: Expected 'result' to be %d, but was %d instead.\n",
10884 expected_len
, result
);
10886 if(uri
) IUri_Release(uri
);
10889 static void test_CoInternetParseIUri(void) {
10892 for(i
= 0; i
< sizeof(uri_parse_tests
)/sizeof(uri_parse_tests
[0]); ++i
) {
10896 uri_parse_test test
= uri_parse_tests
[i
];
10898 uriW
= a2w(test
.uri
);
10899 hr
= pCreateUri(uriW
, test
.uri_flags
, 0, &uri
);
10900 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x on uri_parse_tests[%d].\n", hr
, i
);
10901 if(SUCCEEDED(hr
)) {
10902 WCHAR result
[INTERNET_MAX_URL_LENGTH
+1];
10903 DWORD result_len
= -1;
10905 hr
= pCoInternetParseIUri(uri
, test
.action
, test
.flags
, result
, INTERNET_MAX_URL_LENGTH
+1, &result_len
, 0);
10908 ok(hr
== test
.expected
,
10909 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x on uri_parse_tests[%d].\n",
10910 hr
, test
.expected
, i
);
10913 ok(hr
== test
.expected
,
10914 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x on uri_parse_tests[%d].\n",
10915 hr
, test
.expected
, i
);
10917 if(SUCCEEDED(hr
)) {
10918 DWORD len
= lstrlenA(test
.property
);
10919 ok(!strcmp_aw(test
.property
, result
),
10920 "Error: Expected %s but got %s instead on uri_parse_tests[%d].\n",
10921 test
.property
, wine_dbgstr_w(result
), i
);
10922 ok(len
== result_len
,
10923 "Error: Expected %d, but got %d instead on uri_parse_tests[%d].\n",
10924 len
, result_len
, i
);
10927 "Error: Expected 'result_len' to be 0, but was %d on uri_parse_tests[%d].\n",
10931 if(uri
) IUri_Release(uri
);
10936 static void test_CoInternetParseIUri_Pluggable(void) {
10940 hr
= pCreateUri(parse_urlW
, 0, 0, &uri
);
10941 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, but got 0x%08x.\n", hr
);
10942 if(SUCCEEDED(hr
)) {
10946 SET_EXPECT(ParseUrl
);
10948 parse_action
= PARSE_CANONICALIZE
;
10949 parse_flags
= URL_UNESCAPE
|URL_ESCAPE_UNSAFE
;
10951 hr
= pCoInternetParseIUri(uri
, parse_action
, parse_flags
, result
, 200, &result_len
, 0);
10952 ok(hr
== S_OK
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10954 CHECK_CALLED(ParseUrl
);
10956 if(SUCCEEDED(hr
)) {
10957 ok(result_len
== lstrlenW(parse_resultW
), "Error: Expected %d, but got %d.\n",
10958 lstrlenW(parse_resultW
), result_len
);
10959 ok(!lstrcmpW(result
, parse_resultW
), "Error: Expected %s, but got %s.\n",
10960 wine_dbgstr_w(parse_resultW
), wine_dbgstr_w(result
));
10963 if(uri
) IUri_Release(uri
);
10969 const char *base_url
;
10970 DWORD base_uri_flags
;
10971 const char *legacy_url
;
10972 const char *uniform_url
;
10973 const char *no_canon_url
;
10974 const char *uri_url
;
10975 } create_urlmon_test_t
;
10977 static const create_urlmon_test_t create_urlmon_tests
[] = {
10979 "http://www.winehq.org",Uri_CREATE_NO_CANONICALIZE
,
10981 "http://www.winehq.org/",
10982 "http://www.winehq.org/",
10983 "http://www.winehq.org",
10984 "http://www.winehq.org"
10987 "file://c:\\dir\\file.txt",Uri_CREATE_NO_CANONICALIZE
,
10989 "file://c:\\dir\\file.txt",
10990 "file:///c:/dir/file.txt",
10991 "file:///c:/dir/file.txt",
10992 "file:///c:/dir/file.txt"
10995 "file://c:\\dir\\file.txt",Uri_CREATE_FILE_USE_DOS_PATH
,
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 "dat%61",Uri_CREATE_ALLOW_RELATIVE
,
11004 "http://www.winehq.org",0,
11005 "http://www.winehq.org/data",
11006 "http://www.winehq.org/data",
11007 "http://www.winehq.org:80/data",
11010 "file.txt",Uri_CREATE_ALLOW_RELATIVE
,
11011 "file://c:\\dir\\x.txt",Uri_CREATE_NO_CANONICALIZE
,
11012 "file://c:\\dir\\file.txt",
11013 "file:///c:/dir/file.txt",
11014 "file:///c:/dir/file.txt",
11017 "",Uri_CREATE_ALLOW_RELATIVE
,
11025 "test",Uri_CREATE_ALLOW_RELATIVE
,
11033 "c:\\dir\\file.txt",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
11035 "file://c:\\dir\\file.txt",
11036 "file:///c:/dir/file.txt",
11037 "file:///c:/dir/file.txt",
11038 "file:///c:/dir/file.txt",
11042 #define test_urlmon_display_name(a,b) _test_urlmon_display_name(__LINE__,a,b)
11043 static void _test_urlmon_display_name(unsigned line
, IMoniker
*mon
, const char *exurl
)
11045 WCHAR
*display_name
;
11048 hres
= IMoniker_GetDisplayName(mon
, NULL
, NULL
, &display_name
);
11049 ok_(__FILE__
,line
)(hres
== S_OK
, "GetDisplayName failed: %08x\n", hres
);
11050 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_name
), "unexpected display name: %s, expected %s\n",
11051 wine_dbgstr_w(display_name
), exurl
);
11053 CoTaskMemFree(display_name
);
11056 #define test_display_uri(a,b) _test_display_uri(__LINE__,a,b)
11057 static void _test_display_uri(unsigned line
, IMoniker
*mon
, const char *exurl
)
11059 IUriContainer
*uri_container
;
11064 hres
= IMoniker_QueryInterface(mon
, &IID_IUriContainer
, (void**)&uri_container
);
11065 ok(hres
== S_OK
, "Could not get IUriContainer iface: %08x\n", hres
);
11068 hres
= IUriContainer_GetIUri(uri_container
, &uri
);
11069 IUriContainer_Release(uri_container
);
11070 ok(hres
== S_OK
, "GetIUri failed: %08x\n", hres
);
11071 ok(uri
!= NULL
, "uri == NULL\n");
11073 hres
= IUri_GetDisplayUri(uri
, &display_uri
);
11075 ok(hres
== S_OK
, "GetDisplayUri failed: %08x\n", hres
);
11076 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_uri
), "unexpected display uri: %s, expected %s\n",
11077 wine_dbgstr_w(display_uri
), exurl
);
11078 SysFreeString(display_uri
);
11081 static void test_CreateURLMoniker(void)
11083 const create_urlmon_test_t
*test
;
11084 IMoniker
*mon
, *base_mon
;
11085 WCHAR
*url
, *base_url
;
11086 IUri
*uri
, *base_uri
;
11089 for(test
= create_urlmon_tests
; test
< create_urlmon_tests
+ sizeof(create_urlmon_tests
)/sizeof(*create_urlmon_tests
); test
++) {
11090 url
= a2w(test
->url
);
11091 base_url
= a2w(test
->base_url
);
11094 hres
= pCreateUri(base_url
, test
->base_uri_flags
, 0, &base_uri
);
11095 ok(hres
== S_OK
, "CreateUri failed: %08x\n", hres
);
11097 hres
= pCreateURLMonikerEx2(NULL
, base_uri
, &base_mon
, URL_MK_NO_CANONICALIZE
);
11098 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11104 hres
= CreateURLMoniker(base_mon
, url
, &mon
);
11105 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11106 test_urlmon_display_name(mon
, test
->legacy_url
);
11107 test_display_uri(mon
, test
->legacy_url
);
11108 IMoniker_Release(mon
);
11110 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_LEGACY
);
11111 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11112 test_urlmon_display_name(mon
, test
->legacy_url
);
11113 test_display_uri(mon
, test
->legacy_url
);
11114 IMoniker_Release(mon
);
11116 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_UNIFORM
);
11117 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11118 test_urlmon_display_name(mon
, test
->uniform_url
);
11119 test_display_uri(mon
, test
->uniform_url
);
11120 IMoniker_Release(mon
);
11122 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_NO_CANONICALIZE
);
11123 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
11124 test_urlmon_display_name(mon
, test
->no_canon_url
);
11125 test_display_uri(mon
, test
->no_canon_url
);
11126 IMoniker_Release(mon
);
11128 hres
= pCreateUri(url
, test
->uri_flags
, 0, &uri
);
11129 ok(hres
== S_OK
, "CreateUri failed: %08x\n", hres
);
11131 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_LEGACY
);
11132 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11133 test_urlmon_display_name(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
11134 test_display_uri(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
11135 IMoniker_Release(mon
);
11137 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_UNIFORM
);
11138 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11139 test_urlmon_display_name(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
11140 test_display_uri(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
11141 IMoniker_Release(mon
);
11143 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_NO_CANONICALIZE
);
11144 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
11145 test_urlmon_display_name(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
11146 test_display_uri(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
11147 IMoniker_Release(mon
);
11151 heap_free(base_url
);
11153 IUri_Release(base_uri
);
11155 IMoniker_Release(base_mon
);
11159 static int add_default_flags(DWORD flags
) {
11160 if(!(flags
& Uri_CREATE_NO_CANONICALIZE
))
11161 flags
|= Uri_CREATE_CANONICALIZE
;
11162 if(!(flags
& Uri_CREATE_NO_DECODE_EXTRA_INFO
))
11163 flags
|= Uri_CREATE_DECODE_EXTRA_INFO
;
11164 if(!(flags
& Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
))
11165 flags
|= Uri_CREATE_CRACK_UNKNOWN_SCHEMES
;
11166 if(!(flags
& Uri_CREATE_NO_PRE_PROCESS_HTML_URI
))
11167 flags
|= Uri_CREATE_PRE_PROCESS_HTML_URI
;
11168 if(!(flags
& Uri_CREATE_IE_SETTINGS
))
11169 flags
|= Uri_CREATE_NO_IE_SETTINGS
;
11174 static void test_IPersistStream(void)
11176 int i
, props_order
[Uri_PROPERTY_DWORD_LAST
+1] = { 0 };
11178 props_order
[Uri_PROPERTY_RAW_URI
] = 1;
11179 props_order
[Uri_PROPERTY_FRAGMENT
] = 2;
11180 props_order
[Uri_PROPERTY_HOST
] = 3;
11181 props_order
[Uri_PROPERTY_PASSWORD
] = 4;
11182 props_order
[Uri_PROPERTY_PATH
] = 5;
11183 props_order
[Uri_PROPERTY_PORT
] = 6;
11184 props_order
[Uri_PROPERTY_QUERY
] = 7;
11185 props_order
[Uri_PROPERTY_SCHEME_NAME
] = 8;
11186 props_order
[Uri_PROPERTY_USER_NAME
] = 9;
11188 for(i
=0; i
<sizeof(uri_tests
)/sizeof(*uri_tests
); i
++) {
11189 const uri_properties
*test
= uri_tests
+i
;
11192 IPersistStream
*persist_stream
;
11195 DWORD props
, props_no
, dw_data
[6];
11196 WCHAR str_data
[1024];
11197 ULARGE_INTEGER size
, max_size
;
11198 LARGE_INTEGER no_off
;
11203 if(test
->create_todo
|| test
->create_expected
!=S_OK
)
11206 uriW
= a2w(test
->uri
);
11207 hr
= pCreateUri(uriW
, test
->create_flags
, 0, &uri
);
11208 ok(hr
== S_OK
, "%d) CreateUri failed 0x%08x, expected S_OK..\n", i
, hr
);
11210 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&persist_stream
);
11211 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11213 hr
= CreateStreamOnHGlobal(NULL
, TRUE
, &stream
);
11214 ok(hr
== S_OK
, "CreateStreamOnHGlobal failed 0x%08x.\n", hr
);
11215 hr
= IPersistStream_IsDirty(persist_stream
);
11216 ok(hr
== S_FALSE
, "%d) IsDirty returned 0x%08x, expected S_FALSE.\n", i
, hr
);
11217 hr
= IPersistStream_Save(persist_stream
, stream
, FALSE
);
11218 ok(hr
== S_OK
, "%d) Save failed 0x%08x, expected S_OK.\n", i
, hr
);
11219 hr
= IPersistStream_IsDirty(persist_stream
);
11220 ok(hr
== S_FALSE
, "%d) IsDirty returned 0x%08x, expected S_FALSE.\n", i
, hr
);
11221 no_off
.QuadPart
= 0;
11222 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_CUR
, &size
);
11223 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11224 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11225 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11226 hr
= IPersistStream_GetSizeMax(persist_stream
, &max_size
);
11227 ok(hr
== S_OK
, "%d) GetSizeMax failed 0x%08x, expected S_OK.\n", i
, hr
);
11228 ok(U(size
).LowPart
+2 == U(max_size
).LowPart
,
11229 "%d) Written data size is %d, max_size %d.\n",
11230 i
, U(size
).LowPart
, U(max_size
).LowPart
);
11232 hr
= IStream_Read(stream
, (void*)dw_data
, sizeof(DWORD
), NULL
);
11233 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11234 ok(dw_data
[0]-2 == U(size
).LowPart
, "%d) Structure size is %d, expected %d\n",
11235 i
, dw_data
[0]-2, U(size
).LowPart
);
11236 hr
= IStream_Read(stream
, (void*)dw_data
, 6*sizeof(DWORD
), NULL
);
11237 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11238 ok(dw_data
[0] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[0]);
11239 ok(dw_data
[1] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[1]);
11240 ok(dw_data
[2] == add_default_flags(test
->create_flags
),
11241 "%d) Incorrect value %x, expected %x (creation flags).\n",
11242 i
, dw_data
[2], add_default_flags(test
->create_flags
));
11243 ok(dw_data
[3] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[3]);
11244 ok(dw_data
[4] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[4]);
11245 ok(dw_data
[5] == 0, "%d) Incorrect value %x, expected 0 (unknown).\n", i
, dw_data
[5]);
11248 for(props
=0; props
<=Uri_PROPERTY_DWORD_LAST
; props
++) {
11249 if(!props_order
[props
])
11252 if(props
<= Uri_PROPERTY_STRING_LAST
) {
11253 if(test
->str_props
[props
].expected
== S_OK
)
11256 if(test
->dword_props
[props
-Uri_PROPERTY_DWORD_START
].expected
== S_OK
)
11260 if(test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_HTTP
11261 && test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_FTP
11262 && test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
!= URL_SCHEME_HTTPS
)
11265 hr
= IStream_Read(stream
, (void*)&props
, sizeof(DWORD
), NULL
);
11266 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11267 ok(props
== props_no
, "%d) Properties no is %d, expected %d.\n", i
, props
, props_no
);
11272 hr
= IStream_Read(stream
, (void*)dw_data
, 2*sizeof(DWORD
), NULL
);
11273 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11275 ok(dw_data
[2]<props_order
[dw_data
[0]],
11276 "%d) Incorrect properties order (%d, %d)\n",
11277 i
, dw_data
[0], dw_data
[3]);
11278 dw_data
[2] = props_order
[dw_data
[0]];
11279 dw_data
[3] = dw_data
[0];
11281 if(dw_data
[0]<=Uri_PROPERTY_STRING_LAST
) {
11282 const uri_str_property
*prop
= test
->str_props
+dw_data
[0];
11283 hr
= IStream_Read(stream
, (void*)str_data
, dw_data
[1], NULL
);
11284 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11285 ok(!strcmp_aw(prop
->value
, str_data
) || broken(prop
->broken_value
&& !strcmp_aw(prop
->broken_value
, str_data
)),
11286 "%d) Expected %s but got %s (%d).\n", i
, prop
->value
, wine_dbgstr_w(str_data
), dw_data
[0]);
11287 } else if(dw_data
[0]>=Uri_PROPERTY_DWORD_START
&& dw_data
[0]<=Uri_PROPERTY_DWORD_LAST
) {
11288 const uri_dword_property
*prop
= test
->dword_props
+dw_data
[0]-Uri_PROPERTY_DWORD_START
;
11289 ok(dw_data
[1] == sizeof(DWORD
), "%d) Size of dword property is %d (%d)\n", i
, dw_data
[1], dw_data
[0]);
11290 hr
= IStream_Read(stream
, (void*)&dw_data
[1], sizeof(DWORD
), NULL
);
11291 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11292 ok(prop
->value
== dw_data
[1], "%d) Expected %d but got %d (%d).\n", i
, prop
->value
, dw_data
[1], dw_data
[0]);
11294 ok(FALSE
, "%d) Incorrect property type (%d)\n", i
, dw_data
[0]);
11298 ok(props
== 0, "%d) Not all properties were processed %d. Next property type: %d\n",
11299 i
, props
, dw_data
[0]);
11301 IPersistStream_Release(persist_stream
);
11304 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11305 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11306 hr
= IPersistStream_GetClassID(persist_stream
, &curi
);
11307 ok(hr
== S_OK
, "%d) GetClassID failed 0x%08x, expected S_OK.\n", i
, hr
);
11308 ok(IsEqualCLSID(&curi
, &CLSID_CUri
), "%d) GetClassID returned incorrect CLSID.\n", i
);
11309 hr
= CoCreateInstance(&curi
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11310 &IID_IUri
, (void**)&uri
);
11311 ok(hr
== S_OK
, "%d) Error creating uninitialized Uri: 0x%08x.\n", i
, hr
);
11312 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&persist_stream
);
11313 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11314 hr
= IPersistStream_Load(persist_stream
, stream
);
11315 ok(hr
== S_OK
, "%d) Load failed 0x%08x, expected S_OK.\n", i
, hr
);
11316 hr
= IUri_GetRawUri(uri
, &raw_uri
);
11317 ok(hr
== S_OK
, "%d) GetRawUri failed 0x%08x, expected S_OK.\n", i
, hr
);
11318 ok(!strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].value
, raw_uri
)
11319 || broken(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
11320 && !strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
, raw_uri
)),
11321 "%d) Expected %s but got %s.\n", i
, test
->str_props
[Uri_PROPERTY_RAW_URI
].value
,
11322 wine_dbgstr_w(raw_uri
));
11323 SysFreeString(raw_uri
);
11325 hr
= IUri_QueryInterface(uri
, &IID_IMarshal
, (void**)&marshal
);
11326 ok(hr
== S_OK
, "%d) QueryInterface(IID_IMarshal) failed 0x%08x, expected S_OK.\n", i
, hr
);
11327 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11328 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11329 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11330 MSHCTX_DIFFERENTMACHINE
, NULL
, MSHLFLAGS_NORMAL
);
11331 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11332 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11333 MSHCTX_CROSSCTX
, NULL
, MSHLFLAGS_NORMAL
);
11334 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11335 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11336 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_TABLESTRONG
);
11337 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11338 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11339 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_TABLEWEAK
);
11340 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11341 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11342 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_NOPING
);
11343 ok(hr
== E_INVALIDARG
, "%d) MarshalInterface returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11344 hr
= IMarshal_MarshalInterface(marshal
, stream
, &IID_IUri
, (void*)uri
,
11345 MSHCTX_LOCAL
, NULL
, MSHLFLAGS_NORMAL
);
11346 ok(hr
== S_OK
, "%d) MarshalInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11347 hr
= IMarshal_GetUnmarshalClass(marshal
, &IID_IUri
, (void*)uri
,
11348 MSHCTX_CROSSCTX
, NULL
, MSHLFLAGS_NORMAL
, &curi
);
11349 ok(hr
== E_INVALIDARG
, "%d) GetUnmarshalClass returned 0x%08x, expected E_INVALIDARG.\n", i
, hr
);
11350 hr
= IMarshal_GetUnmarshalClass(marshal
, &IID_IUri
, (void*)uri
,
11351 MSHCTX_INPROC
, NULL
, MSHLFLAGS_NORMAL
, &curi
);
11352 ok(hr
== S_OK
, "%d) GetUnmarshalClass failed 0x%08x, expected S_OK.\n", i
, hr
);
11353 ok(IsEqualCLSID(&curi
, &CLSID_CUri
), "%d) GetUnmarshalClass returned incorrect CLSID.\n", i
);
11355 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_CUR
, &size
);
11356 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11357 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11358 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11359 hr
= IStream_Read(stream
, (void*)dw_data
, 3*sizeof(DWORD
), NULL
);
11360 ok(hr
== S_OK
, "%d) Read failed 0x%08x, expected S_OK.\n", i
, hr
);
11361 ok(dw_data
[0]-2 == U(size
).LowPart
, "%d) Structure size is %d, expected %d\n",
11362 i
, dw_data
[0]-2, U(size
).LowPart
);
11363 ok(dw_data
[1] == MSHCTX_LOCAL
, "%d) Incorrect value %d, expected MSHCTX_LOCAL.\n",
11365 ok(dw_data
[2] == dw_data
[0]-8, "%d) Incorrect value %d, expected %d (PersistStream size).\n",
11366 i
, dw_data
[2], dw_data
[0]-8);
11367 if(!test
->str_props
[Uri_PROPERTY_PATH
].value
[0] &&
11368 (test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_HTTP
11369 || test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_FTP
11370 || test
->dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
].value
== URL_SCHEME_HTTPS
))
11371 U(max_size
).LowPart
+= 3*sizeof(DWORD
);
11372 ok(dw_data
[2] == U(max_size
).LowPart
, "%d) Incorrect value %d, expected %d (PersistStream size).\n",
11373 i
, dw_data
[2], U(max_size
).LowPart
);
11374 IMarshal_Release(marshal
);
11377 hr
= IStream_Seek(stream
, no_off
, STREAM_SEEK_SET
, NULL
);
11378 ok(hr
== S_OK
, "%d) Seek failed 0x%08x, expected S_OK.\n", i
, hr
);
11379 hr
= CoCreateInstance(&curi
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11380 &IID_IUri
, (void**)&uri
);
11381 ok(hr
== S_OK
, "%d) Error creating uninitialized Uri: 0x%08x.\n", i
, hr
);
11382 hr
= IUri_QueryInterface(uri
, &IID_IMarshal
, (void**)&marshal
);
11383 ok(hr
== S_OK
, "%d) QueryInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11384 hr
= IMarshal_UnmarshalInterface(marshal
, stream
, &IID_IUri
, (void**)&uri
);
11385 ok(hr
== S_OK
, "%d) UnmarshalInterface failed 0x%08x, expected S_OK.\n", i
, hr
);
11386 hr
= IUri_GetRawUri(uri
, &raw_uri
);
11387 ok(hr
== S_OK
, "%d) GetRawUri failed 0x%08x, expected S_OK.\n", i
, hr
);
11388 ok(!strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].value
, raw_uri
)
11389 || broken(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
11390 && !strcmp_aw(test
->str_props
[Uri_PROPERTY_RAW_URI
].broken_value
, raw_uri
)),
11391 "%d) Expected %s but got %s.\n", i
, test
->str_props
[Uri_PROPERTY_RAW_URI
].value
,
11392 wine_dbgstr_w(raw_uri
));
11393 SysFreeString(raw_uri
);
11395 IMarshal_Release(marshal
);
11396 IStream_Release(stream
);
11397 IPersistStream_Release(persist_stream
);
11403 static void test_UninitializedUri(void)
11406 IUriBuilderFactory
*ubf
;
11407 IPersistStream
*ps
;
11415 hr
= CoCreateInstance(&CLSID_CUri
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
11416 &IID_IUri
, (void**)&uri
);
11418 win_skip("Skipping uninitialized Uri tests.\n");
11422 hr
= IUri_QueryInterface(uri
, &IID_IUriBuilderFactory
, (void**)&ubf
);
11423 ok(hr
== S_OK
, "QueryInterface(IID_IUriBuillderFactory) failed: %x.\n", hr
);
11424 hr
= IUri_QueryInterface(uri
, &IID_IPersistStream
, (void**)&ps
);
11425 ok(hr
== S_OK
, "QueryInterface(IID_IPersistStream) failed: %x.\n", hr
);
11427 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
11428 ok(hr
== E_UNEXPECTED
, "GetAbsoluteUri returned %x, expected E_UNEXPECTED.\n", hr
);
11429 hr
= IUri_GetAbsoluteUri(uri
, &bstr
);
11430 ok(hr
== E_UNEXPECTED
, "GetAbsoluteUri returned %x, expected E_UNEXPECTED.\n", hr
);
11431 hr
= IUri_GetAuthority(uri
, &bstr
);
11432 ok(hr
== E_UNEXPECTED
, "GetAuthority returned %x, expected E_UNEXPECTED.\n", hr
);
11433 hr
= IUri_GetDisplayUri(uri
, &bstr
);
11434 ok(hr
== E_UNEXPECTED
, "GetDisplayUri returned %x, expected E_UNEXPECTED.\n", hr
);
11435 hr
= IUri_GetDomain(uri
, &bstr
);
11436 ok(hr
== E_UNEXPECTED
, "GetDomain returned %x, expected E_UNEXPECTED.\n", hr
);
11437 hr
= IUri_GetExtension(uri
, &bstr
);
11438 ok(hr
== E_UNEXPECTED
, "GetExtension returned %x, expected E_UNEXPECTED.\n", hr
);
11439 hr
= IUri_GetFragment(uri
, &bstr
);
11440 ok(hr
== E_UNEXPECTED
, "GetFragment returned %x, expected E_UNEXPECTED.\n", hr
);
11441 hr
= IUri_GetHost(uri
, &bstr
);
11442 ok(hr
== E_UNEXPECTED
, "GetHost returned %x, expected E_UNEXPECTED.\n", hr
);
11443 hr
= IUri_GetHostType(uri
, &dword
);
11444 ok(hr
== E_UNEXPECTED
, "GetHostType returned %x, expected E_UNEXPECTED.\n", hr
);
11445 hr
= IUri_GetPassword(uri
, &bstr
);
11446 ok(hr
== E_UNEXPECTED
, "GetPassword returned %x, expected E_UNEXPECTED.\n", hr
);
11447 hr
= IUri_GetPassword(uri
, &bstr
);
11448 ok(hr
== E_UNEXPECTED
, "GetPassword returned %x, expected E_UNEXPECTED.\n", hr
);
11449 hr
= IUri_GetPathAndQuery(uri
, &bstr
);
11450 ok(hr
== E_UNEXPECTED
, "GetPathAndQuery returned %x, expected E_UNEXPECTED.\n", hr
);
11451 hr
= IUri_GetPort(uri
, &dword
);
11452 ok(hr
== E_UNEXPECTED
, "GetPort returned %x, expected E_UNEXPECTED.\n", hr
);
11453 hr
= IUri_GetProperties(uri
, &dword
);
11454 ok(hr
== E_UNEXPECTED
, "GetProperties returned %x, expected E_UNEXPECTED.\n", hr
);
11455 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, &bstr
, 0);
11456 ok(hr
== E_UNEXPECTED
, "GetPropertyBSTR returned %x, expected E_UNEXPECTED.\n", hr
);
11457 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_PORT
, &dword
, 0);
11458 ok(hr
== E_UNEXPECTED
, "GetPropertyDWORD returned %x, expected E_UNEXPECTED.\n", hr
);
11459 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_RAW_URI
, &dword
, 0);
11460 ok(hr
== E_UNEXPECTED
, "GetPropertyLength returned %x, expected E_UNEXPECTED.\n", hr
);
11461 hr
= IUri_GetQuery(uri
, &bstr
);
11462 ok(hr
== E_UNEXPECTED
, "GetQuery returned %x, expected E_UNEXPECTED.\n", hr
);
11463 hr
= IUri_GetRawUri(uri
, &bstr
);
11464 ok(hr
== E_UNEXPECTED
, "GetRawUri returned %x, expected E_UNEXPECTED.\n", hr
);
11465 hr
= IUri_GetScheme(uri
, &dword
);
11466 ok(hr
== E_UNEXPECTED
, "GetScheme returned %x, expected E_UNEXPECTED.\n", hr
);
11467 hr
= IUri_GetSchemeName(uri
, &bstr
);
11468 ok(hr
== E_UNEXPECTED
, "GetSchemeName returned %x, expected E_UNEXPECTED.\n", hr
);
11469 hr
= IUri_GetUserInfo(uri
, &bstr
);
11470 ok(hr
== E_UNEXPECTED
, "GetUserInfo returned %x, expected E_UNEXPECTED.\n", hr
);
11471 hr
= IUri_GetUserName(uri
, &bstr
);
11472 ok(hr
== E_UNEXPECTED
, "GetUserName returned %x, expected E_UNEXPECTED.\n", hr
);
11473 hr
= IUri_GetZone(uri
, &dword
);
11474 ok(hr
== E_UNEXPECTED
, "GetZone returned %x, expected E_UNEXPECTED.\n", hr
);
11475 hr
= IUri_IsEqual(uri
, uri
, &eq
);
11476 ok(hr
== E_UNEXPECTED
, "IsEqual returned %x, expected E_UNEXPECTED.\n", hr
);
11478 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(ubf
, 0, 0, &ub
);
11479 ok(hr
== E_UNEXPECTED
, "CreateInitializedIUriBuilder returned %x, expected E_UNEXPECTED.\n", hr
);
11480 hr
= IUriBuilderFactory_CreateIUriBuilder(ubf
, 0, 0, &ub
);
11481 ok(hr
== S_OK
, "CreateIUriBuilder returned %x, expected S_OK.\n", hr
);
11482 IUriBuilder_Release(ub
);
11484 hr
= IPersistStream_GetSizeMax(ps
, &ui
);
11485 ok(hr
== S_OK
, "GetSizeMax returned %x, expected S_OK.\n", hr
);
11486 ok(ui
.u
.LowPart
== 34, "ui.LowPart = %d, expected 34.\n", ui
.u
.LowPart
);
11487 hr
= IPersistStream_IsDirty(ps
);
11488 ok(hr
== S_FALSE
, "IsDirty returned %x, expected S_FALSE.\n", hr
);
11490 IPersistStream_Release(ps
);
11491 IUriBuilderFactory_Release(ubf
);
11498 hurlmon
= GetModuleHandle("urlmon.dll");
11499 pCoInternetGetSession
= (void*) GetProcAddress(hurlmon
, "CoInternetGetSession");
11500 pCreateUri
= (void*) GetProcAddress(hurlmon
, "CreateUri");
11501 pCreateUriWithFragment
= (void*) GetProcAddress(hurlmon
, "CreateUriWithFragment");
11502 pCreateIUriBuilder
= (void*) GetProcAddress(hurlmon
, "CreateIUriBuilder");
11503 pCoInternetCombineIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineIUri");
11504 pCoInternetCombineUrlEx
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineUrlEx");
11505 pCoInternetParseIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetParseIUri");
11506 pCreateURLMonikerEx
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx");
11507 pCreateURLMonikerEx2
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx2");
11510 win_skip("CreateUri is not present, skipping tests.\n");
11514 trace("test CreateUri invalid flags...\n");
11515 test_CreateUri_InvalidFlags();
11517 trace("test CreateUri invalid args...\n");
11518 test_CreateUri_InvalidArgs();
11520 trace("test CreateUri invalid URIs...\n");
11521 test_CreateUri_InvalidUri();
11523 trace("test IUri_GetPropertyBSTR...\n");
11524 test_IUri_GetPropertyBSTR();
11526 trace("test IUri_GetPropertyDWORD...\n");
11527 test_IUri_GetPropertyDWORD();
11529 trace("test IUri_GetStrProperties...\n");
11530 test_IUri_GetStrProperties();
11532 trace("test IUri_GetDwordProperties...\n");
11533 test_IUri_GetDwordProperties();
11535 trace("test IUri_GetPropertyLength...\n");
11536 test_IUri_GetPropertyLength();
11538 trace("test IUri_GetProperties...\n");
11539 test_IUri_GetProperties();
11541 trace("test IUri_HasProperty...\n");
11542 test_IUri_HasProperty();
11544 trace("test IUri_IsEqual...\n");
11545 test_IUri_IsEqual();
11547 trace("test CreateUriWithFragment invalid args...\n");
11548 test_CreateUriWithFragment_InvalidArgs();
11550 trace("test CreateUriWithFragment invalid flags...\n");
11551 test_CreateUriWithFragment_InvalidFlags();
11553 trace("test CreateUriWithFragment...\n");
11554 test_CreateUriWithFragment();
11556 trace("test CreateIUriBuilder...\n");
11557 test_CreateIUriBuilder();
11559 trace("test IUriBuilder_CreateInvalidArgs...\n");
11560 test_IUriBuilder_CreateInvalidArgs();
11562 trace("test IUriBuilder...\n");
11563 test_IUriBuilder();
11565 trace("test IUriBuilder_GetInvalidArgs...\n");
11566 test_IUriBuilder_GetInvalidArgs();
11568 trace("test IUriBuilder_HasBeenModified...\n");
11569 test_IUriBuilder_HasBeenModified();
11571 trace("test IUriBuilder_IUriProperty...\n");
11572 test_IUriBuilder_IUriProperty();
11574 trace("test IUriBuilder_RemoveProperties...\n");
11575 test_IUriBuilder_RemoveProperties();
11577 trace("test IUriBuilder miscellaneous...\n");
11578 test_IUriBuilder_Misc();
11580 trace("test IUriBuilderFactory...\n");
11581 test_IUriBuilderFactory();
11583 trace("test CoInternetCombineIUri...\n");
11584 test_CoInternetCombineIUri();
11586 trace("test CoInternetCombineUrlEx...\n");
11587 test_CoInternetCombineUrlEx();
11589 trace("test CoInternetParseIUri Invalid Args...\n");
11590 test_CoInternetParseIUri_InvalidArgs();
11592 trace("test CoInternetParseIUri...\n");
11593 test_CoInternetParseIUri();
11595 register_protocols();
11597 trace("test CoInternetCombineIUri pluggable...\n");
11598 test_CoInternetCombineIUri_Pluggable();
11600 trace("test CoInternetCombineUrlEx Pluggable...\n");
11601 test_CoInternetCombineUrlEx_Pluggable();
11603 trace("test CoInternetParseIUri pluggable...\n");
11604 test_CoInternetParseIUri_Pluggable();
11606 trace("test CreateURLMoniker...\n");
11607 test_CreateURLMoniker();
11609 CoInitialize(NULL
);
11611 trace("test IPersistStream...\n");
11612 test_IPersistStream();
11614 trace("test uninitialized Uri...\n");
11615 test_UninitializedUri();
11618 unregister_protocols();