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
bfefd0d2
Commit
bfefd0d2
authored
May 19, 2021
by
Hans Leidekker
Committed by
Alexandre Julliard
May 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Add async support in WsWriteMessageEnd.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d7f1e5a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
4 deletions
+49
-4
channel.c
dlls/webservices/channel.c
+49
-4
No files found.
dlls/webservices/channel.c
View file @
bfefd0d2
...
...
@@ -2733,18 +2733,57 @@ HRESULT WINAPI WsWriteMessageStart( WS_CHANNEL *handle, WS_MESSAGE *msg, const W
return
hr
;
}
static
HRESULT
write_message_end
(
struct
channel
*
channel
,
WS_MESSAGE
*
msg
)
{
HRESULT
hr
;
if
((
hr
=
WsWriteEnvelopeEnd
(
msg
,
NULL
))
==
S_OK
)
hr
=
send_message_bytes
(
channel
,
msg
);
return
hr
;
}
struct
write_message_end
{
struct
task
task
;
struct
channel
*
channel
;
WS_MESSAGE
*
msg
;
WS_ASYNC_CONTEXT
ctx
;
};
static
void
write_message_end_proc
(
struct
task
*
task
)
{
struct
write_message_end
*
w
=
(
struct
write_message_end
*
)
task
;
HRESULT
hr
;
hr
=
write_message_end
(
w
->
channel
,
w
->
msg
);
TRACE
(
"calling %p(%08x)
\n
"
,
w
->
ctx
.
callback
,
hr
);
w
->
ctx
.
callback
(
hr
,
WS_LONG_CALLBACK
,
w
->
ctx
.
callbackState
);
TRACE
(
"%p returned
\n
"
,
w
->
ctx
.
callback
);
}
static
HRESULT
queue_write_message_end
(
struct
channel
*
channel
,
WS_MESSAGE
*
msg
,
const
WS_ASYNC_CONTEXT
*
ctx
)
{
struct
write_message_start
*
w
;
if
(
!
(
w
=
heap_alloc
(
sizeof
(
*
w
)
)))
return
E_OUTOFMEMORY
;
w
->
task
.
proc
=
write_message_end_proc
;
w
->
channel
=
channel
;
w
->
msg
=
msg
;
w
->
ctx
=
*
ctx
;
return
queue_task
(
&
channel
->
send_q
,
&
w
->
task
);
}
/**************************************************************************
* WsWriteMessageEnd [webservices.@]
*/
HRESULT
WINAPI
WsWriteMessageEnd
(
WS_CHANNEL
*
handle
,
WS_MESSAGE
*
msg
,
const
WS_ASYNC_CONTEXT
*
ctx
,
WS_ERROR
*
error
)
HRESULT
WINAPI
WsWriteMessageEnd
(
WS_CHANNEL
*
handle
,
WS_MESSAGE
*
msg
,
const
WS_ASYNC_CONTEXT
*
ctx
,
WS_ERROR
*
error
)
{
struct
channel
*
channel
=
(
struct
channel
*
)
handle
;
WS_ASYNC_CONTEXT
ctx_local
;
struct
async
async
;
HRESULT
hr
;
TRACE
(
"%p %p %p %p
\n
"
,
handle
,
msg
,
ctx
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
ctx
)
FIXME
(
"ignoring ctx parameter
\n
"
);
if
(
!
channel
||
!
msg
)
return
E_INVALIDARG
;
...
...
@@ -2761,7 +2800,13 @@ HRESULT WINAPI WsWriteMessageEnd( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_
return
WS_E_INVALID_OPERATION
;
}
if
((
hr
=
WsWriteEnvelopeEnd
(
msg
,
NULL
))
==
S_OK
)
hr
=
send_message_bytes
(
channel
,
msg
);
if
(
!
ctx
)
async_init
(
&
async
,
&
ctx_local
);
hr
=
queue_write_message_end
(
channel
,
msg
,
ctx
?
ctx
:
&
ctx_local
);
if
(
!
ctx
)
{
if
(
hr
==
WS_S_ASYNC
)
hr
=
async_wait
(
&
async
);
CloseHandle
(
async
.
done
);
}
LeaveCriticalSection
(
&
channel
->
cs
);
TRACE
(
"returning %08x
\n
"
,
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