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
b60ee21f
Commit
b60ee21f
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
dmband: Use CRT allocation functions.
parent
c3ebc387
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
32 deletions
+13
-32
band.c
dlls/dmband/band.c
+5
-15
bandtrack.c
dlls/dmband/bandtrack.c
+5
-13
dmobject.c
dlls/dmband/dmobject.c
+3
-4
No files found.
dlls/dmband/band.c
View file @
b60ee21f
...
...
@@ -81,9 +81,7 @@ static ULONG WINAPI IDirectMusicBandImpl_Release(IDirectMusicBand *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -277,11 +275,7 @@ static HRESULT parse_instrument(IDirectMusicBandImpl *This, DMUS_PRIVATE_CHUNK *
/*
* @TODO insert pNewInstrument into This
*/
pNewInstrument
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
DMUS_PRIVATE_INSTRUMENT
));
if
(
NULL
==
pNewInstrument
)
{
ERR
(
": no more memory
\n
"
);
return
E_OUTOFMEMORY
;
}
if
(
!
(
pNewInstrument
=
calloc
(
1
,
sizeof
(
*
pNewInstrument
))))
return
E_OUTOFMEMORY
;
memcpy
(
&
pNewInstrument
->
pInstrument
,
&
inst
,
sizeof
(
DMUS_IO_INSTRUMENT
));
pNewInstrument
->
ppReferenceCollection
=
NULL
;
if
(
NULL
!=
pObject
)
{
...
...
@@ -289,8 +283,7 @@ static HRESULT parse_instrument(IDirectMusicBandImpl *This, DMUS_PRIVATE_CHUNK *
hr
=
IDirectMusicObject_QueryInterface
(
pObject
,
&
IID_IDirectMusicCollection
,
(
void
**
)
&
pCol
);
if
(
FAILED
(
hr
))
{
ERR
(
": failed to get IDirectMusicCollection Interface from DMObject
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
pNewInstrument
);
free
(
pNewInstrument
);
return
hr
;
}
pNewInstrument
->
ppReferenceCollection
=
pCol
;
...
...
@@ -514,11 +507,8 @@ HRESULT create_dmband(REFIID lpcGUID, void **ppobj)
IDirectMusicBandImpl
*
obj
;
HRESULT
hr
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicBandImpl
));
if
(
NULL
==
obj
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ppobj
=
NULL
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IDirectMusicBand_iface
.
lpVtbl
=
&
dmband_vtbl
;
obj
->
ref
=
1
;
dmobject_init
(
&
obj
->
dmobj
,
&
CLSID_DirectMusicBand
,
(
IUnknown
*
)
&
obj
->
IDirectMusicBand_iface
);
...
...
dlls/dmband/bandtrack.c
View file @
b60ee21f
...
...
@@ -80,9 +80,7 @@ static ULONG WINAPI band_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -344,11 +342,8 @@ static HRESULT load_band(IDirectMusicBandTrack *This, IStream *pClonedStream,
* @TODO insert pBand into This
*/
if
(
SUCCEEDED
(
hr
))
{
LPDMUS_PRIVATE_BAND
pNewBand
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
DMUS_PRIVATE_BAND
));
if
(
NULL
==
pNewBand
)
{
ERR
(
": no more memory
\n
"
);
return
E_OUTOFMEMORY
;
}
LPDMUS_PRIVATE_BAND
pNewBand
;
if
(
!
(
pNewBand
=
calloc
(
1
,
sizeof
(
*
pNewBand
))))
return
E_OUTOFMEMORY
;
pNewBand
->
BandHeader
=
*
pHeader
;
pNewBand
->
band
=
*
ppBand
;
IDirectMusicBand_AddRef
(
*
ppBand
);
...
...
@@ -637,11 +632,8 @@ HRESULT create_dmbandtrack(REFIID lpcGUID, void **ppobj)
IDirectMusicBandTrack
*
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_DirectMusicBandTrack
,
...
...
dlls/dmband/dmobject.c
View file @
b60ee21f
...
...
@@ -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
;
}
...
...
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