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
c05c0495
Commit
c05c0495
authored
Apr 10, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Apr 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Check wrong params when creating a port + tests.
parent
7776591f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
dmusic.c
dlls/dmusic/dmusic.c
+12
-2
dmusic.c
dlls/dmusic/tests/dmusic.c
+10
-0
No files found.
dlls/dmusic/dmusic.c
View file @
c05c0495
...
...
@@ -167,7 +167,8 @@ static HRESULT WINAPI IDirectMusic8Impl_CreateMusicBuffer (LPDIRECTMUSIC8 iface,
return
DMUSIC_CreateDirectMusicBufferImpl
(
&
IID_IDirectMusicBuffer
,
(
LPVOID
)
ppBuffer
,
NULL
);
}
static
HRESULT
WINAPI
IDirectMusic8Impl_CreatePort
(
LPDIRECTMUSIC8
iface
,
REFCLSID
rclsidPort
,
LPDMUS_PORTPARAMS
pPortParams
,
LPDIRECTMUSICPORT
*
ppPort
,
LPUNKNOWN
pUnkOuter
)
{
static
HRESULT
WINAPI
IDirectMusic8Impl_CreatePort
(
LPDIRECTMUSIC8
iface
,
REFCLSID
rclsidPort
,
LPDMUS_PORTPARAMS
pPortParams
,
LPDIRECTMUSICPORT
*
ppPort
,
LPUNKNOWN
pUnkOuter
)
{
IDirectMusic8Impl
*
This
=
(
IDirectMusic8Impl
*
)
iface
;
int
i
;
DMUS_PORTCAPS
PortCaps
;
...
...
@@ -181,8 +182,17 @@ static HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLS
if
(
TRACE_ON
(
dmusic
))
dump_DMUS_PORTPARAMS
(
pPortParams
);
if
(
!
rclsidPort
)
if
(
!
rclsidPort
)
return
E_POINTER
;
if
(
!
pPortParams
)
return
E_INVALIDARG
;
if
(
!
ppPort
)
return
E_POINTER
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
if
(
TRACE_ON
(
dmusic
))
dump_DMUS_PORTPARAMS
(
pPortParams
);
ZeroMemory
(
&
PortCaps
,
sizeof
(
DMUS_PORTCAPS
));
PortCaps
.
dwSize
=
sizeof
(
DMUS_PORTCAPS
);
...
...
dlls/dmusic/tests/dmusic.c
View file @
c05c0495
...
...
@@ -66,6 +66,16 @@ static void test_dmusic(void)
hr
=
IDirectMusic_SetDirectSound
(
dmusic
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"IDirectMusic_SetDirectSound returned: %x
\n
"
,
hr
);
/* Check wrong params */
hr
=
IDirectMusic_CreatePort
(
dmusic
,
&
GUID_NULL
,
&
port_params
,
&
port
,
(
IUnknown
*
)
dmusic
);
ok
(
hr
==
CLASS_E_NOAGGREGATION
,
"IDirectMusic_CreatePort returned: %x
\n
"
,
hr
);
hr
=
IDirectMusic_CreatePort
(
dmusic
,
NULL
,
&
port_params
,
&
port
,
NULL
);
ok
(
hr
==
E_POINTER
,
"IDirectMusic_CreatePort returned: %x
\n
"
,
hr
);
hr
=
IDirectMusic_CreatePort
(
dmusic
,
&
GUID_NULL
,
NULL
,
&
port
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"IDirectMusic_CreatePort returned: %x
\n
"
,
hr
);
hr
=
IDirectMusic_CreatePort
(
dmusic
,
&
GUID_NULL
,
&
port_params
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"IDirectMusic_CreatePort returned: %x
\n
"
,
hr
);
/* Test creation of default port with GUID_NULL */
hr
=
IDirectMusic_CreatePort
(
dmusic
,
&
GUID_NULL
,
&
port_params
,
&
port
,
NULL
);
ok
(
hr
==
S_OK
,
"IDirectMusic_CreatePort returned: %x
\n
"
,
hr
);
...
...
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