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
Hans Leidekker : webservices: Add async support in WsShutdownSessionChannel.
by Alexandre Julliard
18 May '21
18 May '21
Module: wine Branch: master Commit: 6bc9748a6fc1b1a0278e1808cb18897f9230a6bc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6bc9748a6fc1b1a0278e1808…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue May 18 17:19:43 2021 +0200 webservices: Add async support in WsShutdownSessionChannel. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index 76b0c1a96e2..539a7813605 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -820,14 +820,45 @@ static HRESULT shutdown_session( struct channel *channel ) } } +struct shutdown_session +{ + struct task task; + struct channel *channel; + WS_ASYNC_CONTEXT ctx; +}; + +static void shutdown_session_proc( struct task *task ) +{ + struct shutdown_session *s = (struct shutdown_session *)task; + HRESULT hr; + + hr = shutdown_session( s->channel ); + + 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_shutdown_session( struct channel *channel, const WS_ASYNC_CONTEXT *ctx ) +{ + struct shutdown_session *s; + + if (!(s = heap_alloc( sizeof(*s) ))) return E_OUTOFMEMORY; + s->task.proc = shutdown_session_proc; + s->channel = channel; + s->ctx = *ctx; + return queue_task( &channel->send_q, &s->task ); +} + HRESULT WINAPI WsShutdownSessionChannel( WS_CHANNEL *handle, 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\n", handle, ctx, error ); if (error) FIXME( "ignoring error parameter\n" ); - if (ctx) FIXME( "ignoring ctx parameter\n" ); if (!channel) return E_INVALIDARG; @@ -844,7 +875,13 @@ HRESULT WINAPI WsShutdownSessionChannel( WS_CHANNEL *handle, const WS_ASYNC_CONT return WS_E_INVALID_OPERATION; } - hr = shutdown_session( channel ); + if (!ctx) async_init( &async, &ctx_local ); + hr = queue_shutdown_session( channel, 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: Always queue an async in WsReceiveMessage and WsRequestReply.
by Alexandre Julliard
18 May '21
18 May '21
Module: wine Branch: master Commit: 96d2c61aa6630a20ba76dd7c624372c19aeb8fb0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=96d2c61aa6630a20ba76dd7c…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue May 18 17:19:42 2021 +0200 webservices: Always queue an async in WsReceiveMessage and WsRequestReply. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 58 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index 69ceb2f051e..76b0c1a96e2 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -771,6 +771,34 @@ static HRESULT send_byte( SOCKET socket, BYTE byte ) return S_OK; } +struct async +{ + HRESULT hr; + HANDLE done; +}; + +static void CALLBACK async_callback( HRESULT hr, WS_CALLBACK_MODEL model, void *state ) +{ + struct async *async = state; + async->hr = hr; + SetEvent( async->done ); +} + +static void async_init( struct async *async, WS_ASYNC_CONTEXT *ctx ) +{ + async->done = CreateEventW( NULL, FALSE, FALSE, NULL ); + async->hr = E_FAIL; + ctx->callback = async_callback; + ctx->callbackState = async; +} + +static HRESULT async_wait( struct async *async ) +{ + DWORD err; + if ((err = WaitForSingleObject( async->done, INFINITE )) == WAIT_OBJECT_0) return async->hr; + return HRESULT_FROM_WIN32( err ); +} + static HRESULT shutdown_session( struct channel *channel ) { HRESULT hr; @@ -2154,6 +2182,8 @@ HRESULT WINAPI WsReceiveMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_M void *value, ULONG size, ULONG *index, 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 %u %08x %08x %p %p %u %p %p %p\n", handle, msg, desc, count, option, read_option, heap, @@ -2170,10 +2200,14 @@ HRESULT WINAPI WsReceiveMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_M return E_INVALIDARG; } - if (ctx) - hr = queue_receive_message( channel, msg, desc, count, option, read_option, heap, value, size, index, ctx ); - else - hr = receive_message( channel, msg, desc, count, option, read_option, heap, value, size, index ); + if (!ctx) async_init( &async, &ctx_local ); + hr = queue_receive_message( channel, msg, desc, count, option, read_option, heap, value, size, index, + 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 ); @@ -2266,6 +2300,8 @@ HRESULT WINAPI WsRequestReply( WS_CHANNEL *handle, WS_MESSAGE *request, const WS WS_HEAP *heap, void *value, ULONG size, 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 %08x %p %u %p %p %08x %p %p %u %p %p\n", handle, request, request_desc, write_option, @@ -2287,12 +2323,14 @@ HRESULT WINAPI WsRequestReply( WS_CHANNEL *handle, WS_MESSAGE *request, const WS return WS_E_INVALID_OPERATION; } - if (ctx) - hr = queue_request_reply( channel, request, request_desc, write_option, request_body, request_size, reply, - reply_desc, read_option, heap, value, size, ctx ); - else - hr = request_reply( channel, request, request_desc, write_option, request_body, request_size, reply, - reply_desc, read_option, heap, value, size ); + if (!ctx) async_init( &async, &ctx_local ); + hr = queue_request_reply( channel, request, request_desc, write_option, request_body, request_size, reply, + reply_desc, read_option, heap, value, size, 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: Implement WsAbortChannel.
by Alexandre Julliard
18 May '21
18 May '21
Module: wine Branch: master Commit: 180edff83adad627c29930c8e1f4ede20ff9dbdc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=180edff83adad627c29930c8…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue May 18 17:19:41 2021 +0200 webservices: Implement WsAbortChannel. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index fb9f5b3162c..69ceb2f051e 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -290,10 +290,37 @@ static void clear_queue( struct queue *queue ) queue->ready = NULL; } -static void reset_channel( struct channel *channel ) +static void abort_channel( struct channel *channel ) { clear_queue( &channel->send_q ); clear_queue( &channel->recv_q ); +} + +/************************************************************************** + * WsAbortChannel [webservices.@] + */ +HRESULT WINAPI WsAbortChannel( WS_CHANNEL *handle, WS_ERROR *error ) +{ + struct channel *channel = (struct channel *)handle; + + TRACE( "%p %p\n", handle, error ); + + EnterCriticalSection( &channel->cs ); + + if (channel->magic != CHANNEL_MAGIC) + { + LeaveCriticalSection( &channel->cs ); + return E_INVALIDARG; + } + + abort_channel( channel ); + + LeaveCriticalSection( &channel->cs ); + return S_OK; +} + +static void reset_channel( struct channel *channel ) +{ channel->state = WS_CHANNEL_STATE_CREATED; channel->session_state = SESSION_STATE_UNINITIALIZED; clear_addr( &channel->addr ); @@ -352,6 +379,7 @@ static void free_props( struct channel *channel ) static void free_channel( struct channel *channel ) { + abort_channel( channel ); reset_channel( channel ); WsFreeWriter( channel->writer ); @@ -631,7 +659,10 @@ HRESULT WINAPI WsResetChannel( WS_CHANNEL *handle, WS_ERROR *error ) if (channel->state != WS_CHANNEL_STATE_CREATED && channel->state != WS_CHANNEL_STATE_CLOSED) hr = WS_E_INVALID_OPERATION; else + { + abort_channel( channel ); reset_channel( channel ); + } LeaveCriticalSection( &channel->cs ); TRACE( "returning %08x\n", hr ); @@ -2521,12 +2552,3 @@ HRESULT channel_accept_udp( SOCKET socket, HANDLE wait, HANDLE cancel, WS_CHANNE LeaveCriticalSection( &channel->cs ); return hr; } - -/************************************************************************** - * WsAbortChannel [webservices.@] - */ -HRESULT WINAPI WsAbortChannel( WS_CHANNEL *handle, WS_ERROR *error ) -{ - FIXME( "%p %p: stub!\n", handle, error ); - return E_NOTIMPL; -}
1
0
0
0
Alexandre Julliard : kernelbase: Fix PEB address for Wow64.
by Alexandre Julliard
18 May '21
18 May '21
Module: wine Branch: master Commit: ea767728c679f2d0e3ab5fc7e9f20cff2a7434a0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ea767728c679f2d0e3ab5fc7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 18 21:20:27 2021 +0200 kernelbase: Fix PEB address for Wow64. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51151
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/debug.c | 2 +- dlls/psapi/tests/psapi_main.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c index 5d83e692222..207c04da50c 100644 --- a/dlls/kernelbase/debug.c +++ b/dlls/kernelbase/debug.c @@ -782,7 +782,7 @@ static BOOL init_module_iterator( struct module_iterator *iter, HANDLE process ) DWORD ldr_data32, first_module; PEB32 *peb32; - peb32 = (PEB32 *)(DWORD_PTR)pbi.PebBaseAddress; + peb32 = (PEB32 *)((char *)pbi.PebBaseAddress + 0x1000); if (!ReadProcessMemory( process, &peb32->LdrData, &ldr_data32, sizeof(ldr_data32), NULL )) return FALSE; ldr_data32_ptr = (PEB_LDR_DATA32 *)(DWORD_PTR) ldr_data32; diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c index 8f94e0b5798..2b263d0acff 100644 --- a/dlls/psapi/tests/psapi_main.c +++ b/dlls/psapi/tests/psapi_main.c @@ -161,7 +161,6 @@ static void test_EnumProcessModules(void) ret = GetModuleFileNameExA(pi.hProcess, hMod, name, sizeof(name)); ok(ret, "got error %u\n", GetLastError()); -todo_wine ok(!strcmp(name, buffer), "got %s\n", name); ret = GetModuleInformation(pi.hProcess, hMod, &info, sizeof(info));
1
0
0
0
Alexandre Julliard : ntdll: Add platform-specific helpers for getting/setting the Wow64 context.
by Alexandre Julliard
18 May '21
18 May '21
Module: wine Branch: master Commit: e8a1341f5c1cc1c0116f1aaef3b49baeb33a83f7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e8a1341f5c1cc1c0116f1aae…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 18 11:58:40 2021 +0200 ntdll: Add platform-specific helpers for getting/setting the Wow64 context. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_arm.c | 18 ++++++++++++++++++ dlls/ntdll/unix/signal_arm64.c | 36 ++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/signal_i386.c | 18 ++++++++++++++++++ dlls/ntdll/unix/signal_x86_64.c | 25 +++++++++++++++++++++++++ dlls/ntdll/unix/thread.c | 26 ++------------------------ dlls/ntdll/unix/unix_private.h | 2 ++ 6 files changed, 101 insertions(+), 24 deletions(-) diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index f8c118c116d..c0cf53d503f 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -411,6 +411,24 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) } +/*********************************************************************** + * set_thread_wow64_context + */ +NTSTATUS set_thread_wow64_context( HANDLE handle, const void *ctx, ULONG size ) +{ + return STATUS_INVALID_INFO_CLASS; +} + + +/*********************************************************************** + * get_thread_wow64_context + */ +NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size ) +{ + return STATUS_INVALID_INFO_CLASS; +} + + /*********************************************************************** * setup_exception * diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index 28d7c1df8b3..a685b072431 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -481,6 +481,42 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) } +/*********************************************************************** + * set_thread_wow64_context + */ +NTSTATUS set_thread_wow64_context( HANDLE handle, const void *ctx, ULONG size ) +{ + BOOL self; + USHORT machine; + + switch (size) + { + case sizeof(I386_CONTEXT): machine = IMAGE_FILE_MACHINE_I386; break; + case sizeof(ARM_CONTEXT): machine = IMAGE_FILE_MACHINE_ARMNT; break; + default: return STATUS_INFO_LENGTH_MISMATCH; + } + return set_thread_context( handle, ctx, &self, machine ); +} + + +/*********************************************************************** + * get_thread_wow64_context + */ +NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size ) +{ + BOOL self; + USHORT machine; + + switch (size) + { + case sizeof(I386_CONTEXT): machine = IMAGE_FILE_MACHINE_I386; break; + case sizeof(ARM_CONTEXT): machine = IMAGE_FILE_MACHINE_ARMNT; break; + default: return STATUS_INFO_LENGTH_MISMATCH; + } + return get_thread_context( handle, ctx, &self, machine ); +} + + /* Note, unwind_builtin_dll above has hardcoded assumptions on how this * function stores things on the stack; if modified, modify that one in * sync as well. */ diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 3c7b07e0707..da635c0f516 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1255,6 +1255,24 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) } +/*********************************************************************** + * set_thread_wow64_context + */ +NTSTATUS set_thread_wow64_context( HANDLE handle, const void *ctx, ULONG size ) +{ + return STATUS_INVALID_INFO_CLASS; +} + + +/*********************************************************************** + * get_thread_wow64_context + */ +NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size ) +{ + return STATUS_INVALID_INFO_CLASS; +} + + /*********************************************************************** * is_privileged_instr * diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index d79ddf7d250..b2cda5eef13 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -1849,6 +1849,31 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) return STATUS_SUCCESS; } + +/*********************************************************************** + * set_thread_wow64_context + */ +NTSTATUS set_thread_wow64_context( HANDLE handle, const void *ctx, ULONG size ) +{ + BOOL self; + + if (size != sizeof(I386_CONTEXT)) return STATUS_INFO_LENGTH_MISMATCH; + return set_thread_context( handle, ctx, &self, IMAGE_FILE_MACHINE_I386 ); +} + + +/*********************************************************************** + * get_thread_wow64_context + */ +NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size ) +{ + BOOL self; + + if (size != sizeof(I386_CONTEXT)) return STATUS_INFO_LENGTH_MISMATCH; + return get_thread_context( handle, ctx, &self, IMAGE_FILE_MACHINE_I386 ); +} + + extern void CDECL raise_func_trampoline( void *dispatcher ); __ASM_GLOBAL_FUNC( raise_func_trampoline, diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index d8fd0767da8..624dff0e5f1 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -1665,19 +1665,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, } case ThreadWow64Context: - { -#ifdef _WIN64 - BOOL self; - WOW64_CONTEXT *context = data; - - if (length != sizeof(*context)) return STATUS_INFO_LENGTH_MISMATCH; - if ((status = get_thread_context( handle, context, &self, IMAGE_FILE_MACHINE_I386 ))) return status; - if (ret_len && !status) *ret_len = sizeof(*context); - return status; -#else - return STATUS_INVALID_INFO_CLASS; -#endif - } + return get_thread_wow64_context( handle, data, length ); case ThreadHideFromDebugger: if (length != sizeof(BOOLEAN)) return STATUS_INFO_LENGTH_MISMATCH; @@ -1860,17 +1848,7 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class, } case ThreadWow64Context: - { -#ifdef _WIN64 - BOOL self; - const WOW64_CONTEXT *context = data; - - if (length != sizeof(*context)) return STATUS_INFO_LENGTH_MISMATCH; - return set_thread_context( handle, context, &self, IMAGE_FILE_MACHINE_I386 ); -#else - return STATUS_INVALID_INFO_CLASS; -#endif - } + return set_thread_wow64_context( handle, data, length ); case ThreadEnableAlignmentFaultFixup: if (length != sizeof(BOOLEAN)) return STATUS_INFO_LENGTH_MISMATCH; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 41df2d431a3..bd00d4e9d42 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -236,6 +236,8 @@ extern void DECLSPEC_NORETURN signal_start_thread( PRTL_THREAD_START_ROUTINE ent extern void DECLSPEC_NORETURN signal_exit_thread( int status, void (*func)(int) ) DECLSPEC_HIDDEN; extern void __wine_syscall_dispatcher(void) DECLSPEC_HIDDEN; extern void signal_restore_full_cpu_context(void) DECLSPEC_HIDDEN; +extern NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size ) DECLSPEC_HIDDEN; +extern NTSTATUS set_thread_wow64_context( HANDLE handle, const void *ctx, ULONG size ) DECLSPEC_HIDDEN; extern void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid ) DECLSPEC_HIDDEN; extern NTSTATUS open_hkcu_key( const char *path, HANDLE *key ) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : ntdll: Export RtlWow64Get/SetThreadContext() on all 64-bit platforms.
by Alexandre Julliard
18 May '21
18 May '21
Module: wine Branch: master Commit: ee0b909f878ae56cd24025336ba9f6e7ef445697 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ee0b909f878ae56cd2402533…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 18 10:24:28 2021 +0200 ntdll: Export RtlWow64Get/SetThreadContext() on all 64-bit platforms. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 4 ++-- dlls/ntdll/process.c | 18 ++++++++++++++++++ dlls/ntdll/signal_x86_64.c | 18 ------------------ dlls/ntdll/unix/thread.c | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 06ca3d3957c..f05e9c39a88 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1073,9 +1073,9 @@ @ stdcall -arch=win64 RtlWow64GetCpuAreaInfo(ptr long ptr) @ stdcall RtlWow64GetCurrentMachine() @ stdcall RtlWow64GetProcessMachines(long ptr ptr) -@ stdcall -arch=x86_64 RtlWow64GetThreadContext(long ptr) +@ stdcall -arch=win64 RtlWow64GetThreadContext(long ptr) @ stdcall RtlWow64IsWowGuestMachineSupported(long ptr) -@ stdcall -arch=x86_64 RtlWow64SetThreadContext(long ptr) +@ stdcall -arch=win64 RtlWow64SetThreadContext(long ptr) @ stub RtlWriteMemoryStream @ stdcall RtlWriteRegistryValue(long ptr ptr long ptr long) @ stub RtlZeroHeap diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index 82b1b69c4ea..3ed31e22100 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -142,6 +142,24 @@ NTSTATUS WINAPI RtlWow64GetCpuAreaInfo( WOW64_CPURESERVED *cpu, ULONG reserved, return STATUS_INVALID_PARAMETER; } + +/****************************************************************************** + * RtlWow64GetThreadContext (NTDLL.@) + */ +NTSTATUS WINAPI RtlWow64GetThreadContext( HANDLE handle, WOW64_CONTEXT *context ) +{ + return NtQueryInformationThread( handle, ThreadWow64Context, context, sizeof(*context), NULL ); +} + + +/****************************************************************************** + * RtlWow64SetThreadContext (NTDLL.@) + */ +NTSTATUS WINAPI RtlWow64SetThreadContext( HANDLE handle, const WOW64_CONTEXT *context ) +{ + return NtSetInformationThread( handle, ThreadWow64Context, context, sizeof(*context) ); +} + #endif /********************************************************************** diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 0396433cb32..55975093174 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -343,24 +343,6 @@ __ASM_GLOBAL_FUNC( RtlCaptureContext, "fxsave 0x100(%rcx)\n\t" /* context->FltSave */ "ret" ); -/****************************************************************************** - * RtlWow64GetThreadContext (NTDLL.@) - */ -NTSTATUS WINAPI RtlWow64GetThreadContext( HANDLE handle, WOW64_CONTEXT *context ) -{ - return NtQueryInformationThread( handle, ThreadWow64Context, context, sizeof(*context), NULL ); -} - - -/****************************************************************************** - * RtlWow64SetThreadContext (NTDLL.@) - */ -NTSTATUS WINAPI RtlWow64SetThreadContext( HANDLE handle, const WOW64_CONTEXT *context ) -{ - return NtSetInformationThread( handle, ThreadWow64Context, context, sizeof(*context) ); -} - - static DWORD __cdecl nested_exception_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame, CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher ) { diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 639031059c6..d8fd0767da8 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -1666,7 +1666,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, case ThreadWow64Context: { -#ifdef __x86_64__ +#ifdef _WIN64 BOOL self; WOW64_CONTEXT *context = data; @@ -1861,7 +1861,7 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class, case ThreadWow64Context: { -#ifdef __x86_64__ +#ifdef _WIN64 BOOL self; const WOW64_CONTEXT *context = data;
1
0
0
0
Alexandre Julliard : ntdll: Pass a server context to server_select().
by Alexandre Julliard
18 May '21
18 May '21
Module: wine Branch: master Commit: 8eda3fcc68f281c05518ec1b17522aaf6fcf7d11 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8eda3fcc68f281c05518ec1b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 18 16:20:08 2021 +0200 ntdll: Pass a server context to server_select(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/server.c | 27 ++++----------------------- dlls/ntdll/unix/thread.c | 29 ++++++++++------------------- dlls/ntdll/unix/unix_private.h | 4 +--- 3 files changed, 15 insertions(+), 45 deletions(-) diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index d77a476f7a6..d153fdce0be 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -620,24 +620,18 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO * server_select */ unsigned int server_select( const select_op_t *select_op, data_size_t size, UINT flags, - timeout_t abs_timeout, CONTEXT *context, pthread_mutex_t *mutex, + timeout_t abs_timeout, context_t *context, pthread_mutex_t *mutex, user_apc_t *user_apc ) { unsigned int ret; int cookie; obj_handle_t apc_handle = 0; - context_t server_context; - BOOL suspend_context = FALSE; + BOOL suspend_context = !!context; apc_call_t call; apc_result_t result; sigset_t old_set; memset( &result, 0, sizeof(result) ); - if (context) - { - suspend_context = TRUE; - context_to_server( &server_context, context, current_machine ); - } do { @@ -655,26 +649,13 @@ unsigned int server_select( const select_op_t *select_op, data_size_t size, UINT wine_server_add_data( req, select_op, size ); if (suspend_context) { - wine_server_add_data( req, &server_context, sizeof(server_context) ); + wine_server_add_data( req, context, sizeof(*context) ); suspend_context = FALSE; /* server owns the context now */ } - if (context) wine_server_set_reply( req, &server_context, sizeof(server_context) ); + if (context) wine_server_set_reply( req, context, sizeof(*context) ); ret = server_call_unlocked( req ); apc_handle = reply->apc_handle; call = reply->call; - if (wine_server_reply_size( reply )) - { - DWORD context_flags = context->ContextFlags; /* unchanged registers are still available */ - XSTATE *xs = xstate_from_context( context ); - ULONG64 mask; - - if (xs) - mask = xs->Mask; - context_from_server( context, &server_context, current_machine ); - context->ContextFlags |= context_flags; - if (xs) - xs->Mask |= mask; - } } SERVER_END_REQ; diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 4d2aa47270d..639031059c6 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -139,7 +139,7 @@ static unsigned int get_server_context_flags( const void *context, USHORT machin * * Convert a register context to the server format. */ -NTSTATUS context_to_server( context_t *to, const void *src, USHORT machine ) +static NTSTATUS context_to_server( context_t *to, const void *src, USHORT machine ) { DWORD i, flags; @@ -388,7 +388,7 @@ NTSTATUS context_to_server( context_t *to, const void *src, USHORT machine ) * * Convert a register context from the server format. */ -NTSTATUS context_from_server( void *dst, const context_t *from, USHORT machine ) +static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT machine ) { DWORD i; @@ -1052,9 +1052,12 @@ void exit_process( int status ) void wait_suspend( CONTEXT *context ) { int saved_errno = errno; + context_t server_context; + context_to_server( &server_context, context, current_machine ); /* wait with 0 timeout, will only return once the thread is no longer suspended */ - server_select( NULL, 0, SELECT_INTERRUPTIBLE, 0, context, NULL, NULL ); + server_select( NULL, 0, SELECT_INTERRUPTIBLE, 0, &server_context, NULL, NULL ); + context_from_server( context, &server_context, current_machine ); errno = saved_errno; } @@ -1095,22 +1098,15 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_c if (handle) { - struct xcontext exception_context; - DECLSPEC_ALIGN(64) XSTATE xs; - XSTATE *src_xs; + context_t server_context; select_op.wait.op = SELECT_WAIT; select_op.wait.handles[0] = handle; - exception_context.c = *context; - if ((src_xs = xstate_from_context( context ))) - { - context_init_xstate( &exception_context.c, &xs ); - memcpy( &xs, src_xs, sizeof(xs) ); - } + context_to_server( &server_context, context, current_machine ); server_select( &select_op, offsetof( select_op_t, wait.handles[1] ), SELECT_INTERRUPTIBLE, - TIMEOUT_INFINITE, &exception_context.c, NULL, NULL ); + TIMEOUT_INFINITE, &server_context, NULL, NULL ); SERVER_START_REQ( get_exception_status ) { @@ -1118,12 +1114,7 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_c ret = wine_server_call( req ); } SERVER_END_REQ; - if (ret >= 0) - { - *context = exception_context.c; - if (src_xs) - memcpy( src_xs, &xs, sizeof(xs) ); - } + if (ret >= 0) context_from_server( context, &server_context, current_machine ); } pthread_sigmask( SIG_SETMASK, &old_set, NULL ); diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 3ec412959bc..41df2d431a3 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -159,7 +159,7 @@ extern unsigned int server_call_unlocked( void *req_ptr ) DECLSPEC_HIDDEN; extern void server_enter_uninterrupted_section( pthread_mutex_t *mutex, sigset_t *sigset ) DECLSPEC_HIDDEN; extern void server_leave_uninterrupted_section( pthread_mutex_t *mutex, sigset_t *sigset ) DECLSPEC_HIDDEN; extern unsigned int server_select( const select_op_t *select_op, data_size_t size, UINT flags, - timeout_t abs_timeout, CONTEXT *context, pthread_mutex_t *mutex, + timeout_t abs_timeout, context_t *context, pthread_mutex_t *mutex, user_apc_t *user_apc ) DECLSPEC_HIDDEN; extern unsigned int server_wait( const select_op_t *select_op, data_size_t size, UINT flags, const LARGE_INTEGER *timeout ) DECLSPEC_HIDDEN; @@ -177,8 +177,6 @@ extern int server_pipe( int fd[2] ) DECLSPEC_HIDDEN; extern void set_thread_id( TEB *teb, DWORD pid, DWORD tid ) DECLSPEC_HIDDEN; extern NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR zero_bits, SIZE_T reserve_size, SIZE_T commit_size, SIZE_T *pthread_size ) DECLSPEC_HIDDEN; -extern NTSTATUS context_to_server( context_t *to, const void *src, USHORT machine ) DECLSPEC_HIDDEN; -extern NTSTATUS context_from_server( void *dst, const context_t *from, USHORT machine ) DECLSPEC_HIDDEN; extern void DECLSPEC_NORETURN abort_thread( int status ) DECLSPEC_HIDDEN; extern void DECLSPEC_NORETURN abort_process( int status ) DECLSPEC_HIDDEN; extern void DECLSPEC_NORETURN exit_process( int status ) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : ntdll: Make the server context conversion functions generic.
by Alexandre Julliard
18 May '21
18 May '21
Module: wine Branch: master Commit: f04c2bd4f1e16d0b51cfaf18a5f2f42bacc70a15 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f04c2bd4f1e16d0b51cfaf18…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 18 10:18:19 2021 +0200 ntdll: Make the server context conversion functions generic. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/server.c | 4 +- dlls/ntdll/unix/signal_arm.c | 138 +------ dlls/ntdll/unix/signal_arm64.c | 130 +------ dlls/ntdll/unix/signal_i386.c | 175 +-------- dlls/ntdll/unix/signal_x86_64.c | 226 +---------- dlls/ntdll/unix/thread.c | 818 +++++++++++++++++++++++++++++++--------- dlls/ntdll/unix/unix_private.h | 44 +-- 7 files changed, 651 insertions(+), 884 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f04c2bd4f1e16d0b51cf…
1
0
0
0
Paul Gofman : wbemprox: Partially implement Win32_Process.Create method.
by Alexandre Julliard
18 May '21
18 May '21
Module: wine Branch: master Commit: 85abea6070a4d7cf22a48971b97b43733178236e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=85abea6070a4d7cf22a48971…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue May 18 09:49:45 2021 +0200 wbemprox: Partially implement Win32_Process.Create method. Fixes FunCom launcher failure to launch games. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/builtin.c | 14 ++++- dlls/wbemprox/process.c | 110 ++++++++++++++++++++++++++++++++++ dlls/wbemprox/tests/query.c | 123 ++++++++++++++++++++++++++++++++++++++- dlls/wbemprox/wbemprox_private.h | 1 + 4 files changed, 244 insertions(+), 4 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=85abea6070a4d7cf22a4…
1
0
0
0
Paul Gofman : wbemprox: Check for method existence in class_object_GetMethod().
by Alexandre Julliard
18 May '21
18 May '21
Module: wine Branch: master Commit: 09b0154ac111e032d3d12a94479da1bd4a3d02cb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=09b0154ac111e032d3d12a94…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue May 18 09:49:44 2021 +0200 wbemprox: Check for method existence in class_object_GetMethod(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/class.c | 17 +++++++++++++++++ dlls/wbemprox/tests/query.c | 11 +++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c index f48c815ef8d..2f2d3ef2bfb 100644 --- a/dlls/wbemprox/class.c +++ b/dlls/wbemprox/class.c @@ -875,10 +875,27 @@ static HRESULT WINAPI class_object_GetMethod( { struct class_object *co = impl_from_IWbemClassObject( iface ); IWbemClassObject *in, *out; + struct table *table; + unsigned int i; HRESULT hr; TRACE("%p, %s, %08x, %p, %p\n", iface, debugstr_w(wszName), lFlags, ppInSignature, ppOutSignature); + if (ppInSignature) *ppInSignature = NULL; + if (ppOutSignature) *ppOutSignature = NULL; + + table = get_view_table( impl_from_IEnumWbemClassObject( co->iter )->query->view, co->index ); + + for (i = 0; i < table->num_cols; ++i) + { + if (is_method( table, i ) && !lstrcmpiW( table->columns[i].name, wszName )) break; + } + if (i == table->num_cols) + { + FIXME("Method %s not found in class %s.\n", debugstr_w(wszName), debugstr_w(co->name)); + return WBEM_E_NOT_FOUND; + } + hr = create_signature( co->name, wszName, PARAM_IN, &in ); if (hr != S_OK) return hr; diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index a79bc759bea..85b242aba6f 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -460,7 +460,7 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path ) WBEM_FLAVOR_ORIGIN_PROPAGATED; WCHAR full_path[MAX_COMPUTERNAME_LENGTH + ARRAY_SIZE( L"\\\\%s\\ROOT\\CIMV2:" )]; BSTR class, method; - IWbemClassObject *process, *sig_in, *out; + IWbemClassObject *process, *sig_in, *sig_out, *out; IWbemQualifierSet *qualifiers; VARIANT retval, val; SAFEARRAY *names; @@ -504,8 +504,15 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path ) } SafeArrayDestroy( names ); + sig_in = (void *)0xdeadbeef; + sig_out = (void *)0xdeadbeef; + hr = IWbemClassObject_GetMethod( process, L"unknown", 0, &sig_in, &sig_out ); + ok( hr == WBEM_E_NOT_FOUND, "Got unexpected hr %#x\n", hr ); + ok( !sig_in, "Got unexpected sig_in %p.\n", sig_in ); + ok( !sig_out, "Got unexpected sig_out %p.\n", sig_out ); + sig_in = (void*)0xdeadbeef; - hr = IWbemClassObject_GetMethod( process, L"GetOwner", 0, &sig_in, NULL ); + hr = IWbemClassObject_GetMethod( process, L"getowner", 0, &sig_in, NULL ); ok( hr == S_OK, "failed to get GetOwner method %08x\n", hr ); ok( !sig_in, "sig_in != NULL\n"); IWbemClassObject_Release( process );
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
37
...
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