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
a6f1ebfe
Commit
a6f1ebfe
authored
May 30, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
May 31, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon/tests: Added test for invalid args to IUri_GetPropertyBSTR and IUri_GetPropertyDWORD.
parent
f16fa49f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
3 deletions
+56
-3
Makefile.in
dlls/urlmon/Makefile.in
+1
-1
uri.c
dlls/urlmon/tests/uri.c
+35
-2
uri.c
dlls/urlmon/uri.c
+20
-0
No files found.
dlls/urlmon/Makefile.in
View file @
a6f1ebfe
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
urlmon.dll
IMPORTLIB
=
urlmon
IMPORTS
=
uuid ole32 rpcrt4 shlwapi wininet user32 advapi32 kernel32 ntdll
IMPORTS
=
uuid ole32
oleaut32
rpcrt4 shlwapi wininet user32 advapi32 kernel32 ntdll
EXTRADEFS
=
-D_URLMON_
-DENTRY_PREFIX
=
URLMON_
-DPROXY_DELEGATION
-DREGISTER_PROXY_DLL
\
-DPROXY_CLSID_IS
=
"{0x79EAC9F1,0xBAF9,0x11CE,{0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B}}"
...
...
dlls/urlmon/tests/uri.c
View file @
a6f1ebfe
...
...
@@ -442,13 +442,40 @@ static void test_CreateUri_InvalidArgs(void) {
}
static
void
test_IUri_GetPropertyBSTR
(
void
)
{
IUri
*
uri
=
NULL
;
HRESULT
hr
;
DWORD
i
;
/* Make sure GetPropertyBSTR handles invalid args correctly. */
hr
=
pCreateUri
(
http_urlW
,
0
,
0
,
&
uri
);
ok
(
hr
==
S_OK
,
"Error: CreateUri returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
if
(
SUCCEEDED
(
hr
))
{
BSTR
received
=
NULL
;
hr
=
IUri_GetPropertyBSTR
(
uri
,
Uri_PROPERTY_RAW_URI
,
NULL
,
0
);
ok
(
hr
==
E_POINTER
,
"Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
/* Make sure it handles a invalid Uri_PROPERTY's correctly. */
hr
=
IUri_GetPropertyBSTR
(
uri
,
Uri_PROPERTY_PORT
,
&
received
,
0
);
ok
(
hr
==
S_OK
,
"Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
ok
(
received
!=
NULL
,
"Error: Expected the string not to be NULL.
\n
"
);
ok
(
!
SysStringLen
(
received
),
"Error: Expected the string to be of len=0 but it was %d instead.
\n
"
,
SysStringLen
(
received
));
SysFreeString
(
received
);
/* Make sure it handles the ZONE property correctly. */
received
=
NULL
;
hr
=
IUri_GetPropertyBSTR
(
uri
,
Uri_PROPERTY_ZONE
,
&
received
,
0
);
ok
(
hr
==
S_FALSE
,
"Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_FALSE
);
ok
(
received
!=
NULL
,
"Error: Expected the string not to be NULL.
\n
"
);
ok
(
!
SysStringLen
(
received
),
"Error: Expected the string to be of len=0 but it was %d instead.
\n
"
,
SysStringLen
(
received
));
SysFreeString
(
received
);
}
if
(
uri
)
IUri_Release
(
uri
);
for
(
i
=
0
;
i
<
sizeof
(
uri_tests
)
/
sizeof
(
uri_tests
[
0
]);
++
i
)
{
uri_properties
test
=
uri_tests
[
i
];
HRESULT
hr
;
IUri
*
uri
=
NULL
;
LPWSTR
uriW
;
uri
=
NULL
;
uriW
=
a2w
(
test
.
uri
);
hr
=
pCreateUri
(
uriW
,
test
.
create_flags
,
0
,
&
uri
);
...
...
@@ -505,8 +532,14 @@ static void test_IUri_GetPropertyDWORD(void) {
hr
=
pCreateUri
(
http_urlW
,
0
,
0
,
&
uri
);
ok
(
hr
==
S_OK
,
"Error: CreateUri returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
if
(
SUCCEEDED
(
hr
))
{
DWORD
received
=
0xdeadbeef
;
hr
=
IUri_GetPropertyDWORD
(
uri
,
Uri_PROPERTY_DWORD_START
,
NULL
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_INVALIDARG
);
hr
=
IUri_GetPropertyDWORD
(
uri
,
Uri_PROPERTY_ABSOLUTE_URI
,
&
received
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_INVALIDARG
);
ok
(
received
==
0
,
"Error: Expected received=%d but instead received=%d.
\n
"
,
0
,
received
);
}
if
(
uri
)
IUri_Release
(
uri
);
...
...
dlls/urlmon/uri.c
View file @
a6f1ebfe
...
...
@@ -84,6 +84,21 @@ static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BST
{
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%d %p %x)
\n
"
,
This
,
uriProp
,
pbstrProperty
,
dwFlags
);
if
(
!
pbstrProperty
)
return
E_POINTER
;
if
(
uriProp
>
Uri_PROPERTY_STRING_LAST
)
{
/* Windows allocates an empty BSTR for invalid Uri_PROPERTY's. */
*
pbstrProperty
=
SysAllocStringLen
(
NULL
,
0
);
/* It only returns S_FALSE for the ZONE property... */
if
(
uriProp
==
Uri_PROPERTY_ZONE
)
return
S_FALSE
;
else
return
S_OK
;
}
return
E_NOTIMPL
;
}
...
...
@@ -120,6 +135,11 @@ static HRESULT WINAPI Uri_GetPropertyDWORD(IUri *iface, Uri_PROPERTY uriProp, DW
return
E_NOTIMPL
;
}
if
(
uriProp
<
Uri_PROPERTY_DWORD_START
)
{
*
pcchProperty
=
0
;
return
E_INVALIDARG
;
}
return
E_NOTIMPL
;
}
...
...
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