35#define URI_DISPLAY_NO_ABSOLUTE_URI 0x1
36#define URI_DISPLAY_NO_DEFAULT_PORT_AUTH 0x2
38#define ALLOW_NULL_TERM_SCHEME 0x01
39#define ALLOW_NULL_TERM_USER_NAME 0x02
40#define ALLOW_NULL_TERM_PASSWORD 0x04
41#define ALLOW_BRACKETLESS_IP_LITERAL 0x08
42#define SKIP_IP_FUTURE_CHECK 0x10
43#define IGNORE_PORT_DELIMITER 0x20
45#define RAW_URI_FORCE_PORT_DISP 0x1
46#define RAW_URI_CONVERT_TO_DOS_PATH 0x2
48#define COMBINE_URI_FORCE_FLAG_USE 0x1
52static const IID IID_IUriObj = {0x4b364760,0x9f51,0x11df,{0x98,0x1c,0x08,0x00,0x20,0x0c,0x9a,0x66}};
246 return ((
val >=
'a' &&
val <=
'z') || (
val >=
'A' &&
val <=
'Z'));
250 return (
val >=
'0' &&
val <=
'9');
258 return (
str[0] ==
'\\' &&
str[1] ==
'\\');
262 return (
val ==
'>' ||
val ==
'<' ||
val ==
'\"');
294 val ==
'_' ||
val ==
'~');
301 return (
val ==
'!' ||
val ==
'$' ||
val ==
'&' ||
302 val ==
'\'' ||
val ==
'(' ||
val ==
')' ||
303 val ==
'*' ||
val ==
'+' ||
val ==
',' ||
304 val ==
';' ||
val ==
'=');
309 return (
val ==
':' ||
val ==
'/' ||
val ==
'?' ||
310 val ==
'#' ||
val ==
'[' ||
val ==
']' ||
319 return (
val ==
'#' ||
val ==
'/' ||
val ==
'?' ||
320 val ==
'\0' || (acceptSlash &&
val ==
'\\'));
329 return ((
val >=
'a' &&
val <=
'f') ||
330 (
val >=
'A' &&
val <=
'F') ||
331 (
val >=
'0' &&
val <=
'9'));
340 return c ==
'/' ||
c ==
'\\';
370 return((
flags & Uri_CREATE_DECODE_EXTRA_INFO &&
flags & Uri_CREATE_NO_DECODE_EXTRA_INFO) ||
371 (
flags & Uri_CREATE_CANONICALIZE &&
flags & Uri_CREATE_NO_CANONICALIZE) ||
372 (
flags & Uri_CREATE_CRACK_UNKNOWN_SCHEMES &&
flags & Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES) ||
373 (
flags & Uri_CREATE_PRE_PROCESS_HTML_URI &&
flags & Uri_CREATE_NO_PRE_PROCESS_HTML_URI) ||
374 (
flags & Uri_CREATE_IE_SETTINGS &&
flags & Uri_CREATE_NO_IE_SETTINGS));
381 if(!(*
flags & Uri_CREATE_NO_CANONICALIZE))
382 *
flags |= Uri_CREATE_CANONICALIZE;
383 if(!(*
flags & Uri_CREATE_NO_DECODE_EXTRA_INFO))
384 *
flags |= Uri_CREATE_DECODE_EXTRA_INFO;
385 if(!(*
flags & Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES))
386 *
flags |= Uri_CREATE_CRACK_UNKNOWN_SCHEMES;
387 if(!(*
flags & Uri_CREATE_NO_PRE_PROCESS_HTML_URI))
388 *
flags |= Uri_CREATE_PRE_PROCESS_HTML_URI;
389 if(!(*
flags & Uri_CREATE_IE_SETTINGS))
390 *
flags |= Uri_CREATE_NO_IE_SETTINGS;
422 if(
val >=
'0' &&
val <=
'9')
424 else if(
val >=
'a' &&
val <=
'f')
425 return val -
'a' + 10;
426 else if(
val >=
'A' &&
val <=
'F')
427 return val -
'A' + 10;
479 const WCHAR *last_tld, *sec_last_tld, *
end, *
p;
495 sec_last_tld = last_tld;
510 if(last_tld-
host == 0) {
511 if(
end-(last_tld-1) < 3)
513 }
else if(last_tld-
host == 3) {
527 }
else if(last_tld-
host < 3)
533 for(
p =
host;
p < last_tld;
p++) {
544 }
else if(
end+1-last_tld > 3) {
549 *domain_start = (sec_last_tld+1)-
host;
550 }
else if(last_tld - (sec_last_tld+1) < 4) {
558 if(last_tld - (sec_last_tld+1) == 3) {
561 for (
p = sec_last_tld;
p >
host;
p--)
if (
p[-1] ==
'.')
break;
562 *domain_start =
p -
host;
564 (
host+host_len)-(
host+*domain_start)));
569 *domain_start = (sec_last_tld+1)-
host;
575 for (
p = sec_last_tld;
p >
host;
p--)
if (
p[-1] ==
'.')
break;
576 *domain_start =
p -
host;
583 *domain_start = (sec_last_tld+1)-
host;
587 (
host+host_len)-(
host+*domain_start)));
773 const WCHAR *c1, *c2, *c3;
777 if(*c1 <
'0' || *c1 >
'9')
787 if(*c2 <
'0' || *c2 >
'9')
794 if(*c3 <
'0' || *c3 >
'9')
798 if(*c1 >=
'2' && *c2 >=
'5' && *c3 >=
'5') {
904 data->scheme_len = 0;
914 **
ptr !=
'-' && **
ptr !=
'.')
941 if(
data->scheme &&
data->scheme_len) {
957 }
else if(
data->is_relative) {
980 if(
flags & Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME) {
981 data->scheme =
L"file";
990 TRACE(
"(%p %p %lx): URI is implicitly a file path, but, the ALLOW_IMPLICIT_FILE_SCHEME flag wasn't set.\n",
1000 if(
flags & Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME) {
1001 data->scheme =
L"*";
1006 }
else if (
flags & Uri_CREATE_ALLOW_RELATIVE) {
1010 TRACE(
"(%p %p %lx): Malformed URI found. Unable to deduce scheme name.\n",
ptr,
data,
flags);
1015 if(!
data->is_relative)
1029 while(**
ptr !=
':' && **
ptr !=
'@') {
1057 while(**
ptr !=
'@') {
1114 data->username_len = 0;
1123 data->username_len = 0;
1125 data->password_len = 0;
1176 TRACE(
"(%p %p): Found port %s len=%ld value=%lu\n",
ptr,
data,
1201 TRACE(
"(%p %p): URI didn't contain anything looking like an IPv4 address.\n",
ptr,
data);
1210 data->host_type = Uri_HOST_IPV4;
1230 TRACE(
"(%p %p): IPv4 address found. host=%s host_len=%ld host_type=%d\n",
1257 const BOOL has_start_bracket = **
ptr ==
'[';
1260 BOOL inside_brackets = has_start_bracket;
1274 data->host_type = Uri_HOST_UNKNOWN;
1289 (is_res && **
ptr && **
ptr !=
'/')) {
1290 if(**
ptr ==
':' && !ignore_col) {
1292 if(!inside_brackets) {
1293 const WCHAR *tmp = (*ptr)++;
1301 TRACE(
"(%p %p %lx): Expected valid port\n",
ptr,
data, extras);
1313 }
else if(**
ptr ==
'%' && (known_scheme && !is_res)) {
1325 }
else if(**
ptr ==
']')
1326 inside_brackets =
FALSE;
1327 else if(**
ptr ==
'[')
1328 inside_brackets =
TRUE;
1333 if(has_start_bracket) {
1335 if(*(*
ptr-1) ==
']') {
1336 TRACE(
"(%p %p %lx): Expected an IP literal inside of the host\n",
ptr,
data, extras);
1348 if(
data->host_len == 0 || is_res)
1349 data->host_type = Uri_HOST_UNKNOWN;
1353 data->host_type = Uri_HOST_DNS;
1355 for(
i = 0;
i <
data->host_len;
i++) {
1357 data->host_type = Uri_HOST_IDN;
1363 TRACE(
"(%p %p %lx): Parsed reg-name. host=%s len=%ld type=%d\n",
ptr,
data, extras,
1387 const WCHAR *terminator;
1395 data->host_type = Uri_HOST_IPV6;
1404 if(**
ptr !=
'v' && **
ptr !=
'V')
1434 data->host_type = Uri_HOST_UNKNOWN;
1436 TRACE(
"(%p %p): Parsed IPvFuture address %s len=%d\n",
ptr,
data,
1449 }
else if(**
ptr ==
'[')
1497 TRACE(
"(%p %p %lx): Malformed URI, Unknown host type.\n",
ptr,
data, extras);
1531 }
else if(!(
flags & Uri_CREATE_NO_CANONICALIZE)) {
1545 (
flags & Uri_CREATE_FILE_USE_DOS_PATH)) {
1551 }
else if(**
ptr ==
'\\') {
1555 if(
flags & Uri_CREATE_NO_CANONICALIZE) {
1604 if (is_mailto && (*
ptr)[0] ==
'/' && (*
ptr)[1] ==
'/')
1613 if(**
ptr ==
'%' && known_scheme) {
1621 (
flags & Uri_CREATE_FILE_USE_DOS_PATH)) {
1679 !(
flags & Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES)) {
1684 if(**
ptr ==
'/' && *(*
ptr+1) ==
'/') {
1733 while(**
ptr && **
ptr !=
'#') {
1734 if(**
ptr ==
'%' && known_scheme &&
1735 !(
flags & Uri_CREATE_NO_DECODE_EXTRA_INFO)) {
1773 if(**
ptr ==
'%' && known_scheme &&
1774 !(
flags & Uri_CREATE_NO_DECODE_EXTRA_INFO)) {
1826 if(!
data->username) {
1827 uri->userinfo_start = -1;
1831 uri->userinfo_start =
uri->canon_len;
1853 if(!(
flags & Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS)) {
1857 uri->canon_len += 3;
1874 if(!
data->password) {
1875 uri->userinfo_split = -1;
1879 if(
uri->userinfo_start == -1)
1881 uri->userinfo_start =
uri->canon_len;
1883 uri->userinfo_split =
uri->canon_len -
uri->userinfo_start;
1887 uri->canon_uri[
uri->canon_len] =
':';
1911 if(!(
flags & Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS)) {
1915 uri->canon_len += 3;
1938 uri->userinfo_start =
uri->userinfo_split = -1;
1939 uri->userinfo_len = 0;
1941 if(!
data->username && !
data->password)
1951 uri->userinfo_len =
uri->canon_len -
uri->userinfo_start;
1953 TRACE(
"(%p %p %lx %d): Canonicalized userinfo, userinfo_start=%d, userinfo=%s, userinfo_split=%d userinfo_len=%ld.\n",
1955 uri->userinfo_split,
uri->userinfo_len);
1959 uri->canon_uri[
uri->canon_len] =
'@';
1992 uri->host_start = -1;
1994 uri->host_type = Uri_HOST_UNKNOWN;
2001 uri->canon_uri[
uri->canon_len] =
'\\';
2002 uri->canon_uri[
uri->canon_len+1] =
'\\';
2004 uri->canon_len += 2;
2005 uri->authority_start =
uri->canon_len;
2008 uri->host_start =
uri->canon_len;
2011 if(*
ptr ==
'%' && known_scheme) {
2035 }
else if(*
ptr ==
'\\') {
2040 }
else if(!(
flags & Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS) &&
is_ascii(*
ptr) &&
2046 if(!(
flags & Uri_CREATE_NO_CANONICALIZE)) {
2052 uri->canon_len += 3;
2055 if(!(
flags & Uri_CREATE_NO_CANONICALIZE) && known_scheme)
2065 uri->host_len =
uri->canon_len -
uri->host_start;
2074 &(
uri->domain_offset));
2081 uri->host_start =
uri->canon_len;
2091 uri->canon_len +=
data->host_len;
2099 uri->host_len =
uri->canon_len -
uri->host_start;
2100 uri->host_type = Uri_HOST_IPV4;
2103 TRACE(
"%p %p %lx %d): Canonicalized implicit IP address=%s len=%ld\n",
2130 if(
data->has_implicit_ip)
2133 uri->host_start =
uri->canon_len;
2138 DWORD i, octetDigitCount = 0, octetCount = 0;
2141 for(
i = 0;
i <
data->host_len; ++
i) {
2142 if(
data->host[
i] ==
'0' && !octetHasDigit) {
2148 if(octetDigitCount == 2 ||
2149 i+1 ==
data->host_len ||
2150 data->host[
i+1] ==
'.') {
2154 TRACE(
"Adding zero\n");
2156 }
else if(
data->host[
i] ==
'.') {
2161 octetDigitCount = 0;
2162 octetHasDigit =
FALSE;
2170 octetHasDigit =
TRUE;
2177 for( ; octetCount < 3; ++octetCount) {
2179 uri->canon_uri[
uri->canon_len] =
'.';
2180 uri->canon_uri[
uri->canon_len+1] =
'0';
2183 uri->canon_len += 2;
2189 uri->canon_len +=
data->host_len;
2192 uri->host_len =
uri->canon_len -
uri->host_start;
2194 TRACE(
"(%p %p %lx %d): Canonicalized IPv4 address, ip=%s len=%ld\n",
2240 uri->host_start =
uri->canon_len;
2245 uri->canon_len +=
data->host_len;
2254 uri->canon_uri[
uri->canon_len++] =
'[';
2257 uri->canon_uri[
uri->canon_len++] =
']';
2261 uri->host_len =
uri->canon_len -
uri->host_start;
2264 TRACE(
"(%p %p %lx %d): Canonicalized IPv6 address %s, len=%ld\n",
data,
uri,
flags,
2273 uri->host_start = -1;
2275 uri->domain_offset = -1;
2278 switch(
data->host_type) {
2280 uri->host_type = Uri_HOST_DNS;
2286 uri->host_type = Uri_HOST_IPV4;
2295 uri->host_type = Uri_HOST_IPV6;
2299 uri->host_type = Uri_HOST_IDN;
2304 case Uri_HOST_UNKNOWN:
2306 uri->host_start =
uri->canon_len;
2311 uri->canon_len +=
data->host_len;
2312 uri->host_len =
data->host_len;
2315 uri->host_type = Uri_HOST_UNKNOWN;
2318 FIXME(
"(%p %p %lx %d): Canonicalization for host type %d not supported.\n",
data,
2332 uri->port_offset = -1;
2337 has_default_port =
TRUE;
2343 uri->has_port =
data->has_port || has_default_port;
2351 if(has_default_port &&
data->has_port &&
data->port_value == default_port) {
2353 if(
flags & Uri_CREATE_NO_CANONICALIZE) {
2354 uri->port_offset =
uri->canon_len-
uri->authority_start;
2356 uri->canon_uri[
uri->canon_len] =
':';
2363 uri->canon_len +=
data->port_len;
2372 uri->port = default_port;
2373 }
else if(
data->has_port) {
2374 uri->port_offset =
uri->canon_len-
uri->authority_start;
2376 uri->canon_uri[
uri->canon_len] =
':';
2379 if(
flags & Uri_CREATE_NO_CANONICALIZE &&
data->port) {
2383 uri->canon_len +=
data->port_len;
2392 }
else if(has_default_port)
2393 uri->port = default_port;
2400 uri->authority_start =
uri->canon_len;
2401 uri->authority_len = 0;
2412 if(
uri->host_start != -1 || (
data->is_relative && (
data->password ||
data->username)))
2413 uri->authority_len =
uri->canon_len -
uri->authority_start;
2415 uri->authority_start = -1;
2450 BOOL is_implicit_scheme,
WCHAR *ret_path) {
2463 if(is_file && !has_host) {
2467 ret_path[
len] =
'/';
2470 }
else if(*
ptr ==
'/') {
2471 if(!(
flags & Uri_CREATE_FILE_USE_DOS_PATH)) {
2474 ret_path[
len] =
'/';
2484 ret_path[
len+1] =
':';
2491 if(!is_file && *
path && *
path !=
'/') {
2494 ret_path[
len] =
'/';
2501 if(*
ptr ==
'%' && !is_res) {
2509 if(force_encode || escape_pct) {
2514 do_default_action =
FALSE;
2525 }
else if(*
ptr ==
'/' && is_file && (
flags & Uri_CREATE_FILE_USE_DOS_PATH)) {
2528 ret_path[
len] =
'\\';
2530 do_default_action =
FALSE;
2531 }
else if(*
ptr ==
'\\' && known_scheme) {
2532 if(!(is_file && (
flags & Uri_CREATE_FILE_USE_DOS_PATH))) {
2535 ret_path[
len] =
'/';
2537 do_default_action =
FALSE;
2540 (!(
flags & Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS) || is_file)) {
2541 if(!is_file || !(
flags & Uri_CREATE_FILE_USE_DOS_PATH)) {
2546 do_default_action =
FALSE;
2550 if(do_default_action) {
2561 if(!(is_file && (
flags & Uri_CREATE_FILE_USE_DOS_PATH)) &&
2563 if(!(
flags & Uri_CREATE_NO_CANONICALIZE) && ret_path) {
2601 uri->path_start = -1;
2606 uri->path_start =
uri->canon_len;
2611 flags |= Uri_CREATE_FILE_USE_DOS_PATH;
2618 uri->path_len =
data->path_len;
2619 uri->canon_len +=
data->path_len;
2626 if(
data->scheme && *(
data->path) ==
'/' && *(
data->path+1) ==
'/') {
2629 uri->canon_uri[
uri->canon_len] =
'/';
2630 uri->canon_uri[
uri->canon_len+1] =
'.';
2633 uri->canon_len += 2;
2639 if(*
ptr ==
'%' && known_scheme) {
2650 }
else if(*
ptr ==
'/' && is_file && (
flags & Uri_CREATE_FILE_USE_DOS_PATH)) {
2652 uri->canon_uri[
uri->canon_len] =
'\\';
2654 do_default_action =
FALSE;
2655 }
else if(*
ptr ==
'\\') {
2656 if((
data->is_relative || is_mk || is_file) && !(
flags & Uri_CREATE_FILE_USE_DOS_PATH)) {
2659 uri->canon_uri[
uri->canon_len] =
'/';
2661 do_default_action =
FALSE;
2663 }
else if(is_mk && *
ptr ==
':' &&
ptr + 1 <
data->path +
data->path_len && *(
ptr + 1) ==
':') {
2664 flags &= ~Uri_CREATE_FILE_USE_DOS_PATH;
2666 !(
flags & Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS)) {
2667 if(!(is_file && (
flags & Uri_CREATE_FILE_USE_DOS_PATH))) {
2670 uri->canon_len += 3;
2671 do_default_action =
FALSE;
2675 if(do_default_action) {
2682 if(is_mk && !computeOnly && !(
flags & Uri_CREATE_NO_CANONICALIZE)) {
2684 uri->canon_len -
uri->path_start);
2685 uri->canon_len =
uri->path_start + new_len;
2688 uri->path_len =
uri->canon_len -
uri->path_start;
2691 TRACE(
"(%p %p %lx %d): Canonicalized opaque URI path %s len=%ld\n",
data,
uri,
flags, computeOnly,
2703 if(!
data->is_opaque || (
data->is_relative && (
data->password ||
data->username))) {
2710 if((
data->is_relative && (
data->host ||
data->has_port)) ||
2718 uri->canon_uri[
pos] =
'/';
2719 uri->canon_uri[
pos+1] =
'/';
2721 uri->canon_len += 2;
2727 if(
data->is_relative && (
data->password ||
data->username)) {
2732 uri->path_start =
uri->canon_len;
2735 uri->canon_len +=
uri->path_len;
2736 if(!computeOnly && !
uri->path_len)
2737 uri->path_start = -1;
2741 uri->userinfo_start =
uri->userinfo_split = -1;
2742 uri->userinfo_len = 0;
2743 uri->host_start = -1;
2745 uri->host_type = Uri_HOST_UNKNOWN;
2747 uri->authority_start = -1;
2748 uri->authority_len = 0;
2749 uri->domain_offset = -1;
2750 uri->port_offset = -1;
2774 if(
uri->path_start > -1 && !computeOnly)
2778 uri->extension_offset = -1;
2798 uri->query_start = -1;
2803 uri->query_start =
uri->canon_len;
2808 if(known_scheme && !(
flags & Uri_CREATE_NO_DECODE_EXTRA_INFO)) {
2820 if(!(
flags & Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS) &&
2821 !(
flags & Uri_CREATE_NO_DECODE_EXTRA_INFO)) {
2824 uri->canon_len += 3;
2834 uri->query_len =
uri->canon_len -
uri->query_start;
2837 TRACE(
"(%p %p %lx %d): Canonicalized query string %s len=%ld\n",
data,
uri,
flags,
2847 if(!
data->fragment) {
2848 uri->fragment_start = -1;
2849 uri->fragment_len = 0;
2853 uri->fragment_start =
uri->canon_len;
2858 if(known_scheme && !(
flags & Uri_CREATE_NO_DECODE_EXTRA_INFO)) {
2870 if(!(
flags & Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS) &&
2871 !(
flags & Uri_CREATE_NO_DECODE_EXTRA_INFO)) {
2874 uri->canon_len += 3;
2884 uri->fragment_len =
uri->canon_len -
uri->fragment_start;
2895 uri->scheme_start = -1;
2896 uri->scheme_len = 0;
2902 if(!
data->is_relative) {
2903 FIXME(
"(%p %p %lx): Unable to determine the scheme type of %s.\n",
data,
2912 for(
i = 0;
i <
data->scheme_len; ++
i) {
2917 uri->canon_uri[
i +
pos] =
':';
2925 uri->canon_len +=
data->scheme_len + 1;
2926 uri->scheme_len =
data->scheme_len;
2942 TRACE(
"(%p %lx): Beginning to compute canonicalized length for URI %s\n",
data,
flags,
2946 ERR(
"(%p %lx): Failed to compute URI scheme length.\n",
data,
flags);
2951 ERR(
"(%p %lx): Failed to compute URI hierpart length.\n",
data,
flags);
2956 ERR(
"(%p %lx): Failed to compute query string length.\n",
data,
flags);
2961 ERR(
"(%p %lx): Failed to compute fragment length.\n",
data,
flags);
2965 TRACE(
"(%p %lx): Finished computing canonicalized URI length. length=%ld\n",
data,
flags,
uri.canon_len);
2967 return uri.canon_len;
2982 uri->canon_size =
uri->canon_len = 0;
2989 ERR(
"(%p %p %lx): Could not compute the canonicalized length of %s.\n",
data,
uri,
flags,
3000 ERR(
"(%p %p %lx): Unable to canonicalize the scheme of the URI.\n",
data,
uri,
flags);
3003 uri->scheme_type =
data->scheme_type;
3006 ERR(
"(%p %p %lx): Unable to canonicalize the hierpart of the URI\n",
data,
uri,
flags);
3011 ERR(
"(%p %p %lx): Unable to canonicalize query string of the URI.\n",
3017 ERR(
"(%p %p %lx): Unable to canonicalize fragment of the URI.\n",
3025 if(
uri->canon_len <
uri->canon_size) {
3033 uri->canon_uri = tmp;
3034 uri->canon_size =
uri->canon_len;
3037 uri->canon_uri[
uri->canon_len] =
'\0';
3058 if(!(*component) &&
source) {
3062 *component =
malloc((source_len + 1) *
sizeof(
WCHAR));
3067 (*component)[source_len] =
'\0';
3068 *component_len = source_len;
3071 *output = *component;
3072 *output_len = *component_len;
3108 *component_len =
len+
pos;
3111 *
flags |= success_flag;
3154 const WCHAR *component;
3173 data->scheme_len == expected_len) {
3175 TRACE(
"(%p %p %lx): Found valid scheme component %s len=%ld.\n", builder,
data,
flags,
3178 TRACE(
"(%p %p %lx): Invalid scheme component found %s.\n", builder,
data,
flags,
3210 data->username_len == expected_len)
3211 TRACE(
"(%p %p %lx): Found valid username component %s len=%ld.\n", builder,
data,
flags,
3214 TRACE(
"(%p %p %lx): Invalid username component found %s.\n", builder,
data,
flags,
3245 data->password_len == expected_len)
3246 TRACE(
"(%p %p %lx): Found valid password component %s len=%ld.\n", builder,
data,
flags,
3249 TRACE(
"(%p %p %lx): Invalid password component found %s.\n", builder,
data,
flags,
3292 TRACE(
"(%p %p): Found valid host name %s len=%ld type=%d.\n", builder,
data,
3295 TRACE(
"(%p %p): Invalid host name found %s.\n", builder,
data,
3316 TRACE(
"(%p %p %lx): Using %lu as port for IUri.\n", builder,
data,
flags,
data->port_value);
3321 const WCHAR *component;
3349 if(!
valid || (check_len && expected_len !=
data->path_len)) {
3350 TRACE(
"(%p %p %lx): Invalid path component %s.\n", builder,
data,
flags,
3355 TRACE(
"(%p %p %lx): Valid path component %s len=%ld.\n", builder,
data,
flags,
3366 if(builder->
query) {
3380 TRACE(
"(%p %p %lx): Valid query component %s len=%ld.\n", builder,
data,
flags,
3383 TRACE(
"(%p %p %lx): Invalid query component %s.\n", builder,
data,
flags,
3411 TRACE(
"(%p %p %lx): Valid fragment component %s len=%ld.\n", builder,
data,
flags,
3414 TRACE(
"(%p %p %lx): Invalid fragment component %s.\n", builder,
data,
flags,
3428 TRACE(
"(%p %p %lx): Beginning to validate builder components.\n", builder,
data,
flags);
3438 TRACE(
"(%p %p %lx): File schemes can't contain a username or password.\n",
3455 if(!
data->is_relative)
3473 TRACE(
"(%p %p %lx): Finished validating builder components.\n", builder,
data,
flags);
3480 WCHAR *canon_path_a, *canon_path_b;
3484 *
ret = !
b->path_len;
3494 if(
a->path_len ==
b->path_len && !
wcsnicmp(
a->canon_uri+
a->path_start,
b->canon_uri+
b->path_start,
a->path_len)) {
3514 *
ret = len_a == len_b && !
wcsnicmp(canon_path_a, canon_path_b, len_a);
3528 const BOOL are_hierarchical =
a->authority_start > -1 &&
b->authority_start > -1;
3533 if(
a->scheme_type !=
b->scheme_type)
3538 if((
a->scheme_start > -1 &&
b->scheme_start > -1) &&
3539 (
a->scheme_len ==
b->scheme_len)) {
3541 if(
StrCmpNW(
a->canon_uri+
a->scheme_start,
b->canon_uri+
b->scheme_start,
a->scheme_len))
3543 }
else if(
a->scheme_len !=
b->scheme_len)
3549 if((
a->userinfo_start > -1 &&
b->userinfo_start > -1) &&
3550 (
a->userinfo_len ==
b->userinfo_len)) {
3551 if(
StrCmpNW(
a->canon_uri+
a->userinfo_start,
b->canon_uri+
b->userinfo_start,
a->userinfo_len))
3553 }
else if(
a->userinfo_len !=
b->userinfo_len)
3558 if((
a->host_start > -1 &&
b->host_start > -1) &&
3559 (
a->host_len ==
b->host_len)) {
3562 if(
StrCmpNIW(
a->canon_uri+
a->host_start,
b->canon_uri+
b->host_start,
a->host_len))
3564 }
else if(
StrCmpNW(
a->canon_uri+
a->host_start,
b->canon_uri+
b->host_start,
a->host_len))
3566 }
else if(
a->host_len !=
b->host_len)
3570 if(
a->has_port &&
b->has_port) {
3571 if(
a->port !=
b->port)
3573 }
else if(
a->has_port ||
b->has_port)
3589 }
else if((
a->path_start > -1 &&
b->path_start > -1) &&
3590 (
a->path_len ==
b->path_len)) {
3591 if(
StrCmpNW(
a->canon_uri+
a->path_start,
b->canon_uri+
b->path_start,
a->path_len))
3593 }
else if(are_hierarchical &&
a->path_len == -1 &&
b->path_len == 0) {
3594 if(*(
a->canon_uri+
a->path_start) !=
'/')
3596 }
else if(are_hierarchical &&
b->path_len == 1 &&
a->path_len == 0) {
3597 if(*(
b->canon_uri+
b->path_start) !=
'/')
3599 }
else if(
a->path_len !=
b->path_len)
3603 if((
a->query_start > -1 &&
b->query_start > -1) &&
3604 (
a->query_len ==
b->query_len)) {
3605 if(
StrCmpNW(
a->canon_uri+
a->query_start,
b->canon_uri+
b->query_start,
a->query_len))
3607 }
else if(
a->query_len !=
b->query_len)
3610 if((
a->fragment_start > -1 &&
b->fragment_start > -1) &&
3611 (
a->fragment_len ==
b->fragment_len)) {
3612 if(
StrCmpNW(
a->canon_uri+
a->fragment_start,
b->canon_uri+
b->fragment_start,
a->fragment_len))
3614 }
else if(
a->fragment_len !=
b->fragment_len)
3656 if(!
data->is_opaque) {
3677 if(
data->username) {
3683 if(
data->password) {
3691 if(
data->password ||
data->username) {
3701 const BOOL add_brackets =
data->host_type == Uri_HOST_IPV6 && *(
data->host) !=
'[';
3719 if(
data->has_port) {
3745 if(!
data->is_opaque &&
data->path && *(
data->path) !=
'/') {
3775 if(
data->fragment) {
3832 TRACE(
"(%p)->(IID_IUriBuilderFactory %p)\n",
This,
ppv);
3833 *
ppv = &
This->IUriBuilderFactory_iface;
3836 *
ppv = &
This->IPersistStream_iface;
3883 if(!
This->create_flags)
3888 if(uriProp > Uri_PROPERTY_STRING_LAST) {
3890 if(uriProp == Uri_PROPERTY_ZONE) {
3892 if(!(*pbstrProperty))
3897 *pbstrProperty =
NULL;
3902 &&
dwFlags != Uri_DISPLAY_IDN_HOST)
3905 if((
dwFlags == Uri_DISPLAY_NO_FRAGMENT && uriProp != Uri_PROPERTY_DISPLAY_URI)
3906 || (
dwFlags == Uri_PUNYCODE_IDN_HOST && uriProp != Uri_PROPERTY_ABSOLUTE_URI
3907 && uriProp != Uri_PROPERTY_DOMAIN && uriProp != Uri_PROPERTY_HOST)
3908 || (
dwFlags == Uri_DISPLAY_IDN_HOST && uriProp != Uri_PROPERTY_ABSOLUTE_URI
3909 && uriProp != Uri_PROPERTY_DOMAIN && uriProp != Uri_PROPERTY_HOST))
3913 case Uri_PROPERTY_ABSOLUTE_URI:
3919 else if (
dwFlags == Uri_PUNYCODE_IDN_HOST &&
This->host_type == Uri_HOST_IDN &&
This->host_start > -1) {
3920 unsigned int punycode_host_len;
3925 if(*pbstrProperty) {
3928 memcpy(*pbstrProperty+
This->host_start+punycode_host_len,
3934 if(
This->userinfo_len == 0) {
3938 if(*pbstrProperty) {
3946 }
else if(
This->userinfo_split == 0 &&
This->userinfo_len == 1) {
3950 if(*pbstrProperty) {
3965 if(!(*pbstrProperty))
3969 case Uri_PROPERTY_AUTHORITY:
3970 if(
This->authority_start > -1) {
3983 if(!(*pbstrProperty))
3987 case Uri_PROPERTY_DISPLAY_URI:
3995 if(
dwFlags == Uri_DISPLAY_NO_FRAGMENT &&
This->fragment_start > -1)
4000 if(*pbstrProperty) {
4013 if(
dwFlags == Uri_DISPLAY_NO_FRAGMENT &&
This->fragment_start > -1)
4019 if(!(*pbstrProperty))
4025 case Uri_PROPERTY_DOMAIN:
4026 if(
This->domain_offset > -1) {
4027 if(
dwFlags == Uri_PUNYCODE_IDN_HOST &&
This->host_type == Uri_HOST_IDN) {
4028 unsigned int punycode_length;
4035 This->host_len-
This->domain_offset, *pbstrProperty, punycode_length);
4038 This->host_len-
This->domain_offset);
4047 if(!(*pbstrProperty))
4051 case Uri_PROPERTY_EXTENSION:
4052 if(
This->extension_offset > -1) {
4054 This->path_len-
This->extension_offset);
4061 if(!(*pbstrProperty))
4065 case Uri_PROPERTY_FRAGMENT:
4066 if(
This->fragment_start > -1) {
4074 if(!(*pbstrProperty))
4078 case Uri_PROPERTY_HOST:
4079 if(
This->host_start > -1) {
4081 if(
This->host_type == Uri_HOST_IPV6)
4083 else if(
dwFlags == Uri_PUNYCODE_IDN_HOST &&
This->host_type == Uri_HOST_IDN) {
4084 unsigned int punycode_length;
4100 if(!(*pbstrProperty))
4104 case Uri_PROPERTY_PASSWORD:
4105 if(
This->userinfo_split > -1) {
4107 This->canon_uri+
This->userinfo_start+
This->userinfo_split+1,
4108 This->userinfo_len-
This->userinfo_split-1);
4115 if(!(*pbstrProperty))
4119 case Uri_PROPERTY_PATH:
4120 if(
This->path_start > -1) {
4128 if(!(*pbstrProperty))
4132 case Uri_PROPERTY_PATH_AND_QUERY:
4133 if(
This->path_start > -1) {
4136 }
else if(
This->query_start > -1) {
4144 if(!(*pbstrProperty))
4148 case Uri_PROPERTY_QUERY:
4149 if(
This->query_start > -1) {
4157 if(!(*pbstrProperty))
4161 case Uri_PROPERTY_RAW_URI:
4163 if(!(*pbstrProperty))
4168 case Uri_PROPERTY_SCHEME_NAME:
4169 if(
This->scheme_start > -1) {
4177 if(!(*pbstrProperty))
4181 case Uri_PROPERTY_USER_INFO:
4182 if(
This->userinfo_start > -1) {
4190 if(!(*pbstrProperty))
4194 case Uri_PROPERTY_USER_NAME:
4195 if(
This->userinfo_start > -1 &&
This->userinfo_split != 0) {
4199 if(
This->userinfo_split > -1) {
4211 if(!(*pbstrProperty))
4229 if(!
This->create_flags)
4235 if(uriProp > Uri_PROPERTY_STRING_LAST)
4239 &&
dwFlags != Uri_DISPLAY_IDN_HOST) {
4245 case Uri_PROPERTY_ABSOLUTE_URI:
4251 else if(
dwFlags == Uri_PUNYCODE_IDN_HOST &&
This->host_type == Uri_HOST_IDN &&
This->host_start > -1) {
4253 *pcchProperty =
This->canon_len -
This->host_len + punycode_host_len;
4257 if(
This->userinfo_start > -1 &&
This->userinfo_len == 0)
4259 *pcchProperty =
This->canon_len-1;
4260 else if(
This->userinfo_start > -1 &&
This->userinfo_len == 1 &&
4261 This->userinfo_split == 0)
4263 *pcchProperty =
This->canon_len-2;
4265 *pcchProperty =
This->canon_len;
4267 *pcchProperty =
This->canon_len;
4273 case Uri_PROPERTY_AUTHORITY:
4274 if(
This->port_offset > -1 &&
4278 *pcchProperty =
This->port_offset;
4280 *pcchProperty =
This->authority_len;
4283 case Uri_PROPERTY_DISPLAY_URI:
4285 *pcchProperty =
This->canon_len-
This->userinfo_len-1;
4287 *pcchProperty =
This->canon_len;
4289 if(
dwFlags == Uri_DISPLAY_NO_FRAGMENT &&
This->fragment_start > -1)
4290 *pcchProperty -=
This->fragment_len;
4294 case Uri_PROPERTY_DOMAIN:
4295 if(
This->domain_offset > -1) {
4296 if(
dwFlags == Uri_PUNYCODE_IDN_HOST &&
This->host_type == Uri_HOST_IDN)
4299 *pcchProperty =
This->host_len -
This->domain_offset;
4306 case Uri_PROPERTY_EXTENSION:
4307 if(
This->extension_offset > -1) {
4308 *pcchProperty =
This->path_len -
This->extension_offset;
4316 case Uri_PROPERTY_FRAGMENT:
4317 *pcchProperty =
This->fragment_len;
4320 case Uri_PROPERTY_HOST:
4321 *pcchProperty =
This->host_len;
4324 if(
This->host_type == Uri_HOST_IPV6)
4326 else if(
dwFlags == Uri_PUNYCODE_IDN_HOST &&
This->host_type == Uri_HOST_IDN &&
This->host_start > -1)
4331 case Uri_PROPERTY_PASSWORD:
4332 *pcchProperty = (
This->userinfo_split > -1) ?
This->userinfo_len-
This->userinfo_split-1 : 0;
4335 case Uri_PROPERTY_PATH:
4336 *pcchProperty =
This->path_len;
4339 case Uri_PROPERTY_PATH_AND_QUERY:
4340 *pcchProperty =
This->path_len+
This->query_len;
4343 case Uri_PROPERTY_QUERY:
4344 *pcchProperty =
This->query_len;
4347 case Uri_PROPERTY_RAW_URI:
4351 case Uri_PROPERTY_SCHEME_NAME:
4352 *pcchProperty =
This->scheme_len;
4355 case Uri_PROPERTY_USER_INFO:
4356 *pcchProperty =
This->userinfo_len;
4359 case Uri_PROPERTY_USER_NAME:
4360 *pcchProperty = (
This->userinfo_split > -1) ?
This->userinfo_split :
This->userinfo_len;
4361 if(
This->userinfo_split == 0)
4372 && ((
dwFlags == Uri_DISPLAY_NO_FRAGMENT && uriProp != Uri_PROPERTY_DISPLAY_URI)
4373 || (
dwFlags == Uri_PUNYCODE_IDN_HOST && uriProp != Uri_PROPERTY_ABSOLUTE_URI
4374 && uriProp != Uri_PROPERTY_DOMAIN && uriProp != Uri_PROPERTY_HOST)
4375 || (
dwFlags == Uri_DISPLAY_IDN_HOST && uriProp != Uri_PROPERTY_ABSOLUTE_URI
4376 && uriProp != Uri_PROPERTY_DOMAIN && uriProp != Uri_PROPERTY_HOST))) {
4391 if(!
This->create_flags)
4401 if(uriProp == Uri_PROPERTY_ZONE) {
4402 *pcchProperty = URLZONE_INVALID;
4406 if(uriProp < Uri_PROPERTY_DWORD_START) {
4412 case Uri_PROPERTY_HOST_TYPE:
4413 *pcchProperty =
This->host_type;
4416 case Uri_PROPERTY_PORT:
4417 if(!
This->has_port) {
4421 *pcchProperty =
This->port;
4426 case Uri_PROPERTY_SCHEME:
4427 *pcchProperty =
This->scheme_type;
4448 case Uri_PROPERTY_ABSOLUTE_URI:
4451 case Uri_PROPERTY_AUTHORITY:
4452 *pfHasProperty =
This->authority_start > -1;
4454 case Uri_PROPERTY_DISPLAY_URI:
4455 *pfHasProperty =
TRUE;
4457 case Uri_PROPERTY_DOMAIN:
4458 *pfHasProperty =
This->domain_offset > -1;
4460 case Uri_PROPERTY_EXTENSION:
4461 *pfHasProperty =
This->extension_offset > -1;
4463 case Uri_PROPERTY_FRAGMENT:
4464 *pfHasProperty =
This->fragment_start > -1;
4466 case Uri_PROPERTY_HOST:
4467 *pfHasProperty =
This->host_start > -1;
4469 case Uri_PROPERTY_PASSWORD:
4470 *pfHasProperty =
This->userinfo_split > -1;
4472 case Uri_PROPERTY_PATH:
4473 *pfHasProperty =
This->path_start > -1;
4475 case Uri_PROPERTY_PATH_AND_QUERY:
4476 *pfHasProperty = (
This->path_start > -1 ||
This->query_start > -1);
4478 case Uri_PROPERTY_QUERY:
4479 *pfHasProperty =
This->query_start > -1;
4481 case Uri_PROPERTY_RAW_URI:
4482 *pfHasProperty =
TRUE;
4484 case Uri_PROPERTY_SCHEME_NAME:
4485 *pfHasProperty =
This->scheme_start > -1;
4487 case Uri_PROPERTY_USER_INFO:
4488 *pfHasProperty =
This->userinfo_start > -1;
4490 case Uri_PROPERTY_USER_NAME:
4491 if(
This->userinfo_split == 0)
4492 *pfHasProperty =
FALSE;
4494 *pfHasProperty =
This->userinfo_start > -1;
4496 case Uri_PROPERTY_HOST_TYPE:
4497 *pfHasProperty =
TRUE;
4499 case Uri_PROPERTY_PORT:
4500 *pfHasProperty =
This->has_port;
4502 case Uri_PROPERTY_SCHEME:
4503 *pfHasProperty =
TRUE;
4505 case Uri_PROPERTY_ZONE:
4506 *pfHasProperty =
FALSE;
4509 FIXME(
"(%p)->(%d %p): Unsupported property type.\n",
This, uriProp, pfHasProperty);
4518 TRACE(
"(%p)->(%p)\n", iface, pstrAbsoluteUri);
4519 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_ABSOLUTE_URI, pstrAbsoluteUri, 0);
4524 TRACE(
"(%p)->(%p)\n", iface, pstrAuthority);
4525 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_AUTHORITY, pstrAuthority, 0);
4530 TRACE(
"(%p)->(%p)\n", iface, pstrDisplayUri);
4531 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_DISPLAY_URI, pstrDisplayUri, 0);
4536 TRACE(
"(%p)->(%p)\n", iface, pstrDomain);
4537 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_DOMAIN, pstrDomain, 0);
4542 TRACE(
"(%p)->(%p)\n", iface, pstrExtension);
4543 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_EXTENSION, pstrExtension, 0);
4548 TRACE(
"(%p)->(%p)\n", iface, pstrFragment);
4549 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_FRAGMENT, pstrFragment, 0);
4554 TRACE(
"(%p)->(%p)\n", iface, pstrHost);
4555 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_HOST, pstrHost, 0);
4560 TRACE(
"(%p)->(%p)\n", iface, pstrPassword);
4561 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_PASSWORD, pstrPassword, 0);
4566 TRACE(
"(%p)->(%p)\n", iface, pstrPath);
4567 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_PATH, pstrPath, 0);
4572 TRACE(
"(%p)->(%p)\n", iface, pstrPathAndQuery);
4573 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_PATH_AND_QUERY, pstrPathAndQuery, 0);
4578 TRACE(
"(%p)->(%p)\n", iface, pstrQuery);
4579 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_QUERY, pstrQuery, 0);
4584 TRACE(
"(%p)->(%p)\n", iface, pstrRawUri);
4585 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_RAW_URI, pstrRawUri, 0);
4590 TRACE(
"(%p)->(%p)\n", iface, pstrSchemeName);
4591 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_SCHEME_NAME, pstrSchemeName, 0);
4596 TRACE(
"(%p)->(%p)\n", iface, pstrUserInfo);
4597 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_USER_INFO, pstrUserInfo, 0);
4602 TRACE(
"(%p)->(%p)\n", iface, pstrUserName);
4603 return IUri_GetPropertyBSTR(iface, Uri_PROPERTY_USER_NAME, pstrUserName, 0);
4608 TRACE(
"(%p)->(%p)\n", iface, pdwHostType);
4609 return IUri_GetPropertyDWORD(iface, Uri_PROPERTY_HOST_TYPE, pdwHostType, 0);
4614 TRACE(
"(%p)->(%p)\n", iface, pdwPort);
4615 return IUri_GetPropertyDWORD(iface, Uri_PROPERTY_PORT, pdwPort, 0);
4620 TRACE(
"(%p)->(%p)\n", iface, pdwScheme);
4621 return IUri_GetPropertyDWORD(iface, Uri_PROPERTY_SCHEME, pdwScheme, 0);
4626 TRACE(
"(%p)->(%p)\n", iface, pdwZone);
4627 return IUri_GetPropertyDWORD(iface, Uri_PROPERTY_ZONE,pdwZone, 0);
4635 if(!
This->create_flags)
4641 *pdwProperties = Uri_HAS_DISPLAY_URI|Uri_HAS_RAW_URI|Uri_HAS_SCHEME|Uri_HAS_HOST_TYPE;
4644 *pdwProperties |= Uri_HAS_ABSOLUTE_URI;
4646 if(
This->scheme_start > -1)
4647 *pdwProperties |= Uri_HAS_SCHEME_NAME;
4649 if(
This->authority_start > -1) {
4650 *pdwProperties |= Uri_HAS_AUTHORITY;
4651 if(
This->userinfo_start > -1) {
4652 *pdwProperties |= Uri_HAS_USER_INFO;
4653 if(
This->userinfo_split != 0)
4654 *pdwProperties |= Uri_HAS_USER_NAME;
4656 if(
This->userinfo_split > -1)
4657 *pdwProperties |= Uri_HAS_PASSWORD;
4658 if(
This->host_start > -1)
4659 *pdwProperties |= Uri_HAS_HOST;
4660 if(
This->domain_offset > -1)
4661 *pdwProperties |= Uri_HAS_DOMAIN;
4665 *pdwProperties |= Uri_HAS_PORT;
4666 if(
This->path_start > -1)
4667 *pdwProperties |= Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY;
4668 if(
This->query_start > -1)
4669 *pdwProperties |= Uri_HAS_QUERY|Uri_HAS_PATH_AND_QUERY;
4671 if(
This->extension_offset > -1)
4672 *pdwProperties |= Uri_HAS_EXTENSION;
4674 if(
This->fragment_start > -1)
4675 *pdwProperties |= Uri_HAS_FRAGMENT;
4687 if(!
This->create_flags)
4701 FIXME(
"(%p)->(%p %p) No support for unknown IUri's yet.\n", iface, pUri, pfEqual);
4748 return IUri_QueryInterface(&
This->IUri_iface,
riid,
ppv);
4754 return IUri_AddRef(&
This->IUri_iface);
4760 return IUri_Release(&
This->IUri_iface);
4775 *ppIUriBuilder =
NULL;
4794 *ppIUriBuilder =
NULL;
4817 return IUri_QueryInterface(&
This->IUri_iface,
riid, ppvObject);
4823 return IUri_AddRef(&
This->IUri_iface);
4829 return IUri_Release(&
This->IUri_iface);
4870 if(
This->create_flags)
4892 if(*(
DWORD*)
data->data != Uri_PROPERTY_RAW_URI) {
4894 ERR(
"Can't find raw_uri\n");
4899 if(!
This->raw_uri) {
4903 This->create_flags =
data->create_flags;
4911 This->create_flags = 0;
4918 This->create_flags = 0;
4942 data->create_flags =
This->create_flags;
4944 if(
This->create_flags) {
4945 data->fields_no = 1;
4953 if(
This->fragment_len) {
4956 This->fragment_len,
This->canon_uri+
This->fragment_start);
4959 if(
This->host_len) {
4961 if(
This->host_type == Uri_HOST_IPV6)
4969 if(
This->userinfo_split > -1) {
4972 This->userinfo_len-
This->userinfo_split-1,
4973 This->canon_uri+
This->userinfo_start+
This->userinfo_split+1);
4976 if(
This->path_len) {
4980 }
else if(marshal) {
4981 WCHAR no_path =
'/';
4986 if(
This->has_port) {
4988 *(
DWORD*)
p = Uri_PROPERTY_PORT;
4996 if(
This->query_len) {
5002 if(
This->scheme_len) {
5008 if(
This->userinfo_start>-1 &&
This->userinfo_split!=0) {
5010 if(
This->userinfo_split > -1)
5012 This->userinfo_split,
This->canon_uri+
This->userinfo_start);
5015 This->userinfo_len,
This->canon_uri+
This->userinfo_start);
5026 TRACE(
"(%p)->(%p %x)\n",
This, pStm, fClearDirty);
5031 hres = IPersistStream_GetSizeMax(&
This->IPersistStream_iface, &
size);
5055 pcbSize->
u.HighPart = 0;
5056 if(
This->create_flags)
5059 pcbSize->
u.LowPart -=
sizeof(
DWORD);
5064 if(
This->fragment_len)
5065 pcbSize->
u.LowPart += (
This->fragment_len+1)*
sizeof(
WCHAR) + 2*
sizeof(
DWORD);
5066 if(
This->host_len) {
5067 if(
This->host_type == Uri_HOST_IPV6)
5068 pcbSize->
u.LowPart += (
This->host_len-1)*
sizeof(
WCHAR) + 2*
sizeof(
DWORD);
5070 pcbSize->
u.LowPart += (
This->host_len+1)*
sizeof(
WCHAR) + 2*
sizeof(
DWORD);
5072 if(
This->userinfo_split > -1)
5073 pcbSize->
u.LowPart += (
This->userinfo_len-
This->userinfo_split)*
sizeof(
WCHAR) + 2*
sizeof(
DWORD);
5075 pcbSize->
u.LowPart += (
This->path_len+1)*
sizeof(
WCHAR) + 2*
sizeof(
DWORD);
5077 pcbSize->
u.LowPart += 3*
sizeof(
DWORD);
5079 pcbSize->
u.LowPart += (
This->query_len+1)*
sizeof(
WCHAR) + 2*
sizeof(
DWORD);
5080 if(
This->scheme_len)
5081 pcbSize->
u.LowPart += (
This->scheme_len+1)*
sizeof(
WCHAR) + 2*
sizeof(
DWORD);
5082 if(
This->userinfo_start>-1 &&
This->userinfo_split!=0) {
5083 if(
This->userinfo_split > -1)
5084 pcbSize->
u.LowPart += (
This->userinfo_split+1)*
sizeof(
WCHAR) + 2*
sizeof(
DWORD);
5086 pcbSize->
u.LowPart += (
This->userinfo_len+1)*
sizeof(
WCHAR) + 2*
sizeof(
DWORD);
5110 return IUri_QueryInterface(&
This->IUri_iface,
riid, ppvObject);
5116 return IUri_AddRef(&
This->IUri_iface);
5122 return IUri_Release(&
This->IUri_iface);
5126 DWORD dwDestContext,
void *pvDestContext,
DWORD mshlflags,
CLSID *pCid)
5130 dwDestContext, pvDestContext, mshlflags, pCid);
5132 if(!pCid || (dwDestContext!=MSHCTX_LOCAL && dwDestContext!=MSHCTX_NOSHAREDMEM
5133 && dwDestContext!=MSHCTX_INPROC))
5148 DWORD dwDestContext,
void *pvDestContext,
DWORD mshlflags,
DWORD *pSize)
5154 dwDestContext, pvDestContext, mshlflags, pSize);
5156 if(!pSize || (dwDestContext!=MSHCTX_LOCAL && dwDestContext!=MSHCTX_NOSHAREDMEM
5157 && dwDestContext!=MSHCTX_INPROC))
5160 if(dwDestContext == MSHCTX_INPROC) {
5165 hres = IPersistStream_GetSizeMax(&
This->IPersistStream_iface, &
size);
5172 *pSize =
size.u.LowPart+2*
sizeof(
DWORD);
5185 dwDestContext, pvDestContext,
mshlflags);
5187 if(!pStm ||
mshlflags!=MSHLFLAGS_NORMAL || (dwDestContext!=MSHCTX_LOCAL
5188 && dwDestContext!=MSHCTX_NOSHAREDMEM && dwDestContext!=MSHCTX_INPROC))
5191 if(dwDestContext == MSHCTX_INPROC) {
5195 data.mshlflags = MSHCTX_INPROC;
5206 IUri_AddRef(&
This->IUri_iface);
5210 hres = IMarshal_GetMarshalSizeMax(iface,
riid, pv, dwDestContext,
5220 data[1] = dwDestContext;
5238 if(
This->create_flags)
5247 if(
header[1]!=MSHCTX_LOCAL &&
header[1]!=MSHCTX_NOSHAREDMEM
5248 &&
header[1]!=MSHCTX_INPROC)
5251 if(
header[1] == MSHCTX_INPROC) {
5260 if(!
This->raw_uri) {
5265 parse.uri =
This->raw_uri;
5274 This->create_flags =
data.uri->create_flags;
5275 IUri_Release(&
data.uri->IUri_iface);
5277 return IUri_QueryInterface(&
This->IUri_iface,
riid,
ppv);
5280 hres = IPersistStream_Load(&
This->IPersistStream_iface, pStm);
5284 return IUri_QueryInterface(&
This->IUri_iface,
riid,
ppv);
5303 if(
header[1] == MSHCTX_INPROC) {
5310 IUri_Release(&
data.uri->IUri_iface);
5316 return IStream_Seek(pStm, off, STREAM_SEEK_CUR,
NULL);
5342 TRACE(
"(%p %p)\n", pUnkOuter, ppobj);
5354 *ppobj = &
ret->IUri_iface;
5384 const DWORD supported_flags = Uri_CREATE_ALLOW_RELATIVE|Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME|
5385 Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME|Uri_CREATE_NO_CANONICALIZE|Uri_CREATE_CANONICALIZE|
5386 Uri_CREATE_DECODE_EXTRA_INFO|Uri_CREATE_NO_DECODE_EXTRA_INFO|Uri_CREATE_CRACK_UNKNOWN_SCHEMES|
5387 Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES|Uri_CREATE_PRE_PROCESS_HTML_URI|Uri_CREATE_NO_PRE_PROCESS_HTML_URI|
5388 Uri_CREATE_NO_IE_SETTINGS|Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS|Uri_CREATE_FILE_USE_DOS_PATH;
5410 if(
dwFlags & ~supported_flags)
5411 FIXME(
"Ignoring unsupported flag(s) %lx\n",
dwFlags & ~supported_flags);
5423 if(!(
dwFlags & Uri_CREATE_NO_PRE_PROCESS_HTML_URI))
5439 IUri_Release(&
ret->IUri_iface);
5447 IUri_Release(&
ret->IUri_iface);
5454 *ppURI = &
ret->IUri_iface;
5494 DWORD uri_len, frag_len;
5507 add_pound = *pwzFragment !=
'#';
5510 uriW =
malloc((uri_len + frag_len + 2) *
sizeof(
WCHAR));
5512 uriW =
malloc((uri_len + frag_len + 1) *
sizeof(
WCHAR));
5519 uriW[uri_len++] =
'#';
5520 memcpy(uriW+uri_len, pwzFragment, (frag_len+1)*
sizeof(
WCHAR));
5548 if((use_orig_flags & UriBuilder_USE_ORIGINAL_FLAGS) && builder->
uri)
5581 IUri_Release(&
ret->IUri_iface);
5601 *
ppv = &
This->IUriBuilder_iface;
5604 *
ppv = &
This->IUriBuilder_iface;
5633 if(
This->uri) IUri_Release(&
This->uri->IUri_iface);
5648 DWORD dwAllowEncodingPropertyMask,
5656 hr =
build_uri(
This, ppIUri, 0, UriBuilder_USE_ORIGINAL_FLAGS, dwAllowEncodingPropertyMask);
5663 DWORD dwCreateFlags,
5664 DWORD dwAllowEncodingPropertyMask,
5670 TRACE(
"(%p)->(0x%08lx %ld %Id %p)\n",
This, dwCreateFlags, dwAllowEncodingPropertyMask,
dwReserved, ppIUri);
5672 if(dwCreateFlags == -1)
5673 hr =
build_uri(
This, ppIUri, 0, UriBuilder_USE_ORIGINAL_FLAGS, dwAllowEncodingPropertyMask);
5675 hr =
build_uri(
This, ppIUri, dwCreateFlags, 0, dwAllowEncodingPropertyMask);
5678 FIXME(
"(%p)->(0x%08lx %ld %Id %p)\n",
This, dwCreateFlags, dwAllowEncodingPropertyMask,
dwReserved, ppIUri);
5683 DWORD dwCreateFlags,
5684 DWORD dwUriBuilderFlags,
5685 DWORD dwAllowEncodingPropertyMask,
5691 TRACE(
"(%p)->(0x%08lx 0x%08lx %ld %Id %p)\n",
This, dwCreateFlags, dwUriBuilderFlags,
5692 dwAllowEncodingPropertyMask,
dwReserved, ppIUri);
5694 hr =
build_uri(
This, ppIUri, dwCreateFlags, dwUriBuilderFlags, dwAllowEncodingPropertyMask);
5696 FIXME(
"(%p)->(0x%08lx 0x%08lx %ld %Id %p)\n",
This, dwCreateFlags, dwUriBuilderFlags,
5697 dwAllowEncodingPropertyMask,
dwReserved, ppIUri);
5741 FIXME(
"(%p)->(%p) Unknown IUri types not supported yet.\n",
This, pIUri);
5744 }
else if(
This->uri)
5754 TRACE(
"(%p)->(%p %p)\n",
This, pcchFragment, ppwzFragment);
5756 if(!
This->uri ||
This->uri->fragment_start == -1 ||
This->modified_props & Uri_HAS_FRAGMENT)
5760 This->uri->fragment_len, ppwzFragment, pcchFragment);
5766 TRACE(
"(%p)->(%p %p)\n",
This, pcchHost, ppwzHost);
5768 if(!
This->uri ||
This->uri->host_start == -1 ||
This->modified_props & Uri_HAS_HOST)
5771 if(
This->uri->host_type == Uri_HOST_IPV6)
5774 This->uri->host_len-2, ppwzHost, pcchHost);
5777 This->uri->host_len, ppwzHost, pcchHost);
5784 TRACE(
"(%p)->(%p %p)\n",
This, pcchPassword, ppwzPassword);
5786 if(!
This->uri ||
This->uri->userinfo_split == -1 ||
This->modified_props & Uri_HAS_PASSWORD)
5800 if(!
This->uri ||
This->uri->path_start == -1 ||
This->modified_props & Uri_HAS_PATH)
5810 TRACE(
"(%p)->(%p %p)\n",
This, pfHasPort, pdwPort);
5823 *pfHasPort =
This->has_port;
5824 *pdwPort =
This->port;
5831 TRACE(
"(%p)->(%p %p)\n",
This, pcchQuery, ppwzQuery);
5833 if(!
This->uri ||
This->uri->query_start == -1 ||
This->modified_props & Uri_HAS_QUERY)
5837 This->uri->query_len, ppwzQuery, pcchQuery);
5843 TRACE(
"(%p)->(%p %p)\n",
This, pcchSchemeName, ppwzSchemeName);
5845 if(!
This->uri ||
This->uri->scheme_start == -1 ||
This->modified_props & Uri_HAS_SCHEME_NAME)
5849 This->uri->scheme_len, ppwzSchemeName, pcchSchemeName);
5855 TRACE(
"(%p)->(%p %p)\n",
This, pcchUserName, ppwzUserName);
5857 if(!
This->uri ||
This->uri->userinfo_start == -1 ||
This->uri->userinfo_split == 0 ||
5858 This->modified_props & Uri_HAS_USER_NAME)
5864 if(
This->uri->userinfo_split > -1)
5867 This->uri->userinfo_split, ppwzUserName, pcchUserName);
5870 This->uri->userinfo_len, ppwzUserName, pcchUserName);
5879 &
This->modified_props, Uri_HAS_FRAGMENT);
5892 &
This->modified_props, Uri_HAS_HOST);
5900 &
This->modified_props, Uri_HAS_PASSWORD);
5908 &
This->modified_props, Uri_HAS_PATH);
5914 TRACE(
"(%p)->(%d %ld)\n",
This, fHasPort, dwNewValue);
5916 This->has_port = fHasPort;
5917 This->port = dwNewValue;
5918 This->modified_props |= Uri_HAS_PORT;
5927 &
This->modified_props, Uri_HAS_QUERY);
5936 if(!pwzNewValue || !*pwzNewValue)
5940 &
This->modified_props, Uri_HAS_SCHEME_NAME);
5948 &
This->modified_props, Uri_HAS_USER_NAME);
5953 const DWORD accepted_flags = Uri_HAS_AUTHORITY|Uri_HAS_DOMAIN|Uri_HAS_EXTENSION|Uri_HAS_FRAGMENT|Uri_HAS_HOST|
5954 Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_QUERY|
5955 Uri_HAS_USER_INFO|Uri_HAS_USER_NAME;
5958 TRACE(
"(%p)->(0x%08lx)\n",
This, dwPropertyMask);
5960 if(dwPropertyMask & ~accepted_flags)
5963 if(dwPropertyMask & Uri_HAS_FRAGMENT)
5969 if(dwPropertyMask & Uri_HAS_HOST)
5971 &
This->modified_props, Uri_HAS_HOST);
5973 if(dwPropertyMask & Uri_HAS_PASSWORD)
5976 if(dwPropertyMask & Uri_HAS_PATH)
5979 if(dwPropertyMask & Uri_HAS_PORT)
5982 if(dwPropertyMask & Uri_HAS_QUERY)
5985 if(dwPropertyMask & Uri_HAS_USER_NAME)
5994 TRACE(
"(%p)->(%p)\n",
This, pfModified);
5999 *pfModified =
This->modified_props > 0;
6055 if(!
uri->create_flags) {
6068 *ppIUriBuilder =
NULL;
6069 FIXME(
"(%p %lx %Ix %p): Unknown IUri types not supported yet.\n", pIUri,
dwFlags,
6075 *ppIUriBuilder = &
ret->IUriBuilder_iface;
6086 DWORD base_copy_len = 0;
6093 if(
end[0] ==
':' &&
end[1] ==
':') {
6121 ptr += base_copy_len;
6124 ptr += relative_len;
6170 IUri_Release(&
ret->IUri_iface);
6181 DWORD raw_flags = 0;
6183 if(
base->scheme_start > -1) {
6185 data.scheme_len =
base->scheme_len;
6186 data.scheme_type =
base->scheme_type;
6194 proc_uri = relative;
6223 }
else if(!
data.is_opaque) {
6232 proc_uri = relative;
6258 if(
base->path_len > 3 && *(
base->canon_uri+
base->path_start) ==
'/' &&
6261 copy_drive_path =
TRUE;
6276 if(copy_drive_path) {
6306 DWORD offset = (path_offset > 0) ? path_offset+1 : 0;
6317 tmp[new_len+
offset] =
'\0';
6375 IUri_Release(&
ret->IUri_iface);
6402 TRACE(
"(%p %p %lx %p %Ix)\n", pBaseUri, pRelativeUri, dwCombineFlags, ppCombinedUri,
dwReserved);
6407 if(!pBaseUri || !pRelativeUri) {
6408 *ppCombinedUri =
NULL;
6414 if(!relative || !
base) {
6415 *ppCombinedUri =
NULL;
6416 FIXME(
"(%p %p %lx %p %Ix) Unknown IUri types not supported yet.\n",
6417 pBaseUri, pRelativeUri, dwCombineFlags, ppCombinedUri,
dwReserved);
6424 DWORD result_len = 0;
6426 hr = IInternetProtocolInfo_CombineUrl(
info,
base->canon_uri, relative->
canon_uri, dwCombineFlags,
6428 IInternetProtocolInfo_Release(
info);
6450 TRACE(
"(%p %s %lx %p %Ix)\n", pBaseUri,
debugstr_w(pwzRelativeUrl), dwCombineFlags,
6456 if(!pwzRelativeUrl) {
6457 *ppCombinedUri =
NULL;
6462 *ppCombinedUri =
NULL;
6468 *ppCombinedUri =
NULL;
6469 FIXME(
"(%p %s %lx %p %Ix) Unknown IUri's not supported yet.\n", pBaseUri,
debugstr_w(pwzRelativeUrl),
6477 DWORD result_len = 0;
6479 hr = IInternetProtocolInfo_CombineUrl(
info,
base->canon_uri, pwzRelativeUrl, dwCombineFlags,
6481 IInternetProtocolInfo_Release(
info);
6489 hr =
CreateUri(pwzRelativeUrl, Uri_CREATE_ALLOW_RELATIVE|Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, 0, &relative);
6491 *ppCombinedUri =
NULL;
6497 IUri_Release(relative);
6519 if(
uri->scheme_start > -1 &&
uri->path_start > -1) {
6520 ptr =
uri->canon_uri+
uri->scheme_start+
uri->scheme_len+1;
6526 for(
ptr =
uri->canon_uri; ptr < uri->canon_uri+
uri->canon_len; ++
ptr) {
6532 if(reduce_path && !
path &&
ptr ==
uri->canon_uri+
uri->path_start)
6536 if(reduce_path &&
ptr ==
uri->canon_uri+
uri->path_start+
uri->path_len) {
6541 len -= (current_path_len-new_path_len);
6542 reduce_path =
FALSE;
6549 if(
len < output_len)
6550 output[
len] = decoded;
6553 do_default_action =
FALSE;
6559 if(
len + 3 < output_len)
6562 do_default_action =
FALSE;
6564 }
else if(*
ptr ==
' ') {
6567 if(
len + 3 < output_len)
6570 do_default_action =
FALSE;
6574 if(
len + 3 < output_len)
6577 do_default_action =
FALSE;
6581 if(do_default_action) {
6582 if(
len < output_len)
6591 if(reduce_path &&
path) {
6596 len -= (current_path_len-new_path_len);
6599 if(
len < output_len)
6602 output[output_len-1] = 0;
6606 if(
len >= output_len)
6619 hr = IUri_GetPropertyLength(
uri, Uri_PROPERTY_DISPLAY_URI, &display_len, 0);
6625 *result_len = display_len;
6626 if(display_len+1 > output_len)
6643 static const WCHAR colon_slashesW[] = {
':',
'/',
'/'};
6651 if(
uri->authority_start == -1 ||
6662 len =
uri->scheme_len+
uri->authority_len;
6666 if(
len+1 > output_len) {
6676 memcpy(
ptr, colon_slashesW,
sizeof(colon_slashesW));
6683 ptr +=
uri->authority_len;
6701 uri->authority_start == -1) {
6710 if(
uri->fragment_start > -1)
6711 len =
uri->fragment_start;
6716 if(
len+1 > output_len)
6727 const WCHAR *path_ptr;
6739 if(
uri->host_start > -1) {
6740 static const WCHAR slash_slashW[] = {
'\\',
'\\'};
6742 memcpy(
ptr, slash_slashW,
sizeof(slash_slashW));
6748 path_ptr =
uri->canon_uri+
uri->path_start;
6753 for(; path_ptr <
uri->canon_uri+
uri->path_start+
uri->path_len; ++path_ptr, ++
ptr) {
6756 if(*path_ptr ==
'%') {
6761 do_default_action =
FALSE;
6763 }
else if(*path_ptr ==
'/') {
6765 do_default_action =
FALSE;
6768 if(do_default_action)
6775 if(*result_len+1 > output_len)
6789 hr = IUri_GetPropertyLength(
uri, Uri_PROPERTY_ABSOLUTE_URI, &
len, 0);
6796 if(
len+1 > output_len)
6818 hr = IUri_GetPropertyLength(
uri, Uri_PROPERTY_SCHEME_NAME, &
len, 0);
6825 if(
len+1 > output_len)
6846 hr = IUri_GetPropertyLength(
uri, Uri_PROPERTY_HOST, &
len, 0);
6853 if(
len+1 > output_len)
6874 hr = IUri_GetPropertyLength(
uri, Uri_PROPERTY_DOMAIN, &
len, 0);
6881 if(
len+1 > output_len)
6902 hr = IUri_GetPropertyLength(
uri, Uri_PROPERTY_FRAGMENT, &
len, 0);
6909 if(
len+1 > output_len)
6935 TRACE(
"(%p %d %lx %p %ld %p %Ix)\n", pIUri, ParseAction,
dwFlags, pwzResult,
6941 if(!pwzResult || !pIUri) {
6948 FIXME(
"(%p %d %lx %p %ld %p %Ix) Unknown IUri's not supported for this action.\n",
6955 hr = IInternetProtocolInfo_ParseUrl(
info,
uri->canon_uri, ParseAction,
dwFlags,
6956 pwzResult, cchResult, pcchResult, 0);
6957 IInternetProtocolInfo_Release(
info);
6961 switch(ParseAction) {
6962 case PARSE_CANONICALIZE:
6965 case PARSE_FRIENDLY:
6968 case PARSE_ROOTDOCUMENT:
6971 case PARSE_DOCUMENT:
6974 case PARSE_PATH_FROM_URL:
6977 case PARSE_URL_FROM_PATH:
6984 hr =
parse_site(pIUri, pwzResult, cchResult, pcchResult);
6989 case PARSE_LOCATION:
6993 case PARSE_SECURITY_URL:
6996 case PARSE_SECURITY_DOMAIN:
7003 FIXME(
"(%p %d %lx %p %ld %p %Ix) Partial stub.\n", pIUri, ParseAction,
dwFlags,
7004 pwzResult, cchResult, pcchResult,
dwReserved);
INT WINAPI IdnToAscii(DWORD dwFlags, LPCWSTR lpUnicodeCharStr, INT cchUnicodeChar, LPWSTR lpASCIICharStr, INT cchASCIIChar)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
INT WINAPI StrCmpNIW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen)
INT WINAPI StrCmpNW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen)
static wchar_t * wmemchr(const wchar_t *s, wchar_t c, size_t n)
IInternetProtocolInfo * get_protocol_info(LPCWSTR url)
static HRESULT WINAPI UriBuilderFactory_QueryInterface(IUriBuilderFactory *iface, REFIID riid, void **ppv)
static HRESULT get_builder_component(LPWSTR *component, DWORD *component_len, LPCWSTR source, DWORD source_len, LPCWSTR *output, DWORD *output_len)
static HRESULT parse_site(IUri *uri, LPWSTR output, DWORD output_len, DWORD *result_len)
static BOOL is_reserved(WCHAR val)
static HRESULT compare_uris(const Uri *a, const Uri *b, BOOL *ret)
static ULONG WINAPI Marshal_AddRef(IMarshal *iface)
static BOOL has_invalid_flag_combination(DWORD flags)
static BOOL is_unc_path(const WCHAR *str)
void find_domain_name(const WCHAR *host, DWORD host_len, INT *domain_start)
static HRESULT parse_domain(IUri *uri, LPWSTR output, DWORD output_len, DWORD *result_len)
static UriBuilder * impl_from_IUriBuilder(IUriBuilder *iface)
#define URI_DISPLAY_NO_DEFAULT_PORT_AUTH
static const IID IID_IUriObj
static BOOL is_hierarchical_uri(const WCHAR **ptr, const parse_data *data)
static void reset_builder(UriBuilder *builder)
static HRESULT WINAPI Marshal_ReleaseMarshalData(IMarshal *iface, IStream *pStm)
static BOOL parse_hierpart(const WCHAR **ptr, parse_data *data, DWORD flags)
static BOOL parse_path_opaque(const WCHAR **ptr, parse_data *data, DWORD flags)
static BOOL is_default_port(URL_SCHEME scheme, DWORD port)
static HRESULT WINAPI Marshal_MarshalInterface(IMarshal *iface, IStream *pStm, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags)
static const IMarshalVtbl MarshalVtbl
static const CHAR hexDigits[]
static HRESULT WINAPI UriBuilder_GetIUri(IUriBuilder *iface, IUri **ppIUri)
static BOOL is_gendelim(WCHAR val)
static int compute_canonicalized_length(const parse_data *data, DWORD flags)
static HRESULT WINAPI Uri_GetPathAndQuery(IUri *iface, BSTR *pstrPathAndQuery)
HRESULT WINAPI CoInternetCombineIUri(IUri *pBaseUri, IUri *pRelativeUri, DWORD dwCombineFlags, IUri **ppCombinedUri, DWORD_PTR dwReserved)
static HRESULT WINAPI Uri_GetPropertyDWORD(IUri *iface, Uri_PROPERTY uriProp, DWORD *pcchProperty, DWORD dwFlags)
#define RAW_URI_FORCE_PORT_DISP
static const IUriBuilderVtbl UriBuilderVtbl
static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD flags)
HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
HRESULT WINAPI CoInternetCombineUrlEx(IUri *pBaseUri, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, IUri **ppCombinedUri, DWORD_PTR dwReserved)
static BOOL canonicalize_ipv4address(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static HRESULT WINAPI Marshal_GetUnmarshalClass(IMarshal *iface, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, CLSID *pCid)
static const IUriVtbl UriVtbl
static BOOL parse_password(const WCHAR **ptr, parse_data *data, DWORD flags, DWORD extras)
static BOOL parse_ipv4address(const WCHAR **ptr, parse_data *data)
static BOOL is_hexdigit(WCHAR val)
static BOOL parse_username(const WCHAR **ptr, parse_data *data, DWORD flags, DWORD extras)
static HRESULT WINAPI UriBuilder_GetPort(IUriBuilder *iface, BOOL *pfHasPort, DWORD *pdwPort)
static HRESULT WINAPI Uri_GetAbsoluteUri(IUri *iface, BSTR *pstrAbsoluteUri)
static HRESULT WINAPI PersistStream_IsDirty(IPersistStream *iface)
static HRESULT WINAPI UriBuilder_GetUserName(IUriBuilder *iface, DWORD *pcchUserName, LPCWSTR *ppwzUserName)
static BOOL canonicalize_userinfo(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
#define URI_DISPLAY_NO_ABSOLUTE_URI
static BOOL is_forbidden_dos_path_char(WCHAR val)
static ULONG WINAPI UriBuilderFactory_AddRef(IUriBuilderFactory *iface)
static HRESULT validate_path(const UriBuilder *builder, parse_data *data, DWORD flags)
static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result, DWORD extras)
static BOOL check_ipv4address(const WCHAR **ptr, BOOL strict)
static BOOL is_path_delim(URL_SCHEME scheme, WCHAR val)
static HRESULT WINAPI Marshal_DisconnectObject(IMarshal *iface, DWORD dwReserved)
static HRESULT WINAPI PersistStream_Load(IPersistStream *iface, IStream *pStm)
static ULONG WINAPI Marshal_Release(IMarshal *iface)
static BYTE * persist_stream_add_strprop(Uri *This, BYTE *p, DWORD type, DWORD len, WCHAR *data)
static BOOL parse_ipvfuture(const WCHAR **ptr, parse_data *data)
HRESULT WINAPI CoInternetParseIUri(IUri *pIUri, PARSEACTION ParseAction, DWORD dwFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD_PTR dwReserved)
static BOOL parse_port(const WCHAR **ptr, parse_data *data)
static HRESULT WINAPI UriBuilder_RemoveProperties(IUriBuilder *iface, DWORD dwPropertyMask)
static HRESULT WINAPI Uri_HasProperty(IUri *iface, Uri_PROPERTY uriProp, BOOL *pfHasProperty)
static BOOL parse_host(const WCHAR **ptr, parse_data *data, DWORD extras)
static BOOL parse_authority(const WCHAR **ptr, parse_data *data, DWORD flags)
static HRESULT WINAPI Uri_GetProperties(IUri *iface, DWORD *pdwProperties)
static void persist_stream_save(Uri *This, IStream *pStm, BOOL marshal, struct persist_uri *data)
static HRESULT WINAPI UriBuilder_GetQuery(IUriBuilder *iface, DWORD *pcchQuery, LPCWSTR *ppwzQuery)
static BOOL parse_scheme_name(const WCHAR **ptr, parse_data *data, DWORD extras)
static WCHAR decode_pct_val(const WCHAR *ptr)
static HRESULT WINAPI UriBuilder_SetPath(IUriBuilder *iface, LPCWSTR pwzNewValue)
#define ALLOW_BRACKETLESS_IP_LITERAL
static HRESULT WINAPI UriBuilder_CreateUriWithFlags(IUriBuilder *iface, DWORD dwCreateFlags, DWORD dwUriBuilderFlags, DWORD dwAllowEncodingPropertyMask, DWORD_PTR dwReserved, IUri **ppIUri)
static HRESULT WINAPI UriBuilder_GetPath(IUriBuilder *iface, DWORD *pcchPath, LPCWSTR *ppwzPath)
static HRESULT WINAPI Marshal_GetMarshalSizeMax(IMarshal *iface, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, DWORD *pSize)
#define COMBINE_URI_FORCE_FLAG_USE
static BOOL canonicalize_authority(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
#define SKIP_IP_FUTURE_CHECK
static BOOL is_auth_delim(WCHAR val, BOOL acceptSlash)
static HRESULT WINAPI UriBuilder_SetIUri(IUriBuilder *iface, IUri *pIUri)
static HRESULT generate_uri(const UriBuilder *builder, const parse_data *data, Uri *uri, DWORD flags)
static HRESULT WINAPI UriBuilder_QueryInterface(IUriBuilder *iface, REFIID riid, void **ppv)
HRESULT WINAPI CreateUriWithFragment(LPCWSTR pwzURI, LPCWSTR pwzFragment, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
static void convert_to_dos_path(const WCHAR *path, DWORD path_len, WCHAR *output, DWORD *output_len)
static HRESULT WINAPI Uri_GetQuery(IUri *iface, BSTR *pstrQuery)
#define ALLOW_NULL_TERM_SCHEME
static DWORD ui2str(WCHAR *dest, UINT value)
static const IPersistStreamVtbl PersistStreamVtbl
#define ALLOW_NULL_TERM_USER_NAME
static void destroy_uri_obj(Uri *This)
static BOOL canonicalize_fragment(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static BOOL check_hierarchical(const WCHAR **ptr)
#define IGNORE_PORT_DELIMITER
static HRESULT WINAPI UriBuilder_SetSchemeName(IUriBuilder *iface, LPCWSTR pwzNewValue)
static HRESULT WINAPI Uri_GetZone(IUri *iface, DWORD *pdwZone)
static HRESULT parse_anchor(IUri *uri, LPWSTR output, DWORD output_len, DWORD *result_len)
static BOOL parse_scheme(const WCHAR **ptr, parse_data *data, DWORD flags, DWORD extras)
static const struct @614 recognized_tlds[]
static HRESULT WINAPI Marshal_UnmarshalInterface(IMarshal *iface, IStream *pStm, REFIID riid, void **ppv)
HRESULT WINAPI CreateIUriBuilder(IUri *pIUri, DWORD dwFlags, DWORD_PTR dwReserved, IUriBuilder **ppIUriBuilder)
static HRESULT WINAPI UriBuilder_CreateUri(IUriBuilder *iface, DWORD dwCreateFlags, DWORD dwAllowEncodingPropertyMask, DWORD_PTR dwReserved, IUri **ppIUri)
static HRESULT WINAPI Uri_IsEqual(IUri *iface, IUri *pUri, BOOL *pfEqual)
static HRESULT WINAPI UriBuilder_GetFragment(IUriBuilder *iface, DWORD *pcchFragment, LPCWSTR *ppwzFragment)
static HRESULT parse_path_from_url(const Uri *uri, LPWSTR output, DWORD output_len, DWORD *result_len)
static ULONG WINAPI UriBuilderFactory_Release(IUriBuilderFactory *iface)
static BOOL check_implicit_ipv4(const WCHAR **ptr, UINT *val)
static HRESULT WINAPI Uri_GetDomain(IUri *iface, BSTR *pstrDomain)
static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BSTR *pbstrProperty, DWORD dwFlags)
static HRESULT WINAPI UriBuilder_SetPort(IUriBuilder *iface, BOOL fHasPort, DWORD dwNewValue)
static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, DWORD *pcchProperty, DWORD dwFlags)
static HRESULT WINAPI Uri_GetUserInfo(IUri *iface, BSTR *pstrUserInfo)
static DWORD canonicalize_path_hierarchical(const WCHAR *path, DWORD path_len, URL_SCHEME scheme_type, BOOL has_host, DWORD flags, BOOL is_implicit_scheme, WCHAR *ret_path)
static const struct @613 default_ports[]
static BOOL is_unreserved(WCHAR val)
static HRESULT WINAPI UriBuilder_CreateUriSimple(IUriBuilder *iface, DWORD dwAllowEncodingPropertyMask, DWORD_PTR dwReserved, IUri **ppIUri)
static ULONG WINAPI PersistStream_Release(IPersistStream *iface)
static HRESULT WINAPI Uri_GetPassword(IUri *iface, BSTR *pstrPassword)
static HRESULT WINAPI Uri_GetScheme(IUri *iface, DWORD *pdwScheme)
static HRESULT parse_rootdocument(const Uri *uri, LPWSTR output, DWORD output_len, DWORD *result_len)
HRESULT Uri_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
static HRESULT validate_userinfo(const UriBuilder *builder, parse_data *data, DWORD flags)
static HRESULT WINAPI Uri_GetUserName(IUri *iface, BSTR *pstrUserName)
static HRESULT WINAPI PersistStream_Save(IPersistStream *iface, IStream *pStm, BOOL fClearDirty)
static BOOL canonicalize_reg_name(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static BOOL canonicalize_username(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static Uri * impl_from_IMarshal(IMarshal *iface)
static BOOL parse_ipv6address(const WCHAR **ptr, parse_data *data)
static BOOL is_slash(WCHAR c)
static void apply_default_flags(DWORD *flags)
static BOOL is_implicit_file_path(const WCHAR *str)
static HRESULT validate_query(const UriBuilder *builder, parse_data *data, DWORD flags)
static BOOL parse_scheme_type(parse_data *data)
static HRESULT WINAPI Marshal_QueryInterface(IMarshal *iface, REFIID riid, void **ppvObject)
static BOOL is_hierarchical_scheme(URL_SCHEME type)
#define ALLOW_NULL_TERM_PASSWORD
static void setup_port(const UriBuilder *builder, parse_data *data, DWORD flags)
static Uri * impl_from_IUriBuilderFactory(IUriBuilderFactory *iface)
static HRESULT WINAPI UriBuilderFactory_CreateInitializedIUriBuilder(IUriBuilderFactory *iface, DWORD dwFlags, DWORD_PTR dwReserved, IUriBuilder **ppIUriBuilder)
static HRESULT validate_fragment(const UriBuilder *builder, parse_data *data, DWORD flags)
static HRESULT merge_paths(parse_data *data, const WCHAR *base, DWORD base_len, const WCHAR *relative, DWORD relative_len, WCHAR **result, DWORD *result_len, DWORD flags)
#define RAW_URI_CONVERT_TO_DOS_PATH
static HRESULT WINAPI Uri_GetExtension(IUri *iface, BSTR *pstrExtension)
static BOOL canonicalize_scheme(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static DWORD generate_raw_uri(const parse_data *data, BSTR uri, DWORD flags)
static BOOL is_subdelim(WCHAR val)
static HRESULT WINAPI Uri_GetPath(IUri *iface, BSTR *pstrPath)
static ULONG WINAPI Uri_Release(IUri *iface)
static HRESULT WINAPI Uri_GetFragment(IUri *iface, BSTR *pstrFragment)
static BOOL canonicalize_host(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static ULONG WINAPI UriBuilder_AddRef(IUriBuilder *iface)
static HRESULT WINAPI PersistStream_GetClassID(IPersistStream *iface, CLSID *pClassID)
static Uri * get_uri_obj(IUri *uri)
static DWORD ui2ipv4(WCHAR *dest, UINT address)
static HRESULT parse_canonicalize(const Uri *uri, DWORD flags, LPWSTR output, DWORD output_len, DWORD *result_len)
static ULONG WINAPI PersistStream_AddRef(IPersistStream *iface)
static BOOL parse_fragment(const WCHAR **ptr, parse_data *data, DWORD flags)
static BOOL parse_reg_name(const WCHAR **ptr, parse_data *data, DWORD extras)
static HRESULT WINAPI UriBuilder_SetPassword(IUriBuilder *iface, LPCWSTR pwzNewValue)
static BOOL parse_uri(parse_data *data, DWORD flags)
static HRESULT WINAPI UriBuilder_GetSchemeName(IUriBuilder *iface, DWORD *pcchSchemeName, LPCWSTR *ppwzSchemeName)
static HRESULT WINAPI UriBuilder_HasBeenModified(IUriBuilder *iface, BOOL *pfModified)
static HRESULT WINAPI Uri_GetHost(IUri *iface, BSTR *pstrHost)
static ULONG WINAPI Uri_AddRef(IUri *iface)
static BOOL canonicalize_query(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static HRESULT validate_host(const UriBuilder *builder, parse_data *data)
static BOOL is_ascii(WCHAR c)
static BOOL canonicalize_implicit_ipv4address(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static const IUriBuilderFactoryVtbl UriBuilderFactoryVtbl
static HRESULT WINAPI Uri_GetPort(IUri *iface, DWORD *pdwPort)
static BOOL parse_ip_literal(const WCHAR **ptr, parse_data *data, DWORD extras)
static void pct_encode_val(WCHAR val, WCHAR *dest)
static HRESULT validate_password(const UriBuilder *builder, parse_data *data, DWORD flags)
static BOOL check_pct_encoded(const WCHAR **ptr)
static HRESULT WINAPI Uri_GetAuthority(IUri *iface, BSTR *pstrAuthority)
static HRESULT parse_document(const Uri *uri, LPWSTR output, DWORD output_len, DWORD *result_len)
static const struct @612 recognized_schemes[]
static BOOL canonicalize_password(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static BOOL check_dec_octet(const WCHAR **ptr)
static HRESULT parse_url_from_path(IUri *uri, LPWSTR output, DWORD output_len, DWORD *result_len)
static HRESULT WINAPI UriBuilder_SetFragment(IUriBuilder *iface, LPCWSTR pwzNewValue)
static int hex_to_int(WCHAR val)
static HRESULT validate_scheme_name(const UriBuilder *builder, parse_data *data, DWORD flags)
static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static HRESULT WINAPI UriBuilderFactory_CreateIUriBuilder(IUriBuilderFactory *iface, DWORD dwFlags, DWORD_PTR dwReserved, IUriBuilder **ppIUriBuilder)
static HRESULT WINAPI UriBuilder_SetHost(IUriBuilder *iface, LPCWSTR pwzNewValue)
static HRESULT parse_schema(IUri *uri, LPWSTR output, DWORD output_len, DWORD *result_len)
static ULONG WINAPI UriBuilder_Release(IUriBuilder *iface)
static HRESULT WINAPI UriBuilder_GetPassword(IUriBuilder *iface, DWORD *pcchPassword, LPCWSTR *ppwzPassword)
static BOOL canonicalize_path_opaque(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static HRESULT validate_components(const UriBuilder *builder, parse_data *data, DWORD flags)
static Uri * impl_from_IPersistStream(IPersistStream *iface)
static BSTR pre_process_uri(LPCWSTR uri)
static Uri * impl_from_IUri(IUri *iface)
static DWORD remove_dot_segments(WCHAR *path, DWORD path_len)
static HRESULT WINAPI Uri_GetRawUri(IUri *iface, BSTR *pstrRawUri)
static HRESULT parse_friendly(IUri *uri, LPWSTR output, DWORD output_len, DWORD *result_len)
static BOOL is_num(WCHAR val)
static BOOL is_drive_path(const WCHAR *str)
static HRESULT WINAPI UriBuilder_SetUserName(IUriBuilder *iface, LPCWSTR pwzNewValue)
static HRESULT WINAPI Uri_GetSchemeName(IUri *iface, BSTR *pstrSchemeName)
static HRESULT build_uri(const UriBuilder *builder, IUri **uri, DWORD create_flags, DWORD use_orig_flags, DWORD encoding_mask)
static INT find_file_extension(const WCHAR *path, DWORD path_len)
static HRESULT WINAPI Uri_QueryInterface(IUri *iface, REFIID riid, void **ppv)
static HRESULT WINAPI UriBuilder_GetHost(IUriBuilder *iface, DWORD *pcchHost, LPCWSTR *ppwzHost)
static HRESULT canonicalize_uri(const parse_data *data, Uri *uri, DWORD flags)
static BOOL parse_query(const WCHAR **ptr, parse_data *data, DWORD flags)
static HRESULT WINAPI PersistStream_GetSizeMax(IPersistStream *iface, ULARGE_INTEGER *pcbSize)
static BOOL canonicalize_hierpart(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
static void parse_userinfo(const WCHAR **ptr, parse_data *data, DWORD flags)
static HRESULT validate_username(const UriBuilder *builder, parse_data *data, DWORD flags)
static HRESULT set_builder_component(LPWSTR *component, DWORD *component_len, LPCWSTR new_value, WCHAR prefix, DWORD *flags, DWORD success_flag)
static HRESULT compare_file_paths(const Uri *a, const Uri *b, BOOL *ret)
static HRESULT WINAPI UriBuilder_SetQuery(IUriBuilder *iface, LPCWSTR pwzNewValue)
static HRESULT WINAPI Uri_GetDisplayUri(IUri *iface, BSTR *pstrDisplayUri)
static HRESULT WINAPI Uri_GetHostType(IUri *iface, DWORD *pdwHostType)
static HRESULT WINAPI PersistStream_QueryInterface(IPersistStream *iface, REFIID riid, void **ppvObject)
static BOOL canonicalize_ipv6address(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLboolean GLboolean GLboolean b
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static const int digits[]
#define memcpy(s1, s2, n)
static LPWSTR PDWORD pcchPath
#define cmp(status, error)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
NTSYSAPI NTSTATUS NTAPI RtlIpv6StringToAddressW(_In_ PCWSTR String, _Out_ PCWSTR *Terminator, _Out_ struct in6_addr *Addr)
NTSYSAPI NTSTATUS NTAPI RtlIpv6AddressToStringExW(_In_ const struct in6_addr *Address, _In_ ULONG ScopeId, _In_ USHORT Port, _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString, _Inout_ PULONG AddressStringLength)
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
BSTR WINAPI SysAllocString(LPCOLESTR str)
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
const GUID IID_IPersistStream
#define IsEqualGUID(rguid1, rguid2)
#define URL_ESCAPE_UNSAFE
@ URL_SCHEME_MSSHELLROOTED
@ URL_SCHEME_MSSHELLIDLIST
#define URL_ESCAPE_SPACES_ONLY
#define URL_DONT_SIMPLIFY
#define URL_FILE_USE_PATHURL
#define URL_DONT_UNESCAPE_EXTRA_INFO
#define URL_ESCAPE_PERCENT
#define STRSAFE_E_INSUFFICIENT_BUFFER
IUriBuilder IUriBuilder_iface
IUriBuilderFactory IUriBuilderFactory_iface
IPersistStream IPersistStream_iface
struct _ULARGE_INTEGER::@4637 u
Character const *const prefix
#define CONTAINING_RECORD(address, type, field)
struct _LARGE_INTEGER::@2527 u
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
#define INET_E_INVALID_URL
#define INTERNET_MAX_URL_LENGTH