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
d6dc41c2
Commit
d6dc41c2
authored
Sep 04, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Simplify and cleanup IDirectMusicInstrument constructor.
parent
4a60c0f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
19 deletions
+14
-19
collection.c
dlls/dmusic/collection.c
+1
-1
dmusic_private.h
dlls/dmusic/dmusic_private.h
+2
-1
instrument.c
dlls/dmusic/instrument.c
+11
-17
No files found.
dlls/dmusic/collection.c
View file @
d6dc41c2
...
@@ -377,7 +377,7 @@ static HRESULT WINAPI collection_stream_Load(IPersistStream *iface,
...
@@ -377,7 +377,7 @@ static HRESULT WINAPI collection_stream_Load(IPersistStream *iface,
DMUS_PRIVATE_INSTRUMENTENTRY
*
new_instrument
=
calloc
(
1
,
sizeof
(
DMUS_PRIVATE_INSTRUMENTENTRY
));
DMUS_PRIVATE_INSTRUMENTENTRY
*
new_instrument
=
calloc
(
1
,
sizeof
(
DMUS_PRIVATE_INSTRUMENTENTRY
));
TRACE_
(
dmfile
)(
": instrument list
\n
"
);
TRACE_
(
dmfile
)(
": instrument list
\n
"
);
/* Only way to create this one... even M$ does it discretely */
/* Only way to create this one... even M$ does it discretely */
DMUSIC_CreateDirectMusicInstrumentImpl
(
&
IID_IDirectMusicInstrument
,
(
void
**
)
&
new_instrument
->
pInstrument
,
NULL
);
instrument_create
(
&
new_instrument
->
pInstrument
);
{
{
IDirectMusicInstrumentImpl
*
instrument
=
impl_from_IDirectMusicInstrument
(
new_instrument
->
pInstrument
);
IDirectMusicInstrumentImpl
*
instrument
=
impl_from_IDirectMusicInstrument
(
new_instrument
->
pInstrument
);
/* Store offset and length, they will be needed when loading the instrument */
/* Store offset and length, they will be needed when loading the instrument */
...
...
dlls/dmusic/dmusic_private.h
View file @
d6dc41c2
...
@@ -97,10 +97,11 @@ extern HRESULT collection_create(IUnknown **ret_iface);
...
@@ -97,10 +97,11 @@ extern HRESULT collection_create(IUnknown **ret_iface);
/* Internal */
/* Internal */
extern
HRESULT
DMUSIC_CreateDirectMusicBufferImpl
(
LPDMUS_BUFFERDESC
desc
,
LPVOID
*
ret_iface
);
extern
HRESULT
DMUSIC_CreateDirectMusicBufferImpl
(
LPDMUS_BUFFERDESC
desc
,
LPVOID
*
ret_iface
);
extern
HRESULT
DMUSIC_CreateReferenceClockImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
);
extern
HRESULT
DMUSIC_CreateReferenceClockImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
);
extern
HRESULT
DMUSIC_CreateDirectMusicInstrumentImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
);
extern
HRESULT
download_create
(
DWORD
size
,
IDirectMusicDownload
**
ret_iface
);
extern
HRESULT
download_create
(
DWORD
size
,
IDirectMusicDownload
**
ret_iface
);
extern
HRESULT
instrument_create
(
IDirectMusicInstrument
**
ret_iface
);
/*****************************************************************************
/*****************************************************************************
* IDirectMusic8Impl implementation structure
* IDirectMusic8Impl implementation structure
*/
*/
...
...
dlls/dmusic/instrument.c
View file @
d6dc41c2
...
@@ -119,24 +119,18 @@ static const IDirectMusicInstrumentVtbl DirectMusicInstrument_Vtbl =
...
@@ -119,24 +119,18 @@ static const IDirectMusicInstrumentVtbl DirectMusicInstrument_Vtbl =
IDirectMusicInstrumentImpl_SetPatch
IDirectMusicInstrumentImpl_SetPatch
};
};
/* for ClassFactory */
HRESULT
instrument_create
(
IDirectMusicInstrument
**
ret_iface
)
HRESULT
DMUSIC_CreateDirectMusicInstrumentImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
)
{
{
IDirectMusicInstrumentImpl
*
dminst
;
IDirectMusicInstrumentImpl
*
dminst
;
HRESULT
hr
;
dminst
=
calloc
(
1
,
sizeof
(
IDirectMusicInstrumentImpl
));
if
(
NULL
==
dminst
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
dminst
->
IDirectMusicInstrument_iface
.
lpVtbl
=
&
DirectMusicInstrument_Vtbl
;
dminst
->
ref
=
1
;
hr
=
IDirectMusicInstrument_QueryInterface
(
&
dminst
->
IDirectMusicInstrument_iface
,
lpcGUID
,
ppobj
);
IDirectMusicInstrument_Release
(
&
dminst
->
IDirectMusicInstrument_iface
);
return
hr
;
*
ret_iface
=
NULL
;
if
(
!
(
dminst
=
calloc
(
1
,
sizeof
(
*
dminst
))))
return
E_OUTOFMEMORY
;
dminst
->
IDirectMusicInstrument_iface
.
lpVtbl
=
&
DirectMusicInstrument_Vtbl
;
dminst
->
ref
=
1
;
TRACE
(
"Created DirectMusicInstrument %p
\n
"
,
dminst
);
*
ret_iface
=
&
dminst
->
IDirectMusicInstrument_iface
;
return
S_OK
;
}
}
static
HRESULT
read_from_stream
(
IStream
*
stream
,
void
*
data
,
ULONG
size
)
static
HRESULT
read_from_stream
(
IStream
*
stream
,
void
*
data
,
ULONG
size
)
...
...
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