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
51589948
Commit
51589948
authored
Apr 25, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.media.speech: Simplify error handling in async_operation_create.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8992e208
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
async.c
dlls/windows.media.speech/async.c
+5
-15
No files found.
dlls/windows.media.speech/async.c
View file @
51589948
...
@@ -370,16 +370,9 @@ static void CALLBACK async_run_cb(TP_CALLBACK_INSTANCE *instance, void *data, TP
...
@@ -370,16 +370,9 @@ static void CALLBACK async_run_cb(TP_CALLBACK_INSTANCE *instance, void *data, TP
HRESULT
async_operation_create
(
const
GUID
*
iid
,
IInspectable
*
invoker
,
async_operation_callback
callback
,
IAsyncOperation_IInspectable
**
out
)
HRESULT
async_operation_create
(
const
GUID
*
iid
,
IInspectable
*
invoker
,
async_operation_callback
callback
,
IAsyncOperation_IInspectable
**
out
)
{
{
struct
async_operation
*
impl
;
struct
async_operation
*
impl
;
HRESULT
hr
;
*
out
=
NULL
;
*
out
=
NULL
;
if
(
!
(
impl
=
calloc
(
1
,
sizeof
(
*
impl
))))
return
E_OUTOFMEMORY
;
if
(
!
(
impl
=
calloc
(
1
,
sizeof
(
*
impl
))))
{
hr
=
E_OUTOFMEMORY
;
goto
error
;
}
impl
->
IAsyncOperation_IInspectable_iface
.
lpVtbl
=
&
async_operation_vtbl
;
impl
->
IAsyncOperation_IInspectable_iface
.
lpVtbl
=
&
async_operation_vtbl
;
impl
->
IAsyncInfo_iface
.
lpVtbl
=
&
async_operation_info_vtbl
;
impl
->
IAsyncInfo_iface
.
lpVtbl
=
&
async_operation_info_vtbl
;
impl
->
iid
=
iid
;
impl
->
iid
=
iid
;
...
@@ -389,11 +382,10 @@ HRESULT async_operation_create( const GUID *iid, IInspectable *invoker, async_op
...
@@ -389,11 +382,10 @@ HRESULT async_operation_create( const GUID *iid, IInspectable *invoker, async_op
impl
->
callback
=
callback
;
impl
->
callback
=
callback
;
impl
->
status
=
Started
;
impl
->
status
=
Started
;
IAsyncOperation_IInspectable_AddRef
(
&
impl
->
IAsyncOperation_IInspectable_iface
);
/* AddRef to keep the obj alive in the callback. */
if
(
!
(
impl
->
async_run_work
=
CreateThreadpoolWork
(
async_run_cb
,
&
impl
->
IAsyncOperation_IInspectable_iface
,
NULL
)))
if
(
!
(
impl
->
async_run_work
=
CreateThreadpoolWork
(
async_run_cb
,
&
impl
->
IAsyncOperation_IInspectable_iface
,
NULL
)))
{
{
hr
=
HRESULT_FROM_WIN32
(
GetLastError
()
);
free
(
impl
);
goto
error
;
return
HRESULT_FROM_WIN32
(
GetLastError
())
;
}
}
if
(
invoker
)
IInspectable_AddRef
((
impl
->
invoker
=
invoker
));
if
(
invoker
)
IInspectable_AddRef
((
impl
->
invoker
=
invoker
));
...
@@ -401,13 +393,11 @@ HRESULT async_operation_create( const GUID *iid, IInspectable *invoker, async_op
...
@@ -401,13 +393,11 @@ HRESULT async_operation_create( const GUID *iid, IInspectable *invoker, async_op
InitializeCriticalSection
(
&
impl
->
cs
);
InitializeCriticalSection
(
&
impl
->
cs
);
impl
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": async_operation.cs"
);
impl
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": async_operation.cs"
);
/* AddRef to keep the obj alive in the callback. */
IAsyncOperation_IInspectable_AddRef
(
&
impl
->
IAsyncOperation_IInspectable_iface
);
SubmitThreadpoolWork
(
impl
->
async_run_work
);
SubmitThreadpoolWork
(
impl
->
async_run_work
);
*
out
=
&
impl
->
IAsyncOperation_IInspectable_iface
;
*
out
=
&
impl
->
IAsyncOperation_IInspectable_iface
;
TRACE
(
"created %p
\n
"
,
*
out
);
TRACE
(
"created %p
\n
"
,
*
out
);
return
S_OK
;
return
S_OK
;
error:
free
(
impl
);
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