Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
50db65a4
Commit
50db65a4
authored
Jun 19, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Jul 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Implemented IUri_GetUserName.
parent
152a1efd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
39 deletions
+59
-39
uri.c
dlls/urlmon/tests/uri.c
+32
-32
uri.c
dlls/urlmon/uri.c
+27
-7
No files found.
dlls/urlmon/tests/uri.c
View file @
50db65a4
...
...
@@ -107,7 +107,7 @@ static const uri_properties uri_tests[] = {
{
"http://www.winehq.org/tests/../tests/../.."
,
S_OK
,
FALSE
},
/* RAW_URI */
{
"http"
,
S_OK
,
FALSE
},
/* SCHEME_NAME */
{
""
,
S_FALSE
,
FALSE
},
/* USER_INFO */
{
""
,
S_FALSE
,
TRUE
}
/* USER_NAME */
{
""
,
S_FALSE
,
FALSE
}
/* USER_NAME */
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
/* HOST_TYPE */
...
...
@@ -136,7 +136,7 @@ static const uri_properties uri_tests[] = {
{
"http://winehq.org/tests/.././tests"
,
S_OK
,
FALSE
},
{
"http"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -165,7 +165,7 @@ static const uri_properties uri_tests[] = {
{
"HtTp://www.winehq.org/tests/..?query=x&return=y"
,
S_OK
,
FALSE
},
{
"http"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -194,7 +194,7 @@ static const uri_properties uri_tests[] = {
{
"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters"
,
S_OK
,
FALSE
},
{
"http"
,
S_OK
,
FALSE
},
{
"usEr%3Ainfo"
,
S_OK
,
FALSE
},
{
"usEr%3Ainfo"
,
S_OK
,
TRU
E
}
{
"usEr%3Ainfo"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -224,7 +224,7 @@ static const uri_properties uri_tests[] = {
{
"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt"
,
S_OK
,
FALSE
},
{
"ftp"
,
S_OK
,
FALSE
},
{
"winepass:wine"
,
S_OK
,
FALSE
},
{
"winepass"
,
S_OK
,
TRU
E
}
{
"winepass"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -252,7 +252,7 @@ static const uri_properties uri_tests[] = {
{
"file://c:
\\
tests
\\
../tests/foo%20bar.mp3"
,
S_OK
,
FALSE
},
{
"file"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
TRUE
},
...
...
@@ -280,7 +280,7 @@ static const uri_properties uri_tests[] = {
{
"FILE://localhost/test dir
\\
../tests/test%20file.README.txt"
,
S_OK
,
FALSE
},
{
"file"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
TRUE
},
...
...
@@ -308,7 +308,7 @@ static const uri_properties uri_tests[] = {
{
"urn:nothing:should:happen here"
,
S_OK
,
FALSE
},
{
"urn"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
TRUE
},
...
...
@@ -337,7 +337,7 @@ static const uri_properties uri_tests[] = {
{
"http://127.0.0.1/tests/../test dir/./test.txt"
,
S_OK
,
FALSE
},
{
"http"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_IPV4
,
S_OK
,
TRUE
},
...
...
@@ -366,7 +366,7 @@ static const uri_properties uri_tests[] = {
{
"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]"
,
S_OK
,
FALSE
},
{
"http"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_IPV6
,
S_OK
,
TRUE
},
...
...
@@ -395,7 +395,7 @@ static const uri_properties uri_tests[] = {
{
"ftp://[::13.1.68.3]"
,
S_OK
,
FALSE
},
{
"ftp"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_IPV6
,
S_OK
,
TRUE
},
...
...
@@ -424,7 +424,7 @@ static const uri_properties uri_tests[] = {
{
"http://[FEDC:BA98:0:0:0:0:0:3210]"
,
S_OK
,
FALSE
},
{
"http"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
},
{
""
,
S_FALSE
,
FALS
E
},
},
{
{
Uri_HOST_IPV6
,
S_OK
,
TRUE
},
...
...
@@ -453,7 +453,7 @@ static const uri_properties uri_tests[] = {
{
"1234://www.winehq.org"
,
S_OK
,
FALSE
},
{
"1234"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -616,7 +616,7 @@ static const uri_properties uri_tests[] = {
{
"C:/test/test.mp3"
,
S_OK
,
FALSE
},
{
"file"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
TRUE
},
...
...
@@ -646,7 +646,7 @@ static const uri_properties uri_tests[] = {
{
"
\\\\
Server/test.mp3"
,
S_OK
,
FALSE
},
{
"file"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -675,7 +675,7 @@ static const uri_properties uri_tests[] = {
{
"www.winehq.org/test"
,
S_OK
,
FALSE
},
{
"*"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -705,7 +705,7 @@ static const uri_properties uri_tests[] = {
{
"*:www.winehq.org/test"
,
S_OK
,
FALSE
},
{
"*"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -787,7 +787,7 @@ static const uri_properties uri_tests[] = {
{
"/../some dir/test.ext"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
TRUE
},
...
...
@@ -815,7 +815,7 @@ static const uri_properties uri_tests[] = {
{
"//implicit/wildcard/uri scheme"
,
S_OK
,
FALSE
},
{
"*"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
},
{
""
,
S_FALSE
,
FALS
E
},
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
TRUE
},
...
...
@@ -845,7 +845,7 @@ static const uri_properties uri_tests[] = {
{
"zip://google.com"
,
S_OK
,
FALSE
},
{
"zip"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
TRUE
},
...
...
@@ -876,7 +876,7 @@ static const uri_properties uri_tests[] = {
{
"ftp://user:pass:word@winehq.org/"
,
S_OK
,
FALSE
},
{
"ftp"
,
S_OK
,
FALSE
},
{
"user:pass:word"
,
S_OK
,
FALSE
},
{
"user"
,
S_OK
,
TRU
E
}
{
"user"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -907,7 +907,7 @@ static const uri_properties uri_tests[] = {
{
"ftp://w%49%4Ee:PA%53%53@ftp.google.com/"
,
S_OK
,
FALSE
},
{
"ftp"
,
S_OK
,
FALSE
},
{
"wINe:PASS"
,
S_OK
,
FALSE
},
{
"wINe"
,
S_OK
,
TRU
E
}
{
"wINe"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -938,7 +938,7 @@ static const uri_properties uri_tests[] = {
{
"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/"
,
S_OK
,
FALSE
},
{
"ftp"
,
S_OK
,
FALSE
},
{
"w%5D%5Be:PA%7B%7D"
,
S_OK
,
FALSE
},
{
"w%5D%5Be"
,
S_OK
,
TRU
E
}
{
"w%5D%5Be"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -969,7 +969,7 @@ static const uri_properties uri_tests[] = {
{
"ftp://empty:@ftp.google.com/"
,
S_OK
,
FALSE
},
{
"ftp"
,
S_OK
,
FALSE
},
{
"empty:"
,
S_OK
,
FALSE
},
{
"empty"
,
S_OK
,
TRU
E
}
{
"empty"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -1000,7 +1000,7 @@ static const uri_properties uri_tests[] = {
{
"ftp://
\"
\"
weird@ftp.google.com/"
,
S_OK
,
FALSE
},
{
"ftp"
,
S_OK
,
FALSE
},
{
"%22%20%22weird"
,
S_OK
,
FALSE
},
{
"%22%20%22weird"
,
S_OK
,
TRU
E
}
{
"%22%20%22weird"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -1031,7 +1031,7 @@ static const uri_properties uri_tests[] = {
{
"ftp://
\"
\"
weird@ftp.google.com/"
,
S_OK
,
FALSE
},
{
"ftp"
,
S_OK
,
FALSE
},
{
"
\"
\"
weird"
,
S_OK
,
FALSE
},
{
"
\"
\"
weird"
,
S_OK
,
TRU
E
}
{
"
\"
\"
weird"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -1061,7 +1061,7 @@ static const uri_properties uri_tests[] = {
{
"zip://%xy:word@winehq.org/"
,
S_OK
,
FALSE
},
{
"zip"
,
S_OK
,
FALSE
},
{
"%xy:word"
,
S_OK
,
FALSE
},
{
"%xy"
,
S_OK
,
TRU
E
}
{
"%xy"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -1093,7 +1093,7 @@ static const uri_properties uri_tests[] = {
{
"zip://%2E:%52%53ord@winehq.org/"
,
S_OK
,
FALSE
},
{
"zip"
,
S_OK
,
FALSE
},
{
"%2E:%52%53ord"
,
S_OK
,
FALSE
},
{
"%2E"
,
S_OK
,
TRU
E
}
{
"%2E"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -1123,7 +1123,7 @@ static const uri_properties uri_tests[] = {
{
"ftp://[](),'test':word@winehq.org/"
,
S_OK
,
FALSE
},
{
"ftp"
,
S_OK
,
FALSE
},
{
"[](),'test':word"
,
S_OK
,
FALSE
},
{
"[](),'test'"
,
S_OK
,
TRU
E
}
{
"[](),'test'"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -1152,7 +1152,7 @@ static const uri_properties uri_tests[] = {
{
"ftp://test?:word@winehq.org/"
,
S_OK
,
FALSE
},
{
"ftp"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -1181,7 +1181,7 @@ static const uri_properties uri_tests[] = {
{
"ftp://test#:word@winehq.org/"
,
S_OK
,
FALSE
},
{
"ftp"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRU
E
}
{
""
,
S_FALSE
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
@@ -1211,7 +1211,7 @@ static const uri_properties uri_tests[] = {
{
"zip://test
\\
:word@winehq.org/"
,
S_OK
,
FALSE
},
{
"zip"
,
S_OK
,
FALSE
},
{
"test
\\
:word"
,
S_OK
,
FALSE
},
{
"test
\\
"
,
S_OK
,
TRU
E
}
{
"test
\\
"
,
S_OK
,
FALS
E
}
},
{
{
Uri_HOST_DNS
,
S_OK
,
TRUE
},
...
...
dlls/urlmon/uri.c
View file @
50db65a4
...
...
@@ -893,6 +893,27 @@ static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BST
hres
=
E_OUTOFMEMORY
;
break
;
case
Uri_PROPERTY_USER_NAME
:
if
(
This
->
userinfo_start
>
-
1
)
{
/* If userinfo_split is set, that means a password exists
* so the username is only from userinfo_start to userinfo_split.
*/
if
(
This
->
userinfo_split
>
-
1
)
{
*
pbstrProperty
=
SysAllocStringLen
(
This
->
canon_uri
+
This
->
userinfo_start
,
This
->
userinfo_split
);
hres
=
S_OK
;
}
else
{
*
pbstrProperty
=
SysAllocStringLen
(
This
->
canon_uri
+
This
->
userinfo_start
,
This
->
userinfo_len
);
hres
=
S_OK
;
}
}
else
{
*
pbstrProperty
=
SysAllocStringLen
(
NULL
,
0
);
hres
=
S_FALSE
;
}
if
(
!
(
*
pbstrProperty
))
return
E_OUTOFMEMORY
;
break
;
default:
FIXME
(
"(%p)->(%d %p %x)
\n
"
,
This
,
uriProp
,
pbstrProperty
,
dwFlags
);
hres
=
E_NOTIMPL
;
...
...
@@ -933,6 +954,10 @@ static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, D
*
pcchProperty
=
This
->
userinfo_len
;
hres
=
(
This
->
userinfo_start
>
-
1
)
?
S_OK
:
S_FALSE
;
break
;
case
Uri_PROPERTY_USER_NAME
:
*
pcchProperty
=
(
This
->
userinfo_split
>
-
1
)
?
This
->
userinfo_split
:
This
->
userinfo_len
;
hres
=
(
This
->
userinfo_start
>
-
1
)
?
S_OK
:
S_FALSE
;
break
;
default:
FIXME
(
"(%p)->(%d %p %x)
\n
"
,
This
,
uriProp
,
pcchProperty
,
dwFlags
);
hres
=
E_NOTIMPL
;
...
...
@@ -1135,13 +1160,8 @@ static HRESULT WINAPI Uri_GetUserInfo(IUri *iface, BSTR *pstrUserInfo)
static
HRESULT
WINAPI
Uri_GetUserName
(
IUri
*
iface
,
BSTR
*
pstrUserName
)
{
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrUserName
);
if
(
!
pstrUserName
)
return
E_POINTER
;
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
pstrUserName
);
return
Uri_GetPropertyBSTR
(
iface
,
Uri_PROPERTY_USER_NAME
,
pstrUserName
,
0
);
}
static
HRESULT
WINAPI
Uri_GetHostType
(
IUri
*
iface
,
DWORD
*
pdwHostType
)
...
...
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