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
81c274a5
Commit
81c274a5
authored
Nov 28, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Nov 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added implementation for PARSE_ROOTDOCUMENT for CoInternetParseIUri.
parent
6d996f32
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
1 deletion
+69
-1
uri.c
dlls/urlmon/tests/uri.c
+9
-1
uri.c
dlls/urlmon/uri.c
+60
-0
No files found.
dlls/urlmon/tests/uri.c
View file @
81c274a5
...
@@ -5925,7 +5925,15 @@ static const uri_parse_test uri_parse_tests[] = {
...
@@ -5925,7 +5925,15 @@ static const uri_parse_test uri_parse_tests[] = {
/* PARSE_FRIENDLY tests. */
/* PARSE_FRIENDLY tests. */
{
"http://test@google.com/test#test"
,
0
,
PARSE_FRIENDLY
,
0
,
"http://google.com/test#test"
,
S_OK
,
FALSE
},
{
"http://test@google.com/test#test"
,
0
,
PARSE_FRIENDLY
,
0
,
"http://google.com/test#test"
,
S_OK
,
FALSE
},
{
"zip://test@google.com/test"
,
0
,
PARSE_FRIENDLY
,
0
,
"zip://test@google.com/test"
,
S_OK
,
FALSE
}
{
"zip://test@google.com/test"
,
0
,
PARSE_FRIENDLY
,
0
,
"zip://test@google.com/test"
,
S_OK
,
FALSE
},
/* PARSE_ROOTDOCUMENT tests. */
{
"http://google.com:200/test/test"
,
0
,
PARSE_ROOTDOCUMENT
,
0
,
"http://google.com:200/"
,
S_OK
,
FALSE
},
{
"http://google.com"
,
Uri_CREATE_NO_CANONICALIZE
,
PARSE_ROOTDOCUMENT
,
0
,
"http://google.com/"
,
S_OK
,
FALSE
},
{
"zip://google.com/"
,
0
,
PARSE_ROOTDOCUMENT
,
0
,
""
,
S_OK
,
FALSE
},
{
"file:///c:/testing/"
,
0
,
PARSE_ROOTDOCUMENT
,
0
,
""
,
S_OK
,
FALSE
},
{
"file://server/test"
,
0
,
PARSE_ROOTDOCUMENT
,
0
,
""
,
S_OK
,
FALSE
},
{
"zip:test/test"
,
0
,
PARSE_ROOTDOCUMENT
,
0
,
""
,
S_OK
,
FALSE
}
};
};
static
inline
LPWSTR
a2w
(
LPCSTR
str
)
{
static
inline
LPWSTR
a2w
(
LPCSTR
str
)
{
...
...
dlls/urlmon/uri.c
View file @
81c274a5
...
@@ -6214,6 +6214,57 @@ static HRESULT parse_friendly(IUri *uri, LPWSTR output, DWORD output_len,
...
@@ -6214,6 +6214,57 @@ static HRESULT parse_friendly(IUri *uri, LPWSTR output, DWORD output_len,
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
parse_rootdocument
(
const
Uri
*
uri
,
LPWSTR
output
,
DWORD
output_len
,
DWORD
*
result_len
)
{
static
const
WCHAR
colon_slashesW
[]
=
{
':'
,
'/'
,
'/'
};
WCHAR
*
ptr
;
DWORD
len
=
0
;
/* Windows only returns the root document if the URI has an authority
* and it's not an unknown scheme type or a file scheme type.
*/
if
(
uri
->
authority_start
==
-
1
||
uri
->
scheme_type
==
URL_SCHEME_UNKNOWN
||
uri
->
scheme_type
==
URL_SCHEME_FILE
)
{
*
result_len
=
0
;
if
(
!
output_len
)
return
STRSAFE_E_INSUFFICIENT_BUFFER
;
output
[
0
]
=
0
;
return
S_OK
;
}
len
=
uri
->
scheme_len
+
uri
->
authority_len
;
/* For the "://" and '/' which will be added. */
len
+=
4
;
if
(
len
+
1
>
output_len
)
{
*
result_len
=
len
;
return
STRSAFE_E_INSUFFICIENT_BUFFER
;
}
ptr
=
output
;
memcpy
(
ptr
,
uri
->
canon_uri
+
uri
->
scheme_start
,
uri
->
scheme_len
*
sizeof
(
WCHAR
));
/* Add the "://". */
ptr
+=
uri
->
scheme_len
;
memcpy
(
ptr
,
colon_slashesW
,
sizeof
(
colon_slashesW
));
/* Add the authority. */
ptr
+=
sizeof
(
colon_slashesW
)
/
sizeof
(
WCHAR
);
memcpy
(
ptr
,
uri
->
canon_uri
+
uri
->
authority_start
,
uri
->
authority_len
*
sizeof
(
WCHAR
));
/* Add the '/' after the authority. */
ptr
+=
uri
->
authority_len
;
*
ptr
=
'/'
;
ptr
[
1
]
=
0
;
*
result_len
=
len
;
return
S_OK
;
}
/***********************************************************************
/***********************************************************************
* CoInternetParseIUri (urlmon.@)
* CoInternetParseIUri (urlmon.@)
*/
*/
...
@@ -6248,6 +6299,15 @@ HRESULT WINAPI CoInternetParseIUri(IUri *pIUri, PARSEACTION ParseAction, DWORD d
...
@@ -6248,6 +6299,15 @@ HRESULT WINAPI CoInternetParseIUri(IUri *pIUri, PARSEACTION ParseAction, DWORD d
case
PARSE_FRIENDLY
:
case
PARSE_FRIENDLY
:
hr
=
parse_friendly
(
pIUri
,
pwzResult
,
cchResult
,
pcchResult
);
hr
=
parse_friendly
(
pIUri
,
pwzResult
,
cchResult
,
pcchResult
);
break
;
break
;
case
PARSE_ROOTDOCUMENT
:
if
(
!
(
uri
=
get_uri_obj
(
pIUri
)))
{
*
pcchResult
=
0
;
FIXME
(
"(%p %d %x %p %d %p %x) Unknown IUri's not supported for this action.
\n
"
,
pIUri
,
ParseAction
,
dwFlags
,
pwzResult
,
cchResult
,
pcchResult
,
(
DWORD
)
dwReserved
);
return
E_NOTIMPL
;
}
hr
=
parse_rootdocument
(
uri
,
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