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
17880993
Commit
17880993
authored
Dec 02, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Dec 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Implemented PARSE_URL_FROM_PATH for CoInternetParseIUri.
parent
221331e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
uri.c
dlls/urlmon/tests/uri.c
+9
-1
uri.c
dlls/urlmon/uri.c
+32
-0
No files found.
dlls/urlmon/tests/uri.c
View file @
17880993
...
@@ -5948,7 +5948,15 @@ static const uri_parse_test uri_parse_tests[] = {
...
@@ -5948,7 +5948,15 @@ static const uri_parse_test uri_parse_tests[] = {
{
"file:///c:/t<|>est.mp3"
,
0
,
PARSE_PATH_FROM_URL
,
0
,
"c:
\\
t<|>est.mp3"
,
S_OK
,
FALSE
},
{
"file:///c:/t<|>est.mp3"
,
0
,
PARSE_PATH_FROM_URL
,
0
,
"c:
\\
t<|>est.mp3"
,
S_OK
,
FALSE
},
{
"file:///c:/te%XX t/"
,
0
,
PARSE_PATH_FROM_URL
,
0
,
"c:
\\
te%XX t
\\
"
,
S_OK
,
FALSE
},
{
"file:///c:/te%XX t/"
,
0
,
PARSE_PATH_FROM_URL
,
0
,
"c:
\\
te%XX t
\\
"
,
S_OK
,
FALSE
},
{
"file://server/test"
,
0
,
PARSE_PATH_FROM_URL
,
0
,
"
\\\\
server
\\
test"
,
S_OK
,
FALSE
},
{
"file://server/test"
,
0
,
PARSE_PATH_FROM_URL
,
0
,
"
\\\\
server
\\
test"
,
S_OK
,
FALSE
},
{
"http://google.com/"
,
0
,
PARSE_PATH_FROM_URL
,
0
,
""
,
E_INVALIDARG
,
FALSE
}
{
"http://google.com/"
,
0
,
PARSE_PATH_FROM_URL
,
0
,
""
,
E_INVALIDARG
,
FALSE
},
/* PARSE_URL_FROM_PATH tests. */
/* This function almost seems to useless (just returns the absolute uri). */
{
"test.com"
,
Uri_CREATE_ALLOW_RELATIVE
,
PARSE_URL_FROM_PATH
,
0
,
"test.com"
,
S_OK
,
FALSE
},
{
"/test/test"
,
Uri_CREATE_ALLOW_RELATIVE
,
PARSE_URL_FROM_PATH
,
0
,
"/test/test"
,
S_OK
,
FALSE
},
{
"file://c:
\\
test
\\
test"
,
Uri_CREATE_FILE_USE_DOS_PATH
,
PARSE_URL_FROM_PATH
,
0
,
"file://c:
\\
test
\\
test"
,
S_OK
,
FALSE
},
{
"file:c:/test"
,
0
,
PARSE_URL_FROM_PATH
,
0
,
""
,
S_OK
,
FALSE
},
{
"http:google.com/"
,
0
,
PARSE_URL_FROM_PATH
,
0
,
""
,
S_OK
,
FALSE
}
};
};
static
inline
LPWSTR
a2w
(
LPCSTR
str
)
{
static
inline
LPWSTR
a2w
(
LPCSTR
str
)
{
...
...
dlls/urlmon/uri.c
View file @
17880993
...
@@ -6356,6 +6356,35 @@ static HRESULT parse_path_from_url(const Uri *uri, LPWSTR output, DWORD output_l
...
@@ -6356,6 +6356,35 @@ static HRESULT parse_path_from_url(const Uri *uri, LPWSTR output, DWORD output_l
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
parse_url_from_path
(
IUri
*
uri
,
LPWSTR
output
,
DWORD
output_len
,
DWORD
*
result_len
)
{
HRESULT
hr
;
BSTR
received
;
DWORD
len
=
0
;
hr
=
IUri_GetPropertyLength
(
uri
,
Uri_PROPERTY_ABSOLUTE_URI
,
&
len
,
0
);
if
(
FAILED
(
hr
))
{
*
result_len
=
0
;
return
hr
;
}
*
result_len
=
len
;
if
(
len
+
1
>
output_len
)
return
STRSAFE_E_INSUFFICIENT_BUFFER
;
hr
=
IUri_GetAbsoluteUri
(
uri
,
&
received
);
if
(
FAILED
(
hr
))
{
*
result_len
=
0
;
return
hr
;
}
memcpy
(
output
,
received
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
SysFreeString
(
received
);
return
S_OK
;
}
/***********************************************************************
/***********************************************************************
* CoInternetParseIUri (urlmon.@)
* CoInternetParseIUri (urlmon.@)
*/
*/
...
@@ -6417,6 +6446,9 @@ HRESULT WINAPI CoInternetParseIUri(IUri *pIUri, PARSEACTION ParseAction, DWORD d
...
@@ -6417,6 +6446,9 @@ HRESULT WINAPI CoInternetParseIUri(IUri *pIUri, PARSEACTION ParseAction, DWORD d
}
}
hr
=
parse_path_from_url
(
uri
,
pwzResult
,
cchResult
,
pcchResult
);
hr
=
parse_path_from_url
(
uri
,
pwzResult
,
cchResult
,
pcchResult
);
break
;
break
;
case
PARSE_URL_FROM_PATH
:
hr
=
parse_url_from_path
(
pIUri
,
pwzResult
,
cchResult
,
pcchResult
);
break
;
case
PARSE_SECURITY_URL
:
case
PARSE_SECURITY_URL
:
case
PARSE_MIME
:
case
PARSE_MIME
:
case
PARSE_SERVER
:
case
PARSE_SERVER
:
...
...
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