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 2023
----- 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
633 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Load modules with a high base address in high memory.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: f473e31341a0dbc2eb5222cc1d1cfe468946bf0a URL:
https://gitlab.winehq.org/wine/wine/-/commit/f473e31341a0dbc2eb5222cc1d1cfe…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 13 14:44:26 2023 +0200 ntdll: Load modules with a high base address in high memory. --- dlls/ntdll/unix/virtual.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index b062ac5038a..daba5086422 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -2829,9 +2829,15 @@ static NTSTATUS virtual_map_image( HANDLE mapping, void **addr_ptr, SIZE_T *size base = wine_server_get_ptr( image_info->base ); if ((ULONG_PTR)base != image_info->base) base = NULL; - if ((char *)base >= (char *)address_space_start) /* make sure the DOS area remains free */ - status = map_view( &view, base, size, alloc_type, vprot, limit_low, limit_high, 0 ); - + limit_low = max( limit_low, (ULONG_PTR)address_space_start ); /* make sure the DOS area remains free */ + status = map_view( &view, base, size, alloc_type, vprot, limit_low, limit_high, 0 ); + if (status && limit_low < limit_4g) + { + if ((ULONG_PTR)base >= limit_4g) status = map_view( &view, NULL, size, alloc_type, vprot, + limit_4g, limit_high, 0 ); + else if (limit_high > limit_2g) status = map_view( &view, NULL, size, alloc_type, vprot, + limit_low, limit_2g - 1, 0 ); + } if (status) status = map_view( &view, NULL, size, alloc_type, vprot, limit_low, limit_high, 0 ); if (status) goto done;
1
0
0
0
Alexandre Julliard : ntdll: Allocate 64-bit and kernel stacks in high memory.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: a82238fad52761114ab2488d422fad3f70dbb854 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a82238fad52761114ab2488d422fad…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 13 12:17:32 2023 +0200 ntdll: Allocate 64-bit and kernel stacks in high memory. --- dlls/ntdll/unix/thread.c | 8 ++++---- dlls/ntdll/unix/unix_private.h | 5 ++++- dlls/ntdll/unix/virtual.c | 5 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index e821fa680ce..d312ed6a066 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -1180,7 +1180,7 @@ NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR limit, SIZE_T reserve_size, SIZE NTSTATUS status; /* kernel stack */ - if ((status = virtual_alloc_thread_stack( &stack, 0, 0, kernel_stack_size, kernel_stack_size, FALSE ))) + if ((status = virtual_alloc_thread_stack( &stack, limit_4g, 0, kernel_stack_size, kernel_stack_size, FALSE ))) return status; thread_data->kernel_stack = stack.DeallocationStack; @@ -1191,7 +1191,7 @@ NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR limit, SIZE_T reserve_size, SIZE ((get_machine_context_size( main_image_info.Machine ) + 7) & ~7) + sizeof(ULONG64); /* 64-bit stack */ - if ((status = virtual_alloc_thread_stack( &stack, 0, 0, 0x40000, 0x40000, TRUE ))) return status; + if ((status = virtual_alloc_thread_stack( &stack, limit_4g, 0, 0x40000, 0x40000, TRUE ))) return status; cpu = (WOW64_CPURESERVED *)(((ULONG_PTR)stack.StackBase - cpusize) & ~15); cpu->Machine = main_image_info.Machine; @@ -1201,8 +1201,8 @@ NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR limit, SIZE_T reserve_size, SIZE teb->DeallocationStack = stack.DeallocationStack; /* 32-bit stack */ - if ((status = virtual_alloc_thread_stack( &stack, 0, limit ? limit : 0x7fffffff, - reserve_size, commit_size, TRUE ))) + if (!limit || limit >= limit_2g) limit = limit_2g - 1; + if ((status = virtual_alloc_thread_stack( &stack, 0, limit, reserve_size, commit_size, TRUE ))) return status; wow_teb->Tib.StackBase = PtrToUlong( stack.StackBase ); wow_teb->Tib.StackLimit = PtrToUlong( stack.StackLimit ); diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index b7ea96bb20a..1f49d957e0d 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -44,6 +44,9 @@ extern WORD native_machine DECLSPEC_HIDDEN; static const BOOL is_win64 = (sizeof(void *) > sizeof(int)); +static const ULONG_PTR limit_2g = (ULONG_PTR)1 << 31; +static const ULONG_PTR limit_4g = (ULONG_PTR)((ULONGLONG)1 << 32); + static inline BOOL is_machine_64bit( WORD machine ) { return (machine == IMAGE_FILE_MACHINE_AMD64 || machine == IMAGE_FILE_MACHINE_ARM64); @@ -513,7 +516,7 @@ static inline NTSTATUS map_section( HANDLE mapping, void **ptr, SIZE_T *size, UL { *ptr = NULL; *size = 0; - return NtMapViewOfSection( mapping, NtCurrentProcess(), ptr, is_win64 && wow_peb ? 0x7fffffff : 0, + return NtMapViewOfSection( mapping, NtCurrentProcess(), ptr, is_win64 && wow_peb ? limit_2g - 1 : 0, 0, NULL, size, ViewShare, 0, protect ); } diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index a7f4d7412e5..b062ac5038a 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -3352,7 +3352,7 @@ TEB *virtual_alloc_first_teb(void) exit(1); } - NtAllocateVirtualMemory( NtCurrentProcess(), &teb_block, is_win64 ? 0x7fffffff : 0, &total, + NtAllocateVirtualMemory( NtCurrentProcess(), &teb_block, is_win64 ? limit_2g - 1 : 0, &total, MEM_RESERVE | MEM_TOP_DOWN, PAGE_READWRITE ); teb_block_pos = 30; ptr = (char *)teb_block + 30 * block_size; @@ -3390,7 +3390,8 @@ NTSTATUS virtual_alloc_teb( TEB **ret_teb ) { SIZE_T total = 32 * block_size; - if ((status = NtAllocateVirtualMemory( NtCurrentProcess(), &ptr, is_win64 && is_wow64() ? 0x7fffffff : 0, + if ((status = NtAllocateVirtualMemory( NtCurrentProcess(), &ptr, + is_win64 && is_wow64() ? limit_2g - 1 : 0, &total, MEM_RESERVE, PAGE_READWRITE ))) { server_leave_uninterrupted_section( &virtual_mutex, &sigset );
1
0
0
0
Alexandre Julliard : ntdll: Support the lower memory limit in MEM_ADDRESS_REQUIREMENTS.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: 11cd51139d4b9adaf877f4082d16adccc22cab7c URL:
https://gitlab.winehq.org/wine/wine/-/commit/11cd51139d4b9adaf877f4082d16ad…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 13 11:17:03 2023 +0200 ntdll: Support the lower memory limit in MEM_ADDRESS_REQUIREMENTS. --- dlls/ntdll/tests/virtual.c | 62 +++++++++++++++++++++ dlls/ntdll/unix/loader.c | 35 ++++++------ dlls/ntdll/unix/server.c | 27 +++++----- dlls/ntdll/unix/thread.c | 8 +-- dlls/ntdll/unix/unix_private.h | 16 +++--- dlls/ntdll/unix/virtual.c | 119 ++++++++++++++++++++++++----------------- include/wine/server_protocol.h | 11 ++-- server/protocol.def | 9 ++-- server/request.h | 2 +- server/trace.c | 7 ++- tools/make_requests | 2 +- 11 files changed, 199 insertions(+), 99 deletions(-)
1
0
0
0
Alexandre Julliard : server: Also enforce the size of varargs data structures.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: 2705e6c319119663836e3c3c7a18649b0afad028 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2705e6c319119663836e3c3c7a1864…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 13 10:47:20 2023 +0200 server: Also enforce the size of varargs data structures. --- include/wine/server_protocol.h | 3 ++- server/protocol.def | 1 + server/request.h | 18 ++++++++++++++++++ tools/make_requests | 22 +++++++++++++++++++++- 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 5a14a3c4370..1dfb9131f50 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -456,6 +456,7 @@ typedef union { enum select_op op; obj_handle_t handles[MAXIMUM_WAIT_OBJECTS]; + int __pad; } wait; struct { @@ -6413,7 +6414,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 774 +#define SERVER_PROTOCOL_VERSION 775 /* ### protocol_version end ### */ diff --git a/server/protocol.def b/server/protocol.def index 4237737ab40..90227fad66a 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -472,6 +472,7 @@ typedef union { enum select_op op; /* SELECT_WAIT or SELECT_WAIT_ALL */ obj_handle_t handles[MAXIMUM_WAIT_OBJECTS]; + int __pad; } wait; struct { diff --git a/server/request.h b/server/request.h index ea08babdda8..f1ec5c63579 100644 --- a/server/request.h +++ b/server/request.h @@ -689,13 +689,17 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = C_ASSERT( sizeof(abstime_t) == 8 ); C_ASSERT( sizeof(affinity_t) == 8 ); +C_ASSERT( sizeof(apc_call_t) == 48 ); C_ASSERT( sizeof(apc_param_t) == 8 ); C_ASSERT( sizeof(apc_result_t) == 40 ); C_ASSERT( sizeof(async_data_t) == 40 ); C_ASSERT( sizeof(atom_t) == 4 ); C_ASSERT( sizeof(char) == 1 ); C_ASSERT( sizeof(client_ptr_t) == 8 ); +C_ASSERT( sizeof(context_t) == 1720 ); +C_ASSERT( sizeof(cursor_pos_t) == 24 ); C_ASSERT( sizeof(data_size_t) == 4 ); +C_ASSERT( sizeof(debug_event_t) == 160 ); C_ASSERT( sizeof(file_pos_t) == 8 ); C_ASSERT( sizeof(generic_map_t) == 16 ); C_ASSERT( sizeof(hw_input_t) == 40 ); @@ -704,17 +708,31 @@ C_ASSERT( sizeof(ioctl_code_t) == 4 ); C_ASSERT( sizeof(irp_params_t) == 32 ); C_ASSERT( sizeof(lparam_t) == 8 ); C_ASSERT( sizeof(mem_size_t) == 8 ); +C_ASSERT( sizeof(message_data_t) == 56 ); C_ASSERT( sizeof(mod_handle_t) == 8 ); C_ASSERT( sizeof(obj_handle_t) == 4 ); +C_ASSERT( sizeof(pe_image_info_t) == 80 ); C_ASSERT( sizeof(process_id_t) == 4 ); +C_ASSERT( sizeof(property_data_t) == 16 ); C_ASSERT( sizeof(rectangle_t) == 16 ); +C_ASSERT( sizeof(select_op_t) == 264 ); C_ASSERT( sizeof(short int) == 2 ); +C_ASSERT( sizeof(startup_info_t) == 92 ); +C_ASSERT( sizeof(struct filesystem_event) == 12 ); +C_ASSERT( sizeof(struct handle_info) == 20 ); C_ASSERT( sizeof(struct luid) == 8 ); +C_ASSERT( sizeof(struct luid_attr) == 12 ); +C_ASSERT( sizeof(struct object_attributes) == 16 ); +C_ASSERT( sizeof(struct object_type_info) == 44 ); +C_ASSERT( sizeof(struct process_info) == 40 ); +C_ASSERT( sizeof(struct rawinput_device) == 12 ); +C_ASSERT( sizeof(struct thread_info) == 40 ); C_ASSERT( sizeof(thread_id_t) == 4 ); C_ASSERT( sizeof(timeout_t) == 8 ); C_ASSERT( sizeof(unsigned char) == 1 ); C_ASSERT( sizeof(unsigned int) == 4 ); C_ASSERT( sizeof(unsigned short) == 2 ); +C_ASSERT( sizeof(user_apc_t) == 40 ); C_ASSERT( sizeof(user_handle_t) == 4 ); C_ASSERT( FIELD_OFFSET(struct new_process_request, token) == 12 ); C_ASSERT( FIELD_OFFSET(struct new_process_request, debug) == 16 ); diff --git a/tools/make_requests b/tools/make_requests index e5db1c7fc0a..a3c987c4702 100755 --- a/tools/make_requests +++ b/tools/make_requests @@ -52,6 +52,25 @@ my %formats = "generic_map_t" => [ 16, 4, "&dump_generic_map" ], "ioctl_code_t" => [ 4, 4, "&dump_ioctl_code" ], "hw_input_t" => [ 40, 8, "&dump_hw_input" ], + # varargs-only structures + "apc_call_t" => [ 48, 8 ], + "context_t" => [ 1720, 8 ], + "cursor_pos_t" => [ 24, 8 ], + "debug_event_t" => [ 160, 8 ], + "message_data_t" => [ 56, 8 ], + "pe_image_info_t" => [ 80, 8 ], + "property_data_t" => [ 16, 8 ], + "select_op_t" => [ 264, 8 ], + "startup_info_t" => [ 92, 4 ], + "user_apc_t" => [ 40, 8 ], + "struct filesystem_event" => [ 12, 4 ], + "struct handle_info" => [ 20, 4 ], + "struct luid_attr" => [ 12, 4 ], + "struct object_attributes" => [ 16, 4 ], + "struct object_type_info" => [ 44, 4 ], + "struct process_info" => [ 40, 8 ], + "struct rawinput_device" => [ 12, 4 ], + "struct thread_info" => [ 40, 8 ], ); my @requests = (); @@ -479,7 +498,8 @@ push @request_lines, "};\n\n"; foreach my $type (sort keys %formats) { - my $size = ${$formats{$type}}[0]; + my ($size, $align) = @{$formats{$type}}; + die "$type: invalid size $size for alignment $align" if $size % $align; push @request_lines, "C_ASSERT( sizeof($type) == $size );\n"; } push @request_lines, @asserts;
1
0
0
0
Alexandre Julliard : kernel32/tests: Fix the PROCESS_BASIC_INFORMATION exit status type.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: 2f3c8be54f3e469616ddb78b134c5617f2e711ca URL:
https://gitlab.winehq.org/wine/wine/-/commit/2f3c8be54f3e469616ddb78b134c56…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 13 22:04:44 2023 +0200 kernel32/tests: Fix the PROCESS_BASIC_INFORMATION exit status type. --- dlls/kernel32/tests/loader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 696ffae4430..2c9e97d7fc7 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -38,7 +38,7 @@ struct PROCESS_BASIC_INFORMATION_PRIVATE { - DWORD_PTR ExitStatus; + NTSTATUS ExitStatus; PPEB PebBaseAddress; DWORD_PTR AffinityMask; DWORD_PTR BasePriority; @@ -3004,7 +3004,7 @@ static void child_process(const char *dll_name, DWORD target_offset) ret = pNtQueryInformationProcess(process, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); ok(!ret, "NtQueryInformationProcess error %#lx\n", ret); ok(pbi.ExitStatus == STILL_ACTIVE || pbi.ExitStatus == 195, - "expected STILL_ACTIVE, got %Iu\n", pbi.ExitStatus); + "expected STILL_ACTIVE, got %lu\n", pbi.ExitStatus); affinity = 1; ret = pNtSetInformationProcess(process, ProcessAffinityMask, &affinity, sizeof(affinity)); ok(!ret, "NtSetInformationProcess error %#lx\n", ret); @@ -3040,7 +3040,7 @@ static void child_process(const char *dll_name, DWORD target_offset) ret = pNtQueryInformationProcess(process, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); ok(!ret, "NtQueryInformationProcess error %#lx\n", ret); ok(pbi.ExitStatus == STILL_ACTIVE || pbi.ExitStatus == 195, - "expected STILL_ACTIVE, got %Iu\n", pbi.ExitStatus); + "expected STILL_ACTIVE, got %lu\n", pbi.ExitStatus); affinity = 1; ret = pNtSetInformationProcess(process, ProcessAffinityMask, &affinity, sizeof(affinity)); ok(!ret, "NtSetInformationProcess error %#lx\n", ret); @@ -3555,7 +3555,7 @@ static void test_ExitProcess(void) memset(&pbi, 0, sizeof(pbi)); ret = pNtQueryInformationProcess(pi.hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); ok(!ret, "NtQueryInformationProcess error %#lx\n", ret); - ok(pbi.ExitStatus == 198, "expected 198, got %Iu\n", pbi.ExitStatus); + ok(pbi.ExitStatus == 198, "expected 198, got %lu\n", pbi.ExitStatus); affinity = 1; ret = pNtSetInformationProcess(pi.hProcess, ProcessAffinityMask, &affinity, sizeof(affinity)); ok(ret == STATUS_PROCESS_IS_TERMINATING, "expected STATUS_PROCESS_IS_TERMINATING, got %#lx\n", ret);
1
0
0
0
Davide Beatrici : wineoss: Implement main_loop in unixlib.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: e55c432a91870d7d86f9a60848c2ec79b63e555b URL:
https://gitlab.winehq.org/wine/wine/-/commit/e55c432a91870d7d86f9a60848c2ec…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Mon Jun 12 19:42:38 2023 +0200 wineoss: Implement main_loop in unixlib. --- dlls/wineoss.drv/mmdevdrv.c | 7 +++++++ dlls/wineoss.drv/oss.c | 24 ++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 12f10fd4377..038dcecd07f 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -82,6 +82,8 @@ extern const IAudioClock2Vtbl AudioClock2_Vtbl; extern const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; extern const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; +extern HRESULT main_loop_start(void) DECLSPEC_HIDDEN; + extern struct audio_session_wrapper *session_wrapper_create( struct audio_client *client) DECLSPEC_HIDDEN; @@ -575,6 +577,11 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, return AUDCLNT_E_ALREADY_INITIALIZED; } + if(FAILED(params.result = main_loop_start())){ + sessions_unlock(); + return params.result; + } + params.name = NULL; params.device = This->device_name; params.flow = This->dataflow; diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c index df03d3286d9..5049c711e98 100644 --- a/dlls/wineoss.drv/oss.c +++ b/dlls/wineoss.drv/oss.c @@ -221,6 +221,13 @@ static void get_default_device(EDataFlow flow, char device[OSS_DEVNODE_SIZE]) return; } +static NTSTATUS oss_main_loop(void *args) +{ + struct main_loop_params *params = args; + NtSetEvent(params->event, NULL); + return STATUS_SUCCESS; +} + static NTSTATUS oss_get_endpoint_ids(void *args) { struct get_endpoint_ids_params *params = args; @@ -1684,7 +1691,7 @@ unixlib_entry_t __wine_unix_call_funcs[] = { oss_not_implemented, oss_not_implemented, - oss_not_implemented, + oss_main_loop, oss_get_endpoint_ids, oss_create_stream, oss_release_stream, @@ -1738,6 +1745,19 @@ static NTSTATUS oss_wow64_test_connect(void *args) return STATUS_SUCCESS; } +static NTSTATUS oss_wow64_main_loop(void *args) +{ + struct + { + PTR32 event; + } *params32 = args; + struct main_loop_params params = + { + .event = ULongToHandle(params32->event) + }; + return oss_main_loop(¶ms); +} + static NTSTATUS oss_wow64_get_endpoint_ids(void *args) { struct @@ -2108,7 +2128,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] = { oss_not_implemented, oss_not_implemented, - oss_not_implemented, + oss_wow64_main_loop, oss_wow64_get_endpoint_ids, oss_wow64_create_stream, oss_wow64_release_stream,
1
0
0
0
Davide Beatrici : winecoreaudio: Implement main_loop in unixlib.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: 9ad0694aed6ad3622975fc37ef26c0437d0efbdc URL:
https://gitlab.winehq.org/wine/wine/-/commit/9ad0694aed6ad3622975fc37ef26c0…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Mon Jun 12 19:42:17 2023 +0200 winecoreaudio: Implement main_loop in unixlib. --- dlls/winecoreaudio.drv/coreaudio.c | 24 ++++++++++++++++++++++-- dlls/winecoreaudio.drv/mmdevdrv.c | 7 +++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/dlls/winecoreaudio.drv/coreaudio.c b/dlls/winecoreaudio.drv/coreaudio.c index d031b82583e..f41118e62f5 100644 --- a/dlls/winecoreaudio.drv/coreaudio.c +++ b/dlls/winecoreaudio.drv/coreaudio.c @@ -196,6 +196,13 @@ static BOOL device_has_channels(AudioDeviceID device, EDataFlow flow) return ret; } +static NTSTATUS unix_main_loop(void *args) +{ + struct main_loop_params *params = args; + NtSetEvent(params->event, NULL); + return STATUS_SUCCESS; +} + static NTSTATUS unix_get_endpoint_ids(void *args) { struct get_endpoint_ids_params *params = args; @@ -1775,7 +1782,7 @@ unixlib_entry_t __wine_unix_call_funcs[] = { unix_not_implemented, unix_not_implemented, - unix_not_implemented, + unix_main_loop, unix_get_endpoint_ids, unix_create_stream, unix_release_stream, @@ -1813,6 +1820,19 @@ unixlib_entry_t __wine_unix_call_funcs[] = typedef UINT PTR32; +static NTSTATUS unix_wow64_main_loop(void *args) +{ + struct + { + PTR32 event; + } *params32 = args; + struct main_loop_params params = + { + .event = ULongToHandle(params32->event) + }; + return unix_main_loop(¶ms); +} + static NTSTATUS unix_wow64_get_endpoint_ids(void *args) { struct @@ -2157,7 +2177,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] = { unix_not_implemented, unix_not_implemented, - unix_not_implemented, + unix_wow64_main_loop, unix_wow64_get_endpoint_ids, unix_wow64_create_stream, unix_wow64_release_stream, diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index f268e9565b4..300d2a8223a 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -70,6 +70,8 @@ static CRITICAL_SECTION_DEBUG g_sessions_lock_debug = static CRITICAL_SECTION g_sessions_lock = { &g_sessions_lock_debug, -1, 0, 0, 0, 0 }; static struct list g_sessions = LIST_INIT(g_sessions); +extern HRESULT main_loop_start(void) DECLSPEC_HIDDEN; + extern struct audio_session_wrapper *session_wrapper_create( struct audio_client *client) DECLSPEC_HIDDEN; @@ -587,6 +589,11 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, return AUDCLNT_E_ALREADY_INITIALIZED; } + if(FAILED(params.result = main_loop_start())){ + sessions_unlock(); + return params.result; + } + params.name = NULL; params.device = This->device_name; params.flow = This->dataflow;
1
0
0
0
Davide Beatrici : winealsa: Implement main_loop in unixlib.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: b089e4a2bbf9b6c295f29315bbe168610f003d30 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b089e4a2bbf9b6c295f29315bbe168…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Mon Jun 12 19:41:57 2023 +0200 winealsa: Implement main_loop in unixlib. --- dlls/winealsa.drv/alsa.c | 24 ++++++++++++++++++++++-- dlls/winealsa.drv/mmdevdrv.c | 7 +++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/dlls/winealsa.drv/alsa.c b/dlls/winealsa.drv/alsa.c index dbf85a7947e..4930850e9dc 100644 --- a/dlls/winealsa.drv/alsa.c +++ b/dlls/winealsa.drv/alsa.c @@ -476,6 +476,13 @@ static WCHAR *alsa_get_card_name(int card) return ret; } +static NTSTATUS alsa_main_loop(void *args) +{ + struct main_loop_params *params = args; + NtSetEvent(params->event, NULL); + return STATUS_SUCCESS; +} + static NTSTATUS alsa_get_endpoint_ids(void *args) { static const WCHAR defaultW[] = {'d','e','f','a','u','l','t',0}; @@ -2493,7 +2500,7 @@ unixlib_entry_t __wine_unix_call_funcs[] = { alsa_not_implemented, alsa_not_implemented, - alsa_not_implemented, + alsa_main_loop, alsa_get_endpoint_ids, alsa_create_stream, alsa_release_stream, @@ -2531,6 +2538,19 @@ unixlib_entry_t __wine_unix_call_funcs[] = typedef UINT PTR32; +static NTSTATUS alsa_wow64_main_loop(void *args) +{ + struct + { + PTR32 event; + } *params32 = args; + struct main_loop_params params = + { + .event = ULongToHandle(params32->event) + }; + return alsa_main_loop(¶ms); +} + static NTSTATUS alsa_wow64_get_endpoint_ids(void *args) { struct @@ -2934,7 +2954,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] = { alsa_not_implemented, alsa_not_implemented, - alsa_not_implemented, + alsa_wow64_main_loop, alsa_wow64_get_endpoint_ids, alsa_wow64_create_stream, alsa_wow64_release_stream, diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 7c7096d584a..d2681fc8e9c 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -76,6 +76,8 @@ extern const IAudioClock2Vtbl AudioClock2_Vtbl; extern const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; extern const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; +extern HRESULT main_loop_start(void) DECLSPEC_HIDDEN; + extern struct audio_session_wrapper *session_wrapper_create( struct audio_client *client) DECLSPEC_HIDDEN; @@ -598,6 +600,11 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, return AUDCLNT_E_ALREADY_INITIALIZED; } + if(FAILED(params.result = main_loop_start())){ + sessions_unlock(); + return params.result; + } + dump_fmt(fmt); params.name = NULL;
1
0
0
0
Davide Beatrici : winepulse: Move main loop logic into mmdevapi.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: 03e5c9fa7d798d7176e7b533d9ac010d13099ae0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/03e5c9fa7d798d7176e7b533d9ac01…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Mon Jun 12 19:41:33 2023 +0200 winepulse: Move main loop logic into mmdevapi. --- dlls/mmdevapi/client.c | 41 ++++++++++++++++++++++++++++++++++++++++ dlls/mmdevapi/main.c | 2 ++ dlls/mmdevapi/mmdevapi_private.h | 2 ++ dlls/winepulse.drv/mmdevdrv.c | 32 +++++-------------------------- 4 files changed, 50 insertions(+), 27 deletions(-) diff --git a/dlls/mmdevapi/client.c b/dlls/mmdevapi/client.c index bd861f8b890..b1b178e00a5 100644 --- a/dlls/mmdevapi/client.c +++ b/dlls/mmdevapi/client.c @@ -38,6 +38,16 @@ extern void sessions_unlock(void) DECLSPEC_HIDDEN; extern struct audio_session_wrapper *session_wrapper_create(struct audio_client *client) DECLSPEC_HIDDEN; +static HANDLE main_loop_thread; + +void main_loop_stop(void) +{ + if (main_loop_thread) { + WaitForSingleObject(main_loop_thread, INFINITE); + CloseHandle(main_loop_thread); + } +} + void set_stream_volumes(struct audio_client *This) { struct set_volumes_params params; @@ -114,6 +124,37 @@ static void dump_fmt(const WAVEFORMATEX *fmt) } } +static DWORD CALLBACK main_loop_func(void *event) +{ + struct main_loop_params params; + + SetThreadDescription(GetCurrentThread(), L"audio_client_main"); + + params.event = event; + + WINE_UNIX_CALL(main_loop, ¶ms); + + return 0; +} + +HRESULT main_loop_start(void) +{ + if (!main_loop_thread) { + HANDLE event = CreateEventW(NULL, TRUE, FALSE, NULL); + if (!(main_loop_thread = CreateThread(NULL, 0, main_loop_func, event, 0, NULL))) { + ERR("Failed to create main loop thread\n"); + CloseHandle(event); + return E_FAIL; + } + + SetThreadPriority(main_loop_thread, THREAD_PRIORITY_TIME_CRITICAL); + WaitForSingleObject(event, INFINITE); + CloseHandle(event); + } + + return S_OK; +} + static DWORD CALLBACK timer_loop_func(void *user) { struct timer_loop_params params; diff --git a/dlls/mmdevapi/main.c b/dlls/mmdevapi/main.c index d3d4ec6a905..d1006b9999c 100644 --- a/dlls/mmdevapi/main.c +++ b/dlls/mmdevapi/main.c @@ -202,6 +202,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) WARN("Unable to deinitialize library: %lx\n", status); } + main_loop_stop(); + if (!lpvReserved) MMDevEnum_Free(); break; diff --git a/dlls/mmdevapi/mmdevapi_private.h b/dlls/mmdevapi/mmdevapi_private.h index 684d303eefb..5abde115951 100644 --- a/dlls/mmdevapi/mmdevapi_private.h +++ b/dlls/mmdevapi/mmdevapi_private.h @@ -80,4 +80,6 @@ extern HRESULT SpatialAudioClient_Create(IMMDevice *device, ISpatialAudioClient extern HRESULT load_devices_from_reg(void) DECLSPEC_HIDDEN; extern HRESULT load_driver_devices(EDataFlow flow) DECLSPEC_HIDDEN; +extern void main_loop_stop(void) DECLSPEC_HIDDEN; + extern const WCHAR drv_keyW[] DECLSPEC_HIDDEN; diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 12e36fae827..f15fa88c15e 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -56,7 +56,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(pulse); #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) -static HANDLE pulse_thread; static struct list g_sessions = LIST_INIT(g_sessions); static struct list g_devices_cache = LIST_INIT(g_devices_cache); @@ -115,11 +114,6 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) LIST_FOR_EACH_ENTRY_SAFE(device, device_next, &g_devices_cache, struct device_cache, entry) free(device); - - if (pulse_thread) { - WaitForSingleObject(pulse_thread, INFINITE); - CloseHandle(pulse_thread); - } } return TRUE; } @@ -134,6 +128,8 @@ extern const IAudioClockVtbl AudioClock_Vtbl; extern const IAudioClock2Vtbl AudioClock2_Vtbl; extern const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; +extern HRESULT main_loop_start(void) DECLSPEC_HIDDEN; + extern struct audio_session_wrapper *session_wrapper_create( struct audio_client *client) DECLSPEC_HIDDEN; @@ -157,15 +153,6 @@ static void pulse_release_stream(stream_handle stream, HANDLE timer) pulse_call(release_stream, ¶ms); } -static DWORD CALLBACK pulse_mainloop_thread(void *event) -{ - struct main_loop_params params; - params.event = event; - SetThreadDescription(GetCurrentThread(), L"winepulse_mainloop"); - pulse_call(main_loop, ¶ms); - return 0; -} - typedef struct tagLANGANDCODEPAGE { WORD wLanguage; @@ -735,19 +722,10 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, return AUDCLNT_E_ALREADY_INITIALIZED; } - if (!pulse_thread) + if (FAILED(hr = main_loop_start())) { - HANDLE event = CreateEventW(NULL, TRUE, FALSE, NULL); - if (!(pulse_thread = CreateThread(NULL, 0, pulse_mainloop_thread, event, 0, NULL))) - { - ERR("Failed to create mainloop thread.\n"); - sessions_unlock(); - CloseHandle(event); - return E_FAIL; - } - SetThreadPriority(pulse_thread, THREAD_PRIORITY_TIME_CRITICAL); - WaitForSingleObject(event, INFINITE); - CloseHandle(event); + sessions_unlock(); + return hr; } params.name = name = get_application_name(TRUE);
1
0
0
0
Connor McAdams : uiautomationcore: Unconditionally match all events registered on the desktop node with a scope of subtree.
by Alexandre Julliard
12 Jun '23
12 Jun '23
Module: wine Branch: master Commit: c7431990d815e664cf22267142b76cc59f21d192 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c7431990d815e664cf22267142b76c…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Thu May 18 11:31:00 2023 -0400 uiautomationcore: Unconditionally match all events registered on the desktop node with a scope of subtree. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 43 ++++++++++++++++++++++++++++++ dlls/uiautomationcore/uia_client.c | 18 ------------- dlls/uiautomationcore/uia_event.c | 34 +++++++++++++++++++++++ dlls/uiautomationcore/uia_private.h | 2 ++ dlls/uiautomationcore/uia_utils.c | 17 ++++++++++++ 5 files changed, 96 insertions(+), 18 deletions(-) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 0ad9a883c1c..efcba1c2b5f 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -14237,6 +14237,49 @@ static void test_UiaAddEvent(void) todo_wine CHECK_CALLED_MULTI(prov_callback_proxy, 2); CHECK_CALLED(uia_event_callback); + hr = UiaRemoveEvent(event); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + /* + * Register an event on the desktop HWND with a scope of TreeScope_Element + * and TreeScope_Descendants. This is a special case where all providers + * will match, regardless of whether or not they can navigate to the + * desktop node. + */ + set_cache_request(&cache_req, (struct UiaCondition *)&UiaTrueCondition, TreeScope_Element, NULL, 0, NULL, 0, + AutomationElementMode_Full); + hr = UiaAddEvent(node, UIA_AutomationFocusChangedEventId, uia_event_callback, TreeScope_Element | TreeScope_Descendants, NULL, 0, + &cache_req, &event); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!!event, "event == NULL\n"); + + /* + * Raise an event on Provider2 - completely disconnected from all other + * providers, will still trigger the event callback. + */ + initialize_provider(&Provider2, ProviderOptions_ServerSideProvider, NULL, TRUE); + init_node_provider_desc(&exp_node_desc, GetCurrentProcessId(), NULL); + add_provider_desc(&exp_node_desc, L"Main", L"Provider2", TRUE); + set_event_data(0, 0, 1, 1, &exp_node_desc, L"P)"); + SET_EXPECT(uia_event_callback); + hr = UiaRaiseAutomationEvent(&Provider2.IRawElementProviderSimple_iface, UIA_AutomationFocusChangedEventId); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + CHECK_CALLED(uia_event_callback); + + /* + * No clientside providers to match us to the desktop node through + * navigation, but event will still be triggered. + */ + init_node_provider_desc(&exp_node_desc, GetCurrentProcessId(), hwnd); + add_provider_desc(&exp_node_desc, L"Main", L"Provider_hwnd2", TRUE); + set_event_data(0, 0, 1, 1, &exp_node_desc, L"P)"); + SET_EXPECT(uia_event_callback); + Provider_hwnd2.prov_opts = ProviderOptions_ServerSideProvider; + Provider_hwnd2.ignore_hwnd_prop = TRUE; + hr = UiaRaiseAutomationEvent(&Provider_hwnd2.IRawElementProviderSimple_iface, UIA_AutomationFocusChangedEventId); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + CHECK_CALLED(uia_event_callback); + hr = UiaRemoveEvent(event); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); UiaNodeRelease(node); diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index a94a6b8db81..e1dd7d0bd23 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -2692,30 +2692,12 @@ HRESULT WINAPI UiaGetPropertyValue(HUIANODE huianode, PROPERTYID prop_id, VARIAN return hr; } -#define UIA_RUNTIME_ID_PREFIX 42 - enum fragment_root_prov_type_ids { FRAGMENT_ROOT_NONCLIENT_TYPE_ID = 0x03, FRAGMENT_ROOT_MAIN_TYPE_ID = 0x04, FRAGMENT_ROOT_OVERRIDE_TYPE_ID = 0x05, }; -static HRESULT write_runtime_id_base(SAFEARRAY *sa, HWND hwnd) -{ - const int rt_id[2] = { UIA_RUNTIME_ID_PREFIX, HandleToUlong(hwnd) }; - HRESULT hr; - LONG idx; - - for (idx = 0; idx < ARRAY_SIZE(rt_id); idx++) - { - hr = SafeArrayPutElement(sa, &idx, (void *)&rt_id[idx]); - if (FAILED(hr)) - return hr; - } - - return S_OK; -} - static SAFEARRAY *append_uia_runtime_id(SAFEARRAY *sa, HWND hwnd, enum ProviderOptions root_opts) { LONG i, idx, lbound, elems; diff --git a/dlls/uiautomationcore/uia_event.c b/dlls/uiautomationcore/uia_event.c index dc3474d1b13..a0b4ced1aa9 100644 --- a/dlls/uiautomationcore/uia_event.c +++ b/dlls/uiautomationcore/uia_event.c @@ -24,6 +24,32 @@ WINE_DEFAULT_DEBUG_CHANNEL(uiautomation); +static SAFEARRAY *uia_desktop_node_rt_id; +static BOOL WINAPI uia_init_desktop_rt_id(INIT_ONCE *once, void *param, void **ctx) +{ + SAFEARRAY *sa; + + if ((sa = SafeArrayCreateVector(VT_I4, 0, 2))) + { + if (SUCCEEDED(write_runtime_id_base(sa, GetDesktopWindow()))) + uia_desktop_node_rt_id = sa; + else + SafeArrayDestroy(sa); + } + + return !!uia_desktop_node_rt_id; +} + +static SAFEARRAY *uia_get_desktop_rt_id(void) +{ + static INIT_ONCE once = INIT_ONCE_STATIC_INIT; + + if (!uia_desktop_node_rt_id) + InitOnceExecuteOnce(&once, uia_init_desktop_rt_id, NULL, NULL); + + return uia_desktop_node_rt_id; +} + /* * UI Automation event map. */ @@ -81,8 +107,13 @@ static struct uia_event_map_entry *uia_get_event_map_entry_for_event(int event_i static HRESULT uia_event_map_add_event(struct uia_event *event) { + const int subtree_scope = TreeScope_Element | TreeScope_Descendants; struct uia_event_map_entry *event_entry; + if (((event->scope & subtree_scope) == subtree_scope) && event->runtime_id && + !uia_compare_safearrays(uia_get_desktop_rt_id(), event->runtime_id, UIAutomationType_IntArray)) + event->desktop_subtree_event = TRUE; + EnterCriticalSection(&event_map_cs); if (!(event_entry = uia_get_event_map_entry_for_event(event->event_id))) @@ -539,6 +570,9 @@ static HRESULT uia_event_check_match(HUIANODE node, SAFEARRAY *rt_id, struct Uia if (!event->runtime_id) return S_OK; + if (event->desktop_subtree_event) + return uia_event_invoke(node, args, event); + if (rt_id && !uia_compare_safearrays(rt_id, event->runtime_id, UIAutomationType_IntArray)) { if (event->scope & TreeScope_Element) diff --git a/dlls/uiautomationcore/uia_private.h b/dlls/uiautomationcore/uia_private.h index 4fa9043d7df..18b97b74e65 100644 --- a/dlls/uiautomationcore/uia_private.h +++ b/dlls/uiautomationcore/uia_private.h @@ -98,6 +98,7 @@ struct uia_event IWineUiaEvent IWineUiaEvent_iface; LONG ref; + BOOL desktop_subtree_event; SAFEARRAY *runtime_id; int event_id; int scope; @@ -190,6 +191,7 @@ HRESULT create_msaa_provider(IAccessible *acc, long child_id, HWND hwnd, BOOL kn HRESULT register_interface_in_git(IUnknown *iface, REFIID riid, DWORD *ret_cookie) DECLSPEC_HIDDEN; HRESULT unregister_interface_in_git(DWORD git_cookie) DECLSPEC_HIDDEN; HRESULT get_interface_in_git(REFIID riid, DWORD git_cookie, IUnknown **ret_iface) DECLSPEC_HIDDEN; +HRESULT write_runtime_id_base(SAFEARRAY *sa, HWND hwnd) DECLSPEC_HIDDEN; void uia_cache_request_destroy(struct UiaCacheRequest *cache_req) DECLSPEC_HIDDEN; HRESULT uia_cache_request_clone(struct UiaCacheRequest *dst, struct UiaCacheRequest *src) DECLSPEC_HIDDEN; HRESULT get_safearray_dim_bounds(SAFEARRAY *sa, UINT dim, LONG *lbound, LONG *elems) DECLSPEC_HIDDEN; diff --git a/dlls/uiautomationcore/uia_utils.c b/dlls/uiautomationcore/uia_utils.c index 03fdef40e01..8e034916397 100644 --- a/dlls/uiautomationcore/uia_utils.c +++ b/dlls/uiautomationcore/uia_utils.c @@ -98,6 +98,23 @@ HRESULT get_interface_in_git(REFIID riid, DWORD git_cookie, IUnknown **ret_iface return S_OK; } +#define UIA_RUNTIME_ID_PREFIX 42 +HRESULT write_runtime_id_base(SAFEARRAY *sa, HWND hwnd) +{ + const int rt_id[2] = { UIA_RUNTIME_ID_PREFIX, HandleToUlong(hwnd) }; + HRESULT hr; + LONG idx; + + for (idx = 0; idx < ARRAY_SIZE(rt_id); idx++) + { + hr = SafeArrayPutElement(sa, &idx, (void *)&rt_id[idx]); + if (FAILED(hr)) + return hr; + } + + return S_OK; +} + /* * UiaCondition cloning functions. */
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
64
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
Results per page:
10
25
50
100
200