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
d18ec193
Commit
d18ec193
authored
Sep 09, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 12, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmstyle: Use CRT allocation functions.
parent
994bcb48
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
78 deletions
+31
-78
auditiontrack.c
dlls/dmstyle/auditiontrack.c
+3
-8
chordtrack.c
dlls/dmstyle/chordtrack.c
+3
-8
commandtrack.c
dlls/dmstyle/commandtrack.c
+4
-9
dmobject.c
dlls/dmstyle/dmobject.c
+3
-4
motiftrack.c
dlls/dmstyle/motiftrack.c
+3
-8
mutetrack.c
dlls/dmstyle/mutetrack.c
+3
-8
style.c
dlls/dmstyle/style.c
+9
-25
styletrack.c
dlls/dmstyle/styletrack.c
+3
-8
No files found.
dlls/dmstyle/auditiontrack.c
View file @
d18ec193
...
...
@@ -77,9 +77,7 @@ static ULONG WINAPI audition_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -320,11 +318,8 @@ HRESULT create_dmauditiontrack(REFIID lpcGUID, void **ppobj)
IDirectMusicAuditionTrack
*
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_DirectMusicAuditionTrack
,
...
...
dlls/dmstyle/chordtrack.c
View file @
d18ec193
...
...
@@ -80,9 +80,7 @@ static ULONG WINAPI chord_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -419,11 +417,8 @@ HRESULT create_dmchordtrack(REFIID lpcGUID, void **ppobj)
IDirectMusicChordTrack
*
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_DirectMusicChordTrack
,
...
...
dlls/dmstyle/commandtrack.c
View file @
d18ec193
...
...
@@ -79,9 +79,7 @@ static ULONG WINAPI command_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -302,7 +300,7 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
nrCommands
=
chunkSize
/
dwSizeOfStruct
;
/* and this is the number of commands */
/* load each command separately in new entry */
for
(
count
=
0
;
count
<
nrCommands
;
count
++
)
{
LPDMUS_PRIVATE_COMMAND
pNewCommand
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
DMUS_PRIVATE_COMMAND
));
LPDMUS_PRIVATE_COMMAND
pNewCommand
=
calloc
(
1
,
sizeof
(
*
pNewCommand
));
IStream_Read
(
pStm
,
&
pNewCommand
->
pCommand
,
dwSizeOfStruct
,
NULL
);
list_add_tail
(
&
This
->
Commands
,
&
pNewCommand
->
entry
);
}
...
...
@@ -372,11 +370,8 @@ HRESULT create_dmcommandtrack(REFIID lpcGUID, void **ppobj)
IDirectMusicCommandTrack
*
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_DirectMusicCommandTrack
,
...
...
dlls/dmstyle/dmobject.c
View file @
d18ec193
...
...
@@ -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,10 @@ 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
)))
if
(
!
(
*
array
=
m
alloc
(
size
)))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
stream_read
(
stream
,
*
array
,
size
)))
{
heap_
free
(
*
array
);
free
(
*
array
);
*
array
=
NULL
;
return
hr
;
}
...
...
dlls/dmstyle/motiftrack.c
View file @
d18ec193
...
...
@@ -77,9 +77,7 @@ static ULONG WINAPI motif_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -292,11 +290,8 @@ HRESULT create_dmmotiftrack(REFIID lpcGUID, void **ppobj)
IDirectMusicMotifTrack
*
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_DirectMusicMotifTrack
,
...
...
dlls/dmstyle/mutetrack.c
View file @
d18ec193
...
...
@@ -77,9 +77,7 @@ static ULONG WINAPI mute_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -301,11 +299,8 @@ HRESULT create_dmmutetrack(REFIID lpcGUID, void **ppobj)
IDirectMusicMuteTrack
*
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_DirectMusicMuteTrack
,
...
...
dlls/dmstyle/style.c
View file @
d18ec193
...
...
@@ -20,7 +20,6 @@
#include "dmstyle_private.h"
#include "dmobject.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmstyle
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
...
...
@@ -116,17 +115,17 @@ static ULONG WINAPI IDirectMusicStyle8Impl_Release(IDirectMusicStyle8 *iface)
list_remove
(
&
band
->
entry
);
if
(
band
->
pBand
)
IDirectMusicBand_Release
(
band
->
pBand
);
heap_
free
(
band
);
free
(
band
);
}
LIST_FOR_EACH_ENTRY_SAFE
(
motif
,
motif2
,
&
This
->
motifs
,
struct
style_motif
,
entry
)
{
list_remove
(
&
motif
->
entry
);
LIST_FOR_EACH_ENTRY_SAFE
(
item
,
item2
,
&
motif
->
Items
,
struct
style_partref_item
,
entry
)
{
list_remove
(
&
item
->
entry
);
heap_
free
(
item
);
free
(
item
);
}
heap_
free
(
motif
);
free
(
motif
);
}
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -405,11 +404,7 @@ static HRESULT parse_part_ref_list(DMUS_PRIVATE_CHUNK *pChunk, IStream *pStm,
switch
(
Chunk
.
fccID
)
{
case
DMUS_FOURCC_PARTREF_CHUNK
:
{
TRACE_
(
dmfile
)(
": PartRef chunk
\n
"
);
pNewItem
=
heap_alloc_zero
(
sizeof
(
*
pNewItem
));
if
(
!
pNewItem
)
{
ERR
(
": no more memory
\n
"
);
return
E_OUTOFMEMORY
;
}
if
(
!
(
pNewItem
=
calloc
(
1
,
sizeof
(
*
pNewItem
))))
return
E_OUTOFMEMORY
;
hr
=
IStream_Read
(
pStm
,
&
pNewItem
->
part_ref
,
sizeof
(
DMUS_IO_PARTREF
),
NULL
);
/*TRACE_(dmfile)(" - sizeof %lu\n", sizeof(DMUS_IO_PARTREF));*/
list_add_tail
(
&
pNewMotif
->
Items
,
&
pNewItem
->
entry
);
...
...
@@ -630,11 +625,7 @@ static HRESULT parse_pattern_list(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHU
case
DMUS_FOURCC_PATTERN_CHUNK
:
{
TRACE_
(
dmfile
)(
": Pattern chunk
\n
"
);
/** alloc new motif entry */
pNewMotif
=
heap_alloc_zero
(
sizeof
(
*
pNewMotif
));
if
(
NULL
==
pNewMotif
)
{
ERR
(
": no more memory
\n
"
);
return
E_OUTOFMEMORY
;
}
if
(
!
(
pNewMotif
=
calloc
(
1
,
sizeof
(
*
pNewMotif
))))
return
E_OUTOFMEMORY
;
list_add_tail
(
&
This
->
motifs
,
&
pNewMotif
->
entry
);
IStream_Read
(
pStm
,
&
pNewMotif
->
pattern
,
Chunk
.
dwSize
,
NULL
);
...
...
@@ -826,11 +817,7 @@ static HRESULT parse_style_form(IDirectMusicStyle8Impl *This, DMUS_PRIVATE_CHUNK
return
hr
;
}
pNewBand
=
heap_alloc_zero
(
sizeof
(
*
pNewBand
));
if
(
NULL
==
pNewBand
)
{
ERR
(
": no more memory
\n
"
);
return
E_OUTOFMEMORY
;
}
if
(
!
(
pNewBand
=
calloc
(
1
,
sizeof
(
*
pNewBand
))))
return
E_OUTOFMEMORY
;
pNewBand
->
pBand
=
pBand
;
IDirectMusicBand_AddRef
(
pBand
);
list_add_tail
(
&
This
->
bands
,
&
pNewBand
->
entry
);
...
...
@@ -977,11 +964,8 @@ HRESULT create_dmstyle(REFIID lpcGUID, void **ppobj)
IDirectMusicStyle8Impl
*
obj
;
HRESULT
hr
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicStyle8Impl
));
if
(
NULL
==
obj
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IDirectMusicStyle8_iface
.
lpVtbl
=
&
dmstyle8_vtbl
;
obj
->
ref
=
1
;
dmobject_init
(
&
obj
->
dmobj
,
&
CLSID_DirectMusicStyle
,
(
IUnknown
*
)
&
obj
->
IDirectMusicStyle8_iface
);
...
...
dlls/dmstyle/styletrack.c
View file @
d18ec193
...
...
@@ -20,8 +20,6 @@
#include "dmstyle_private.h"
#include "dmobject.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmstyle
);
/*****************************************************************************
...
...
@@ -95,7 +93,7 @@ static ULONG WINAPI style_track_Release(IDirectMusicTrack8 *iface)
free
(
item
);
}
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -390,11 +388,8 @@ HRESULT create_dmstyletrack(REFIID lpcGUID, void **ppobj)
IDirectMusicStyleTrack
*
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_DirectMusicStyleTrack
,
...
...
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