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
48f2cabb
Commit
48f2cabb
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 WsReadMessageStart.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bebffaf9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
6 deletions
+48
-6
channel.c
dlls/webservices/channel.c
+48
-6
No files found.
dlls/webservices/channel.c
View file @
48f2cabb
...
...
@@ -2500,18 +2500,58 @@ HRESULT WINAPI WsRequestReply( WS_CHANNEL *handle, WS_MESSAGE *request, const WS
return
hr
;
}
static
HRESULT
read_message_start
(
struct
channel
*
channel
,
WS_MESSAGE
*
msg
)
{
HRESULT
hr
;
if
((
hr
=
receive_message_bytes
(
channel
,
msg
))
==
S_OK
&&
(
hr
=
init_reader
(
channel
))
==
S_OK
)
hr
=
WsReadEnvelopeStart
(
msg
,
channel
->
reader
,
NULL
,
NULL
,
NULL
);
return
hr
;
}
struct
read_message_start
{
struct
task
task
;
struct
channel
*
channel
;
WS_MESSAGE
*
msg
;
WS_ASYNC_CONTEXT
ctx
;
};
static
void
read_message_start_proc
(
struct
task
*
task
)
{
struct
read_message_start
*
r
=
(
struct
read_message_start
*
)
task
;
HRESULT
hr
;
hr
=
read_message_start
(
r
->
channel
,
r
->
msg
);
TRACE
(
"calling %p(%08x)
\n
"
,
r
->
ctx
.
callback
,
hr
);
r
->
ctx
.
callback
(
hr
,
WS_LONG_CALLBACK
,
r
->
ctx
.
callbackState
);
TRACE
(
"%p returned
\n
"
,
r
->
ctx
.
callback
);
}
static
HRESULT
queue_read_message_start
(
struct
channel
*
channel
,
WS_MESSAGE
*
msg
,
const
WS_ASYNC_CONTEXT
*
ctx
)
{
struct
read_message_start
*
r
;
if
(
!
(
r
=
heap_alloc
(
sizeof
(
*
r
)
)))
return
E_OUTOFMEMORY
;
r
->
task
.
proc
=
read_message_start_proc
;
r
->
channel
=
channel
;
r
->
msg
=
msg
;
r
->
ctx
=
*
ctx
;
return
queue_task
(
&
channel
->
recv_q
,
&
r
->
task
);
}
/**************************************************************************
* WsReadMessageStart [webservices.@]
*/
HRESULT
WINAPI
WsReadMessageStart
(
WS_CHANNEL
*
handle
,
WS_MESSAGE
*
msg
,
const
WS_ASYNC_CONTEXT
*
ctx
,
WS_ERROR
*
error
)
HRESULT
WINAPI
WsReadMessageStart
(
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
;
...
...
@@ -2528,10 +2568,12 @@ HRESULT WINAPI WsReadMessageStart( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS
return
WS_E_INVALID_OPERATION
;
}
if
((
hr
=
receive_message_bytes
(
channel
,
msg
))
==
S_OK
)
if
(
!
ctx
)
async_init
(
&
async
,
&
ctx_local
);
hr
=
queue_read_message_start
(
channel
,
msg
,
ctx
?
ctx
:
&
ctx_local
);
if
(
!
ctx
)
{
if
(
(
hr
=
init_reader
(
channel
))
==
S_OK
)
hr
=
WsReadEnvelopeStart
(
msg
,
channel
->
reader
,
NULL
,
NULL
,
NULL
);
if
(
hr
==
WS_S_ASYNC
)
hr
=
async_wait
(
&
async
);
CloseHandle
(
async
.
done
);
}
LeaveCriticalSection
(
&
channel
->
cs
);
...
...
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