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
0da2e4c3
Commit
0da2e4c3
authored
Sep 12, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Sep 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Can't set the scheme name of a IUriBuilder to NULL or an empty string.
parent
f39d9452
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
8 deletions
+84
-8
uri.c
dlls/urlmon/tests/uri.c
+76
-2
uri.c
dlls/urlmon/uri.c
+8
-6
No files found.
dlls/urlmon/tests/uri.c
View file @
0da2e4c3
...
@@ -4922,6 +4922,72 @@ static const uri_builder_test uri_builder_tests[] = {
...
@@ -4922,6 +4922,72 @@ static const uri_builder_test uri_builder_tests[] = {
{
URL_SCHEME_HTTP
,
S_OK
},
{
URL_SCHEME_HTTP
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
}
},
/* Can't set the scheme name to NULL. */
{
"zip://google.com/"
,
0
,
S_OK
,
FALSE
,
{
{
TRUE
,
NULL
,
"zip"
,
Uri_PROPERTY_SCHEME_NAME
,
E_INVALIDARG
,
FALSE
}
},
{
FALSE
},
0
,
S_OK
,
TRUE
,
0
,
S_OK
,
TRUE
,
0
,
0
,
0
,
S_OK
,
TRUE
,
{
{
"zip://google.com/"
,
S_OK
},
{
"google.com"
,
S_OK
},
{
"zip://google.com/"
,
S_OK
},
{
"google.com"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
"google.com"
,
S_OK
},
{
""
,
S_FALSE
},
{
"/"
,
S_OK
},
{
"/"
,
S_OK
},
{
""
,
S_FALSE
},
{
"zip://google.com/"
,
S_OK
},
{
"zip"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_DNS
,
S_OK
},
{
0
,
S_FALSE
},
{
URL_SCHEME_UNKNOWN
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
},
/* Can't set the scheme name to an empty string. */
{
"zip://google.com/"
,
0
,
S_OK
,
FALSE
,
{
{
TRUE
,
""
,
"zip"
,
Uri_PROPERTY_SCHEME_NAME
,
E_INVALIDARG
,
FALSE
}
},
{
FALSE
},
0
,
S_OK
,
TRUE
,
0
,
S_OK
,
TRUE
,
0
,
0
,
0
,
S_OK
,
TRUE
,
{
{
"zip://google.com/"
,
S_OK
},
{
"google.com"
,
S_OK
},
{
"zip://google.com/"
,
S_OK
},
{
"google.com"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
"google.com"
,
S_OK
},
{
""
,
S_FALSE
},
{
"/"
,
S_OK
},
{
"/"
,
S_OK
},
{
""
,
S_FALSE
},
{
"zip://google.com/"
,
S_OK
},
{
"zip"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_DNS
,
S_OK
},
{
0
,
S_FALSE
},
{
URL_SCHEME_UNKNOWN
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
}
}
};
};
...
@@ -4975,6 +5041,11 @@ static const uri_builder_remove_test uri_builder_remove_tests[] = {
...
@@ -4975,6 +5041,11 @@ static const uri_builder_remove_test uri_builder_remove_tests[] = {
{
"http://google.com/?test=x"
,
0
,
S_OK
,
FALSE
,
{
"http://google.com/?test=x"
,
0
,
S_OK
,
FALSE
,
Uri_HAS_PATH_AND_QUERY
,
S_OK
,
FALSE
,
Uri_HAS_PATH_AND_QUERY
,
S_OK
,
FALSE
,
"http://google.com/?test=x"
,
0
,
S_OK
,
TRUE
"http://google.com/?test=x"
,
0
,
S_OK
,
TRUE
},
/* Can't remove the scheme name. */
{
"http://google.com/?test=x"
,
0
,
S_OK
,
FALSE
,
Uri_HAS_SCHEME_NAME
|
Uri_HAS_QUERY
,
E_INVALIDARG
,
FALSE
,
"http://google.com/?test=x"
,
0
,
S_OK
,
TRUE
}
}
};
};
...
@@ -7519,7 +7590,7 @@ static void test_IUriBuilder_GetUserName(IUriBuilder *builder, const uri_builder
...
@@ -7519,7 +7590,7 @@ static void test_IUriBuilder_GetUserName(IUriBuilder *builder, const uri_builder
prop
=
&
(
test
->
properties
[
i
]);
prop
=
&
(
test
->
properties
[
i
]);
}
}
if
(
prop
)
{
if
(
prop
&&
prop
->
value
&&
*
prop
->
value
)
{
/* Use expected_value unless it's NULL, then use value. */
/* Use expected_value unless it's NULL, then use value. */
LPCSTR
expected
=
prop
->
expected_value
?
prop
->
expected_value
:
prop
->
value
;
LPCSTR
expected
=
prop
->
expected_value
?
prop
->
expected_value
:
prop
->
value
;
hr
=
IUriBuilder_GetUserName
(
builder
,
&
len
,
&
received
);
hr
=
IUriBuilder_GetUserName
(
builder
,
&
len
,
&
received
);
...
@@ -7652,8 +7723,11 @@ static void test_IUriBuilder(void) {
...
@@ -7652,8 +7723,11 @@ static void test_IUriBuilder(void) {
for
(
j
=
0
;
j
<
URI_BUILDER_STR_PROPERTY_COUNT
;
++
j
)
{
for
(
j
=
0
;
j
<
URI_BUILDER_STR_PROPERTY_COUNT
;
++
j
)
{
uri_builder_property
prop
=
test
.
properties
[
j
];
uri_builder_property
prop
=
test
.
properties
[
j
];
if
(
prop
.
change
)
{
if
(
prop
.
change
)
{
modified
=
TRUE
;
change_property
(
builder
,
&
prop
,
i
);
change_property
(
builder
,
&
prop
,
i
);
if
(
prop
.
property
!=
Uri_PROPERTY_SCHEME_NAME
)
modified
=
TRUE
;
else
if
(
prop
.
value
&&
*
prop
.
value
)
modified
=
TRUE
;
}
}
}
}
...
...
dlls/urlmon/uri.c
View file @
0da2e4c3
...
@@ -4729,8 +4729,13 @@ static HRESULT WINAPI UriBuilder_SetSchemeName(IUriBuilder *iface, LPCWSTR pwzNe
...
@@ -4729,8 +4729,13 @@ static HRESULT WINAPI UriBuilder_SetSchemeName(IUriBuilder *iface, LPCWSTR pwzNe
{
{
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
pwzNewValue
));
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
pwzNewValue
));
return
set_builder_component
(
&
This
->
scheme
,
&
This
->
scheme_len
,
pwzNewValue
,
0
,
&
This
->
modified_props
,
Uri_HAS_SCHEME_NAME
);
/* 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
return
E_INVALIDARG
;
}
}
static
HRESULT
WINAPI
UriBuilder_SetUserName
(
IUriBuilder
*
iface
,
LPCWSTR
pwzNewValue
)
static
HRESULT
WINAPI
UriBuilder_SetUserName
(
IUriBuilder
*
iface
,
LPCWSTR
pwzNewValue
)
...
@@ -4745,7 +4750,7 @@ static HRESULT WINAPI UriBuilder_RemoveProperties(IUriBuilder *iface, DWORD dwPr
...
@@ -4745,7 +4750,7 @@ static HRESULT WINAPI UriBuilder_RemoveProperties(IUriBuilder *iface, DWORD dwPr
{
{
const
DWORD
accepted_flags
=
Uri_HAS_AUTHORITY
|
Uri_HAS_DOMAIN
|
Uri_HAS_EXTENSION
|
Uri_HAS_FRAGMENT
|
Uri_HAS_HOST
|
const
DWORD
accepted_flags
=
Uri_HAS_AUTHORITY
|
Uri_HAS_DOMAIN
|
Uri_HAS_EXTENSION
|
Uri_HAS_FRAGMENT
|
Uri_HAS_HOST
|
Uri_HAS_PASSWORD
|
Uri_HAS_PATH
|
Uri_HAS_PATH_AND_QUERY
|
Uri_HAS_QUERY
|
Uri_HAS_PASSWORD
|
Uri_HAS_PATH
|
Uri_HAS_PATH_AND_QUERY
|
Uri_HAS_QUERY
|
Uri_HAS_
SCHEME_NAME
|
Uri_HAS_
USER_INFO
|
Uri_HAS_USER_NAME
;
Uri_HAS_USER_INFO
|
Uri_HAS_USER_NAME
;
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
TRACE
(
"(%p)->(0x%08x)
\n
"
,
This
,
dwPropertyMask
);
TRACE
(
"(%p)->(0x%08x)
\n
"
,
This
,
dwPropertyMask
);
...
@@ -4771,9 +4776,6 @@ static HRESULT WINAPI UriBuilder_RemoveProperties(IUriBuilder *iface, DWORD dwPr
...
@@ -4771,9 +4776,6 @@ static HRESULT WINAPI UriBuilder_RemoveProperties(IUriBuilder *iface, DWORD dwPr
if
(
dwPropertyMask
&
Uri_HAS_QUERY
)
if
(
dwPropertyMask
&
Uri_HAS_QUERY
)
UriBuilder_SetQuery
(
iface
,
NULL
);
UriBuilder_SetQuery
(
iface
,
NULL
);
if
(
dwPropertyMask
&
Uri_HAS_SCHEME_NAME
)
UriBuilder_SetSchemeName
(
iface
,
NULL
);
if
(
dwPropertyMask
&
Uri_HAS_USER_NAME
)
if
(
dwPropertyMask
&
Uri_HAS_USER_NAME
)
UriBuilder_SetUserName
(
iface
,
NULL
);
UriBuilder_SetUserName
(
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