Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
c0dff8ac
Commit
c0dff8ac
authored
12 years ago
by
Christian Costa
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dmusic: Cleanup IDirectMusicCollection_EnumInstrument.
parent
495e3288
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/dmusic/collection.c
+25
-24
25 additions, 24 deletions
dlls/dmusic/collection.c
with
25 additions
and
24 deletions
dlls/dmusic/collection.c
+
25
−
24
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
dwI
ndex
,
DWORD
*
p
dwP
atch
,
LPWSTR
pwszN
ame
,
DWORD
dwNameLen
)
static
HRESULT
WINAPI
IDirectMusicCollectionImpl_IDirectMusicCollection_EnumInstrument
(
LPDIRECTMUSICCOLLECTION
iface
,
DWORD
i
ndex
,
DWORD
*
patch
,
LPWSTR
n
ame
,
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
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment