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
7e292893
Commit
7e292893
authored
Sep 22, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Sep 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Can't set the host of a IUriBuilder to NULL.
parent
cbea4e2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
6 deletions
+85
-6
uri.c
dlls/urlmon/tests/uri.c
+71
-1
uri.c
dlls/urlmon/uri.c
+14
-5
No files found.
dlls/urlmon/tests/uri.c
View file @
7e292893
...
...
@@ -5295,6 +5295,72 @@ static const uri_builder_test uri_builder_tests[] = {
{
URL_SCHEME_HTTP
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
},
/* Can't set the host name to NULL. */
{
"http://google.com/"
,
0
,
S_OK
,
FALSE
,
{
{
TRUE
,
NULL
,
"google.com"
,
Uri_PROPERTY_HOST
,
E_INVALIDARG
,
FALSE
}
},
{
FALSE
},
0
,
S_OK
,
FALSE
,
0
,
S_OK
,
FALSE
,
0
,
0
,
0
,
S_OK
,
FALSE
,
{
{
"http://google.com/"
,
S_OK
},
{
"google.com"
,
S_OK
},
{
"http://google.com/"
,
S_OK
},
{
"google.com"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
"google.com"
,
S_OK
},
{
""
,
S_FALSE
},
{
"/"
,
S_OK
},
{
"/"
,
S_OK
},
{
""
,
S_FALSE
},
{
"http://google.com/"
,
S_OK
},
{
"http"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_DNS
,
S_OK
},
{
80
,
S_OK
},
{
URL_SCHEME_HTTP
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
},
/* Can set the host name to an empty string. */
{
"http://google.com/"
,
0
,
S_OK
,
FALSE
,
{
{
TRUE
,
""
,
NULL
,
Uri_PROPERTY_HOST
,
S_OK
,
FALSE
}
},
{
FALSE
},
0
,
S_OK
,
TRUE
,
0
,
S_OK
,
TRUE
,
0
,
0
,
0
,
S_OK
,
TRUE
,
{
{
"http:///"
,
S_OK
},
{
""
,
S_OK
},
{
"http:///"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_OK
},
{
""
,
S_FALSE
},
{
"/"
,
S_OK
},
{
"/"
,
S_OK
},
{
""
,
S_FALSE
},
{
"http:///"
,
S_OK
},
{
"http"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
},
{
80
,
S_OK
},
{
URL_SCHEME_HTTP
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
}
};
...
...
@@ -8025,10 +8091,14 @@ static void test_IUriBuilder(void) {
uri_builder_property
prop
=
test
.
properties
[
j
];
if
(
prop
.
change
)
{
change_property
(
builder
,
&
prop
,
i
);
if
(
prop
.
property
!=
Uri_PROPERTY_SCHEME_NAME
)
if
(
prop
.
property
!=
Uri_PROPERTY_SCHEME_NAME
&&
prop
.
property
!=
Uri_PROPERTY_HOST
)
modified
=
TRUE
;
else
if
(
prop
.
value
&&
*
prop
.
value
)
modified
=
TRUE
;
else
if
(
prop
.
value
&&
!*
prop
.
value
&&
prop
.
property
==
Uri_PROPERTY_HOST
)
/* Host name property can't be NULL, but it can be empty. */
modified
=
TRUE
;
}
}
...
...
dlls/urlmon/uri.c
View file @
7e292893
...
...
@@ -5082,6 +5082,11 @@ static HRESULT WINAPI UriBuilder_SetHost(IUriBuilder *iface, LPCWSTR pwzNewValue
{
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
pwzNewValue
));
/* Host name can't be set to NULL. */
if
(
!
pwzNewValue
)
return
E_INVALIDARG
;
return
set_builder_component
(
&
This
->
host
,
&
This
->
host_len
,
pwzNewValue
,
0
,
&
This
->
modified_props
,
Uri_HAS_HOST
);
}
...
...
@@ -5127,11 +5132,11 @@ static HRESULT WINAPI UriBuilder_SetSchemeName(IUriBuilder *iface, LPCWSTR pwzNe
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
pwzNewValue
));
/* Only set the scheme name if it's not NULL or empty. */
if
(
pwzNewValue
&&
*
pwzNewValue
)
return
set_builder_component
(
&
This
->
scheme
,
&
This
->
scheme_len
,
pwzNewValue
,
0
,
&
This
->
modified_props
,
Uri_HAS_SCHEME_NAME
);
else
if
(
!
pwzNewValue
||
!*
pwzNewValue
)
return
E_INVALIDARG
;
return
set_builder_component
(
&
This
->
scheme
,
&
This
->
scheme_len
,
pwzNewValue
,
0
,
&
This
->
modified_props
,
Uri_HAS_SCHEME_NAME
);
}
static
HRESULT
WINAPI
UriBuilder_SetUserName
(
IUriBuilder
*
iface
,
LPCWSTR
pwzNewValue
)
...
...
@@ -5157,8 +5162,12 @@ static HRESULT WINAPI UriBuilder_RemoveProperties(IUriBuilder *iface, DWORD dwPr
if
(
dwPropertyMask
&
Uri_HAS_FRAGMENT
)
UriBuilder_SetFragment
(
iface
,
NULL
);
/* Even though you can't set the host name to NULL or an
* empty string, you can still remove it... for some reason.
*/
if
(
dwPropertyMask
&
Uri_HAS_HOST
)
UriBuilder_SetHost
(
iface
,
NULL
);
set_builder_component
(
&
This
->
host
,
&
This
->
host_len
,
NULL
,
0
,
&
This
->
modified_props
,
Uri_HAS_HOST
);
if
(
dwPropertyMask
&
Uri_HAS_PASSWORD
)
UriBuilder_SetPassword
(
iface
,
NULL
);
...
...
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