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
142c527b
Commit
142c527b
authored
Sep 17, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Sep 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Use system ports list to create port in CreatePort and rename params.
parent
7c83bd84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
51 deletions
+54
-51
dmusic.c
dlls/dmusic/dmusic.c
+54
-51
No files found.
dlls/dmusic/dmusic.c
View file @
142c527b
...
...
@@ -117,59 +117,62 @@ static HRESULT WINAPI IDirectMusic8Impl_CreateMusicBuffer(LPDIRECTMUSIC8 iface,
return
DMUSIC_CreateDirectMusicBufferImpl
(
buffer_desc
,
(
LPVOID
)
buffer
);
}
static
HRESULT
WINAPI
IDirectMusic8Impl_CreatePort
(
LPDIRECTMUSIC8
iface
,
REFCLSID
rclsid
Port
,
LPDMUS_PORTPARAMS
pPortParams
,
LPDIRECTMUSICPORT
*
ppPort
,
LPUNKNOWN
pUnkO
uter
)
static
HRESULT
WINAPI
IDirectMusic8Impl_CreatePort
(
LPDIRECTMUSIC8
iface
,
REFCLSID
rclsid
_port
,
LPDMUS_PORTPARAMS
port_params
,
LPDIRECTMUSICPORT
*
port
,
LPUNKNOWN
unko
uter
)
{
IDirectMusic8Impl
*
This
=
impl_from_IDirectMusic8
(
iface
);
int
i
;
DMUS_PORTCAPS
PortCaps
;
IDirectMusicPort
*
pNewPort
=
NULL
;
HRESULT
hr
;
GUID
default_port
;
const
GUID
*
request_port
=
rclsidPort
;
TRACE
(
"(%p, %s, %p, %p, %p)
\n
"
,
This
,
debugstr_dmguid
(
rclsidPort
),
pPortParams
,
ppPort
,
pUnkOuter
);
if
(
TRACE_ON
(
dmusic
))
dump_DMUS_PORTPARAMS
(
pPortParams
);
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
);
if
(
IsEqualGUID
(
request_port
,
&
GUID_NULL
)){
hr
=
IDirectMusic8_GetDefaultPort
(
iface
,
&
default_port
);
if
(
FAILED
(
hr
))
return
hr
;
request_port
=
&
default_port
;
}
IDirectMusic8Impl
*
This
=
impl_from_IDirectMusic8
(
iface
);
int
i
;
DMUS_PORTCAPS
port_caps
;
IDirectMusicPort
*
new_port
=
NULL
;
HRESULT
hr
;
GUID
default_port
;
const
GUID
*
request_port
=
rclsid_port
;
for
(
i
=
0
;
S_FALSE
!=
IDirectMusic8Impl_EnumPort
(
iface
,
i
,
&
PortCaps
);
i
++
)
{
if
(
IsEqualCLSID
(
request_port
,
&
PortCaps
.
guidPort
))
{
hr
=
DMUSIC_CreateDirectMusicPortImpl
(
&
IID_IDirectMusicPort
,
(
LPVOID
*
)
&
pNewPort
,
(
LPUNKNOWN
)
This
,
pPortParams
,
&
PortCaps
,
0
);
if
(
FAILED
(
hr
))
{
*
ppPort
=
NULL
;
return
hr
;
}
This
->
nrofports
++
;
if
(
!
This
->
ppPorts
)
This
->
ppPorts
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPDIRECTMUSICPORT
)
*
This
->
nrofports
);
else
This
->
ppPorts
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
ppPorts
,
sizeof
(
LPDIRECTMUSICPORT
)
*
This
->
nrofports
);
This
->
ppPorts
[
This
->
nrofports
-
1
]
=
pNewPort
;
*
ppPort
=
pNewPort
;
return
S_OK
;
}
}
return
E_NOINTERFACE
;
TRACE
(
"(%p)->(%s, %p, %p, %p)
\n
"
,
This
,
debugstr_dmguid
(
rclsid_port
),
port_params
,
port
,
unkouter
);
if
(
TRACE_ON
(
dmusic
))
dump_DMUS_PORTPARAMS
(
port_params
);
if
(
!
rclsid_port
)
return
E_POINTER
;
if
(
!
port_params
)
return
E_INVALIDARG
;
if
(
!
port
)
return
E_POINTER
;
if
(
unkouter
)
return
CLASS_E_NOAGGREGATION
;
if
(
TRACE_ON
(
dmusic
))
dump_DMUS_PORTPARAMS
(
port_params
);
ZeroMemory
(
&
port_caps
,
sizeof
(
DMUS_PORTCAPS
));
port_caps
.
dwSize
=
sizeof
(
DMUS_PORTCAPS
);
if
(
IsEqualGUID
(
request_port
,
&
GUID_NULL
))
{
hr
=
IDirectMusic8_GetDefaultPort
(
iface
,
&
default_port
);
if
(
FAILED
(
hr
))
return
hr
;
request_port
=
&
default_port
;
}
for
(
i
=
0
;
S_FALSE
!=
IDirectMusic8Impl_EnumPort
(
iface
,
i
,
&
port_caps
);
i
++
)
{
if
(
IsEqualCLSID
(
request_port
,
&
port_caps
.
guidPort
))
{
hr
=
This
->
system_ports
[
i
].
create
(
&
IID_IDirectMusicPort
,
(
LPVOID
*
)
&
new_port
,
(
LPUNKNOWN
)
This
,
port_params
,
&
port_caps
,
This
->
system_ports
[
i
].
device
);
if
(
FAILED
(
hr
))
{
*
port
=
NULL
;
return
hr
;
}
This
->
nrofports
++
;
if
(
!
This
->
ppPorts
)
This
->
ppPorts
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPDIRECTMUSICPORT
)
*
This
->
nrofports
);
else
This
->
ppPorts
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
ppPorts
,
sizeof
(
LPDIRECTMUSICPORT
)
*
This
->
nrofports
);
This
->
ppPorts
[
This
->
nrofports
-
1
]
=
new_port
;
*
port
=
new_port
;
return
S_OK
;
}
}
return
E_NOINTERFACE
;
}
static
HRESULT
WINAPI
IDirectMusic8Impl_EnumMasterClock
(
LPDIRECTMUSIC8
iface
,
DWORD
index
,
LPDMUS_CLOCKINFO
clock_info
)
...
...
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