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
Alexandre Julliard : ntdll: Free the initial process parameters once they are copied.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 2b03b2873e675ecb8e0d92fdb950487bfafc8029 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2b03b2873e675ecb8e0d92fd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 25 17:16:30 2021 +0200 ntdll: Free the initial process parameters once they are copied. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/env.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index c11960db165..bb8931a556b 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -634,7 +634,7 @@ void WINAPI RtlDestroyProcessParameters( RTL_USER_PROCESS_PARAMETERS *params ) void init_user_process_params(void) { WCHAR *env; - SIZE_T env_size; + SIZE_T size = 0, env_size; RTL_USER_PROCESS_PARAMETERS *new_params, *params = NtCurrentTeb()->Peb->ProcessParameters; UNICODE_STRING curdir; @@ -671,15 +671,16 @@ void init_user_process_params(void) new_params->dwFlags = params->dwFlags; new_params->wShowWindow = params->wShowWindow; - NtCurrentTeb()->Peb->ProcessParameters = params = new_params; + NtCurrentTeb()->Peb->ProcessParameters = new_params; + NtFreeVirtualMemory( GetCurrentProcess(), (void **)¶ms, &size, MEM_RELEASE ); - if (RtlSetCurrentDirectory_U( ¶ms->CurrentDirectory.DosPath )) + if (RtlSetCurrentDirectory_U( &new_params->CurrentDirectory.DosPath )) { MESSAGE("wine: could not open working directory %s, starting in the Windows directory.\n", - debugstr_w( params->CurrentDirectory.DosPath.Buffer )); + debugstr_w( new_params->CurrentDirectory.DosPath.Buffer )); RtlInitUnicodeString( &curdir, windows_dir ); RtlSetCurrentDirectory_U( &curdir ); } - set_wow64_environment( ¶ms->Environment ); - params->EnvironmentSize = RtlSizeHeap( GetProcessHeap(), 0, params->Environment ); + set_wow64_environment( &new_params->Environment ); + new_params->EnvironmentSize = RtlSizeHeap( GetProcessHeap(), 0, new_params->Environment ); }
1
0
0
0
Alexandre Julliard : ntdll: Fill the Wow64 PEB and process parameters.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 78cbc269572b4a7e5e7cfcf4e063a023fcff2cba URL:
https://source.winehq.org/git/wine.git/?a=commit;h=78cbc269572b4a7e5e7cfcf4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 25 16:21:58 2021 +0200 ntdll: Fill the Wow64 PEB and process parameters. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 2 - dlls/ntdll/tests/env.c | 24 ++++---- dlls/ntdll/tests/info.c | 38 +++++++++++++ dlls/ntdll/unix/env.c | 136 ++++++++++++++++++++++++++++++++++++++++++---- dlls/ntdll/unix/virtual.c | 21 +------ include/winternl.h | 106 +++++++++++++++++++++++++++++++++++- 6 files changed, 281 insertions(+), 46 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=78cbc269572b4a7e5e7c…
1
0
0
0
Alexandre Julliard : ntdll: Pass an extra context arguments to APC functions on 64-bit.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 72ace07c6ff61c6fd3443acefe82f51ec711f193 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=72ace07c6ff61c6fd3443ace…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 25 14:08:54 2021 +0200 ntdll: Pass an extra context arguments to APC functions on 64-bit. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_arm64.c | 6 +++--- dlls/ntdll/signal_x86_64.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index dc6b072fa6c..1e2d51b9630 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -552,10 +552,10 @@ NTSTATUS WINAPI KiUserExceptionDispatcher( EXCEPTION_RECORD *rec, CONTEXT *conte /******************************************************************* * KiUserApcDispatcher (NTDLL.@) */ -void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1, ULONG_PTR arg2, - PNTAPCFUNC func ) +void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3, + void (CALLBACK *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR,CONTEXT*) ) { - func( ctx, arg1, arg2 ); + func( arg1, arg2, arg3, context ); NtContinue( context, TRUE ); } diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 55975093174..19146aea40b 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -597,10 +597,10 @@ __ASM_GLOBAL_FUNC( KiUserExceptionDispatcher, /******************************************************************* * KiUserApcDispatcher (NTDLL.@) */ -void WINAPI dispatch_apc( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1, ULONG_PTR arg2, - PNTAPCFUNC func ) +void WINAPI dispatch_apc( CONTEXT *context, ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3, + void (CALLBACK *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR,CONTEXT*) ) { - func( ctx, arg1, arg2 ); + func( arg1, arg2, arg3, context ); NtContinue( context, TRUE ); }
1
0
0
0
Alexandre Julliard : ntdll: Implement NtTestAlert().
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 8e01e8763bc45d1ecb71a56a38f93187d1a4daa6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8e01e8763bc45d1ecb71a56a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 25 13:15:16 2021 +0200 ntdll: Implement NtTestAlert(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/sync.c | 20 ++++++++++++++++++++ dlls/ntdll/ntdll.spec | 4 ++-- dlls/ntdll/unix/server.c | 14 ++++++++++++++ dlls/ntdll/unix/signal_x86_64.c | 2 +- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index bde3e15fe26..827f4c53aa0 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -64,6 +64,7 @@ static PSLIST_ENTRY (__fastcall *pRtlInterlockedPushListSList)(PSLIST_HEADER lis static PSLIST_ENTRY (WINAPI *pRtlInterlockedPushListSListEx)(PSLIST_HEADER list, PSLIST_ENTRY first, PSLIST_ENTRY last, ULONG count); static NTSTATUS (WINAPI *pNtQueueApcThread)(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR); +static NTSTATUS (WINAPI *pNtTestAlert)(void); #ifdef __i386__ @@ -2712,8 +2713,11 @@ static DWORD WINAPI thread_proc(LPVOID unused) return 0; } +static int apc_count; + static void CALLBACK user_apc(ULONG_PTR unused) { + apc_count++; } static void CALLBACK call_user_apc(ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3) @@ -2726,6 +2730,7 @@ static void test_QueueUserAPC(void) { HANDLE thread; DWORD tid, ret; + NTSTATUS status; thread = CreateThread(NULL, 0, thread_proc, NULL, CREATE_SUSPENDED, &tid); ok(thread != NULL, "CreateThread error %u\n", GetLastError()); @@ -2748,15 +2753,29 @@ static void test_QueueUserAPC(void) CloseHandle(thread); + apc_count = 0; ret = QueueUserAPC(user_apc, GetCurrentThread(), 0); ok(ret, "QueueUserAPC failed err %u\n", GetLastError()); + ok(!apc_count, "APC count %u\n", apc_count); ret = SleepEx( 100, TRUE ); ok( ret == WAIT_IO_COMPLETION, "SleepEx returned %u\n", ret); + ok(apc_count == 1, "APC count %u\n", apc_count); ret = pNtQueueApcThread( GetCurrentThread(), NULL, 0, 0, 0 ); ok( !ret, "got %#x\n", ret); ret = SleepEx( 100, TRUE ); ok( ret == WAIT_OBJECT_0, "SleepEx returned %u\n", ret); + + apc_count = 0; + ret = QueueUserAPC(user_apc, GetCurrentThread(), 0); + ok(ret, "QueueUserAPC failed err %u\n", GetLastError()); + ok(!apc_count, "APC count %u\n", apc_count); + status = pNtTestAlert(); + ok(!status, "got %x\n", status); + ok(apc_count == 1, "APC count %u\n", apc_count); + status = pNtTestAlert(); + ok(!status, "got %x\n", status); + ok(apc_count == 1, "APC count %u\n", apc_count); } START_TEST(sync) @@ -2790,6 +2809,7 @@ START_TEST(sync) pRtlInterlockedPushListSList = (void *)GetProcAddress(hntdll, "RtlInterlockedPushListSList"); pRtlInterlockedPushListSListEx = (void *)GetProcAddress(hntdll, "RtlInterlockedPushListSListEx"); pNtQueueApcThread = (void *)GetProcAddress(hntdll, "NtQueueApcThread"); + pNtTestAlert = (void *)GetProcAddress(hntdll, "NtTestAlert"); argc = winetest_get_mainargs( &argv ); if (argc >= 3) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 4eb7aec1aa5..c092e7a9d78 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -412,7 +412,7 @@ @ stdcall -syscall NtTerminateJobObject(long long) @ stdcall -syscall NtTerminateProcess(long long) @ stdcall -syscall NtTerminateThread(long long) -@ stub NtTestAlert +@ stdcall -syscall NtTestAlert() # @ stub NtTraceEvent # @ stub NtTranslateFilePath @ stdcall -syscall NtUnloadDriver(ptr) @@ -1425,7 +1425,7 @@ @ stdcall -private -syscall ZwTerminateJobObject(long long) NtTerminateJobObject @ stdcall -private -syscall ZwTerminateProcess(long long) NtTerminateProcess @ stdcall -private -syscall ZwTerminateThread(long long) NtTerminateThread -@ stub ZwTestAlert +@ stdcall -private -syscall ZwTestAlert() NtTestAlert # @ stub ZwTraceEvent # @ stub ZwTranslateFilePath @ stdcall -private -syscall ZwUnloadDriver(ptr) NtUnloadDriver diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index e30f2dd683d..c0cf13b3cb4 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -720,6 +720,20 @@ NTSTATUS WINAPI NtContinue( CONTEXT *context, BOOLEAN alertable ) } +/*********************************************************************** + * NtTestAlert (NTDLL.@) + */ +NTSTATUS WINAPI NtTestAlert(void) +{ + user_apc_t apc; + NTSTATUS status; + + status = server_select( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, 0, NULL, NULL, &apc ); + if (status == STATUS_USER_APC) invoke_user_apc( NULL, &apc, STATUS_SUCCESS ); + return STATUS_SUCCESS; +} + + /*********************************************************************** * server_queue_process_apc */ diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 5897e793b3e..0b7dde1b931 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -1973,7 +1973,7 @@ static void setup_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec ) */ struct apc_stack_layout * WINAPI setup_user_apc_dispatcher_stack( CONTEXT *context, struct apc_stack_layout *stack, - NSTATUS status ) + NTSTATUS status ) { CONTEXT c;
1
0
0
0
Alexandre Julliard : ntdll: Pass the result status to call_user_apc_dispatcher().
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 1364b11fd49bbe21624a3ce1c8471b72886af2e8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1364b11fd49bbe21624a3ce1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 25 13:04:24 2021 +0200 ntdll: Pass the result status to call_user_apc_dispatcher(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/server.c | 8 ++++---- dlls/ntdll/unix/signal_arm.c | 24 ++++++++++++------------ dlls/ntdll/unix/signal_arm64.c | 24 ++++++++++++------------ dlls/ntdll/unix/signal_i386.c | 16 +++++++++------- dlls/ntdll/unix/signal_x86_64.c | 19 +++++++++++-------- dlls/ntdll/unix/unix_private.h | 7 ++++--- 6 files changed, 52 insertions(+), 46 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=1364b11fd49bbe21624a…
1
0
0
0
Alexandre Julliard : server: Use a standard user APC also for timers.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: e1716530d92611026f84622546a596dc7a7d21d5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e1716530d92611026f846225…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 25 13:03:49 2021 +0200 server: Use a standard user APC also for timers. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/server.c | 32 ++++++++++---------------------- dlls/ntdll/unix/thread.c | 10 +++++----- include/wine/server_protocol.h | 25 ++++++------------------- server/async.c | 10 +++++----- server/protocol.def | 23 +++++------------------ server/thread.c | 1 - server/timer.c | 11 ++++++----- server/trace.c | 12 ++++-------- 8 files changed, 41 insertions(+), 83 deletions(-) diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index 10f53bea8ab..ca712e4a56c 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -351,30 +351,18 @@ static int wait_select_reply( void *cookie ) } -static void invoke_apc( CONTEXT *context, const user_apc_t *apc ) +/*********************************************************************** + * invoke_user_apc + */ +static void invoke_user_apc( CONTEXT *context, const user_apc_t *apc ) { - switch( apc->type ) - { - case APC_USER: - call_user_apc_dispatcher( context, apc->user.args[0], apc->user.args[1], apc->user.args[2], - wine_server_get_ptr( apc->user.func ), pKiUserApcDispatcher ); - break; - case APC_TIMER: - call_user_apc_dispatcher( context, (ULONG_PTR)wine_server_get_ptr( apc->user.args[1] ), - (DWORD)apc->timer.time, (DWORD)(apc->timer.time >> 32), - wine_server_get_ptr( apc->user.func ), pKiUserApcDispatcher ); - break; - default: - server_protocol_error( "get_apc_request: bad type %d\n", apc->type ); - break; - } + call_user_apc_dispatcher( context, apc->args[0], apc->args[1], apc->args[2], + wine_server_get_ptr( apc->func ), pKiUserApcDispatcher ); } + /*********************************************************************** - * invoke_apc - * - * Invoke a single APC. - * + * invoke_system_apc */ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOOL self ) { @@ -702,7 +690,7 @@ unsigned int server_wait( const select_op_t *select_op, data_size_t size, UINT f } ret = server_select( select_op, size, flags, abs_timeout, NULL, NULL, &apc ); - if (ret == STATUS_USER_APC) invoke_apc( NULL, &apc ); + if (ret == STATUS_USER_APC) invoke_user_apc( NULL, &apc ); /* A test on Windows 2000 shows that Windows always yields during a wait, but a wait that is hit by an event gets a priority @@ -723,7 +711,7 @@ NTSTATUS WINAPI NtContinue( CONTEXT *context, BOOLEAN alertable ) if (alertable) { status = server_select( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, 0, NULL, NULL, &apc ); - if (status == STATUS_USER_APC) invoke_apc( context, &apc ); + if (status == STATUS_USER_APC) invoke_user_apc( context, &apc ); } status = NtSetContextThread( GetCurrentThread(), context ); if (!status && (context->ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER) diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 1ac87352b39..54b748e99cb 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -1296,11 +1296,11 @@ NTSTATUS WINAPI NtQueueApcThread( HANDLE handle, PNTAPCFUNC func, ULONG_PTR arg1 req->handle = wine_server_obj_handle( handle ); if (func) { - req->call.type = APC_USER; - req->call.user.user.func = wine_server_client_ptr( func ); - req->call.user.user.args[0] = arg1; - req->call.user.user.args[1] = arg2; - req->call.user.user.args[2] = arg3; + req->call.type = APC_USER; + req->call.user.func = wine_server_client_ptr( func ); + req->call.user.args[0] = arg1; + req->call.user.args[1] = arg2; + req->call.user.args[2] = arg3; } else req->call.type = APC_NONE; /* wake up only */ ret = wine_server_call( req ); diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index e48154fb120..730bb3c151c 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -455,7 +455,6 @@ enum apc_type { APC_NONE, APC_USER, - APC_TIMER, APC_ASYNC_IO, APC_VIRTUAL_ALLOC, APC_VIRTUAL_FREE, @@ -471,24 +470,12 @@ enum apc_type APC_BREAK_PROCESS }; -typedef union +typedef struct { - enum apc_type type; - struct - { - enum apc_type type; - int __pad; - client_ptr_t func; - apc_param_t args[3]; - } user; - struct - { - enum apc_type type; - int __pad; - client_ptr_t func; - abstime_t time; - client_ptr_t arg; - } timer; + enum apc_type type; + int __pad; + client_ptr_t func; + apc_param_t args[3]; } user_apc_t; typedef union @@ -6300,7 +6287,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 705 +#define SERVER_PROTOCOL_VERSION 706 /* ### protocol_version end ### */ diff --git a/server/async.c b/server/async.c index 27af3be52ff..d6d3a8ad86a 100644 --- a/server/async.c +++ b/server/async.c @@ -406,11 +406,11 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota { apc_call_t data; memset( &data, 0, sizeof(data) ); - data.type = APC_USER; - data.user.user.func = async->data.apc; - data.user.user.args[0] = async->data.apc_context; - data.user.user.args[1] = async->data.iosb; - data.user.user.args[2] = 0; + data.type = APC_USER; + data.user.func = async->data.apc; + data.user.args[0] = async->data.apc_context; + data.user.args[1] = async->data.iosb; + data.user.args[2] = 0; thread_queue_apc( NULL, async->thread, NULL, &data ); } else if (async->data.apc_context && (async->pending || diff --git a/server/protocol.def b/server/protocol.def index db50e03c691..f0a9107cfbe 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -471,7 +471,6 @@ enum apc_type { APC_NONE, APC_USER, - APC_TIMER, APC_ASYNC_IO, APC_VIRTUAL_ALLOC, APC_VIRTUAL_FREE, @@ -487,24 +486,12 @@ enum apc_type APC_BREAK_PROCESS }; -typedef union +typedef struct { - enum apc_type type; - struct - { - enum apc_type type; /* APC_USER */ - int __pad; - client_ptr_t func; /* void (__stdcall *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR); */ - apc_param_t args[3]; /* arguments for user function */ - } user; - struct - { - enum apc_type type; /* APC_TIMER */ - int __pad; - client_ptr_t func; /* void (__stdcall *func)(void*, unsigned int, unsigned int); */ - abstime_t time; /* time of expiration */ - client_ptr_t arg; /* user argument */ - } timer; + enum apc_type type; /* APC_USER */ + int __pad; + client_ptr_t func; /* void (__stdcall *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR); */ + apc_param_t args[3]; /* arguments for user function */ } user_apc_t; typedef union diff --git a/server/thread.c b/server/thread.c index 4077a752e4a..0c7f11c0da1 100644 --- a/server/thread.c +++ b/server/thread.c @@ -1071,7 +1071,6 @@ static inline struct list *get_apc_queue( struct thread *thread, enum apc_type t case APC_NONE: return NULL; case APC_USER: - case APC_TIMER: return &thread->user_apc; default: return &thread->system_apc; diff --git a/server/timer.c b/server/timer.c index 0c787d0b7e0..5e265d2ddf6 100644 --- a/server/timer.c +++ b/server/timer.c @@ -128,10 +128,11 @@ static void timer_callback( void *private ) assert (timer->callback); memset( &data, 0, sizeof(data) ); - data.type = APC_TIMER; - data.user.timer.func = timer->callback; - data.user.timer.time = timer->when; - data.user.timer.arg = timer->arg; + data.type = APC_USER; + data.user.func = timer->callback; + data.user.args[0] = timer->arg; + data.user.args[1] = (unsigned int)timer->when; + data.user.args[2] = timer->when >> 32; if (!thread_queue_apc( NULL, timer->thread, &timer->obj, &data )) { @@ -165,7 +166,7 @@ static int cancel_timer( struct timer *timer ) } if (timer->thread) { - thread_cancel_apc( timer->thread, &timer->obj, APC_TIMER ); + thread_cancel_apc( timer->thread, &timer->obj, APC_USER ); release_object( timer->thread ); timer->thread = NULL; } diff --git a/server/trace.c b/server/trace.c index d9ca82bd228..1420f1e799f 100644 --- a/server/trace.c +++ b/server/trace.c @@ -156,16 +156,12 @@ static void dump_apc_call( const char *prefix, const apc_call_t *call ) fprintf( stderr, "APC_NONE" ); break; case APC_USER: - dump_uint64( "APC_USER,func=", &call->user.user.func ); - dump_uint64( ",args={", &call->user.user.args[0] ); - dump_uint64( ",", &call->user.user.args[1] ); - dump_uint64( ",", &call->user.user.args[2] ); + dump_uint64( "APC_USER,func=", &call->user.func ); + dump_uint64( ",args={", &call->user.args[0] ); + dump_uint64( ",", &call->user.args[1] ); + dump_uint64( ",", &call->user.args[2] ); fputc( '}', stderr ); break; - case APC_TIMER: - dump_timeout( "APC_TIMER,time=", &call->user.timer.time ); - dump_uint64( ",arg=", &call->user.timer.arg ); - break; case APC_ASYNC_IO: dump_uint64( "APC_ASYNC_IO,user=", &call->async_io.user ); dump_uint64( ",sb=", &call->async_io.sb );
1
0
0
0
Alexandre Julliard : ntdll: Always put the pthread stack at the top of the 64-bit stack if there's one.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 118bd9fee324c347283de17388055e4cdbd6d493 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=118bd9fee324c347283de173…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 25 11:17:23 2021 +0200 ntdll: Always put the pthread stack at the top of the 64-bit stack if there's one. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/thread.c | 55 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index b14b441c094..1ac87352b39 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -787,36 +787,67 @@ void set_thread_id( TEB *teb, DWORD pid, DWORD tid ) NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR zero_bits, SIZE_T reserve_size, SIZE_T commit_size, SIZE_T *pthread_size ) { - INITIAL_TEB stack, stack64; + INITIAL_TEB stack; NTSTATUS status; - if ((status = virtual_alloc_thread_stack( &stack, zero_bits, reserve_size, commit_size, pthread_size ))) - return status; - - if (teb->WowTebOffset && !(status = virtual_alloc_thread_stack( &stack64, 0, 0x40000, 0x40000, NULL ))) + if (teb->WowTebOffset) { + WOW64_CPURESERVED *cpu; SIZE_T cpusize = sizeof(WOW64_CPURESERVED) + ((get_machine_context_size( main_image_info.Machine ) + 7) & ~7) + sizeof(ULONG64); - WOW64_CPURESERVED *cpu = (WOW64_CPURESERVED *)(((ULONG_PTR)stack64.StackBase - cpusize) & ~15); + #ifdef _WIN64 TEB32 *teb32 = (TEB32 *)((char *)teb + teb->WowTebOffset); + + /* 32-bit stack */ + if ((status = virtual_alloc_thread_stack( &stack, zero_bits, reserve_size, commit_size, NULL ))) + return status; teb32->Tib.StackBase = PtrToUlong( stack.StackBase ); teb32->Tib.StackLimit = PtrToUlong( stack.StackLimit ); teb32->DeallocationStack = PtrToUlong( stack.DeallocationStack ); - stack64.StackBase = teb->TlsSlots[WOW64_TLS_CPURESERVED] = cpu; - stack = stack64; + + /* 64-bit stack */ + if ((status = virtual_alloc_thread_stack( &stack, 0, 0x40000, 0x40000, pthread_size ))) + return status; + cpu = (WOW64_CPURESERVED *)(((ULONG_PTR)stack.StackBase - cpusize) & ~15); + cpu->Machine = main_image_info.Machine; + teb->Tib.StackBase = teb->TlsSlots[WOW64_TLS_CPURESERVED] = cpu; + teb->Tib.StackLimit = stack.StackLimit; + teb->DeallocationStack = stack.DeallocationStack; + + if (pthread_size) + { + struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; + thread_data->start_stack = stack.StackBase; + *pthread_size += (char *)stack.StackBase - (char *)cpu; + } + return STATUS_SUCCESS; #else TEB64 *teb64 = (TEB64 *)((char *)teb + teb->WowTebOffset); + + /* 64-bit stack */ + if ((status = virtual_alloc_thread_stack( &stack, 0, 0x40000, 0x40000, NULL ))) return status; + + cpu = (WOW64_CPURESERVED *)(((ULONG_PTR)stack.StackBase - cpusize) & ~15); + cpu->Machine = main_image_info.Machine; teb64->Tib.StackBase = teb64->TlsSlots[WOW64_TLS_CPURESERVED] = PtrToUlong( cpu ); - teb64->Tib.StackLimit = PtrToUlong( stack64.StackLimit ); - teb64->DeallocationStack = PtrToUlong( stack64.DeallocationStack ); + teb64->Tib.StackLimit = PtrToUlong( stack.StackLimit ); + teb64->DeallocationStack = PtrToUlong( stack.DeallocationStack ); #endif - cpu->Machine = main_image_info.Machine; } + + /* native stack */ + if ((status = virtual_alloc_thread_stack( &stack, zero_bits, reserve_size, commit_size, pthread_size ))) + return status; teb->Tib.StackBase = stack.StackBase; teb->Tib.StackLimit = stack.StackLimit; teb->DeallocationStack = stack.DeallocationStack; - return status; + if (pthread_size) + { + struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; + thread_data->start_stack = stack.StackBase; + } + return STATUS_SUCCESS; }
1
0
0
0
Zebediah Figura : ws2_32/tests: Add tests for IOCTL_AFD_POLL.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 5c1be1dbaee660c7e4646276518de402ad174932 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5c1be1dbaee660c7e4646276…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 24 23:13:42 2021 -0500 ws2_32/tests: Add tests for IOCTL_AFD_POLL. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/tests/afd.c | 683 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 683 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=5c1be1dbaee660c7e464…
1
0
0
0
Zebediah Figura : ntdll: Implement IOCTL_AFD_POLL.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 834e2f04c606d433ad4d9c4e3da6cb91f9bbcc32 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=834e2f04c606d433ad4d9c4e…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 24 23:13:41 2021 -0500 ntdll: Implement IOCTL_AFD_POLL. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50975
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/socket.c | 157 +++++++++++++++++++++ include/wine/afd.h | 30 ++++ include/wine/server_protocol.h | 35 ++++- server/protocol.def | 24 ++++ server/request.h | 8 ++ server/sock.c | 306 ++++++++++++++++++++++++++++++++++++++++- server/trace.c | 49 +++++++ 7 files changed, 605 insertions(+), 4 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=834e2f04c606d433ad4d…
1
0
0
0
Zebediah Figura : server: Allow opening the Afd device with a file name.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 30fd3019e1b9f0e05d6da911a3605dd7956e696c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=30fd3019e1b9f0e05d6da911…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 24 23:13:40 2021 -0500 server: Allow opening the Afd device with a file name. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50974
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/tests/afd.c | 2 +- server/sock.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ws2_32/tests/afd.c b/dlls/ws2_32/tests/afd.c index a02b4f3da27..48b177ee845 100644 --- a/dlls/ws2_32/tests/afd.c +++ b/dlls/ws2_32/tests/afd.c @@ -64,7 +64,7 @@ static void test_open_device(void) RtlInitUnicodeString(&string, L"\\Device\\Afd\\foobar"); InitializeObjectAttributes(&attr, &string, 0, NULL, NULL); ret = NtOpenFile(&handle, SYNCHRONIZE, &attr, &io, 0, 0); - todo_wine ok(!ret, "got %#x\n", ret); + ok(!ret, "got %#x\n", ret); CloseHandle(handle); s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); diff --git a/server/sock.c b/server/sock.c index 7f8d9760afb..ab5aa57a6cd 100644 --- a/server/sock.c +++ b/server/sock.c @@ -1981,6 +1981,7 @@ static void socket_device_dump( struct object *obj, int verbose ) static struct object *socket_device_lookup_name( struct object *obj, struct unicode_str *name, unsigned int attr, struct object *root ) { + if (name) name->len = 0; return NULL; }
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
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