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
c0dff8ac
Commit
c0dff8ac
authored
May 18, 2012
by
Christian Costa
Committed by
Alexandre Julliard
May 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Cleanup IDirectMusicCollection_EnumInstrument.
parent
495e3288
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
24 deletions
+25
-24
collection.c
dlls/dmusic/collection.c
+25
-24
No files found.
dlls/dmusic/collection.c
View file @
c0dff8ac
...
...
@@ -129,31 +129,32 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_GetInstr
return
DMUS_E_INVALIDPATCH
;
}
static
HRESULT
WINAPI
IDirectMusicCollectionImpl_IDirectMusicCollection_EnumInstrument
(
LPDIRECTMUSICCOLLECTION
iface
,
DWORD
dwIndex
,
DWORD
*
pdwPatch
,
LPWSTR
pwszName
,
DWORD
dwNameLen
)
static
HRESULT
WINAPI
IDirectMusicCollectionImpl_IDirectMusicCollection_EnumInstrument
(
LPDIRECTMUSICCOLLECTION
iface
,
DWORD
index
,
DWORD
*
patch
,
LPWSTR
name
,
DWORD
name_length
)
{
IDirectMusicCollectionImpl
*
This
=
impl_from_IDirectMusicCollection
(
iface
);
unsigned
int
r
=
0
;
DMUS_PRIVATE_INSTRUMENTENTRY
*
tmpEntry
;
struct
list
*
listEntry
;
DWORD
dwLen
;
TRACE
(
"(%p, %d, %p, %p, %d)
\n
"
,
This
,
dwIndex
,
pdwPatch
,
pwszName
,
dwNameLen
);
LIST_FOR_EACH
(
listEntry
,
&
This
->
Instruments
)
{
tmpEntry
=
LIST_ENTRY
(
listEntry
,
DMUS_PRIVATE_INSTRUMENTENTRY
,
entry
);
if
(
r
==
dwIndex
)
{
IDirectMusicInstrumentImpl
*
pInstrument
=
impl_from_IDirectMusicInstrument
(
tmpEntry
->
pInstrument
);
IDirectMusicInstrument_GetPatch
(
tmpEntry
->
pInstrument
,
pdwPatch
);
if
(
pwszName
)
{
dwLen
=
min
(
strlenW
(
pInstrument
->
wszName
),
dwNameLen
-
1
);
memcpy
(
pwszName
,
pInstrument
->
wszName
,
dwLen
*
sizeof
(
WCHAR
));
pwszName
[
dwLen
]
=
'\0'
;
}
return
S_OK
;
}
r
++
;
}
return
S_FALSE
;
IDirectMusicCollectionImpl
*
This
=
impl_from_IDirectMusicCollection
(
iface
);
DWORD
i
=
0
;
DMUS_PRIVATE_INSTRUMENTENTRY
*
inst_entry
;
struct
list
*
list_entry
;
DWORD
length
;
TRACE
(
"(%p/%p)->(%d, %p, %p, %d)
\n
"
,
iface
,
This
,
index
,
patch
,
name
,
name_length
);
LIST_FOR_EACH
(
list_entry
,
&
This
->
Instruments
)
{
inst_entry
=
LIST_ENTRY
(
list_entry
,
DMUS_PRIVATE_INSTRUMENTENTRY
,
entry
);
if
(
i
==
index
)
{
IDirectMusicInstrumentImpl
*
instrument
=
impl_from_IDirectMusicInstrument
(
inst_entry
->
pInstrument
);
IDirectMusicInstrument_GetPatch
(
inst_entry
->
pInstrument
,
patch
);
if
(
name
)
{
length
=
min
(
strlenW
(
instrument
->
wszName
),
name_length
-
1
);
memcpy
(
name
,
instrument
->
wszName
,
length
*
sizeof
(
WCHAR
));
name
[
length
]
=
'\0'
;
}
return
S_OK
;
}
i
++
;
}
return
S_FALSE
;
}
static
const
IDirectMusicCollectionVtbl
DirectMusicCollection_Collection_Vtbl
=
{
...
...
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