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
898c2954
Commit
898c2954
authored
Dec 21, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Dec 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Use static variables for instrument header and id instead of using pointer.
parent
bf0605c0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
16 deletions
+14
-16
collection.c
dlls/dmusic/collection.c
+9
-11
dmusic_private.h
dlls/dmusic/dmusic_private.h
+2
-2
instrument.c
dlls/dmusic/instrument.c
+3
-3
No files found.
dlls/dmusic/collection.c
View file @
898c2954
...
...
@@ -662,7 +662,7 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_Load(LPPERSISTST
LPDMUS_PRIVATE_INSTRUMENTENTRY
new_instrument
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
DMUS_PRIVATE_INSTRUMENTENTRY
));
TRACE_
(
dmfile
)(
": instrument list
\n
"
);
/* Only way to create this one... even M$ does it discretely */
DMUSIC_CreateDirectMusicInstrumentImpl
(
&
IID_IDirectMusicInstrument
,
(
LPVOID
*
)
&
new_instrument
->
pInstrument
,
NULL
);
DMUSIC_CreateDirectMusicInstrumentImpl
(
&
IID_IDirectMusicInstrument
,
(
void
*
*
)
&
new_instrument
->
pInstrument
,
NULL
);
{
IDirectMusicInstrumentImpl
*
instrument
=
impl_from_IDirectMusicInstrument
(
new_instrument
->
pInstrument
);
/* Store offset and length, they will be needed when loading the instrument */
...
...
@@ -677,14 +677,12 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_Load(LPPERSISTST
switch
(
chunk
.
fccID
)
{
case
FOURCC_INSH
:
{
TRACE_
(
dmfile
)(
": instrument header chunk
\n
"
);
instrument
->
pHeader
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
chunk
.
dwSize
);
IStream_Read
(
stream
,
instrument
->
pHeader
,
chunk
.
dwSize
,
NULL
);
IStream_Read
(
stream
,
&
instrument
->
header
,
chunk
.
dwSize
,
NULL
);
break
;
}
case
FOURCC_DLID
:
{
TRACE_
(
dmfile
)(
": DLID (GUID) chunk
\n
"
);
instrument
->
pInstrumentID
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
chunk
.
dwSize
);
IStream_Read
(
stream
,
instrument
->
pInstrumentID
,
chunk
.
dwSize
,
NULL
);
IStream_Read
(
stream
,
&
instrument
->
id
,
chunk
.
dwSize
,
NULL
);
break
;
}
case
FOURCC_LIST
:
{
...
...
@@ -712,14 +710,14 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_Load(LPPERSISTST
/* DEBUG: dumps whole instrument object tree: */
if
(
TRACE_ON
(
dmusic
))
{
TRACE
(
"*** IDirectMusicInstrument (%p) ***
\n
"
,
instrument
);
if
(
instrument
->
pInstrumentID
)
TRACE
(
" - GUID = %s
\n
"
,
debugstr_dmguid
(
instrument
->
pInstrumentID
));
if
(
!
IsEqualGUID
(
&
instrument
->
id
,
&
GUID_NULL
)
)
TRACE
(
" - GUID = %s
\n
"
,
debugstr_dmguid
(
&
instrument
->
id
));
TRACE
(
" - Instrument header:
\n
"
);
TRACE
(
" - cRegions: %d
\n
"
,
instrument
->
pHeader
->
cRegions
);
TRACE
(
" - cRegions: %d
\n
"
,
instrument
->
header
.
cRegions
);
TRACE
(
" - Locale:
\n
"
);
TRACE
(
" - ulBank: %d
\n
"
,
instrument
->
pHeader
->
Locale
.
ulBank
);
TRACE
(
" - ulInstrument: %d
\n
"
,
instrument
->
pHeader
->
Locale
.
ulInstrument
);
TRACE
(
" => dwPatch: %d
\n
"
,
MIDILOCALE2Patch
(
&
instrument
->
pHeader
->
Locale
));
TRACE
(
" - ulBank: %d
\n
"
,
instrument
->
header
.
Locale
.
ulBank
);
TRACE
(
" - ulInstrument: %d
\n
"
,
instrument
->
header
.
Locale
.
ulInstrument
);
TRACE
(
" => dwPatch: %d
\n
"
,
MIDILOCALE2Patch
(
&
instrument
->
header
.
Locale
));
}
list_add_tail
(
&
This
->
Instruments
,
&
new_instrument
->
entry
);
}
...
...
dlls/dmusic/dmusic_private.h
View file @
898c2954
...
...
@@ -238,8 +238,8 @@ struct IDirectMusicInstrumentImpl {
/* IDirectMusicInstrumentImpl fields */
LARGE_INTEGER
liInstrumentPosition
;
/* offset in a stream where instrument chunk can be found */
ULONG
length
;
/* Length of the instrument in the stream */
LPGUID
pInstrumentID
;
LPINSTHEADER
pH
eader
;
GUID
id
;
INSTHEADER
h
eader
;
WCHAR
wszName
[
DMUS_MAX_NAME
];
/* instrument data */
BOOL
loaded
;
...
...
dlls/dmusic/instrument.c
View file @
898c2954
...
...
@@ -92,7 +92,7 @@ static HRESULT WINAPI IDirectMusicInstrumentImpl_GetPatch(LPDIRECTMUSICINSTRUMEN
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pdwPatch
);
*
pdwPatch
=
MIDILOCALE2Patch
(
&
This
->
pHeader
->
Locale
);
*
pdwPatch
=
MIDILOCALE2Patch
(
&
This
->
header
.
Locale
);
return
S_OK
;
}
...
...
@@ -103,7 +103,7 @@ static HRESULT WINAPI IDirectMusicInstrumentImpl_SetPatch(LPDIRECTMUSICINSTRUMEN
TRACE
(
"(%p)->(%d): stub
\n
"
,
This
,
dwPatch
);
Patch2MIDILOCALE
(
dwPatch
,
&
This
->
pHeader
->
Locale
);
Patch2MIDILOCALE
(
dwPatch
,
&
This
->
header
.
Locale
);
return
S_OK
;
}
...
...
@@ -264,7 +264,7 @@ HRESULT IDirectMusicInstrumentImpl_CustomLoad(IDirectMusicInstrument *iface, ISt
return
DMUS_E_UNSUPPORTED_STREAM
;
}
This
->
regions
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
->
regions
)
*
This
->
pHeader
->
cRegions
);
This
->
regions
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
->
regions
)
*
This
->
header
.
cRegions
);
if
(
!
This
->
regions
)
return
E_OUTOFMEMORY
;
...
...
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