winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
770 discussions
Start a n
N
ew thread
Paul Gofman : server: Send completions for existing job processes when adding completion port.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: de0dc0e8ac664549c64124fa02011b8f096217b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=de0dc0e8ac664549c64124fa…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue May 18 14:36:34 2021 +0300 server: Send completions for existing job processes when adding completion port. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/process.c | 64 +++++++++++++++++++++++++++++++++++++++++-- server/process.c | 21 ++++++++++++++ 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index f170043b5b9..52c3036fe59 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -2786,13 +2786,17 @@ static void test_QueryInformationJobObject(void) static void test_CompletionPort(void) { JOBOBJECT_ASSOCIATE_COMPLETION_PORT port_info; - PROCESS_INFORMATION pi; + PROCESS_INFORMATION pi, pi2; HANDLE job, port; BOOL ret; job = pCreateJobObjectW(NULL, NULL); ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); + create_process("wait", &pi2); + ret = pAssignProcessToJobObject(job, pi2.hProcess); + ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + port = pCreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 1); ok(port != NULL, "CreateIoCompletionPort error %u\n", GetLastError()); @@ -2806,12 +2810,19 @@ static void test_CompletionPort(void) ret = pAssignProcessToJobObject(job, pi.hProcess); ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + test_completion(port, JOB_OBJECT_MSG_NEW_PROCESS, (DWORD_PTR)job, pi2.dwProcessId, 0); test_completion(port, JOB_OBJECT_MSG_NEW_PROCESS, (DWORD_PTR)job, pi.dwProcessId, 0); TerminateProcess(pi.hProcess, 0); wait_child_process(pi.hProcess); test_completion(port, JOB_OBJECT_MSG_EXIT_PROCESS, (DWORD_PTR)job, pi.dwProcessId, 0); + TerminateProcess(pi2.hProcess, 0); + wait_child_process(pi2.hProcess); + CloseHandle(pi2.hProcess); + CloseHandle(pi2.hThread); + + test_completion(port, JOB_OBJECT_MSG_EXIT_PROCESS, (DWORD_PTR)job, pi2.dwProcessId, 0); test_completion(port, JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO, (DWORD_PTR)job, 0, 100); CloseHandle(pi.hProcess); @@ -4350,10 +4361,15 @@ static void test_dead_process(void) static void test_nested_jobs_child(unsigned int index) { - HANDLE job, job_parent, job_other; + JOBOBJECT_ASSOCIATE_COMPLETION_PORT port_info; + HANDLE job, job_parent, job_other, port; PROCESS_INFORMATION pi; + OVERLAPPED *overlapped; char job_name[32]; + ULONG_PTR value; + DWORD dead_pid; BOOL ret, out; + DWORD key; sprintf(job_name, "test_nested_jobs_%u", index); job = pOpenJobObjectA(JOB_OBJECT_ASSIGN_PROCESS | JOB_OBJECT_SET_ATTRIBUTES | JOB_OBJECT_QUERY @@ -4412,6 +4428,20 @@ static void test_nested_jobs_child(unsigned int index) CloseHandle(pi.hProcess); CloseHandle(pi.hThread); + dead_pid = pi.dwProcessId; + + port = pCreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 1); + ok(!!port, "CreateIoCompletionPort error %u\n", GetLastError()); + + port_info.CompletionPort = port; + port_info.CompletionKey = job; + ret = pSetInformationJobObject(job, JobObjectAssociateCompletionPortInformation, &port_info, sizeof(port_info)); + ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + port_info.CompletionKey = job_parent; + ret = pSetInformationJobObject(job_parent, JobObjectAssociateCompletionPortInformation, + &port_info, sizeof(port_info)); + ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + create_process("wait", &pi); out = FALSE; ret = pIsProcessInJob(pi.hProcess, job, &out); @@ -4423,12 +4453,42 @@ static void test_nested_jobs_child(unsigned int index) ok(ret, "IsProcessInJob error %u\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out); + /* The first already dead child process still shows up randomly. */ + do + { + ret = GetQueuedCompletionStatus(port, &key, &value, &overlapped, 0); + } while (ret && (ULONG_PTR)overlapped == dead_pid); + + ok(ret, "GetQueuedCompletionStatus: %x\n", GetLastError()); + ok(key == JOB_OBJECT_MSG_NEW_PROCESS, "unexpected key %x\n", key); + ok((HANDLE)value == job, "unexpected value %p\n", (void *)value); + ok((ULONG_PTR)overlapped == GetCurrentProcessId(), "unexpected pid %#x\n", (DWORD)(DWORD_PTR)overlapped); + + do + { + ret = GetQueuedCompletionStatus(port, &key, &value, &overlapped, 0); + } while (ret && (ULONG_PTR)overlapped == dead_pid); + + ok(ret, "GetQueuedCompletionStatus: %x\n", GetLastError()); + ok(key == JOB_OBJECT_MSG_NEW_PROCESS, "unexpected key %x\n", key); + ok((HANDLE)value == job_parent, "unexpected value %p\n", (void *)value); + ok((ULONG_PTR)overlapped == GetCurrentProcessId(), "unexpected pid %#x\n", (DWORD)(DWORD_PTR)overlapped); + + test_completion(port, JOB_OBJECT_MSG_NEW_PROCESS, (DWORD_PTR)job, pi.dwProcessId, 0); + test_completion(port, JOB_OBJECT_MSG_NEW_PROCESS, (DWORD_PTR)job_parent, pi.dwProcessId, 0); + + ret = GetQueuedCompletionStatus(port, &key, &value, &overlapped, 0); + ok(!ret, "GetQueuedCompletionStatus succeeded.\n"); + if (index) { ret = pAssignProcessToJobObject(job_other, GetCurrentProcess()); ok(!ret, "AssignProcessToJobObject succeded\n"); ok(GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected error %u.\n", GetLastError()); } + + CloseHandle(port); + done: TerminateProcess(pi.hProcess, 0); wait_child_process(pi.hProcess); diff --git a/server/process.c b/server/process.c index 8baccdbad94..32c6fdd269b 100644 --- a/server/process.c +++ b/server/process.c @@ -255,6 +255,25 @@ static void add_job_completion( struct job *job, apc_param_t msg, apc_param_t pi add_completion( job->completion_port, job->completion_key, pid, STATUS_SUCCESS, msg ); } +static void add_job_completion_existing_processes( struct job *job, struct job *completion_job ) +{ + struct process *process; + struct job *j; + + assert( completion_job->obj.ops == &job_ops ); + + LIST_FOR_EACH_ENTRY( j, &job->child_job_list, struct job, parent_job_entry ) + { + add_job_completion_existing_processes( j, completion_job ); + } + + LIST_FOR_EACH_ENTRY( process, &job->process_list, struct process, job_entry ) + { + if (process->running_threads) + add_job_completion( completion_job, JOB_OBJECT_MSG_NEW_PROCESS, get_process_id( process )); + } +} + static int process_in_job( struct job *job, struct process *process ) { struct job *j; @@ -1715,6 +1734,8 @@ DECL_HANDLER(set_job_completion_port) { job->completion_port = get_completion_obj( current->process, req->port, IO_COMPLETION_MODIFY_STATE ); job->completion_key = req->key; + + add_job_completion_existing_processes( job, job ); } else set_error( STATUS_INVALID_PARAMETER );
1
0
0
0
Paul Gofman : server: Support nested jobs.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: 21f5597de417575d476a00b567d972a89903b4b6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=21f5597de417575d476a00b5…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue May 18 14:36:33 2021 +0300 server: Support nested jobs. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/process.c | 180 +++++++++++++++++++++++++++++++++++++++++- server/process.c | 139 +++++++++++++++++++++++--------- 2 files changed, 280 insertions(+), 39 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=21f5597de417575d476a…
1
0
0
0
Dmitry Timoshkov : msxml3/tests: Execute ProcessingInstruction tests before other tests to avoid crashes under 64-bit Windows.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: d7ce5bddf9ba7b5f617ad352e362f278e03d8ee6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d7ce5bddf9ba7b5f617ad352…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon May 17 14:09:18 2021 +0300 msxml3/tests: Execute ProcessingInstruction tests before other tests to avoid crashes under 64-bit Windows. It seems that the ProcessingInstruction tests somehow trigger internal inconsistency in 64-bit msxml under Windows, and I haven't found other ways to stop crashes on exit. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msxml3/tests/domdoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 59a8a243c87..3dcfdb8fd39 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -13610,6 +13610,7 @@ START_TEST(domdoc) return; } + test_createProcessingInstruction(); test_load_with_site(); test_domdoc(); test_persiststream(); @@ -13651,7 +13652,6 @@ START_TEST(domdoc) test_default_properties(); test_selectSingleNode(); test_events(); - test_createProcessingInstruction(); test_put_nodeTypedValue(); test_get_xml(); test_insertBefore();
1
0
0
0
Hans Leidekker : webservices: Return WS_S_END when we receive an end frame.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: a17c5a0bb1d3e4d1e8ebcf0f979873ecb67a9a79 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a17c5a0bb1d3e4d1e8ebcf0f…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed May 19 09:32:14 2021 +0200 webservices: Return WS_S_END when we receive an end frame. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index b920f972de3..b894b0f61ba 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -2050,6 +2050,7 @@ static HRESULT receive_sized_envelope( struct channel *channel ) HRESULT hr; if ((hr = receive_bytes( channel, &type, 1 )) != S_OK) return hr; + if (type == FRAME_RECORD_TYPE_END) return WS_S_END; if (type != FRAME_RECORD_TYPE_SIZED_ENVELOPE) return WS_E_INVALID_FORMAT; if ((hr = receive_size( channel, &size )) != S_OK) return hr; if ((hr = receive_message_sized( channel, size )) != S_OK) return hr;
1
0
0
0
Hans Leidekker : webservices: Add async support in WsWriteMessageEnd.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: bfefd0d2a309aa93c321dc60def164be5e2c4eca URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bfefd0d2a309aa93c321dc60…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed May 19 09:32:13 2021 +0200 webservices: Add async support in WsWriteMessageEnd. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 53 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index 9957592f9f7..b920f972de3 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -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 );
1
0
0
0
Hans Leidekker : webservices: Add async support in WsWriteMessageStart.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: d7f1e5a0c2fb79ff3aba20880aacdc1a1c091c7c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d7f1e5a0c2fb79ff3aba2088…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed May 19 09:32:12 2021 +0200 webservices: Add async support in WsWriteMessageStart. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 57 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index c97a0d49a66..9957592f9f7 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -2652,18 +2652,58 @@ HRESULT WINAPI WsReadMessageEnd( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_A return hr; } +static HRESULT write_message_start( struct channel *channel, WS_MESSAGE *msg ) +{ + HRESULT hr; + if ((hr = init_writer( channel )) != S_OK) return hr; + if ((hr = WsAddressMessage( msg, &channel->addr, NULL )) != S_OK) return hr; + return WsWriteEnvelopeStart( msg, channel->writer, NULL, NULL, NULL ); +} + +struct write_message_start +{ + struct task task; + struct channel *channel; + WS_MESSAGE *msg; + WS_ASYNC_CONTEXT ctx; +}; + +static void write_message_start_proc( struct task *task ) +{ + struct write_message_start *w = (struct write_message_start *)task; + HRESULT hr; + + hr = write_message_start( 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_start( 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_start_proc; + w->channel = channel; + w->msg = msg; + w->ctx = *ctx; + return queue_task( &channel->send_q, &w->task ); +} + /************************************************************************** * WsWriteMessageStart [webservices.@] */ -HRESULT WINAPI WsWriteMessageStart( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_ASYNC_CONTEXT *ctx, - WS_ERROR *error ) +HRESULT WINAPI WsWriteMessageStart( 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; @@ -2680,11 +2720,14 @@ HRESULT WINAPI WsWriteMessageStart( WS_CHANNEL *handle, WS_MESSAGE *msg, const W return WS_E_INVALID_OPERATION; } - if ((hr = init_writer( channel )) != S_OK) goto done; - if ((hr = WsAddressMessage( msg, &channel->addr, NULL )) != S_OK) goto done; - hr = WsWriteEnvelopeStart( msg, channel->writer, NULL, NULL, NULL ); + if (!ctx) async_init( &async, &ctx_local ); + hr = queue_write_message_start( channel, msg, ctx ? ctx : &ctx_local ); + if (!ctx) + { + if (hr == WS_S_ASYNC) hr = async_wait( &async ); + CloseHandle( async.done ); + } -done: LeaveCriticalSection( &channel->cs ); TRACE( "returning %08x\n", hr ); return hr;
1
0
0
0
Hans Leidekker : webservices: Add async support in WsReadMessageEnd.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: 6f1e12e891791f49dc1fea09d2620b01bab61a9b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6f1e12e891791f49dc1fea09…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed May 19 09:32:11 2021 +0200 webservices: Add async support in WsReadMessageEnd. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 49 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index 4df761cd5ea..c97a0d49a66 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -2581,18 +2581,53 @@ HRESULT WINAPI WsReadMessageStart( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS return hr; } +static HRESULT read_message_end( WS_MESSAGE *msg ) +{ + return WsReadEnvelopeEnd( msg, NULL ); +} + +struct read_message_end +{ + struct task task; + WS_MESSAGE *msg; + WS_ASYNC_CONTEXT ctx; +}; + +static void read_message_end_proc( struct task *task ) +{ + struct read_message_end *r = (struct read_message_end *)task; + HRESULT hr; + + hr = read_message_end( 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_end( struct channel *channel, WS_MESSAGE *msg, const WS_ASYNC_CONTEXT *ctx ) +{ + struct read_message_end *r; + + if (!(r = heap_alloc( sizeof(*r) ))) return E_OUTOFMEMORY; + r->task.proc = read_message_end_proc; + r->msg = msg; + r->ctx = *ctx; + return queue_task( &channel->recv_q, &r->task ); +} + /************************************************************************** * WsReadMessageEnd [webservices.@] */ -HRESULT WINAPI WsReadMessageEnd( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_ASYNC_CONTEXT *ctx, - WS_ERROR *error ) +HRESULT WINAPI WsReadMessageEnd( 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; @@ -2604,7 +2639,13 @@ HRESULT WINAPI WsReadMessageEnd( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_A return E_INVALIDARG; } - hr = WsReadEnvelopeEnd( msg, NULL ); + if (!ctx) async_init( &async, &ctx_local ); + hr = queue_read_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 );
1
0
0
0
Hans Leidekker : webservices: Add async support in WsReadMessageStart.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: 48f2cabb6cfbd23f26956b6398a2ee1253d636b8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=48f2cabb6cfbd23f26956b63…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed May 19 09:32:10 2021 +0200 webservices: Add async support in WsReadMessageStart. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 54 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index 430453443d0..4df761cd5ea 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -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 );
1
0
0
0
Hans Leidekker : webservices: Add async support in WsSendReplyMessage.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: bebffaf9e7a83964af4c63c606e35f86cedbc025 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bebffaf9e7a83964af4c63c6…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed May 19 09:32:09 2021 +0200 webservices: Add async support in WsSendReplyMessage. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index 7e576544205..430453443d0 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -1738,12 +1738,13 @@ HRESULT WINAPI WsSendReplyMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS const WS_ASYNC_CONTEXT *ctx, WS_ERROR *error ) { struct channel *channel = (struct channel *)handle; - GUID req_id; + WS_ASYNC_CONTEXT ctx_local; + struct async async; + GUID id; HRESULT hr; TRACE( "%p %p %p %08x %p %u %p %p %p\n", handle, msg, desc, option, body, size, request, ctx, error ); if (error) FIXME( "ignoring error parameter\n" ); - if (ctx) FIXME( "ignoring ctx parameter\n" ); if (!channel || !msg || !desc || !request) return E_INVALIDARG; @@ -1760,15 +1761,16 @@ HRESULT WINAPI WsSendReplyMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS return WS_E_INVALID_OPERATION; } - if ((hr = WsInitializeMessage( msg, WS_REPLY_MESSAGE, NULL, NULL )) != S_OK) goto done; - if ((hr = WsAddressMessage( msg, &channel->addr, NULL )) != S_OK) goto done; - if ((hr = message_set_action( msg, desc->action )) != S_OK) goto done; - if ((hr = message_get_id( request, &req_id )) != S_OK) goto done; - if ((hr = message_set_request_id( msg, &req_id )) != S_OK) goto done; + if ((hr = message_get_id( request, &id )) != S_OK) goto done; + if ((hr = message_set_request_id( msg, &id )) != S_OK) goto done; - if ((hr = init_writer( channel )) != S_OK) goto done; - if ((hr = write_message( channel, msg, desc->bodyElementDescription, option, body, size )) != S_OK) goto done; - hr = send_message_bytes( channel, msg ); + if (!ctx) async_init( &async, &ctx_local ); + hr = queue_send_message( channel, msg, desc, option, body, size, ctx ? ctx : &ctx_local ); + if (!ctx) + { + if (hr == WS_S_ASYNC) hr = async_wait( &async ); + CloseHandle( async.done ); + } done: LeaveCriticalSection( &channel->cs ); @@ -2387,14 +2389,9 @@ static HRESULT request_reply( struct channel *channel, WS_MESSAGE *request, WS_HEAP *heap, void *value, ULONG size ) { HRESULT hr; - WsInitializeMessage( request, WS_REQUEST_MESSAGE, NULL, NULL ); - if ((hr = WsAddressMessage( request, &channel->addr, NULL )) != S_OK) return hr; - if ((hr = message_set_action( request, request_desc->action )) != S_OK) return hr; - if ((hr = init_writer( channel )) != S_OK) return hr; - if ((hr = write_message( channel, request, request_desc->bodyElementDescription, write_option, request_body, - request_size )) != S_OK) return hr; - if ((hr = send_message_bytes( channel, request )) != S_OK) return hr; + if ((hr = send_message( channel, request, request_desc, write_option, request_body, request_size )) != S_OK) + return hr; return receive_message( channel, reply, &reply_desc, 1, WS_RECEIVE_OPTIONAL_MESSAGE, read_option, heap, value, size, NULL );
1
0
0
0
Hans Leidekker : webservices: Add async support in WsSendMessage.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: 927273159169cb97a866099fc00055b099b833f9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=927273159169cb97a866099f…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed May 19 09:32:08 2021 +0200 webservices: Add async support in WsSendMessage. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 85 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 69 insertions(+), 16 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index bc65f0943bf..7e576544205 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -1460,7 +1460,7 @@ static HRESULT open_http_request( struct channel *channel, HINTERNET *req ) return HRESULT_FROM_WIN32( GetLastError() ); } -static HRESULT send_message( struct channel *channel, WS_MESSAGE *msg ) +static HRESULT send_message_bytes( struct channel *channel, WS_MESSAGE *msg ) { WS_XML_WRITER *writer; WS_BYTES buf; @@ -1529,7 +1529,7 @@ HRESULT channel_send_message( WS_CHANNEL *handle, WS_MESSAGE *msg ) return WS_E_INVALID_OPERATION; } - hr = send_message( channel, msg ); + hr = send_message_bytes( channel, msg ); LeaveCriticalSection( &channel->cs ); return hr; @@ -1561,8 +1561,8 @@ static HRESULT CALLBACK dict_cb( void *state, const WS_XML_STRING *str, BOOL *fo return hr; } -static CALLBACK HRESULT write_callback( void *state, const WS_BYTES *buf, ULONG count, - const WS_ASYNC_CONTEXT *ctx, WS_ERROR *error ) +static CALLBACK HRESULT write_callback( void *state, const WS_BYTES *buf, ULONG count, const WS_ASYNC_CONTEXT *ctx, + WS_ERROR *error ) { SOCKET socket = *(SOCKET *)state; if (send( socket, (const char *)buf->bytes, buf->length, 0 ) < 0) @@ -1634,6 +1634,59 @@ static HRESULT write_message( struct channel *channel, WS_MESSAGE *msg, const WS return WsWriteEnvelopeEnd( msg, NULL ); } +static HRESULT send_message( struct channel *channel, WS_MESSAGE *msg, const WS_MESSAGE_DESCRIPTION *desc, + WS_WRITE_OPTION option, const void *body, ULONG size ) +{ + HRESULT hr; + WsInitializeMessage( msg, WS_REQUEST_MESSAGE, NULL, NULL ); + if ((hr = WsAddressMessage( msg, &channel->addr, NULL )) != S_OK) return hr; + if ((hr = message_set_action( msg, desc->action )) != S_OK) return hr; + if ((hr = init_writer( channel )) != S_OK) return hr; + if ((hr = write_message( channel, msg, desc->bodyElementDescription, option, body, size )) != S_OK) return hr; + return send_message_bytes( channel, msg ); +} + +struct send_message +{ + struct task task; + struct channel *channel; + WS_MESSAGE *msg; + const WS_MESSAGE_DESCRIPTION *desc; + WS_WRITE_OPTION option; + const void *body; + ULONG size; + WS_ASYNC_CONTEXT ctx; +}; + +static void send_message_proc( struct task *task ) +{ + struct send_message *s = (struct send_message *)task; + HRESULT hr; + + hr = send_message( s->channel, s->msg, s->desc, s->option, s->body, s->size ); + + TRACE( "calling %p(%08x)\n", s->ctx.callback, hr ); + s->ctx.callback( hr, WS_LONG_CALLBACK, s->ctx.callbackState ); + TRACE( "%p returned\n", s->ctx.callback ); +} + +static HRESULT queue_send_message( struct channel *channel, WS_MESSAGE *msg, const WS_MESSAGE_DESCRIPTION *desc, + WS_WRITE_OPTION option, const void *body, ULONG size, const WS_ASYNC_CONTEXT *ctx ) +{ + struct send_message *s; + + if (!(s = heap_alloc( sizeof(*s) ))) return E_OUTOFMEMORY; + s->task.proc = send_message_proc; + s->channel = channel; + s->msg = msg; + s->desc = desc; + s->option = option; + s->body = body; + s->size = size; + s->ctx = *ctx; + return queue_task( &channel->send_q, &s->task ); +} + /************************************************************************** * WsSendMessage [webservices.@] */ @@ -1642,11 +1695,12 @@ HRESULT WINAPI WsSendMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_MESS WS_ERROR *error ) { struct channel *channel = (struct channel *)handle; + WS_ASYNC_CONTEXT ctx_local; + struct async async; HRESULT hr; TRACE( "%p %p %p %08x %p %u %p %p\n", handle, msg, desc, option, body, size, ctx, error ); if (error) FIXME( "ignoring error parameter\n" ); - if (ctx) FIXME( "ignoring ctx parameter\n" ); if (!channel || !msg || !desc) return E_INVALIDARG; @@ -1663,15 +1717,14 @@ HRESULT WINAPI WsSendMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_MESS return WS_E_INVALID_OPERATION; } - if ((hr = WsInitializeMessage( msg, WS_REQUEST_MESSAGE, NULL, NULL )) != S_OK) goto done; - if ((hr = WsAddressMessage( msg, &channel->addr, NULL )) != S_OK) goto done; - if ((hr = message_set_action( msg, desc->action )) != S_OK) goto done; - - if ((hr = init_writer( channel )) != S_OK) goto done; - if ((hr = write_message( channel, msg, desc->bodyElementDescription, option, body, size )) != S_OK) goto done; - hr = send_message( channel, msg ); + if (!ctx) async_init( &async, &ctx_local ); + hr = queue_send_message( channel, msg, desc, option, body, size, ctx ? ctx : &ctx_local ); + if (!ctx) + { + if (hr == WS_S_ASYNC) hr = async_wait( &async ); + CloseHandle( async.done ); + } -done: LeaveCriticalSection( &channel->cs ); TRACE( "returning %08x\n", hr ); return hr; @@ -1715,7 +1768,7 @@ HRESULT WINAPI WsSendReplyMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS if ((hr = init_writer( channel )) != S_OK) goto done; if ((hr = write_message( channel, msg, desc->bodyElementDescription, option, body, size )) != S_OK) goto done; - hr = send_message( channel, msg ); + hr = send_message_bytes( channel, msg ); done: LeaveCriticalSection( &channel->cs ); @@ -2341,7 +2394,7 @@ static HRESULT request_reply( struct channel *channel, WS_MESSAGE *request, if ((hr = init_writer( channel )) != S_OK) return hr; if ((hr = write_message( channel, request, request_desc->bodyElementDescription, write_option, request_body, request_size )) != S_OK) return hr; - if ((hr = send_message( channel, request )) != S_OK) return hr; + if ((hr = send_message_bytes( channel, request )) != S_OK) return hr; return receive_message( channel, reply, &reply_desc, 1, WS_RECEIVE_OPTIONAL_MESSAGE, read_option, heap, value, size, NULL ); @@ -2585,7 +2638,7 @@ 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( channel, msg ); + if ((hr = WsWriteEnvelopeEnd( msg, NULL )) == S_OK) hr = send_message_bytes( channel, msg ); LeaveCriticalSection( &channel->cs ); TRACE( "returning %08x\n", hr );
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
77
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200