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
June 2020
----- 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
1 participants
947 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Update the __wine_ldt_copy pointer directly from the Unix library.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: f1ff598e2aca810c3a0540d6a764787d31890741 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f1ff598e2aca810c3a0540d6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jun 29 12:10:00 2020 +0200 ntdll: Update the __wine_ldt_copy pointer directly from the Unix library. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_i386.c | 2 ++ dlls/ntdll/thread.c | 4 +--- dlls/ntdll/unix/loader.c | 7 +++++++ dlls/ntdll/unix/server.c | 3 --- dlls/ntdll/unix/thread.c | 6 +----- dlls/ntdll/unix/unix_private.h | 6 ++++-- dlls/ntdll/unixlib.h | 5 ++--- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index ac722bef55..7567a5e5d1 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -95,6 +95,8 @@ static inline struct x86_thread_data *x86_thread_data(void) return (struct x86_thread_data *)NtCurrentTeb()->SystemReserved2; } +struct ldt_copy *__wine_ldt_copy = NULL; + /* Exception record for handling exceptions happening inside exception handlers */ typedef struct { diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 7b8a717241..027b72d3be 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -46,8 +46,6 @@ static RTL_BITMAP tls_bitmap; static RTL_BITMAP tls_expansion_bitmap; static RTL_BITMAP fls_bitmap; -struct ldt_copy *__wine_ldt_copy = NULL; - static RTL_CRITICAL_SECTION peb_lock; static RTL_CRITICAL_SECTION_DEBUG critsect_debug = { @@ -104,7 +102,7 @@ int __cdecl __wine_dbg_output( const char *str ) TEB *thread_init( SIZE_T *info_size ) { ULONG_PTR val; - TEB *teb = unix_funcs->init_threading( &__wine_ldt_copy, info_size ); + TEB *teb = unix_funcs->init_threading( info_size ); peb = teb->Peb; peb->FastPebLock = &peb_lock; diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 892ff10c35..600a2b0e39 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -838,6 +838,13 @@ static void fixup_ntdll_imports( const IMAGE_NT_HEADERS *nt ) GET_FUNC( LdrInitializeThunk ); GET_FUNC( RtlUserThreadStart ); GET_FUNC( __wine_set_unix_funcs ); +#ifdef __i386__ + { + struct ldt_copy **p__wine_ldt_copy; + GET_FUNC( __wine_ldt_copy ); + *p__wine_ldt_copy = &__wine_ldt_copy; + } +#endif #undef GET_FUNC } diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index f02d1ed8a2..c311665267 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -1461,9 +1461,6 @@ void server_init_process(void) */ void CDECL server_init_process_done( void *relay ) { -#ifdef __i386__ - extern struct ldt_copy __wine_ldt_copy; -#endif PEB *peb = NtCurrentTeb()->Peb; IMAGE_NT_HEADERS *nt = RtlImageNtHeader( peb->ImageBaseAddress ); void *entry = (char *)peb->ImageBaseAddress + nt->OptionalHeader.AddressOfEntryPoint; diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 2be8d2d3e2..129410f8d7 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -86,15 +86,11 @@ static void pthread_exit_wrapper( int status ) /*********************************************************************** * init_threading */ -TEB * CDECL init_threading( struct ldt_copy **ldt_copy, SIZE_T *size ) +TEB * CDECL init_threading( SIZE_T *size ) { TEB *teb; BOOL suspend; SIZE_T info_size; -#ifdef __i386__ - extern struct ldt_copy __wine_ldt_copy; - *ldt_copy = &__wine_ldt_copy; -#endif teb = virtual_alloc_first_teb(); diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 1f4c2da0c6..54254632e7 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -73,7 +73,6 @@ extern void (WINAPI *pDbgUiRemoteBreakin)( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS (WINAPI *pKiUserExceptionDispatcher)(EXCEPTION_RECORD*,CONTEXT*) DECLSPEC_HIDDEN; extern void (WINAPI *pLdrInitializeThunk)(CONTEXT*,void**,ULONG_PTR,ULONG_PTR) DECLSPEC_HIDDEN; extern void (WINAPI *pRtlUserThreadStart)( PRTL_THREAD_START_ROUTINE entry, void *arg ) DECLSPEC_HIDDEN; - extern NTSTATUS CDECL fast_RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit, int timeout ) DECLSPEC_HIDDEN; extern NTSTATUS CDECL fast_RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION *crit ) DECLSPEC_HIDDEN; extern NTSTATUS CDECL fast_RtlDeleteCriticalSection( RTL_CRITICAL_SECTION *crit ) DECLSPEC_HIDDEN; @@ -117,7 +116,7 @@ extern NTSTATUS CDECL server_handle_to_fd( HANDLE handle, unsigned int access, i unsigned int *options ) DECLSPEC_HIDDEN; extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDEN; extern void CDECL server_init_process_done( void *relay ) DECLSPEC_HIDDEN; -extern TEB * CDECL init_threading( struct ldt_copy **ldt_copy, SIZE_T *size ) DECLSPEC_HIDDEN; +extern TEB * CDECL init_threading( SIZE_T *size ) DECLSPEC_HIDDEN; extern void CDECL DECLSPEC_NORETURN exit_thread( int status ) DECLSPEC_HIDDEN; extern void CDECL DECLSPEC_NORETURN exit_process( int status ) DECLSPEC_HIDDEN; extern NTSTATUS CDECL exec_process( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTSTATUS status ) DECLSPEC_HIDDEN; @@ -149,6 +148,9 @@ extern sigset_t server_block_set DECLSPEC_HIDDEN; extern SIZE_T signal_stack_size DECLSPEC_HIDDEN; extern SIZE_T signal_stack_mask DECLSPEC_HIDDEN; extern struct _KUSER_SHARED_DATA *user_shared_data DECLSPEC_HIDDEN; +#ifdef __i386__ +extern struct ldt_copy __wine_ldt_copy DECLSPEC_HIDDEN; +#endif extern void init_environment( int argc, char *argv[], char *envp[] ) DECLSPEC_HIDDEN; extern DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD dstlen ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index 19e532da47..c8bcac3836 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -24,12 +24,11 @@ #include "wine/server.h" #include "wine/debug.h" -struct ldt_copy; struct msghdr; struct _DISPATCHER_CONTEXT; /* increment this when you change the function table */ -#define NTDLL_UNIXLIB_VERSION 66 +#define NTDLL_UNIXLIB_VERSION 67 struct unix_funcs { @@ -319,7 +318,7 @@ struct unix_funcs void (CDECL *virtual_set_large_address_space)(void); /* thread/process functions */ - TEB * (CDECL *init_threading)( struct ldt_copy **ldt_copy, SIZE_T *size ); + TEB * (CDECL *init_threading)( SIZE_T *size ); void (CDECL *exit_thread)( int status ); void (CDECL *exit_process)( int status ); NTSTATUS (CDECL *exec_process)( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTSTATUS status );
1
0
0
0
Alexandre Julliard : ntdll: Stop sharing the thread counter with the Unix library.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 2334f4e64582a518e4d5a7627472a0d817b147ef URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2334f4e64582a518e4d5a762…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jun 29 12:09:25 2020 +0200 ntdll: Stop sharing the thread counter with the Unix library. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/info.c | 31 +++++++++++++++++++++++++++++++ dlls/ntdll/thread.c | 9 +++++---- dlls/ntdll/unix/thread.c | 18 +++++++++--------- dlls/ntdll/unix/unix_private.h | 2 +- dlls/ntdll/unixlib.h | 4 ++-- 5 files changed, 48 insertions(+), 16 deletions(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index eaf2f1a45b..4de562b994 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -2670,6 +2670,36 @@ static void test_thread_lookup(void) "NtOpenThread returned %#x\n", status); } +static void test_thread_info(void) +{ + NTSTATUS status; + ULONG len, data; + + len = 0xdeadbeef; + data = 0xcccccccc; + status = pNtQueryInformationThread( GetCurrentThread(), ThreadAmILastThread, + &data, sizeof(data), &len ); + ok( !status, "failed %x\n", status ); + ok( data == 0 || data == 1, "wrong data %x\n", data ); + ok( len == sizeof(data), "wrong len %u\n", len ); + + len = 0xdeadbeef; + data = 0xcccccccc; + status = pNtQueryInformationThread( GetCurrentThread(), ThreadAmILastThread, + &data, sizeof(data) - 1, &len ); + ok( status == STATUS_INFO_LENGTH_MISMATCH, "failed %x\n", status ); + ok( data == 0xcccccccc, "wrong data %x\n", data ); + ok( len == 0xdeadbeef, "wrong len %u\n", len ); + + len = 0xdeadbeef; + data = 0xcccccccc; + status = pNtQueryInformationThread( GetCurrentThread(), ThreadAmILastThread, + &data, sizeof(data) + 1, &len ); + ok( status == STATUS_INFO_LENGTH_MISMATCH, "failed %x\n", status ); + ok( data == 0xcccccccc, "wrong data %x\n", data ); + ok( len == 0xdeadbeef, "wrong len %u\n", len ); +} + START_TEST(info) { char **argv; @@ -2827,4 +2857,5 @@ START_TEST(info) test_query_data_alignment(); test_thread_lookup(); + test_thread_info(); } diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index ec94338f3f..7b8a717241 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -45,7 +45,6 @@ static PEB_LDR_DATA ldr; static RTL_BITMAP tls_bitmap; static RTL_BITMAP tls_expansion_bitmap; static RTL_BITMAP fls_bitmap; -static int nb_threads = 1; struct ldt_copy *__wine_ldt_copy = NULL; @@ -105,7 +104,7 @@ int __cdecl __wine_dbg_output( const char *str ) TEB *thread_init( SIZE_T *info_size ) { ULONG_PTR val; - TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size ); + TEB *teb = unix_funcs->init_threading( &__wine_ldt_copy, info_size ); peb = teb->Peb; peb->FastPebLock = &peb_lock; @@ -147,6 +146,8 @@ TEB *thread_init( SIZE_T *info_size ) */ void WINAPI RtlExitUserThread( ULONG status ) { + ULONG last; + if (status) /* send the exit code to the server (0 is already the default) */ { SERVER_START_REQ( terminate_thread ) @@ -158,12 +159,12 @@ void WINAPI RtlExitUserThread( ULONG status ) SERVER_END_REQ; } - if (InterlockedDecrement( &nb_threads ) <= 0) + NtQueryInformationThread( GetCurrentThread(), ThreadAmILastThread, &last, sizeof(last), NULL ); + if (last) { LdrShutdownProcess(); unix_funcs->exit_process( status ); } - LdrShutdownThread(); RtlFreeThreadActivationContextStack(); for (;;) unix_funcs->exit_thread( status ); diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index c583a08c05..2be8d2d3e2 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -60,7 +60,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(seh); #define PTHREAD_STACK_MIN 16384 #endif -static int *nb_threads; +static int nb_threads = 1; static inline int get_unix_exit_code( NTSTATUS status ) { @@ -86,7 +86,7 @@ static void pthread_exit_wrapper( int status ) /*********************************************************************** * init_threading */ -TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size ) +TEB * CDECL init_threading( struct ldt_copy **ldt_copy, SIZE_T *size ) { TEB *teb; BOOL suspend; @@ -95,7 +95,6 @@ TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZ extern struct ldt_copy __wine_ldt_copy; *ldt_copy = &__wine_ldt_copy; #endif - nb_threads = nb_threads_ptr; teb = virtual_alloc_first_teb(); @@ -290,10 +289,10 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT (char *)teb->Tib.StackBase + extra_stack - (char *)teb->DeallocationStack ); pthread_attr_setguardsize( &pthread_attr, 0 ); pthread_attr_setscope( &pthread_attr, PTHREAD_SCOPE_SYSTEM ); /* force creating a kernel thread */ - InterlockedIncrement( nb_threads ); + InterlockedIncrement( &nb_threads ); if (pthread_create( &pthread_id, &pthread_attr, (void * (*)(void *))start_thread, teb )) { - InterlockedDecrement( nb_threads ); + InterlockedDecrement( &nb_threads ); virtual_free_teb( teb ); status = STATUS_NO_MEMORY; } @@ -319,7 +318,7 @@ done: void abort_thread( int status ) { pthread_sigmask( SIG_BLOCK, &server_block_set, NULL ); - if (InterlockedDecrement( nb_threads ) <= 0) abort_process( status ); + if (InterlockedDecrement( &nb_threads ) <= 0) abort_process( status ); signal_exit_thread( status, pthread_exit_wrapper ); } @@ -987,6 +986,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, case ThreadAmILastThread: { + if (length != sizeof(ULONG)) return STATUS_INFO_LENGTH_MISMATCH; SERVER_START_REQ( get_thread_info ) { req->handle = wine_server_obj_handle( handle ); @@ -994,9 +994,9 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, status = wine_server_call( req ); if (status == STATUS_SUCCESS) { - BOOLEAN last = reply->last; - if (data) memcpy( data, &last, min( length, sizeof(last) )); - if (ret_len) *ret_len = min( length, sizeof(last) ); + ULONG last = reply->last; + if (data) memcpy( data, &last, sizeof(last) ); + if (ret_len) *ret_len = sizeof(last); } } SERVER_END_REQ; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index d6a15d5f7b..1f4c2da0c6 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -117,7 +117,7 @@ extern NTSTATUS CDECL server_handle_to_fd( HANDLE handle, unsigned int access, i unsigned int *options ) DECLSPEC_HIDDEN; extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDEN; extern void CDECL server_init_process_done( void *relay ) DECLSPEC_HIDDEN; -extern TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size ) DECLSPEC_HIDDEN; +extern TEB * CDECL init_threading( struct ldt_copy **ldt_copy, SIZE_T *size ) DECLSPEC_HIDDEN; extern void CDECL DECLSPEC_NORETURN exit_thread( int status ) DECLSPEC_HIDDEN; extern void CDECL DECLSPEC_NORETURN exit_process( int status ) DECLSPEC_HIDDEN; extern NTSTATUS CDECL exec_process( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTSTATUS status ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index 88010b695e..19e532da47 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -29,7 +29,7 @@ struct msghdr; struct _DISPATCHER_CONTEXT; /* increment this when you change the function table */ -#define NTDLL_UNIXLIB_VERSION 65 +#define NTDLL_UNIXLIB_VERSION 66 struct unix_funcs { @@ -319,7 +319,7 @@ struct unix_funcs void (CDECL *virtual_set_large_address_space)(void); /* thread/process functions */ - TEB * (CDECL *init_threading)( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size ); + TEB * (CDECL *init_threading)( struct ldt_copy **ldt_copy, SIZE_T *size ); void (CDECL *exit_thread)( int status ); void (CDECL *exit_process)( int status ); NTSTATUS (CDECL *exec_process)( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTSTATUS status );
1
0
0
0
Alexandre Julliard : include: Fix _memccpy, _memicmp and _memicmp_l prototypes.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 635593a01c2590168324b5a9477f63597535bdeb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=635593a01c2590168324b5a9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jun 29 10:44:56 2020 +0200 include: Fix _memccpy, _memicmp and _memicmp_l prototypes. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/msvcrt/corecrt_wstring.h | 6 +++--- include/msvcrt/memory.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/msvcrt/corecrt_wstring.h b/include/msvcrt/corecrt_wstring.h index 10ab894328..53537185f4 100644 --- a/include/msvcrt/corecrt_wstring.h +++ b/include/msvcrt/corecrt_wstring.h @@ -19,9 +19,9 @@ _ACRTIMP int __cdecl memcmp(const void*,const void*,size_t); _ACRTIMP void* __cdecl memcpy(void*,const void*,size_t); _ACRTIMP errno_t __cdecl memcpy_s(void*,size_t,const void*,size_t); _ACRTIMP void* __cdecl memset(void*,int,size_t); -_ACRTIMP void* __cdecl _memccpy(void*,const void*,int,unsigned int); -_ACRTIMP int __cdecl _memicmp(const void*,const void*,unsigned int); -_ACRTIMP int __cdecl _memicmp_l(const void*,const void*,unsigned int,_locale_t); +_ACRTIMP void* __cdecl _memccpy(void*,const void*,int,size_t); +_ACRTIMP int __cdecl _memicmp(const void*,const void*,size_t); +_ACRTIMP int __cdecl _memicmp_l(const void*,const void*,size_t,_locale_t); static inline int memicmp(const void* s1, const void* s2, size_t len) { return _memicmp(s1, s2, len); } static inline void* memccpy(void *s1, const void *s2, int c, size_t n) { return _memccpy(s1, s2, c, n); } diff --git a/include/msvcrt/memory.h b/include/msvcrt/memory.h index 21198e8f8b..ebdd2bee93 100644 --- a/include/msvcrt/memory.h +++ b/include/msvcrt/memory.h @@ -22,9 +22,9 @@ int __cdecl memcmp(const void*,const void*,size_t); void* __cdecl memcpy(void*,const void*,size_t); errno_t __cdecl memcpy_s(void*,size_t,const void*,size_t); void* __cdecl memset(void*,int,size_t); -void* __cdecl _memccpy(void*,const void*,int,unsigned int); -int __cdecl _memicmp(const void*,const void*,unsigned int); -int __cdecl _memicmp_l(const void*,const void*,unsigned int,_locale_t); +void* __cdecl _memccpy(void*,const void*,int,size_t); +int __cdecl _memicmp(const void*,const void*,size_t); +int __cdecl _memicmp_l(const void*,const void*,size_t,_locale_t); static inline int memicmp(const void* s1, const void* s2, size_t len) { return _memicmp(s1, s2, len); } static inline void* memccpy(void *s1, const void *s2, int c, size_t n) { return _memccpy(s1, s2, c, n); }
1
0
0
0
Alexandre Julliard : ntdll: Reimplement the string functions to avoid depending on libc.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 067648cd2bdc4776cb69c6554ee9d799e0b201c7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=067648cd2bdc4776cb69c655…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jun 29 10:43:42 2020 +0200 ntdll: Reimplement the string functions to avoid depending on libc. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll_misc.h | 20 +++++ dlls/ntdll/string.c | 212 ++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 206 insertions(+), 26 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=067648cd2bdc4776cb69…
1
0
0
0
Alexandre Julliard : ntdll: Reimplement the ctype functions to avoid depending on libc.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: bc8745851e3005fd98c45fe06fc9d4d92c68fa53 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bc8745851e3005fd98c45fe0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jun 29 10:42:28 2020 +0200 ntdll: Reimplement the ctype functions to avoid depending on libc. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/string.c | 78 ++++++++++++++++++++++++++++++++++------------- dlls/ntdll/tests/string.c | 74 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 22 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=bc8745851e3005fd98c4…
1
0
0
0
Alexandre Julliard : ntdll: Avoid a compiler warning when fetching the return address.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 716cf7d342466235d3117db5da788704cbf2853d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=716cf7d342466235d3117db5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jun 29 10:46:04 2020 +0200 ntdll: Avoid a compiler warning when fetching the return address. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_i386.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index d91d19f043..ac722bef55 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -360,7 +360,7 @@ NTSTATUS CDECL DECLSPEC_HIDDEN __regs_NtGetContextThread( DWORD edi, DWORD esi, { context->Ebp = ebp; context->Esp = (DWORD)&retaddr; - context->Eip = *(&edi - 1); + context->Eip = (DWORD)NtGetContextThread + 12; context->EFlags = eflags; } return unix_funcs->NtGetContextThread( handle, context );
1
0
0
0
Alexandre Julliard : ntdll: Avoid some Unix dependencies.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 38c78a968259963d29559096dda575237039c561 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=38c78a968259963d29559096…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jun 29 10:40:28 2020 +0200 ntdll: Avoid some Unix dependencies. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 4 +- dlls/ntdll/signal_arm.c | 16 +---- dlls/ntdll/signal_x86_64.c | 144 --------------------------------------------- dlls/ntdll/thread.c | 2 - 4 files changed, 4 insertions(+), 162 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=38c78a968259963d2955…
1
0
0
0
Alexandre Julliard : ntdll: Move the console handle initialization to the Unix library.
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: b9f531a0e81ebf7a0dfeac00d557632546b12f56 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b9f531a0e81ebf7a0dfeac00…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jun 29 10:39:27 2020 +0200 ntdll: Move the console handle initialization to the Unix library. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/env.c | 10 ++-------- dlls/ntdll/unix/env.c | 15 +++++++++++++++ dlls/ntdll/unix/loader.c | 1 + dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unixlib.h | 4 +++- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index a72fc6943d..a68ef5786e 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -1286,14 +1286,8 @@ void init_user_process_params( SIZE_T data_size ) RtlFreeUnicodeString( &cmdline ); RtlReleasePath( load_path ); - if (isatty(0) || isatty(1) || isatty(2)) - params->ConsoleHandle = (HANDLE)2; /* see kernel32/kernel_private.h */ - if (!isatty(0)) - wine_server_fd_to_handle( 0, GENERIC_READ|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdInput ); - if (!isatty(1)) - wine_server_fd_to_handle( 1, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdOutput ); - if (!isatty(2)) - wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdError ); + unix_funcs->get_initial_console( ¶ms->ConsoleHandle, ¶ms->hStdInput, + ¶ms->hStdOutput, ¶ms->hStdError ); params->wShowWindow = 1; /* SW_SHOWNORMAL */ run_wineboot( ¶ms->Environment ); diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 7bf57a228f..1ffe45ea3b 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -954,6 +954,21 @@ NTSTATUS CDECL get_dynamic_environment( WCHAR *env, SIZE_T *size ) } +/************************************************************************* + * get_initial_console + * + * Return the initial console handles. + */ +void CDECL get_initial_console( HANDLE *handle, HANDLE *std_in, HANDLE *std_out, HANDLE *std_err ) +{ + *handle = *std_in = *std_out = *std_err = 0; + if (isatty(0) || isatty(1) || isatty(2)) *handle = (HANDLE)2; /* see kernel32/kernel_private.h */ + if (!isatty(0)) server_fd_to_handle( 0, GENERIC_READ|SYNCHRONIZE, OBJ_INHERIT, std_in ); + if (!isatty(1)) server_fd_to_handle( 1, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, std_out ); + if (!isatty(2)) server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, std_err ); +} + + /************************************************************************* * get_initial_directory * diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index be71498343..892ff10c35 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1491,6 +1491,7 @@ static struct unix_funcs unix_funcs = ntdll_tan, get_initial_environment, get_dynamic_environment, + get_initial_console, get_initial_directory, get_unix_codepage, get_locales, diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index fe63606ed8..d6a15d5f7b 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -99,6 +99,7 @@ int CDECL mmap_enum_reserved_areas( int (CDECL *enum_func)(void *base, SIZE_T s extern NTSTATUS CDECL get_initial_environment( WCHAR **wargv[], WCHAR *env, SIZE_T *size ) DECLSPEC_HIDDEN; extern NTSTATUS CDECL get_dynamic_environment( WCHAR *env, SIZE_T *size ) DECLSPEC_HIDDEN; extern void CDECL get_initial_directory( UNICODE_STRING *dir ) DECLSPEC_HIDDEN; +extern void CDECL get_initial_console( HANDLE *handle, HANDLE *std_in, HANDLE *std_out, HANDLE *std_err ) DECLSPEC_HIDDEN; extern void CDECL get_unix_codepage( CPTABLEINFO *table ) DECLSPEC_HIDDEN; extern void CDECL get_locales( WCHAR *sys, WCHAR *user ) DECLSPEC_HIDDEN; extern NTSTATUS CDECL virtual_map_section( HANDLE handle, PVOID *addr_ptr, unsigned short zero_bits_64, SIZE_T commit_size, diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index cec36b58c0..88010b695e 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -29,7 +29,7 @@ struct msghdr; struct _DISPATCHER_CONTEXT; /* increment this when you change the function table */ -#define NTDLL_UNIXLIB_VERSION 64 +#define NTDLL_UNIXLIB_VERSION 65 struct unix_funcs { @@ -300,6 +300,8 @@ struct unix_funcs /* environment functions */ NTSTATUS (CDECL *get_initial_environment)( WCHAR **wargv[], WCHAR *env, SIZE_T *size ); NTSTATUS (CDECL *get_dynamic_environment)( WCHAR *env, SIZE_T *size ); + void (CDECL *get_initial_console)( HANDLE *handle, HANDLE *std_in, + HANDLE *std_out, HANDLE *std_err ); void (CDECL *get_initial_directory)( UNICODE_STRING *dir ); void (CDECL *get_unix_codepage)( CPTABLEINFO *table ); void (CDECL *get_locales)( WCHAR *sys, WCHAR *user );
1
0
0
0
Michael Müller : ntdll: Return process times in NtQuerySystemInformation(SystemProcessInformation).
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: ed566a87232fddde73481efe2dfcefceca5e49e4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ed566a87232fddde73481efe…
Author: Michael Müller <michael(a)fds-team.de> Date: Sun Jun 28 20:43:19 2020 -0500 ntdll: Return process times in NtQuerySystemInformation(SystemProcessInformation). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/system.c | 2 ++ dlls/ntdll/unix/thread.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index fd86ab874a..7045bc1550 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2155,6 +2155,8 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, { int i, j; + get_thread_times(unix_pid, -1, &spi->KernelTime, &spi->UserTime); + /* set thread info */ i = j = 0; while (ret == STATUS_SUCCESS) diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 3655adf2db..c583a08c05 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -833,7 +833,10 @@ BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LA FILE *f; int i; - sprintf( buf, "/proc/%u/task/%u/stat", unix_pid, unix_tid ); + if (unix_tid == -1) + sprintf( buf, "/proc/%u/stat", unix_pid ); + else + sprintf( buf, "/proc/%u/task/%u/stat", unix_pid, unix_tid ); if (!(f = fopen( buf, "r" ))) { ERR("Failed to open %s: %s\n", buf, strerror(errno));
1
0
0
0
Michael Müller : ntdll: Return thread times in NtQuerySystemInformation(SystemProcessInformation).
by Alexandre Julliard
29 Jun '20
29 Jun '20
Module: wine Branch: master Commit: 69e9651c1ae0542e52f5ea924b9e286584446607 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=69e9651c1ae0542e52f5ea92…
Author: Michael Müller <michael(a)fds-team.de> Date: Sun Jun 28 20:43:18 2020 -0500 ntdll: Return thread times in NtQuerySystemInformation(SystemProcessInformation). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/system.c | 40 +++++++++++++++++++++++++--------------- dlls/ntdll/unix/thread.c | 4 ++-- dlls/ntdll/unix/unix_private.h | 2 ++ include/wine/server_protocol.h | 4 ++-- server/protocol.def | 1 + server/request.h | 1 + server/snapshot.c | 1 + server/trace.c | 1 + 8 files changed, 35 insertions(+), 19 deletions(-) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 5e2e763445..fd86ab874a 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2101,6 +2101,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, len = 0; while (ret == STATUS_SUCCESS) { + int unix_pid = -1; SERVER_START_REQ( next_process ) { req->handle = wine_server_obj_handle( handle ); @@ -2108,6 +2109,8 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, wine_server_set_reply( req, procname, sizeof(procname) - sizeof(WCHAR) ); if (!(ret = wine_server_call( req ))) { + unix_pid = reply->unix_pid; + /* Make sure procname is 0 terminated */ procname[wine_server_reply_size(reply) / sizeof(WCHAR)] = 0; @@ -2156,31 +2159,38 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, i = j = 0; while (ret == STATUS_SUCCESS) { + int unix_tid, pid, tid, base_pri, delta_pri; SERVER_START_REQ( next_thread ) { req->handle = wine_server_obj_handle( handle ); req->reset = (j == 0); if (!(ret = wine_server_call( req ))) { + unix_tid = reply->unix_tid; + pid = reply->pid; + tid = reply->tid; + base_pri = reply->base_pri; + delta_pri = reply->delta_pri; j++; - if (UlongToHandle(reply->pid) == spi->UniqueProcessId) - { - /* ftKernelTime, ftUserTime, ftCreateTime; - * dwTickCount, dwStartAddress - */ - - memset(&spi->ti[i], 0, sizeof(spi->ti)); - - spi->ti[i].CreateTime.QuadPart = 0xdeadbeef; - spi->ti[i].ClientId.UniqueProcess = UlongToHandle(reply->pid); - spi->ti[i].ClientId.UniqueThread = UlongToHandle(reply->tid); - spi->ti[i].dwCurrentPriority = reply->base_pri + reply->delta_pri; - spi->ti[i].dwBasePriority = reply->base_pri; - i++; - } } } SERVER_END_REQ; + + if (!ret) + { + if (UlongToHandle(pid) == spi->UniqueProcessId) + { + memset(&spi->ti[i], 0, sizeof(spi->ti)); + + spi->ti[i].CreateTime.QuadPart = 0xdeadbeef; + spi->ti[i].ClientId.UniqueProcess = UlongToHandle(pid); + spi->ti[i].ClientId.UniqueThread = UlongToHandle(tid); + spi->ti[i].dwCurrentPriority = base_pri + delta_pri; + spi->ti[i].dwBasePriority = base_pri; + get_thread_times(unix_pid, unix_tid, &spi->ti[i].KernelTime, &spi->ti[i].UserTime); + i++; + } + } } if (ret == STATUS_NO_MORE_FILES) ret = STATUS_SUCCESS; diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 54483e1f99..3655adf2db 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -824,7 +824,7 @@ static void wow64_context_to_server( context_t *to, const WOW64_CONTEXT *from ) #endif /* __x86_64__ */ #ifdef linux -static BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LARGE_INTEGER *user_time) +BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LARGE_INTEGER *user_time) { unsigned long clocks_per_sec = sysconf( _SC_CLK_TCK ); unsigned long usr, sys; @@ -869,7 +869,7 @@ static BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_t return FALSE; } #else -static BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LARGE_INTEGER *user_time) +BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LARGE_INTEGER *user_time) { static int once; if (!once++) FIXME("not implemented on this platform\n"); diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index ee6caaec8f..fe63606ed8 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -209,6 +209,8 @@ extern void virtual_fill_image_information( const pe_image_info_t *pe_info, SECTION_IMAGE_INFORMATION *info ) DECLSPEC_HIDDEN; extern NTSTATUS get_thread_ldt_entry( HANDLE handle, void *data, ULONG len, ULONG *ret_len ) DECLSPEC_HIDDEN; +extern BOOL get_thread_times( int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, + LARGE_INTEGER *user_time ) DECLSPEC_HIDDEN; extern void signal_init_threading(void) DECLSPEC_HIDDEN; extern NTSTATUS signal_alloc_thread( TEB *teb ) DECLSPEC_HIDDEN; extern void signal_free_thread( TEB *teb ) DECLSPEC_HIDDEN; diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 0473c6a64a..13da55aded 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -2493,7 +2493,7 @@ struct next_thread_reply thread_id_t tid; int base_pri; int delta_pri; - char __pad_28[4]; + int unix_tid; }; @@ -6702,7 +6702,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 610 +#define SERVER_PROTOCOL_VERSION 611 /* ### protocol_version end ### */ diff --git a/server/protocol.def b/server/protocol.def index ed8ca3c478..38079f23da 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1913,6 +1913,7 @@ enum char_info_mode thread_id_t tid; /* thread id */ int base_pri; /* base priority */ int delta_pri; /* delta priority */ + int unix_tid; /* thread native pid */ @END diff --git a/server/request.h b/server/request.h index 2a64643848..3b7db3997b 100644 --- a/server/request.h +++ b/server/request.h @@ -1362,6 +1362,7 @@ C_ASSERT( FIELD_OFFSET(struct next_thread_reply, pid) == 12 ); C_ASSERT( FIELD_OFFSET(struct next_thread_reply, tid) == 16 ); C_ASSERT( FIELD_OFFSET(struct next_thread_reply, base_pri) == 20 ); C_ASSERT( FIELD_OFFSET(struct next_thread_reply, delta_pri) == 24 ); +C_ASSERT( FIELD_OFFSET(struct next_thread_reply, unix_tid) == 28 ); C_ASSERT( sizeof(struct next_thread_reply) == 32 ); C_ASSERT( FIELD_OFFSET(struct wait_debug_event_request, get_handle) == 12 ); C_ASSERT( sizeof(struct wait_debug_event_request) == 16 ); diff --git a/server/snapshot.c b/server/snapshot.c index a0f2ea17a3..bdceaef530 100644 --- a/server/snapshot.c +++ b/server/snapshot.c @@ -150,6 +150,7 @@ static int snapshot_next_thread( struct snapshot *snapshot, struct next_thread_r reply->tid = get_thread_id( ptr->thread ); reply->base_pri = ptr->priority; reply->delta_pri = 0; /* FIXME */ + reply->unix_tid = ptr->thread->unix_tid; return 1; } diff --git a/server/trace.c b/server/trace.c index 2b22dc5207..951ac44d9d 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2412,6 +2412,7 @@ static void dump_next_thread_reply( const struct next_thread_reply *req ) fprintf( stderr, ", tid=%04x", req->tid ); fprintf( stderr, ", base_pri=%d", req->base_pri ); fprintf( stderr, ", delta_pri=%d", req->delta_pri ); + fprintf( stderr, ", unix_tid=%d", req->unix_tid ); } static void dump_wait_debug_event_request( const struct wait_debug_event_request *req )
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
95
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Results per page:
10
25
50
100
200