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
8f26aaf2
Commit
8f26aaf2
authored
Nov 16, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sapi: Use CRT allocation functions.
parent
0f5fab24
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
33 deletions
+31
-33
async.c
dlls/sapi/async.c
+2
-3
automation.c
dlls/sapi/automation.c
+2
-2
mmaudio.c
dlls/sapi/mmaudio.c
+11
-11
resource.c
dlls/sapi/resource.c
+2
-2
sapi_private.h
dlls/sapi/sapi_private.h
+0
-1
stream.c
dlls/sapi/stream.c
+2
-2
tts.c
dlls/sapi/tts.c
+12
-12
No files found.
dlls/sapi/async.c
View file @
8f26aaf2
...
...
@@ -24,7 +24,6 @@
#include "winbase.h"
#include "objbase.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/debug.h"
...
...
@@ -58,7 +57,7 @@ void async_empty_queue(struct async_queue *queue)
LIST_FOR_EACH_ENTRY_SAFE
(
task
,
next
,
&
queue
->
tasks
,
struct
async_task
,
entry
)
{
list_remove
(
&
task
->
entry
);
heap_
free
(
task
);
free
(
task
);
}
LeaveCriticalSection
(
&
queue
->
cs
);
...
...
@@ -87,7 +86,7 @@ static void CALLBACK async_worker(TP_CALLBACK_INSTANCE *instance, void *ctx)
{
ResetEvent
(
queue
->
empty
);
task
->
proc
(
task
);
heap_
free
(
task
);
free
(
task
);
if
(
WaitForSingleObject
(
queue
->
cancel
,
0
)
==
WAIT_OBJECT_0
)
goto
cancel
;
}
...
...
dlls/sapi/automation.c
View file @
8f26aaf2
...
...
@@ -95,7 +95,7 @@ static ULONG WINAPI file_stream_Release(ISpeechFileStream *iface)
if
(
!
ref
)
{
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -375,7 +375,7 @@ const static ISpStreamVtbl spstream_vtbl =
HRESULT
file_stream_create
(
IUnknown
*
outer
,
REFIID
iid
,
void
**
obj
)
{
struct
file_stream
*
This
=
heap_
alloc
(
sizeof
(
*
This
));
struct
file_stream
*
This
=
m
alloc
(
sizeof
(
*
This
));
HRESULT
hr
;
if
(
!
This
)
return
E_OUTOFMEMORY
;
...
...
dlls/sapi/mmaudio.c
View file @
8f26aaf2
...
...
@@ -381,12 +381,12 @@ static ULONG WINAPI mmsysaudio_Release(ISpMMSysAudio *iface)
async_cancel_queue
(
&
This
->
queue
);
if
(
This
->
token
)
ISpObjectToken_Release
(
This
->
token
);
heap_
free
(
This
->
wfx
);
free
(
This
->
wfx
);
CloseHandle
(
This
->
event
);
DeleteCriticalSection
(
&
This
->
pending_cs
);
DeleteCriticalSection
(
&
This
->
cs
);
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -421,7 +421,7 @@ static HRESULT WINAPI mmsysaudio_Write(ISpMMSysAudio *iface, const void *pv, ULO
return
SP_AUDIO_STOPPED
;
}
if
(
!
(
buf
=
heap_
alloc
(
sizeof
(
WAVEHDR
)
+
cb
)))
if
(
!
(
buf
=
m
alloc
(
sizeof
(
WAVEHDR
)
+
cb
)))
{
LeaveCriticalSection
(
&
This
->
cs
);
return
E_OUTOFMEMORY
;
...
...
@@ -434,7 +434,7 @@ static HRESULT WINAPI mmsysaudio_Write(ISpMMSysAudio *iface, const void *pv, ULO
if
(
waveOutPrepareHeader
(
This
->
hwave
.
out
,
buf
,
sizeof
(
WAVEHDR
))
!=
MMSYSERR_NOERROR
)
{
LeaveCriticalSection
(
&
This
->
cs
);
heap_
free
(
buf
);
free
(
buf
);
return
E_FAIL
;
}
...
...
@@ -562,7 +562,7 @@ static void free_out_buf_proc(struct async_task *task)
TRACE
(
"(%p).
\n
"
,
task
);
waveOutUnprepareHeader
(
fbt
->
audio
->
hwave
.
out
,
fbt
->
buf
,
sizeof
(
WAVEHDR
));
heap_
free
(
fbt
->
buf
);
free
(
fbt
->
buf
);
EnterCriticalSection
(
&
fbt
->
audio
->
pending_cs
);
buf_count
=
--
fbt
->
audio
->
pending_buf_count
;
...
...
@@ -582,7 +582,7 @@ static void CALLBACK wave_out_proc(HWAVEOUT hwo, UINT msg, DWORD_PTR instance, D
switch
(
msg
)
{
case
WOM_DONE
:
if
(
!
(
task
=
heap_
alloc
(
sizeof
(
*
task
))))
if
(
!
(
task
=
m
alloc
(
sizeof
(
*
task
))))
{
ERR
(
"failed to allocate free_buf_task.
\n
"
);
break
;
...
...
@@ -685,13 +685,13 @@ static HRESULT WINAPI mmsysaudio_SetFormat(ISpMMSysAudio *iface, const GUID *gui
return
res
==
WAVERR_BADFORMAT
?
SPERR_UNSUPPORTED_FORMAT
:
SPERR_GENERIC_MMSYS_ERROR
;
}
if
(
!
(
new_wfx
=
heap_
alloc
(
sizeof
(
*
wfx
)
+
wfx
->
cbSize
)))
if
(
!
(
new_wfx
=
m
alloc
(
sizeof
(
*
wfx
)
+
wfx
->
cbSize
)))
{
LeaveCriticalSection
(
&
This
->
cs
);
return
E_OUTOFMEMORY
;
}
memcpy
(
new_wfx
,
wfx
,
sizeof
(
*
wfx
)
+
wfx
->
cbSize
);
heap_
free
(
This
->
wfx
);
free
(
This
->
wfx
);
This
->
wfx
=
new_wfx
;
LeaveCriticalSection
(
&
This
->
cs
);
...
...
@@ -874,7 +874,7 @@ static HRESULT mmaudio_create(IUnknown *outer, REFIID iid, void **obj, enum flow
return
E_NOTIMPL
;
}
if
(
!
(
This
=
heap_alloc_zero
(
sizeof
(
*
This
))))
if
(
!
(
This
=
calloc
(
1
,
sizeof
(
*
This
))))
return
E_OUTOFMEMORY
;
This
->
ISpEventSource_iface
.
lpVtbl
=
&
event_source_vtbl
;
This
->
ISpEventSink_iface
.
lpVtbl
=
&
event_sink_vtbl
;
...
...
@@ -887,9 +887,9 @@ static HRESULT mmaudio_create(IUnknown *outer, REFIID iid, void **obj, enum flow
This
->
device_id
=
WAVE_MAPPER
;
This
->
state
=
SPAS_CLOSED
;
if
(
!
(
This
->
wfx
=
heap_
alloc
(
sizeof
(
*
This
->
wfx
))))
if
(
!
(
This
->
wfx
=
m
alloc
(
sizeof
(
*
This
->
wfx
))))
{
heap_
free
(
This
);
free
(
This
);
return
E_OUTOFMEMORY
;
}
This
->
wfx
->
wFormatTag
=
WAVE_FORMAT_PCM
;
...
...
dlls/sapi/resource.c
View file @
8f26aaf2
...
...
@@ -84,7 +84,7 @@ static ULONG WINAPI resource_manager_Release(ISpResourceManager *iface)
if
(
!
ref
)
{
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -126,7 +126,7 @@ const static ISpResourceManagerVtbl resource_manager_vtbl =
HRESULT
resource_manager_create
(
IUnknown
*
outer
,
REFIID
iid
,
void
**
obj
)
{
struct
resource_manager
*
This
=
heap_
alloc
(
sizeof
(
*
This
));
struct
resource_manager
*
This
=
m
alloc
(
sizeof
(
*
This
));
HRESULT
hr
;
if
(
!
This
)
return
E_OUTOFMEMORY
;
...
...
dlls/sapi/sapi_private.h
View file @
8f26aaf2
...
...
@@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wine/heap.h"
#include "wine/list.h"
struct
async_task
...
...
dlls/sapi/stream.c
View file @
8f26aaf2
...
...
@@ -84,7 +84,7 @@ static ULONG WINAPI spstream_Release(ISpStream *iface)
if
(
!
ref
)
{
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -235,7 +235,7 @@ const static ISpStreamVtbl spstream_vtbl =
HRESULT
speech_stream_create
(
IUnknown
*
outer
,
REFIID
iid
,
void
**
obj
)
{
struct
spstream
*
This
=
heap_
alloc
(
sizeof
(
*
This
));
struct
spstream
*
This
=
m
alloc
(
sizeof
(
*
This
));
HRESULT
hr
;
if
(
!
This
)
return
E_OUTOFMEMORY
;
...
...
dlls/sapi/tts.c
View file @
8f26aaf2
...
...
@@ -166,7 +166,7 @@ static ULONG WINAPI speech_voice_Release(ISpeechVoice *iface)
if
(
This
->
engine
)
ISpTTSEngine_Release
(
This
->
engine
);
DeleteCriticalSection
(
&
This
->
cs
);
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -822,7 +822,7 @@ done:
}
CoTaskMemFree
(
wfx
);
if
(
engine
)
ISpTTSEngine_Release
(
engine
);
heap_
free
(
speak_task
->
frag_list
);
free
(
speak_task
->
frag_list
);
ISpTTSEngineSite_Release
(
speak_task
->
site
);
if
(
speak_task
->
result
)
...
...
@@ -898,7 +898,7 @@ static HRESULT WINAPI spvoice_Speak(ISpVoice *iface, const WCHAR *contents, DWOR
return
hr
;
}
if
(
!
(
frag
=
heap_
alloc
(
sizeof
(
*
frag
)
+
contents_size
)))
if
(
!
(
frag
=
m
alloc
(
sizeof
(
*
frag
)
+
contents_size
)))
return
E_OUTOFMEMORY
;
memset
(
frag
,
0
,
sizeof
(
*
frag
));
memcpy
(
frag
+
1
,
contents
,
contents_size
);
...
...
@@ -915,7 +915,7 @@ static HRESULT WINAPI spvoice_Speak(ISpVoice *iface, const WCHAR *contents, DWOR
goto
fail
;
}
speak_task
=
heap_
alloc
(
sizeof
(
*
speak_task
));
speak_task
=
m
alloc
(
sizeof
(
*
speak_task
));
speak_task
->
task
.
proc
=
speak_proc
;
speak_task
->
result
=
NULL
;
...
...
@@ -926,7 +926,7 @@ static HRESULT WINAPI spvoice_Speak(ISpVoice *iface, const WCHAR *contents, DWOR
if
(
!
(
flags
&
SPF_ASYNC
))
{
if
(
!
(
result
=
heap_
alloc
(
sizeof
(
*
result
))))
if
(
!
(
result
=
m
alloc
(
sizeof
(
*
result
))))
{
hr
=
E_OUTOFMEMORY
;
goto
fail
;
...
...
@@ -952,18 +952,18 @@ static HRESULT WINAPI spvoice_Speak(ISpVoice *iface, const WCHAR *contents, DWOR
WaitForSingleObject
(
result
->
done
,
INFINITE
);
hr
=
result
->
hr
;
CloseHandle
(
result
->
done
);
heap_
free
(
result
);
free
(
result
);
return
hr
;
}
fail:
if
(
site
)
ISpTTSEngineSite_Release
(
site
);
heap_
free
(
frag
);
heap_
free
(
speak_task
);
free
(
frag
);
free
(
speak_task
);
if
(
result
)
{
CloseHandle
(
result
->
done
);
heap_
free
(
result
);
free
(
result
);
}
return
hr
;
}
...
...
@@ -1210,7 +1210,7 @@ static ULONG WINAPI ttsenginesite_Release(ISpTTSEngineSite *iface)
{
if
(
This
->
voice
)
ISpeechVoice_Release
(
&
This
->
voice
->
ISpeechVoice_iface
);
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -1315,7 +1315,7 @@ const static ISpTTSEngineSiteVtbl ttsenginesite_vtbl =
static
HRESULT
ttsenginesite_create
(
struct
speech_voice
*
voice
,
ULONG
stream_num
,
ISpTTSEngineSite
**
site
)
{
struct
tts_engine_site
*
This
=
heap_
alloc
(
sizeof
(
*
This
));
struct
tts_engine_site
*
This
=
m
alloc
(
sizeof
(
*
This
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
...
...
@@ -1387,7 +1387,7 @@ const static IConnectionPointContainerVtbl container_vtbl =
HRESULT
speech_voice_create
(
IUnknown
*
outer
,
REFIID
iid
,
void
**
obj
)
{
struct
speech_voice
*
This
=
heap_
alloc
(
sizeof
(
*
This
));
struct
speech_voice
*
This
=
m
alloc
(
sizeof
(
*
This
));
HRESULT
hr
;
if
(
!
This
)
return
E_OUTOFMEMORY
;
...
...
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