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
0feb0cda
Commit
0feb0cda
authored
Sep 04, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Use CRT allocation functions.
parent
6e1e7a88
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
70 additions
and
131 deletions
+70
-131
audiopath.c
dlls/dmime/audiopath.c
+3
-6
dmobject.c
dlls/dmime/dmobject.c
+3
-5
graph.c
dlls/dmime/graph.c
+3
-8
lyricstrack.c
dlls/dmime/lyricstrack.c
+3
-6
markertrack.c
dlls/dmime/markertrack.c
+3
-6
paramcontroltrack.c
dlls/dmime/paramcontroltrack.c
+3
-6
performance.c
dlls/dmime/performance.c
+10
-18
segment.c
dlls/dmime/segment.c
+9
-9
segmentstate.c
dlls/dmime/segmentstate.c
+2
-7
segtriggertrack.c
dlls/dmime/segtriggertrack.c
+6
-12
seqtrack.c
dlls/dmime/seqtrack.c
+3
-6
sysextrack.c
dlls/dmime/sysextrack.c
+3
-6
tempotrack.c
dlls/dmime/tempotrack.c
+6
-13
timesigtrack.c
dlls/dmime/timesigtrack.c
+4
-8
wavetrack.c
dlls/dmime/wavetrack.c
+9
-15
No files found.
dlls/dmime/audiopath.c
View file @
0feb0cda
...
...
@@ -112,7 +112,7 @@ static ULONG WINAPI IDirectMusicAudioPathImpl_Release (IDirectMusicAudioPath *if
if
(
This
->
pDSBuffer
)
IDirectSoundBuffer_Release
(
This
->
pDSBuffer
);
This
->
pPerf
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -328,11 +328,8 @@ HRESULT create_dmaudiopath(REFIID riid, void **ppobj)
IDirectMusicAudioPathImpl
*
obj
;
HRESULT
hr
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicAudioPathImpl
));
if
(
NULL
==
obj
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IDirectMusicAudioPath_iface
.
lpVtbl
=
&
DirectMusicAudioPathVtbl
;
obj
->
ref
=
1
;
dmobject_init
(
&
obj
->
dmobj
,
&
CLSID_DirectMusicAudioPathConfig
,
...
...
dlls/dmime/dmobject.c
View file @
0feb0cda
...
...
@@ -28,7 +28,6 @@
#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
...
...
@@ -375,7 +374,7 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
/* Reads chunk data of the form:
DWORD - size of array element
element[] - Array of elements
The caller needs to
heap_
free() the array.
The caller needs to free() the array.
*/
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
...
...
@@ -400,10 +399,9 @@ HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk,
*
count
=
(
chunk
->
size
-
sizeof
(
DWORD
))
/
elem_size
;
size
=
*
count
*
elem_size
;
if
(
!
(
*
array
=
heap_alloc
(
size
)))
return
E_OUTOFMEMORY
;
if
(
!
(
*
array
=
malloc
(
size
)))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
stream_read
(
stream
,
*
array
,
size
)))
{
heap_
free
(
*
array
);
free
(
*
array
);
*
array
=
NULL
;
return
hr
;
}
...
...
dlls/dmime/graph.c
View file @
0feb0cda
...
...
@@ -85,8 +85,7 @@ static ULONG WINAPI DirectMusicGraph_Release(IDirectMusicGraph *iface)
TRACE
(
"(%p): %ld
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -127,7 +126,7 @@ static HRESULT WINAPI DirectMusicGraph_InsertTool(IDirectMusicGraph *iface, IDir
}
++
This
->
num_tools
;
pNewTool
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
DMUS_PRIVATE_GRAPH_TOOL
));
pNewTool
=
calloc
(
1
,
sizeof
(
*
pNewTool
));
pNewTool
->
pTool
=
pTool
;
pNewTool
->
dwIndex
=
lIndex
;
IDirectMusicTool8_AddRef
(
pTool
);
...
...
@@ -255,11 +254,7 @@ HRESULT create_dmgraph(REFIID riid, void **ret_iface)
HRESULT
hr
;
*
ret_iface
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicGraphImpl
));
if
(
!
obj
)
return
E_OUTOFMEMORY
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IDirectMusicGraph_iface
.
lpVtbl
=
&
DirectMusicGraphVtbl
;
obj
->
ref
=
1
;
dmobject_init
(
&
obj
->
dmobj
,
&
CLSID_DirectMusicGraph
,
(
IUnknown
*
)
&
obj
->
IDirectMusicGraph_iface
);
...
...
dlls/dmime/lyricstrack.c
View file @
0feb0cda
...
...
@@ -83,7 +83,7 @@ static ULONG WINAPI lyrics_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -347,11 +347,8 @@ HRESULT create_dmlyricstrack(REFIID lpcGUID, void **ppobj)
IDirectMusicLyricsTrack
*
track
;
HRESULT
hr
;
track
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
track
));
if
(
!
track
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
track
=
calloc
(
1
,
sizeof
(
*
track
))))
return
E_OUTOFMEMORY
;
track
->
IDirectMusicTrack8_iface
.
lpVtbl
=
&
dmtrack8_vtbl
;
track
->
ref
=
1
;
dmobject_init
(
&
track
->
dmobj
,
&
CLSID_DirectMusicLyricsTrack
,
...
...
dlls/dmime/markertrack.c
View file @
0feb0cda
...
...
@@ -77,7 +77,7 @@ static ULONG WINAPI IDirectMusicTrackImpl_Release(IDirectMusicTrack *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -225,11 +225,8 @@ HRESULT create_dmmarkertrack(REFIID lpcGUID, void **ppobj)
IDirectMusicMarkerTrack
*
track
;
HRESULT
hr
;
track
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
track
));
if
(
!
track
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
track
=
calloc
(
1
,
sizeof
(
*
track
))))
return
E_OUTOFMEMORY
;
track
->
IDirectMusicTrack_iface
.
lpVtbl
=
&
dmtrack_vtbl
;
track
->
ref
=
1
;
dmobject_init
(
&
track
->
dmobj
,
&
CLSID_DirectMusicMarkerTrack
,
...
...
dlls/dmime/paramcontroltrack.c
View file @
0feb0cda
...
...
@@ -78,7 +78,7 @@ static ULONG WINAPI paramcontrol_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -261,11 +261,8 @@ HRESULT create_dmparamcontroltrack(REFIID lpcGUID, void **ppobj)
IDirectMusicParamControlTrack
*
track
;
HRESULT
hr
;
track
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
track
));
if
(
!
track
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
track
=
calloc
(
1
,
sizeof
(
*
track
))))
return
E_OUTOFMEMORY
;
track
->
IDirectMusicTrack8_iface
.
lpVtbl
=
&
dmtrack8_vtbl
;
track
->
ref
=
1
;
dmobject_init
(
&
track
->
dmobj
,
&
CLSID_DirectMusicParamControlTrack
,
...
...
dlls/dmime/performance.c
View file @
0feb0cda
...
...
@@ -19,7 +19,6 @@
*/
#include "dmime_private.h"
#include "wine/heap.h"
#include "wine/rbtree.h"
#include "dmobject.h"
...
...
@@ -133,15 +132,15 @@ static DWORD WINAPI ProcessMsgThread(LPVOID lpParam) {
for
(
it
=
This
->
imm_head
;
NULL
!=
it
;
)
{
it_next
=
it
->
next
;
cur
=
ProceedMsg
(
This
,
it
);
HeapFree
(
GetProcessHeap
(),
0
,
cur
);
cur
=
ProceedMsg
(
This
,
it
);
free
(
cur
);
it
=
it_next
;
}
for
(
it
=
This
->
head
;
NULL
!=
it
&&
it
->
rtItemTime
<
rtCurTime
+
dwDec
;
)
{
it_next
=
it
->
next
;
cur
=
ProceedMsg
(
This
,
it
);
HeapFree
(
GetProcessHeap
(),
0
,
cur
);
free
(
cur
);
it
=
it_next
;
}
if
(
NULL
!=
it
)
{
...
...
@@ -215,7 +214,7 @@ static void pchannel_block_free(struct wine_rb_entry *entry, void *context)
{
struct
pchannel_block
*
b
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
pchannel_block
,
entry
);
heap_
free
(
b
);
free
(
b
);
}
static
struct
pchannel_block
*
pchannel_block_set
(
struct
wine_rb_tree
*
tree
,
DWORD
block_num
,
...
...
@@ -231,8 +230,7 @@ static struct pchannel_block *pchannel_block_set(struct wine_rb_tree *tree, DWOR
if
(
only_set_new
)
return
block
;
}
else
{
if
(
!
(
block
=
heap_alloc
(
sizeof
(
*
block
))))
return
NULL
;
if
(
!
(
block
=
malloc
(
sizeof
(
*
block
))))
return
NULL
;
block
->
block_num
=
block_num
;
}
...
...
@@ -292,7 +290,7 @@ static ULONG WINAPI IDirectMusicPerformance8Impl_Release(IDirectMusicPerformance
wine_rb_destroy
(
&
This
->
pchannels
,
pchannel_block_free
,
NULL
);
This
->
safe
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
safe
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -501,10 +499,7 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_AllocPMsg(IDirectMusicPerform
if
(
NULL
==
ppPMSG
)
{
return
E_POINTER
;
}
pItem
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
cb
-
sizeof
(
DMUS_PMSG
)
+
sizeof
(
DMUS_PMSGItem
));
if
(
NULL
==
pItem
)
{
return
E_OUTOFMEMORY
;
}
if
(
!
(
pItem
=
calloc
(
1
,
cb
-
sizeof
(
DMUS_PMSG
)
+
sizeof
(
DMUS_PMSGItem
))))
return
E_OUTOFMEMORY
;
pItem
->
pMsg
.
dwSize
=
cb
;
*
ppPMSG
=
DMUS_ItemToPMSG
(
pItem
);
return
S_OK
;
...
...
@@ -540,7 +535,7 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_FreePMsg(IDirectMusicPerforma
if
(
pPMSG
->
punkUser
)
IUnknown_Release
(
pPMSG
->
punkUser
);
HeapFree
(
GetProcessHeap
(),
0
,
pItem
);
free
(
pItem
);
return
S_OK
;
}
...
...
@@ -1286,11 +1281,8 @@ HRESULT create_dmperformance(REFIID lpcGUID, void **ppobj)
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
lpcGUID
),
ppobj
);
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicPerformance8Impl
));
if
(
NULL
==
obj
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IDirectMusicPerformance8_iface
.
lpVtbl
=
&
DirectMusicPerformance8_Vtbl
;
obj
->
ref
=
0
;
/* will be inited by QueryInterface */
obj
->
pDefaultPath
=
NULL
;
...
...
dlls/dmime/segment.c
View file @
0feb0cda
...
...
@@ -93,7 +93,7 @@ static ULONG WINAPI IDirectMusicSegment8Impl_Release(IDirectMusicSegment8 *iface
if
(
This
->
wave_data
)
free
(
This
->
wave_data
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -266,9 +266,7 @@ static HRESULT WINAPI IDirectMusicSegment8Impl_InsertTrack(IDirectMusicSegment8
}
}
pNewSegTrack
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
DMUS_PRIVATE_SEGMENT_TRACK
));
if
(
NULL
==
pNewSegTrack
)
return
E_OUTOFMEMORY
;
if
(
!
(
pNewSegTrack
=
calloc
(
1
,
sizeof
(
*
pNewSegTrack
))))
return
E_OUTOFMEMORY
;
pNewSegTrack
->
dwGroupBits
=
group
;
pNewSegTrack
->
pTrack
=
pTrack
;
...
...
@@ -296,7 +294,7 @@ static HRESULT WINAPI IDirectMusicSegment8Impl_RemoveTrack(IDirectMusicSegment8
list_remove
(
&
pIt
->
entry
);
IDirectMusicTrack_Init
(
pIt
->
pTrack
,
NULL
);
IDirectMusicTrack_Release
(
pIt
->
pTrack
);
HeapFree
(
GetProcessHeap
(),
0
,
pIt
);
free
(
pIt
);
return
S_OK
;
}
...
...
@@ -445,13 +443,16 @@ static HRESULT WINAPI IDirectMusicSegment8Impl_Clone(IDirectMusicSegment8 *iface
LIST_FOR_EACH_ENTRY
(
track_item
,
&
This
->
Tracks
,
DMUS_PRIVATE_SEGMENT_TRACK
,
entry
)
{
if
(
SUCCEEDED
(
hr
=
IDirectMusicTrack_Clone
(
track_item
->
pTrack
,
start
,
end
,
&
track
)))
{
if
((
cloned_item
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
cloned_item
))))
{
if
((
cloned_item
=
malloc
(
sizeof
(
*
cloned_item
))))
{
cloned_item
->
dwGroupBits
=
track_item
->
dwGroupBits
;
cloned_item
->
flags
=
track_item
->
flags
;
cloned_item
->
pTrack
=
track
;
list_add_tail
(
&
clone
->
Tracks
,
&
cloned_item
->
entry
);
continue
;
}
else
{
}
else
{
IDirectMusicTrack_Release
(
track
);
}
}
...
...
@@ -924,8 +925,7 @@ IDirectMusicSegment8Impl *create_segment(void)
{
IDirectMusicSegment8Impl
*
obj
;
if
(
!
(
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
obj
))))
return
NULL
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
NULL
;
obj
->
IDirectMusicSegment8_iface
.
lpVtbl
=
&
dmsegment8_vtbl
;
obj
->
ref
=
1
;
...
...
dlls/dmime/segmentstate.c
View file @
0feb0cda
...
...
@@ -73,8 +73,7 @@ static ULONG WINAPI DirectMusicSegmentState8_Release(IDirectMusicSegmentState8 *
TRACE
(
"(%p): %ld
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -146,11 +145,7 @@ HRESULT create_dmsegmentstate(REFIID riid, void **ret_iface)
HRESULT
hr
;
*
ret_iface
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IDirectMusicSegmentState8Impl
));
if
(
!
obj
)
return
E_OUTOFMEMORY
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IDirectMusicSegmentState8_iface
.
lpVtbl
=
&
DirectMusicSegmentState8Vtbl
;
obj
->
ref
=
1
;
...
...
dlls/dmime/segtriggertrack.c
View file @
0feb0cda
...
...
@@ -21,8 +21,6 @@
#include "dmime_private.h"
#include "dmobject.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmime
);
/*****************************************************************************
...
...
@@ -98,10 +96,10 @@ static ULONG WINAPI segment_track_Release(IDirectMusicTrack8 *iface)
if
(
item
->
dmobj
)
IDirectMusicObject_Release
(
item
->
dmobj
);
heap_
free
(
item
);
free
(
item
);
}
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -274,8 +272,7 @@ static HRESULT parse_segment_item(IDirectMusicSegTriggerTrack *This, IStream *st
/* First chunk is a header */
if
(
stream_get_chunk
(
stream
,
&
chunk
)
!=
S_OK
||
chunk
.
id
!=
DMUS_FOURCC_SEGMENTITEM_CHUNK
)
return
DMUS_E_TRACK_HDR_NOT_FIRST_CK
;
if
(
!
(
item
=
heap_alloc_zero
(
sizeof
(
*
item
))))
return
E_OUTOFMEMORY
;
if
(
!
(
item
=
calloc
(
1
,
sizeof
(
*
item
))))
return
E_OUTOFMEMORY
;
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
item
->
header
,
sizeof
(
DMUS_IO_SEGMENT_ITEM_HEADER
));
if
(
FAILED
(
hr
))
goto
error
;
...
...
@@ -311,7 +308,7 @@ static HRESULT parse_segment_item(IDirectMusicSegTriggerTrack *This, IStream *st
return
S_OK
;
error:
heap_
free
(
item
);
free
(
item
);
return
hr
;
}
...
...
@@ -386,11 +383,8 @@ HRESULT create_dmsegtriggertrack(REFIID lpcGUID, void **ppobj)
IDirectMusicSegTriggerTrack
*
track
;
HRESULT
hr
;
track
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
track
));
if
(
!
track
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
track
=
calloc
(
1
,
sizeof
(
*
track
))))
return
E_OUTOFMEMORY
;
track
->
IDirectMusicTrack8_iface
.
lpVtbl
=
&
dmtrack8_vtbl
;
track
->
ref
=
1
;
dmobject_init
(
&
track
->
dmobj
,
&
CLSID_DirectMusicSegTriggerTrack
,
...
...
dlls/dmime/seqtrack.c
View file @
0feb0cda
...
...
@@ -78,7 +78,7 @@ static ULONG WINAPI sequence_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -261,11 +261,8 @@ HRESULT create_dmseqtrack(REFIID lpcGUID, void **ppobj)
IDirectMusicSeqTrack
*
track
;
HRESULT
hr
;
track
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
track
));
if
(
!
track
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
track
=
calloc
(
1
,
sizeof
(
*
track
))))
return
E_OUTOFMEMORY
;
track
->
IDirectMusicTrack8_iface
.
lpVtbl
=
&
dmtrack8_vtbl
;
track
->
ref
=
1
;
dmobject_init
(
&
track
->
dmobj
,
&
CLSID_DirectMusicSeqTrack
,
...
...
dlls/dmime/sysextrack.c
View file @
0feb0cda
...
...
@@ -78,7 +78,7 @@ static ULONG WINAPI sysex_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -260,11 +260,8 @@ HRESULT create_dmsysextrack(REFIID lpcGUID, void **ppobj)
IDirectMusicSysExTrack
*
track
;
HRESULT
hr
;
track
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
track
));
if
(
!
track
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
track
=
calloc
(
1
,
sizeof
(
*
track
))))
return
E_OUTOFMEMORY
;
track
->
IDirectMusicTrack8_iface
.
lpVtbl
=
&
dmtrack8_vtbl
;
track
->
ref
=
1
;
dmobject_init
(
&
track
->
dmobj
,
&
CLSID_DirectMusicSysExTrack
,
...
...
dlls/dmime/tempotrack.c
View file @
0feb0cda
...
...
@@ -21,8 +21,6 @@
#include "dmime_private.h"
#include "dmobject.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmime
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
...
...
@@ -85,8 +83,8 @@ static ULONG WINAPI tempo_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
heap_
free
(
This
->
items
);
heap_
free
(
This
);
free
(
This
->
items
);
free
(
This
);
}
return
ref
;
...
...
@@ -109,9 +107,7 @@ static HRESULT WINAPI tempo_track_InitPlay(IDirectMusicTrack8 *iface,
FIXME
(
"(%p, %p, %p, %p, %ld, %ld): semi-stub
\n
"
,
This
,
pSegmentState
,
pPerformance
,
ppStateData
,
dwVirtualTrack8ID
,
dwFlags
);
pState
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
DMUS_PRIVATE_TEMPO_PLAY_STATE
));
if
(
NULL
==
pState
)
return
E_OUTOFMEMORY
;
if
(
!
(
pState
=
calloc
(
1
,
sizeof
(
*
pState
))))
return
E_OUTOFMEMORY
;
/** TODO real fill useful data */
pState
->
dummy
=
0
;
...
...
@@ -131,7 +127,7 @@ static HRESULT WINAPI tempo_track_EndPlay(IDirectMusicTrack8 *iface, void *pStat
return
E_POINTER
;
}
/** TODO real clean up */
HeapFree
(
GetProcessHeap
(),
0
,
pState
);
free
(
pState
);
return
S_OK
;
}
...
...
@@ -374,11 +370,8 @@ HRESULT create_dmtempotrack(REFIID lpcGUID, void **ppobj)
IDirectMusicTempoTrack
*
track
;
HRESULT
hr
;
track
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
track
));
if
(
!
track
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
track
=
calloc
(
1
,
sizeof
(
*
track
))))
return
E_OUTOFMEMORY
;
track
->
IDirectMusicTrack8_iface
.
lpVtbl
=
&
dmtrack8_vtbl
;
track
->
ref
=
1
;
dmobject_init
(
&
track
->
dmobj
,
&
CLSID_DirectMusicTempoTrack
,
...
...
dlls/dmime/timesigtrack.c
View file @
0feb0cda
...
...
@@ -19,7 +19,6 @@
#include "dmime_private.h"
#include "dmobject.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmime
);
...
...
@@ -86,8 +85,8 @@ static ULONG WINAPI IDirectMusicTrackImpl_Release(IDirectMusicTrack *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
heap_
free
(
This
->
items
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
->
items
);
free
(
This
);
}
return
ref
;
...
...
@@ -289,11 +288,8 @@ HRESULT create_dmtimesigtrack(REFIID lpcGUID, void **ppobj)
IDirectMusicTimeSigTrack
*
track
;
HRESULT
hr
;
track
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
track
));
if
(
!
track
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
track
=
calloc
(
1
,
sizeof
(
*
track
))))
return
E_OUTOFMEMORY
;
track
->
IDirectMusicTrack_iface
.
lpVtbl
=
&
dmtack_vtbl
;
track
->
ref
=
1
;
dmobject_init
(
&
track
->
dmobj
,
&
CLSID_DirectMusicTimeSigTrack
,
...
...
dlls/dmime/wavetrack.c
View file @
0feb0cda
...
...
@@ -19,7 +19,6 @@
#include "dmime_private.h"
#include "dmobject.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmime
);
...
...
@@ -107,12 +106,12 @@ static ULONG WINAPI wave_track_Release(IDirectMusicTrack8 *iface)
list_remove
(
&
item
->
entry
);
if
(
item
->
object
)
IDirectMusicObject_Release
(
item
->
object
);
heap_
free
(
item
);
free
(
item
);
}
heap_
free
(
part
);
free
(
part
);
}
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -323,8 +322,7 @@ static HRESULT parse_wave_item(struct wave_part *part, IStream *stream, struct c
if
(
wave
.
id
!=
FOURCC_LIST
||
wave
.
type
!=
DMUS_FOURCC_WAVE_LIST
)
return
DMUS_E_UNSUPPORTED_STREAM
;
if
(
!
(
item
=
heap_alloc_zero
(
sizeof
(
*
item
))))
return
E_OUTOFMEMORY
;
if
(
!
(
item
=
calloc
(
1
,
sizeof
(
*
item
))))
return
E_OUTOFMEMORY
;
/* Wave item header chunk */
if
(
FAILED
(
hr
=
stream_next_chunk
(
stream
,
&
chunk
)))
...
...
@@ -366,7 +364,7 @@ static HRESULT parse_wave_item(struct wave_part *part, IStream *stream, struct c
return
S_OK
;
error:
heap_
free
(
item
);
free
(
item
);
return
hr
;
}
...
...
@@ -383,8 +381,7 @@ static HRESULT parse_wave_part(IDirectMusicWaveTrack *This, IStream *stream,
if
(
chunk
.
id
!=
DMUS_FOURCC_WAVEPART_CHUNK
)
return
DMUS_E_UNSUPPORTED_STREAM
;
if
(
!
(
part
=
heap_alloc_zero
(
sizeof
(
*
part
))))
return
E_OUTOFMEMORY
;
if
(
!
(
part
=
calloc
(
1
,
sizeof
(
*
part
))))
return
E_OUTOFMEMORY
;
list_init
(
&
part
->
items
);
if
(
FAILED
(
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
part
->
header
,
sizeof
(
part
->
header
))))
{
...
...
@@ -414,7 +411,7 @@ static HRESULT parse_wave_part(IDirectMusicWaveTrack *This, IStream *stream,
return
S_OK
;
error:
heap_
free
(
part
);
free
(
part
);
return
hr
;
}
...
...
@@ -475,11 +472,8 @@ HRESULT create_dmwavetrack(REFIID lpcGUID, void **ppobj)
IDirectMusicWaveTrack
*
track
;
HRESULT
hr
;
track
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
track
));
if
(
!
track
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
track
=
calloc
(
1
,
sizeof
(
*
track
))))
return
E_OUTOFMEMORY
;
track
->
IDirectMusicTrack8_iface
.
lpVtbl
=
&
dmtrack8_vtbl
;
track
->
ref
=
1
;
dmobject_init
(
&
track
->
dmobj
,
&
CLSID_DirectMusicWaveTrack
,
...
...
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