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
8a02434c
Commit
8a02434c
authored
Sep 09, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmcompos: Use CRT allocation functions.
parent
7d94983c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
47 deletions
+26
-47
chordmap.c
dlls/dmcompos/chordmap.c
+14
-19
chordmaptrack.c
dlls/dmcompos/chordmaptrack.c
+3
-8
composer.c
dlls/dmcompos/composer.c
+3
-8
dmobject.c
dlls/dmcompos/dmobject.c
+3
-4
signposttrack.c
dlls/dmcompos/signposttrack.c
+3
-8
No files found.
dlls/dmcompos/chordmap.c
View file @
8a02434c
...
...
@@ -79,9 +79,7 @@ static ULONG WINAPI IDirectMusicChordMapImpl_Release(IDirectMusicChordMap *iface
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -310,23 +308,20 @@ static const IPersistStreamVtbl persiststream_vtbl = {
/* for ClassFactory */
HRESULT
create_dmchordmap
(
REFIID
lpcGUID
,
void
**
ppobj
)
{
IDirectMusicChordMapImpl
*
obj
;
HRESULT
hr
;
IDirectMusicChordMapImpl
*
obj
;
HRESULT
hr
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicChordMapImpl
));
if
(
NULL
==
obj
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
obj
->
IDirectMusicChordMap_iface
.
lpVtbl
=
&
dmchordmap_vtbl
;
obj
->
ref
=
1
;
dmobject_init
(
&
obj
->
dmobj
,
&
CLSID_DirectMusicChordMap
,
(
IUnknown
*
)
&
obj
->
IDirectMusicChordMap_iface
);
obj
->
dmobj
.
IDirectMusicObject_iface
.
lpVtbl
=
&
dmobject_vtbl
;
obj
->
dmobj
.
IPersistStream_iface
.
lpVtbl
=
&
persiststream_vtbl
;
*
ppobj
=
NULL
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IDirectMusicChordMap_iface
.
lpVtbl
=
&
dmchordmap_vtbl
;
obj
->
ref
=
1
;
dmobject_init
(
&
obj
->
dmobj
,
&
CLSID_DirectMusicChordMap
,
(
IUnknown
*
)
&
obj
->
IDirectMusicChordMap_iface
);
obj
->
dmobj
.
IDirectMusicObject_iface
.
lpVtbl
=
&
dmobject_vtbl
;
obj
->
dmobj
.
IPersistStream_iface
.
lpVtbl
=
&
persiststream_vtbl
;
hr
=
IDirectMusicChordMap_QueryInterface
(
&
obj
->
IDirectMusicChordMap_iface
,
lpcGUID
,
ppobj
);
IDirectMusicChordMap_Release
(
&
obj
->
IDirectMusicChordMap_iface
);
hr
=
IDirectMusicChordMap_QueryInterface
(
&
obj
->
IDirectMusicChordMap_iface
,
lpcGUID
,
ppobj
);
IDirectMusicChordMap_Release
(
&
obj
->
IDirectMusicChordMap_iface
);
return
hr
;
return
hr
;
}
dlls/dmcompos/chordmaptrack.c
View file @
8a02434c
...
...
@@ -77,9 +77,7 @@ static ULONG WINAPI chordmap_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -289,11 +287,8 @@ HRESULT create_dmchordmaptrack(REFIID lpcGUID, void **ppobj)
IDirectMusicChordMapTrack
*
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_DirectMusicChordMapTrack
,
...
...
dlls/dmcompos/composer.c
View file @
8a02434c
...
...
@@ -67,9 +67,7 @@ static ULONG WINAPI IDirectMusicComposerImpl_Release(IDirectMusicComposer *iface
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -174,11 +172,8 @@ HRESULT create_dmcomposer(REFIID riid, void **ret_iface)
IDirectMusicComposerImpl
*
obj
;
HRESULT
hr
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
obj
));
if
(
!
obj
)
{
*
ret_iface
=
NULL
;
return
E_OUTOFMEMORY
;
}
*
ret_iface
=
NULL
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IDirectMusicComposer_iface
.
lpVtbl
=
&
dmcomposer_vtbl
;
obj
->
ref
=
1
;
...
...
dlls/dmcompos/dmobject.c
View file @
8a02434c
...
...
@@ -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/dmcompos/signposttrack.c
View file @
8a02434c
...
...
@@ -77,9 +77,7 @@ static ULONG WINAPI signpost_track_Release(IDirectMusicTrack8 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
ref
)
free
(
This
);
return
ref
;
}
...
...
@@ -277,11 +275,8 @@ HRESULT create_dmsignposttrack(REFIID lpcGUID, void **ppobj)
IDirectMusicSignPostTrack
*
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_DirectMusicSignPostTrack
,
...
...
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