Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
dffc9d31
Commit
dffc9d31
authored
Nov 07, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Nov 09, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Improve IUri support of res URIs.
parent
c067353c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
7 deletions
+130
-7
uri.c
dlls/urlmon/tests/uri.c
+112
-1
uri.c
dlls/urlmon/uri.c
+18
-6
No files found.
dlls/urlmon/tests/uri.c
View file @
dffc9d31
...
...
@@ -3849,6 +3849,110 @@ static const uri_properties uri_tests[] = {
{
URL_SCHEME_HTTP
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
/* For res URIs the host is everything up until the first '/'. */
{
"res://C:
\\
dir
\\
file.exe/DATA/test.html"
,
0
,
S_OK
,
FALSE
,
{
{
"res://C:
\\
dir
\\
file.exe/DATA/test.html"
,
S_OK
,
FALSE
},
{
"C:
\\
dir
\\
file.exe"
,
S_OK
,
FALSE
},
{
"res://C:
\\
dir
\\
file.exe/DATA/test.html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
".html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"C:
\\
dir
\\
file.exe"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"/DATA/test.html"
,
S_OK
,
FALSE
},
{
"/DATA/test.html"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"res://C:
\\
dir
\\
file.exe/DATA/test.html"
,
S_OK
,
FALSE
},
{
"res"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_RES
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
/* Res URI can contain a '|' in the host name. */
{
"res://c:
\\
di|r
\\
file.exe/test"
,
0
,
S_OK
,
FALSE
,
{
{
"res://c:
\\
di|r
\\
file.exe/test"
,
S_OK
,
FALSE
},
{
"c:
\\
di|r
\\
file.exe"
,
S_OK
,
FALSE
},
{
"res://c:
\\
di|r
\\
file.exe/test"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"c:
\\
di|r
\\
file.exe"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"/test"
,
S_OK
,
FALSE
},
{
"/test"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"res://c:
\\
di|r
\\
file.exe/test"
,
S_OK
,
FALSE
},
{
"res"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_RES
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
},
}
},
/* Res URIs can have invalid percent encoded values. */
{
"res://c:
\\
dir%xx
\\
file.exe/test"
,
0
,
S_OK
,
FALSE
,
{
{
"res://c:
\\
dir%xx
\\
file.exe/test"
,
S_OK
,
FALSE
},
{
"c:
\\
dir%xx
\\
file.exe"
,
S_OK
,
FALSE
},
{
"res://c:
\\
dir%xx
\\
file.exe/test"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"c:
\\
dir%xx
\\
file.exe"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"/test"
,
S_OK
,
FALSE
},
{
"/test"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"res://c:
\\
dir%xx
\\
file.exe/test"
,
S_OK
,
FALSE
},
{
"res"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_RES
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
/* Res doesn't get forbidden characters percent encoded in it's path. */
{
"res://c:
\\
test/tes<|>t"
,
0
,
S_OK
,
FALSE
,
{
{
"res://c:
\\
test/tes<|>t"
,
S_OK
,
FALSE
},
{
"c:
\\
test"
,
S_OK
,
FALSE
},
{
"res://c:
\\
test/tes<|>t"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"c:
\\
test"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"/tes<|>t"
,
S_OK
,
FALSE
},
{
"/tes<|>t"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"res://c:
\\
test/tes<|>t"
,
S_OK
,
FALSE
},
{
"res"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_RES
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
}
};
...
...
@@ -3913,7 +4017,14 @@ static const invalid_uri invalid_uri_tests[] = {
{
"file://c:
\\
test
\"
test"
,
Uri_CREATE_FILE_USE_DOS_PATH
,
FALSE
},
{
"file:c:
\\
test<test"
,
Uri_CREATE_FILE_USE_DOS_PATH
,
FALSE
},
{
"file:c:
\\
test>test"
,
Uri_CREATE_FILE_USE_DOS_PATH
,
FALSE
},
{
"file:c:
\\
test
\"
test"
,
Uri_CREATE_FILE_USE_DOS_PATH
,
FALSE
}
{
"file:c:
\\
test
\"
test"
,
Uri_CREATE_FILE_USE_DOS_PATH
,
FALSE
},
/* res URIs aren't allowed to have forbidden dos path characters in the
* hostname.
*/
{
"res://c:
\\
te<st
\\
test/test"
,
0
,
FALSE
},
{
"res://c:
\\
te>st
\\
test/test"
,
0
,
FALSE
},
{
"res://c:
\\
te
\"
st
\\
test/test"
,
0
,
FALSE
},
{
"res://c:
\\
test/te%xxst"
,
0
,
FALSE
}
};
typedef
struct
_uri_equality
{
...
...
dlls/urlmon/uri.c
View file @
dffc9d31
...
...
@@ -1552,8 +1552,11 @@ static BOOL parse_ipv4address(const WCHAR **ptr, parse_data *data, DWORD flags)
static
BOOL
parse_reg_name
(
const
WCHAR
**
ptr
,
parse_data
*
data
,
DWORD
flags
,
DWORD
extras
)
{
const
BOOL
has_start_bracket
=
**
ptr
==
'['
;
const
BOOL
known_scheme
=
data
->
scheme_type
!=
URL_SCHEME_UNKNOWN
;
const
BOOL
is_res
=
data
->
scheme_type
==
URL_SCHEME_RES
;
BOOL
inside_brackets
=
has_start_bracket
;
BOOL
ignore_col
=
extras
&
IGNORE_PORT_DELIMITER
;
/* res URIs don't have ports. */
BOOL
ignore_col
=
(
extras
&
IGNORE_PORT_DELIMITER
)
||
is_res
;
/* We have to be careful with file schemes. */
if
(
data
->
scheme_type
==
URL_SCHEME_FILE
)
{
...
...
@@ -1575,7 +1578,11 @@ static BOOL parse_reg_name(const WCHAR **ptr, parse_data *data, DWORD flags, DWO
data
->
host
=
*
ptr
;
while
(
!
is_auth_delim
(
**
ptr
,
known_scheme
))
{
/* For res URIs, everything before the first '/' is
* considered the host.
*/
while
((
!
is_res
&&
!
is_auth_delim
(
**
ptr
,
known_scheme
))
||
(
is_res
&&
**
ptr
&&
**
ptr
!=
'/'
))
{
if
(
**
ptr
==
':'
&&
!
ignore_col
)
{
/* We can ignore ':' if were inside brackets.*/
if
(
!
inside_brackets
)
{
...
...
@@ -1599,7 +1606,7 @@ static BOOL parse_reg_name(const WCHAR **ptr, parse_data *data, DWORD flags, DWO
break
;
}
}
}
else
if
(
**
ptr
==
'%'
&&
known_scheme
)
{
}
else
if
(
**
ptr
==
'%'
&&
(
known_scheme
&&
!
is_res
)
)
{
/* Has to be a legit % encoded value. */
if
(
!
check_pct_encoded
(
ptr
))
{
*
ptr
=
data
->
host
;
...
...
@@ -1607,6 +1614,10 @@ static BOOL parse_reg_name(const WCHAR **ptr, parse_data *data, DWORD flags, DWO
return
FALSE
;
}
else
continue
;
}
else
if
(
is_res
&&
is_forbidden_dos_path_char
(
**
ptr
))
{
*
ptr
=
data
->
host
;
data
->
host
=
NULL
;
return
FALSE
;
}
else
if
(
**
ptr
==
']'
)
inside_brackets
=
FALSE
;
else
if
(
**
ptr
==
'['
)
...
...
@@ -1631,7 +1642,7 @@ static BOOL parse_reg_name(const WCHAR **ptr, parse_data *data, DWORD flags, DWO
data
->
host_len
=
*
ptr
-
data
->
host
;
/* If the host is empty, then it's an unknown host type. */
if
(
data
->
host_len
==
0
)
if
(
data
->
host_len
==
0
||
is_res
)
data
->
host_type
=
Uri_HOST_UNKNOWN
;
else
data
->
host_type
=
Uri_HOST_DNS
;
...
...
@@ -2913,6 +2924,7 @@ static BOOL canonicalize_path_hierarchical(const parse_data *data, Uri *uri,
const
WCHAR
*
ptr
;
const
BOOL
known_scheme
=
data
->
scheme_type
!=
URL_SCHEME_UNKNOWN
;
const
BOOL
is_file
=
data
->
scheme_type
==
URL_SCHEME_FILE
;
const
BOOL
is_res
=
data
->
scheme_type
==
URL_SCHEME_RES
;
BOOL
escape_pct
=
FALSE
;
...
...
@@ -2961,7 +2973,7 @@ static BOOL canonicalize_path_hierarchical(const parse_data *data, Uri *uri,
}
for
(;
ptr
<
data
->
path
+
data
->
path_len
;
++
ptr
)
{
if
(
*
ptr
==
'%'
)
{
if
(
*
ptr
==
'%'
&&
!
is_res
)
{
const
WCHAR
*
tmp
=
ptr
;
WCHAR
val
;
...
...
@@ -3004,7 +3016,7 @@ static BOOL canonicalize_path_hierarchical(const parse_data *data, Uri *uri,
uri
->
canon_uri
[
uri
->
canon_len
]
=
'/'
;
++
uri
->
canon_len
;
}
}
else
if
(
known_scheme
&&
!
is_unreserved
(
*
ptr
)
&&
!
is_reserved
(
*
ptr
)
&&
}
else
if
(
known_scheme
&&
!
is_
res
&&
!
is_
unreserved
(
*
ptr
)
&&
!
is_reserved
(
*
ptr
)
&&
(
!
(
flags
&
Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
)
||
is_file
))
{
if
(
is_file
&&
(
flags
&
Uri_CREATE_FILE_USE_DOS_PATH
))
{
/* Don't escape the character. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment