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
40213362
Commit
40213362
authored
Aug 17, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Aug 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xaudio2_7: Use CRT allocation functions.
parent
7df4a81f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
23 deletions
+21
-23
xapo.c
dlls/xaudio2_7/xapo.c
+5
-6
xaudio_dll.c
dlls/xaudio2_7/xaudio_dll.c
+16
-17
No files found.
dlls/xaudio2_7/xapo.c
View file @
40213362
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
#include "xapofx.h"
#include "xapofx.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include <FAPO.h>
#include <FAPO.h>
#include <FAPOFX.h>
#include <FAPOFX.h>
...
@@ -84,7 +83,7 @@ static ULONG WINAPI XAPOFX_Release(IXAPO *iface)
...
@@ -84,7 +83,7 @@ static ULONG WINAPI XAPOFX_Release(IXAPO *iface)
TRACE
(
"(%p)->(): Refcount now %lu
\n
"
,
This
,
ref
);
TRACE
(
"(%p)->(): Refcount now %lu
\n
"
,
This
,
ref
);
if
(
!
ref
)
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
return
ref
;
return
ref
;
}
}
...
@@ -258,7 +257,7 @@ static HRESULT xapo_create(FAPO *fapo, XA2XAPOFXImpl **out)
...
@@ -258,7 +257,7 @@ static HRESULT xapo_create(FAPO *fapo, XA2XAPOFXImpl **out)
{
{
XA2XAPOFXImpl
*
object
;
XA2XAPOFXImpl
*
object
;
if
(
!
(
object
=
heap_
alloc
(
sizeof
(
*
object
))))
if
(
!
(
object
=
m
alloc
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
object
->
IXAPO_iface
.
lpVtbl
=
&
XAPOFX_Vtbl
;
object
->
IXAPO_iface
.
lpVtbl
=
&
XAPOFX_Vtbl
;
...
@@ -345,7 +344,7 @@ static ULONG WINAPI xapocf_Release(IClassFactory *iface)
...
@@ -345,7 +344,7 @@ static ULONG WINAPI xapocf_Release(IClassFactory *iface)
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): Refcount now %lu
\n
"
,
This
,
ref
);
TRACE
(
"(%p)->(): Refcount now %lu
\n
"
,
This
,
ref
);
if
(
!
ref
)
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
return
ref
;
return
ref
;
}
}
...
@@ -425,13 +424,13 @@ static const IClassFactoryVtbl xapo_Vtbl =
...
@@ -425,13 +424,13 @@ static const IClassFactoryVtbl xapo_Vtbl =
HRESULT
make_xapo_factory
(
REFCLSID
clsid
,
REFIID
riid
,
void
**
ppv
)
HRESULT
make_xapo_factory
(
REFCLSID
clsid
,
REFIID
riid
,
void
**
ppv
)
{
{
HRESULT
hr
;
HRESULT
hr
;
struct
xapo_cf
*
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
xapo_cf
));
struct
xapo_cf
*
ret
=
malloc
(
sizeof
(
struct
xapo_cf
));
ret
->
IClassFactory_iface
.
lpVtbl
=
&
xapo_Vtbl
;
ret
->
IClassFactory_iface
.
lpVtbl
=
&
xapo_Vtbl
;
ret
->
class
=
clsid
;
ret
->
class
=
clsid
;
ret
->
ref
=
0
;
ret
->
ref
=
0
;
hr
=
IClassFactory_QueryInterface
(
&
ret
->
IClassFactory_iface
,
riid
,
ppv
);
hr
=
IClassFactory_QueryInterface
(
&
ret
->
IClassFactory_iface
,
riid
,
ppv
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
HeapFree
(
GetProcessHeap
(),
0
,
ret
);
free
(
ret
);
return
hr
;
return
hr
;
}
}
...
...
dlls/xaudio2_7/xaudio_dll.c
View file @
40213362
...
@@ -34,7 +34,6 @@
...
@@ -34,7 +34,6 @@
#include "wine/asm.h"
#include "wine/asm.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
xaudio2
);
WINE_DEFAULT_DEBUG_CHANNEL
(
xaudio2
);
...
@@ -114,7 +113,7 @@ static int32_t FAPOCALL XAPO_Release(void *iface)
...
@@ -114,7 +113,7 @@ static int32_t FAPOCALL XAPO_Release(void *iface)
IXAPO_Release
(
This
->
xapo
);
IXAPO_Release
(
This
->
xapo
);
if
(
This
->
xapo_params
)
if
(
This
->
xapo_params
)
IXAPOParameters_Release
(
This
->
xapo_params
);
IXAPOParameters_Release
(
This
->
xapo_params
);
heap_
free
(
This
);
free
(
This
);
}
}
return
r
;
return
r
;
}
}
...
@@ -290,7 +289,7 @@ static XA2XAPOImpl *wrap_xapo(IUnknown *unk)
...
@@ -290,7 +289,7 @@ static XA2XAPOImpl *wrap_xapo(IUnknown *unk)
xapo_params
=
NULL
;
xapo_params
=
NULL
;
}
}
ret
=
heap_
alloc
(
sizeof
(
*
ret
));
ret
=
m
alloc
(
sizeof
(
*
ret
));
ret
->
xapo
=
xapo
;
ret
->
xapo
=
xapo
;
ret
->
xapo_params
=
xapo_params
;
ret
->
xapo_params
=
xapo_params
;
...
@@ -310,7 +309,7 @@ FAudioEffectChain *wrap_effect_chain(const XAUDIO2_EFFECT_CHAIN *pEffectChain)
...
@@ -310,7 +309,7 @@ FAudioEffectChain *wrap_effect_chain(const XAUDIO2_EFFECT_CHAIN *pEffectChain)
if
(
!
pEffectChain
)
if
(
!
pEffectChain
)
return
NULL
;
return
NULL
;
ret
=
heap_
alloc
(
sizeof
(
*
ret
)
+
sizeof
(
FAudioEffectDescriptor
)
*
pEffectChain
->
EffectCount
);
ret
=
m
alloc
(
sizeof
(
*
ret
)
+
sizeof
(
FAudioEffectDescriptor
)
*
pEffectChain
->
EffectCount
);
ret
->
EffectCount
=
pEffectChain
->
EffectCount
;
ret
->
EffectCount
=
pEffectChain
->
EffectCount
;
ret
->
pEffectDescriptors
=
(
void
*
)(
ret
+
1
);
ret
->
pEffectDescriptors
=
(
void
*
)(
ret
+
1
);
...
@@ -331,7 +330,7 @@ static void free_effect_chain(FAudioEffectChain *chain)
...
@@ -331,7 +330,7 @@ static void free_effect_chain(FAudioEffectChain *chain)
return
;
return
;
for
(
i
=
0
;
i
<
chain
->
EffectCount
;
++
i
)
for
(
i
=
0
;
i
<
chain
->
EffectCount
;
++
i
)
XAPO_Release
(
chain
->
pEffectDescriptors
[
i
].
pEffect
);
XAPO_Release
(
chain
->
pEffectDescriptors
[
i
].
pEffect
);
heap_
free
(
chain
);
free
(
chain
);
}
}
/* Send Wrapping */
/* Send Wrapping */
...
@@ -345,7 +344,7 @@ static FAudioVoiceSends *wrap_voice_sends(const XAUDIO2_VOICE_SENDS *sends)
...
@@ -345,7 +344,7 @@ static FAudioVoiceSends *wrap_voice_sends(const XAUDIO2_VOICE_SENDS *sends)
return
NULL
;
return
NULL
;
#if XAUDIO2_VER <= 3
#if XAUDIO2_VER <= 3
ret
=
heap_
alloc
(
sizeof
(
*
ret
)
+
sends
->
OutputCount
*
sizeof
(
FAudioSendDescriptor
));
ret
=
m
alloc
(
sizeof
(
*
ret
)
+
sends
->
OutputCount
*
sizeof
(
FAudioSendDescriptor
));
ret
->
SendCount
=
sends
->
OutputCount
;
ret
->
SendCount
=
sends
->
OutputCount
;
ret
->
pSends
=
(
FAudioSendDescriptor
*
)(
ret
+
1
);
ret
->
pSends
=
(
FAudioSendDescriptor
*
)(
ret
+
1
);
for
(
i
=
0
;
i
<
sends
->
OutputCount
;
++
i
){
for
(
i
=
0
;
i
<
sends
->
OutputCount
;
++
i
){
...
@@ -354,7 +353,7 @@ static FAudioVoiceSends *wrap_voice_sends(const XAUDIO2_VOICE_SENDS *sends)
...
@@ -354,7 +353,7 @@ static FAudioVoiceSends *wrap_voice_sends(const XAUDIO2_VOICE_SENDS *sends)
ret
->
pSends
[
i
].
Flags
=
0
;
ret
->
pSends
[
i
].
Flags
=
0
;
}
}
#else
#else
ret
=
heap_
alloc
(
sizeof
(
*
ret
)
+
sends
->
SendCount
*
sizeof
(
FAudioSendDescriptor
));
ret
=
m
alloc
(
sizeof
(
*
ret
)
+
sends
->
SendCount
*
sizeof
(
FAudioSendDescriptor
));
ret
->
SendCount
=
sends
->
SendCount
;
ret
->
SendCount
=
sends
->
SendCount
;
ret
->
pSends
=
(
FAudioSendDescriptor
*
)(
ret
+
1
);
ret
->
pSends
=
(
FAudioSendDescriptor
*
)(
ret
+
1
);
for
(
i
=
0
;
i
<
sends
->
SendCount
;
++
i
){
for
(
i
=
0
;
i
<
sends
->
SendCount
;
++
i
){
...
@@ -370,7 +369,7 @@ static void free_voice_sends(FAudioVoiceSends *sends)
...
@@ -370,7 +369,7 @@ static void free_voice_sends(FAudioVoiceSends *sends)
{
{
if
(
!
sends
)
if
(
!
sends
)
return
;
return
;
heap_
free
(
sends
);
free
(
sends
);
}
}
/* Voice Callbacks */
/* Voice Callbacks */
...
@@ -1453,15 +1452,15 @@ static ULONG WINAPI IXAudio2Impl_Release(IXAudio2 *iface)
...
@@ -1453,15 +1452,15 @@ static ULONG WINAPI IXAudio2Impl_Release(IXAudio2 *iface)
LIST_FOR_EACH_ENTRY_SAFE
(
v
,
v2
,
&
This
->
voices
,
XA2VoiceImpl
,
entry
){
LIST_FOR_EACH_ENTRY_SAFE
(
v
,
v2
,
&
This
->
voices
,
XA2VoiceImpl
,
entry
){
v
->
lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
v
->
lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
v
->
lock
);
DeleteCriticalSection
(
&
v
->
lock
);
HeapFree
(
GetProcessHeap
(),
0
,
v
);
free
(
v
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
cbs
);
free
(
This
->
cbs
);
This
->
lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
This
->
lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
lock
);
DeleteCriticalSection
(
&
This
->
lock
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
}
return
ref
;
return
ref
;
}
}
...
@@ -1515,7 +1514,7 @@ static HRESULT WINAPI IXAudio2Impl_RegisterForCallbacks(IXAudio2 *iface,
...
@@ -1515,7 +1514,7 @@ static HRESULT WINAPI IXAudio2Impl_RegisterForCallbacks(IXAudio2 *iface,
}
}
This
->
ncbs
++
;
This
->
ncbs
++
;
This
->
cbs
=
heap_
realloc
(
This
->
cbs
,
This
->
ncbs
*
sizeof
(
*
This
->
cbs
));
This
->
cbs
=
realloc
(
This
->
cbs
,
This
->
ncbs
*
sizeof
(
*
This
->
cbs
));
This
->
cbs
[
i
]
=
pCallback
;
This
->
cbs
[
i
]
=
pCallback
;
...
@@ -1557,7 +1556,7 @@ static inline XA2VoiceImpl *create_voice(IXAudio2Impl *This)
...
@@ -1557,7 +1556,7 @@ static inline XA2VoiceImpl *create_voice(IXAudio2Impl *This)
{
{
XA2VoiceImpl
*
voice
;
XA2VoiceImpl
*
voice
;
voice
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
voice
));
voice
=
calloc
(
1
,
sizeof
(
*
voice
));
if
(
!
voice
)
if
(
!
voice
)
return
NULL
;
return
NULL
;
...
@@ -1872,7 +1871,7 @@ static ULONG WINAPI XAudio2CF_Release(IClassFactory *iface)
...
@@ -1872,7 +1871,7 @@ static ULONG WINAPI XAudio2CF_Release(IClassFactory *iface)
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): Refcount now %lu
\n
"
,
This
,
ref
);
TRACE
(
"(%p)->(): Refcount now %lu
\n
"
,
This
,
ref
);
if
(
!
ref
)
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
return
ref
;
return
ref
;
}
}
...
@@ -1890,7 +1889,7 @@ static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *p
...
@@ -1890,7 +1889,7 @@ static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *p
if
(
pOuter
)
if
(
pOuter
)
return
CLASS_E_NOAGGREGATION
;
return
CLASS_E_NOAGGREGATION
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
object
=
calloc
(
1
,
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
object
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -1949,12 +1948,12 @@ static const IClassFactoryVtbl XAudio2CF_Vtbl =
...
@@ -1949,12 +1948,12 @@ static const IClassFactoryVtbl XAudio2CF_Vtbl =
static
inline
HRESULT
make_xaudio2_factory
(
REFIID
riid
,
void
**
ppv
)
static
inline
HRESULT
make_xaudio2_factory
(
REFIID
riid
,
void
**
ppv
)
{
{
HRESULT
hr
;
HRESULT
hr
;
struct
xaudio2_cf
*
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
xaudio2_cf
));
struct
xaudio2_cf
*
ret
=
malloc
(
sizeof
(
struct
xaudio2_cf
));
ret
->
IClassFactory_iface
.
lpVtbl
=
&
XAudio2CF_Vtbl
;
ret
->
IClassFactory_iface
.
lpVtbl
=
&
XAudio2CF_Vtbl
;
ret
->
ref
=
0
;
ret
->
ref
=
0
;
hr
=
IClassFactory_QueryInterface
(
&
ret
->
IClassFactory_iface
,
riid
,
ppv
);
hr
=
IClassFactory_QueryInterface
(
&
ret
->
IClassFactory_iface
,
riid
,
ppv
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
HeapFree
(
GetProcessHeap
(),
0
,
ret
);
free
(
ret
);
return
hr
;
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