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
31853fc2
Commit
31853fc2
authored
Nov 15, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Nov 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Improve parsing of SCHEME_MK URIs.
parent
8f5543c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
119 additions
and
4 deletions
+119
-4
uri.c
dlls/urlmon/tests/uri.c
+107
-1
uri.c
dlls/urlmon/uri.c
+12
-3
No files found.
dlls/urlmon/tests/uri.c
View file @
31853fc2
...
...
@@ -4316,7 +4316,32 @@ static const uri_properties uri_tests[] = {
{
URL_SCHEME_WILDCARD
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
}
},
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/file.txt"
,
0
,
S_OK
,
FALSE
,
{
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/file.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/file.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
".txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
"@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/file.txt"
,
S_OK
},
{
"@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/file.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/file.txt"
,
S_OK
},
{
"mk"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
},
{
0
,
S_FALSE
},
{
URL_SCHEME_MK
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
},
};
typedef
struct
_invalid_uri
{
...
...
@@ -6336,6 +6361,87 @@ static const uri_combine_test uri_combine_tests[] = {
{
URL_SCHEME_HTTP
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
},
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir
\\
file.txt"
,
0
,
"relative/path.txt"
,
Uri_CREATE_ALLOW_RELATIVE
,
0
,
S_OK
,
FALSE
,
{
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
".txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
"@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
"@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
"mk"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
},
{
0
,
S_FALSE
},
{
URL_SCHEME_MK
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
},
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::
\\
subdir
\\
file.txt"
,
0
,
"relative/path.txt"
,
Uri_CREATE_ALLOW_RELATIVE
,
0
,
S_OK
,
FALSE
,
{
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
".txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
"@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
"@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
"mk:@MSITSTORE:C:
\\
Some
\\
Bogus
\\
Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
"mk"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
},
{
0
,
S_FALSE
},
{
URL_SCHEME_MK
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
},
{
"mk:@MSITSTORE:C:/Some
\\
Bogus/Path.chm::/subdir
\\
file.txt"
,
0
,
"relative
\\
path.txt"
,
Uri_CREATE_ALLOW_RELATIVE
,
0
,
S_OK
,
FALSE
,
{
{
"mk:@MSITSTORE:C:/Some
\\
Bogus/Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
"mk:@MSITSTORE:C:/Some
\\
Bogus/Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
".txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
"@MSITSTORE:C:/Some
\\
Bogus/Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
"@MSITSTORE:C:/Some
\\
Bogus/Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
""
,
S_FALSE
},
{
"mk:@MSITSTORE:C:/Some
\\
Bogus/Path.chm::/subdir/relative/path.txt"
,
S_OK
},
{
"mk"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
},
{
0
,
S_FALSE
},
{
URL_SCHEME_MK
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
}
};
...
...
dlls/urlmon/uri.c
View file @
31853fc2
...
...
@@ -3086,6 +3086,7 @@ static BOOL canonicalize_path_opaque(const parse_data *data, Uri *uri, DWORD fla
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_mk
=
data
->
scheme_type
==
URL_SCHEME_MK
;
if
(
!
data
->
path
)
{
uri
->
path_start
=
-
1
;
...
...
@@ -3095,6 +3096,12 @@ static BOOL canonicalize_path_opaque(const parse_data *data, Uri *uri, DWORD fla
uri
->
path_start
=
uri
->
canon_len
;
if
(
is_mk
){
/* hijack this flag for SCHEME_MK to tell the function when to start
* converting slashes */
flags
|=
Uri_CREATE_FILE_USE_DOS_PATH
;
}
/* For javascript: URIs, simply copy path part without any canonicalization */
if
(
data
->
scheme_type
==
URL_SCHEME_JAVASCRIPT
)
{
if
(
!
computeOnly
)
...
...
@@ -3137,13 +3144,15 @@ static BOOL canonicalize_path_opaque(const parse_data *data, Uri *uri, DWORD fla
++
uri
->
canon_len
;
do_default_action
=
FALSE
;
}
else
if
(
*
ptr
==
'\\'
)
{
if
(
is_file
&&
!
(
flags
&
Uri_CREATE_FILE_USE_DOS_PATH
))
{
if
(
(
data
->
is_relative
||
is_mk
||
is_file
)
&&
!
(
flags
&
Uri_CREATE_FILE_USE_DOS_PATH
))
{
/* Convert to a '/'. */
if
(
!
computeOnly
)
uri
->
canon_uri
[
uri
->
canon_len
]
=
'/'
;
++
uri
->
canon_len
;
do_default_action
=
FALSE
;
}
}
else
if
(
is_mk
&&
*
ptr
==
':'
&&
ptr
+
1
<
data
->
path
+
data
->
path_len
&&
*
(
ptr
+
1
)
==
':'
)
{
flags
&=
~
Uri_CREATE_FILE_USE_DOS_PATH
;
}
else
if
(
known_scheme
&&
!
is_unreserved
(
*
ptr
)
&&
!
is_reserved
(
*
ptr
)
&&
!
(
flags
&
Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
))
{
if
(
!
(
is_file
&&
(
flags
&
Uri_CREATE_FILE_USE_DOS_PATH
)))
{
...
...
@@ -3161,7 +3170,7 @@ static BOOL canonicalize_path_opaque(const parse_data *data, Uri *uri, DWORD fla
}
}
if
(
data
->
scheme_type
==
URL_SCHEME_MK
&&
!
computeOnly
&&
!
(
flags
&
Uri_CREATE_NO_CANONICALIZE
))
{
if
(
is_mk
&&
!
computeOnly
&&
!
(
flags
&
Uri_CREATE_NO_CANONICALIZE
))
{
DWORD
new_len
=
remove_dot_segments
(
uri
->
canon_uri
+
uri
->
path_start
,
uri
->
canon_len
-
uri
->
path_start
);
uri
->
canon_len
=
uri
->
path_start
+
new_len
;
...
...
@@ -5165,7 +5174,7 @@ HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IU
memset
(
&
data
,
0
,
sizeof
(
parse_data
));
data
.
uri
=
ret
->
raw_uri
;
/* Validate and parse the URI into it
'
s components. */
/* Validate and parse the URI into its components. */
if
(
!
parse_uri
(
&
data
,
dwFlags
))
{
/* Encountered an unsupported or invalid URI */
IUri_Release
(
&
ret
->
IUri_iface
);
...
...
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