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
a7137975
Commit
a7137975
authored
Sep 15, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Rewrite segment IDirectMusicSegment_GetTrack.
parent
c0b52aa3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
38 deletions
+30
-38
segment.c
dlls/dmime/segment.c
+30
-38
No files found.
dlls/dmime/segment.c
View file @
a7137975
...
...
@@ -190,52 +190,44 @@ static HRESULT WINAPI segment_SetDefaultResolution(IDirectMusicSegment8 *iface,
return
S_OK
;
}
static
HRESULT
WINAPI
segment_GetTrack
(
IDirectMusicSegment8
*
iface
,
REFGUID
rguidType
,
DWORD
dwGroupBits
,
DWORD
dwIndex
,
IDirectMusicTrack
**
ppT
rack
)
static
HRESULT
WINAPI
segment_GetTrack
(
IDirectMusicSegment8
*
iface
,
REFGUID
type
,
DWORD
group
,
DWORD
index
,
IDirectMusicTrack
**
ret_t
rack
)
{
struct
segment
*
This
=
impl_from_IDirectMusicSegment8
(
iface
);
CLSID
pIt_clsid
;
struct
list
*
pEntry
=
NULL
;
struct
track_entry
*
pIt
=
NULL
;
IPersistStream
*
pCLSIDStream
=
NULL
;
struct
track_entry
*
entry
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p, %s, %#lx, %#lx, %p)
\n
"
,
This
,
debugstr_dmguid
(
rguidType
),
dwGroupBits
,
dwIndex
,
ppT
rack
);
TRACE
(
"(%p, %s, %#lx, %#lx, %p)
\n
"
,
This
,
debugstr_dmguid
(
type
),
group
,
index
,
ret_t
rack
);
if
(
NULL
==
ppTrack
)
{
return
E_POINTER
;
}
if
(
!
ret_track
)
return
E_POINTER
;
LIST_FOR_EACH
(
pEntry
,
&
This
->
tracks
)
{
pIt
=
LIST_ENTRY
(
pEntry
,
struct
track_entry
,
entry
);
TRACE
(
" - %p -> %#lx,%p
\n
"
,
pIt
,
pIt
->
dwGroupBits
,
pIt
->
pTrack
);
if
(
0xFFFFFFFF
!=
dwGroupBits
&&
0
==
(
pIt
->
dwGroupBits
&
dwGroupBits
))
continue
;
if
(
FALSE
==
IsEqualGUID
(
&
GUID_NULL
,
rguidType
))
{
/**
* it rguidType is not null we must check if CLSIDs are equal
* and the unique way to get it is using IPersistStream Interface
*/
hr
=
IDirectMusicTrack_QueryInterface
(
pIt
->
pTrack
,
&
IID_IPersistStream
,
(
void
**
)
&
pCLSIDStream
);
if
(
FAILED
(
hr
))
{
ERR
(
"(%p): object %p don't implement IPersistStream Interface. Expect a crash (critical problem)
\n
"
,
This
,
pIt
->
pTrack
);
continue
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
tracks
,
struct
track_entry
,
entry
)
{
if
(
group
!=
-
1
&&
!
(
entry
->
dwGroupBits
&
group
))
continue
;
if
(
!
IsEqualGUID
(
&
GUID_NULL
,
type
))
{
CLSID
entry_type
=
GUID_NULL
;
IPersistStream
*
persist
;
if
(
SUCCEEDED
(
hr
=
IDirectMusicTrack_QueryInterface
(
entry
->
pTrack
,
&
IID_IPersistStream
,
(
void
**
)
&
persist
)))
{
hr
=
IPersistStream_GetClassID
(
persist
,
&
entry_type
);
if
(
SUCCEEDED
(
hr
))
TRACE
(
" - %p -> %s
\n
"
,
entry
,
debugstr_dmguid
(
&
entry_type
));
IPersistStream_Release
(
persist
);
}
if
(
!
IsEqualGUID
(
&
entry_type
,
type
))
continue
;
}
hr
=
IPersistStream_GetClassID
(
pCLSIDStream
,
&
pIt_clsid
);
IPersistStream_Release
(
pCLSIDStream
);
pCLSIDStream
=
NULL
;
if
(
FAILED
(
hr
))
{
ERR
(
"(%p): non-implemented GetClassID for object %p
\n
"
,
This
,
pIt
->
pTrack
);
continue
;
if
(
!
index
--
)
{
*
ret_track
=
entry
->
pTrack
;
IDirectMusicTrack_AddRef
(
entry
->
pTrack
);
return
S_OK
;
}
TRACE
(
" - %p -> %s
\n
"
,
pIt
,
debugstr_dmguid
(
&
pIt_clsid
));
if
(
FALSE
==
IsEqualGUID
(
&
pIt_clsid
,
rguidType
))
continue
;
}
if
(
0
==
dwIndex
)
{
*
ppTrack
=
pIt
->
pTrack
;
IDirectMusicTrack_AddRef
(
*
ppTrack
);
return
S_OK
;
}
--
dwIndex
;
}
}
return
DMUS_E_NOT_FOUND
;
}
...
...
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