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
July 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
826 discussions
Start a n
N
ew thread
Alexandre Julliard : winebuild: Generate Windows-style syscall thunks on x86.
by Alexandre Julliard
08 Jul '20
08 Jul '20
Module: wine Branch: master Commit: 20715ee3fdaa794a7b6ba285cdb72b68991c65af URL:
https://source.winehq.org/git/wine.git/?a=commit;h=20715ee3fdaa794a7b6ba285…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 8 08:26:54 2020 +0200 winebuild: Generate Windows-style syscall thunks on x86. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/import.c | 54 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index dcdca021c0..b40c2c3107 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1441,19 +1441,47 @@ void output_syscalls( DLLSPEC *spec ) switch (target_cpu) { case CPU_x86: + output( "\tpushl %%ebp\n" ); + output_cfi( ".cfi_adjust_cfa_offset 4\n" ); + output_cfi( ".cfi_rel_offset %%ebp,0\n" ); + output( "\tmovl %%esp,%%ebp\n" ); + output_cfi( ".cfi_def_cfa_register %%ebp\n" ); + output( "\tpushl %%esi\n" ); + output_cfi( ".cfi_rel_offset %%esi,-4\n" ); + output( "\tpushl %%edi\n" ); + output_cfi( ".cfi_rel_offset %%edi,-8\n" ); output( "\tcmpl $%u,%%eax\n", count ); - output( "\tjae 1f\n" ); - output( "\taddl $4,%%esp\n" ); + output( "\tjae 3f\n" ); if (UsePIC) { output( "\tmovl %%eax,%%edx\n" ); output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); - output( "1:\tjmp *.Lsyscall_table-1b(%%eax,%%edx,4)\n" ); + output( "1:\tmovzbl .Lsyscall_args-1b(%%eax,%%edx,1),%%ecx\n" ); needs_get_pc_thunk = 1; } - else output( "\tjmp *.Lsyscall_table(,%%eax,4)\n" ); - output( "1:\tmovl $0x%x,%%eax\n", invalid_param ); + else output( "\tmovzbl .Lsyscall_args(%%eax),%%ecx\n" ); + output( "\tsubl %%ecx,%%esp\n" ); + output( "\tshrl $2,%%ecx\n" ); + output( "\tleal 12(%%ebp),%%esi\n" ); + output( "\tandl $~15,%%esp\n" ); + output( "\tmovl %%esp,%%edi\n" ); + output( "\tcld\n" ); + output( "\trep; movsl\n" ); + if (UsePIC) + output( "\tcall *.Lsyscall_table-1b(%%eax,%%edx,4)\n" ); + else + output( "\tcall *.Lsyscall_table(,%%eax,4)\n" ); + output( "\tleal -8(%%ebp),%%esp\n" ); + output( "2:\tpopl %%edi\n" ); + output_cfi( ".cfi_same_value %%edi\n" ); + output( "\tpopl %%esi\n" ); + output_cfi( ".cfi_same_value %%esi\n" ); + output( "\tpopl %%ebp\n" ); + output_cfi( ".cfi_def_cfa %%esp,4\n" ); + output_cfi( ".cfi_same_value %%ebp\n" ); output( "\tret\n" ); + output( "3:\tmovl $0x%x,%%eax\n", invalid_param ); + output( "\tjmp 2b\n" ); break; case CPU_x86_64: output( "\tcmpq $%u,%%rax\n", count ); @@ -1501,6 +1529,9 @@ void output_syscalls( DLLSPEC *spec ) output( ".Lsyscall_table:\n" ); for (i = 0; i < count; i++) output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name( get_link_name( syscalls[i] ))); + output( ".Lsyscall_args:\n" ); + for (i = 0; i < count; i++) + output( "\t.byte %u\n", get_args_size( syscalls[i] )); return; } @@ -1515,20 +1546,19 @@ void output_syscalls( DLLSPEC *spec ) switch (target_cpu) { case CPU_x86: - /* FIXME: syscall thunks not binary-compatible yet */ if (UsePIC) { output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); output( "1:\tmovl %s-1b(%%eax),%%edx\n", asm_name("__wine_syscall_dispatcher") ); output( "\tmovl $%u,%%eax\n", i ); - output( "\tcall *%%edx\n" ); needs_get_pc_thunk = 1; } else { output( "\tmovl $%u,%%eax\n", i ); - output( "\tcall *(%s)\n", asm_name("__wine_syscall_dispatcher") ); + output( "\tmovl $__wine_syscall,%%edx\n" ); } + output( "\tcall *%%edx\n" ); output( "\tret $%u\n", get_args_size( odp )); break; case CPU_x86_64: @@ -1559,6 +1589,14 @@ void output_syscalls( DLLSPEC *spec ) output_function_size( name ); } + if (target_cpu == CPU_x86 && !UsePIC) + { + output( "\t.align %d\n", get_alignment(16) ); + output( "\t%s\n", func_declaration("__wine_syscall") ); + output( "__wine_syscall:\n" ); + output( "\tjmp *(%s)\n", asm_name("__wine_syscall_dispatcher") ); + output_function_size( "__wine_syscall" ); + } output( "\t.data\n" ); output( "\t.align %d\n", get_alignment( get_ptr_size() ) ); output( "%s\n", asm_globl("__wine_syscall_dispatcher") );
1
0
0
0
Zebediah Figura : ntdll: Set the thread creation time in NtQuerySystemInformation(SystemProcessInformation).
by Alexandre Julliard
08 Jul '20
08 Jul '20
Module: wine Branch: master Commit: 82cd85b07918a4437428497ffaf7f13286b83479 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=82cd85b07918a4437428497f…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Jul 7 18:58:34 2020 -0500 ntdll: Set the thread creation time in NtQuerySystemInformation(SystemProcessInformation). Process Hacker displays this information. 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 +- include/wine/server_protocol.h | 3 ++- server/process.c | 1 + server/protocol.def | 1 + server/trace.c | 3 ++- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 051bd37fa3..a80d3c4fd4 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2156,7 +2156,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, if (len <= size) { - nt_process->ti[j].CreateTime.QuadPart = 0xdeadbeef; + nt_process->ti[j].CreateTime.QuadPart = server_thread->start_time; nt_process->ti[j].ClientId.UniqueProcess = UlongToHandle(server_process->pid); nt_process->ti[j].ClientId.UniqueThread = UlongToHandle(server_thread->tid); nt_process->ti[j].dwCurrentPriority = server_thread->current_priority; diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 87a6619703..df1bd853ea 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -2408,6 +2408,7 @@ struct is_same_mapping_reply struct thread_info { + timeout_t start_time; thread_id_t tid; int base_priority; int current_priority; @@ -6654,7 +6655,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 619 +#define SERVER_PROTOCOL_VERSION 620 /* ### protocol_version end ### */ diff --git a/server/process.c b/server/process.c index 8d57879cc1..5e587b28cb 100644 --- a/server/process.c +++ b/server/process.c @@ -1850,6 +1850,7 @@ DECL_HANDLER(list_processes) { struct thread_info *thread_info = (struct thread_info *)(buffer + pos); + thread_info->start_time = thread->creation_time; thread_info->tid = thread->id; thread_info->base_priority = thread->priority; thread_info->current_priority = thread->priority; /* FIXME */ diff --git a/server/protocol.def b/server/protocol.def index bf91637e9d..943c1ade1a 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1862,6 +1862,7 @@ enum char_info_mode struct thread_info { + timeout_t start_time; thread_id_t tid; int base_priority; int current_priority; diff --git a/server/trace.c b/server/trace.c index 288dad718d..55d7bd85dd 100644 --- a/server/trace.c +++ b/server/trace.c @@ -1128,7 +1128,8 @@ static void dump_varargs_process_info( const char *prefix, data_size_t size ) const struct thread_info *thread = (const struct thread_info *)((const char *)cur_data + pos); if (size - pos < sizeof(*thread)) break; if (i) fputc( ',', stderr ); - fprintf( stderr, "{tid=%04x,base_priority=%d,current_priority=%d,unix_tid=%d}", + dump_timeout( "{start_time=", &thread->start_time ); + fprintf( stderr, ",tid=%04x,base_priority=%d,current_priority=%d,unix_tid=%d}", thread->tid, thread->base_priority, thread->current_priority, thread->unix_tid ); pos += sizeof(*thread); }
1
0
0
0
Zebediah Figura : ntdll: Set the process creation time in NtQuerySystemInformation(SystemProcessInformation).
by Alexandre Julliard
08 Jul '20
08 Jul '20
Module: wine Branch: master Commit: 829739273425ba3a275aa8b93cde82bdff02975c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=829739273425ba3a275aa8b9…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Jul 7 18:58:33 2020 -0500 ntdll: Set the process creation time in NtQuerySystemInformation(SystemProcessInformation). Process Hacker displays this information. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/system.c | 1 + include/wine/server_protocol.h | 4 +++- server/process.c | 1 + server/protocol.def | 2 ++ server/trace.c | 3 ++- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 29c133e656..051bd37fa3 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2140,6 +2140,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, memset(nt_process, 0, sizeof(*nt_process)); if (i < process_count - 1) nt_process->NextEntryOffset = proc_len; + nt_process->CreationTime.QuadPart = server_process->start_time; nt_process->dwThreadCount = server_process->thread_count; nt_process->dwBasePriority = server_process->priority; nt_process->UniqueProcessId = UlongToHandle(server_process->pid); diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 33a0dee4b9..87a6619703 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -2416,6 +2416,7 @@ struct thread_info struct process_info { + timeout_t start_time; data_size_t name_len; int thread_count; int priority; @@ -2423,6 +2424,7 @@ struct process_info process_id_t parent_pid; int handle_count; int unix_pid; + int __pad; }; @@ -6652,7 +6654,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 618 +#define SERVER_PROTOCOL_VERSION 619 /* ### protocol_version end ### */ diff --git a/server/process.c b/server/process.c index 9482da98be..8d57879cc1 100644 --- a/server/process.c +++ b/server/process.c @@ -1829,6 +1829,7 @@ DECL_HANDLER(list_processes) pos = (pos + 7) & ~7; process_info = (struct process_info *)(buffer + pos); + process_info->start_time = process->start_time; process_info->name_len = exe ? exe->namelen : 0; process_info->thread_count = process->running_threads; process_info->priority = process->priority; diff --git a/server/protocol.def b/server/protocol.def index bad8fef790..bf91637e9d 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1870,6 +1870,7 @@ struct thread_info struct process_info { + timeout_t start_time; data_size_t name_len; int thread_count; int priority; @@ -1877,6 +1878,7 @@ struct process_info process_id_t parent_pid; int handle_count; int unix_pid; + int __pad; /* VARARG(name,unicode_str,name_len); */ /* VARARG(threads,struct thread_info,thread_count); */ }; diff --git a/server/trace.c b/server/trace.c index dfb3930066..288dad718d 100644 --- a/server/trace.c +++ b/server/trace.c @@ -1113,7 +1113,8 @@ static void dump_varargs_process_info( const char *prefix, data_size_t size ) process = (const struct process_info *)((const char *)cur_data + pos); if (size - pos < sizeof(*process)) break; if (pos) fputc( ',', stderr ); - fprintf( stderr, "{thread_count=%u,priority=%d,pid=%04x,parent_pid=%04x,handle_count=%u,unix_pid=%d,", + dump_timeout( "{start_time=", &process->start_time ); + fprintf( stderr, ",thread_count=%u,priority=%d,pid=%04x,parent_pid=%04x,handle_count=%u,unix_pid=%d,", process->thread_count, process->priority, process->pid, process->parent_pid, process->handle_count, process->unix_pid ); pos += sizeof(*process);
1
0
0
0
Zebediah Figura : d3dcompiler: Store the loop body directly in the hlsr_ir_loop structure.
by Alexandre Julliard
08 Jul '20
08 Jul '20
Module: wine Branch: master Commit: 644dbf06447aba2ac6a13ac3e34f6d917ad01b62 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=644dbf06447aba2ac6a13ac3…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Jul 5 17:45:36 2020 -0500 d3dcompiler: Store the loop body directly in the hlsr_ir_loop structure. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/d3dcompiler_private.h | 2 +- dlls/d3dcompiler_43/hlsl.y | 19 +++++++------------ dlls/d3dcompiler_43/utils.c | 7 +++++-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 4bf1ce8f1b..34e8917069 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -750,7 +750,7 @@ struct hlsl_ir_loop { struct hlsl_ir_node node; /* loop condition is stored in the body (as "if (!condition) break;") */ - struct list *body; + struct list body; unsigned int next_index; /* liveness index of the end of the loop */ }; diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 3c9f1bd604..b0270b6ba2 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -360,24 +360,21 @@ static struct list *create_loop(enum loop_type type, struct list *init, struct l goto oom; init_node(&loop->node, HLSL_IR_LOOP, NULL, loc); list_add_tail(list, &loop->node.entry); - loop->body = d3dcompiler_alloc(sizeof(*loop->body)); - if (!loop->body) - goto oom; - list_init(loop->body); + list_init(&loop->body); if (!append_conditional_break(cond)) goto oom; if (type != LOOP_DO_WHILE) - list_move_tail(loop->body, cond); + list_move_tail(&loop->body, cond); - list_move_tail(loop->body, body); + list_move_tail(&loop->body, body); if (iter) - list_move_tail(loop->body, iter); + list_move_tail(&loop->body, iter); if (type == LOOP_DO_WHILE) - list_move_tail(loop->body, cond); + list_move_tail(&loop->body, cond); d3dcompiler_free(init); d3dcompiler_free(cond); @@ -386,8 +383,6 @@ static struct list *create_loop(enum loop_type type, struct list *init, struct l oom: ERR("Out of memory.\n"); - if (loop) - d3dcompiler_free(loop->body); d3dcompiler_free(loop); d3dcompiler_free(cond_jump); d3dcompiler_free(list); @@ -2857,7 +2852,7 @@ static unsigned int index_instructions(struct list *instrs, unsigned int index) } else if (instr->type == HLSL_IR_LOOP) { - index = index_instructions(loop_from_node(instr)->body, index); + index = index_instructions(&loop_from_node(instr)->body, index); loop_from_node(instr)->next_index = index; } } @@ -2919,7 +2914,7 @@ static void compute_liveness_recurse(struct list *instrs, unsigned int loop_firs case HLSL_IR_LOOP: { struct hlsl_ir_loop *loop = loop_from_node(instr); - compute_liveness_recurse(loop->body, loop_first ? loop_first : instr->index, + compute_liveness_recurse(&loop->body, loop_first ? loop_first : instr->index, loop_last ? loop_last : loop->next_index); break; } diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 8599ffe69a..336bf0d9bc 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -2027,7 +2027,7 @@ static void debug_dump_ir_if(const struct hlsl_ir_if *if_node) static void debug_dump_ir_loop(const struct hlsl_ir_loop *loop) { wine_dbg_printf("for (;;)\n{\n"); - debug_dump_instr_list(loop->body); + debug_dump_instr_list(&loop->body); wine_dbg_printf("}\n"); } @@ -2165,7 +2165,10 @@ static void free_ir_if(struct hlsl_ir_if *if_node) static void free_ir_loop(struct hlsl_ir_loop *loop) { - free_instr_list(loop->body); + struct hlsl_ir_node *node, *next_node; + + LIST_FOR_EACH_ENTRY_SAFE(node, next_node, &loop->body, struct hlsl_ir_node, entry) + free_instr(node); d3dcompiler_free(loop); }
1
0
0
0
Zebediah Figura : d3dcompiler: Store the "then" and "else" instruction lists directly in the hlsl_ir_if structure.
by Alexandre Julliard
08 Jul '20
08 Jul '20
Module: wine Branch: master Commit: 0a9f2d8b0a5394a0803c418c726ef4da488e15e6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0a9f2d8b0a5394a0803c418c…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Jul 7 23:09:24 2020 +0200 d3dcompiler: Store the "then" and "else" instruction lists directly in the hlsl_ir_if structure. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/d3dcompiler_private.h | 4 +-- dlls/d3dcompiler_43/hlsl.y | 51 +++++++++++++++---------------- dlls/d3dcompiler_43/utils.c | 18 +++++------ 3 files changed, 36 insertions(+), 37 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 3e91f74645..4bf1ce8f1b 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -742,8 +742,8 @@ struct hlsl_ir_if { struct hlsl_ir_node node; struct hlsl_src condition; - struct list *then_instrs; - struct list *else_instrs; + struct list then_instrs; + struct list else_instrs; }; struct hlsl_ir_loop diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 475fd414fd..3c9f1bd604 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -284,6 +284,19 @@ static BOOL type_is_void(const struct hlsl_type *type) return type->type == HLSL_CLASS_OBJECT && type->base_type == HLSL_TYPE_VOID; } +static struct hlsl_ir_if *new_if(struct hlsl_ir_node *condition, struct source_location loc) +{ + struct hlsl_ir_if *iff; + + if (!(iff = d3dcompiler_alloc(sizeof(*iff)))) + return NULL; + init_node(&iff->node, HLSL_IR_IF, NULL, loc); + hlsl_src_from_node(&iff->condition, condition); + list_init(&iff->then_instrs); + list_init(&iff->else_instrs); + return iff; +} + static BOOL append_conditional_break(struct list *cond_list) { struct hlsl_ir_node *condition, *not; @@ -302,22 +315,13 @@ static BOOL append_conditional_break(struct list *cond_list) } list_add_tail(cond_list, ¬->entry); - if (!(iff = d3dcompiler_alloc(sizeof(*iff)))) + if (!(iff = new_if(not, condition->loc))) { ERR("Out of memory.\n"); return FALSE; } - init_node(&iff->node, HLSL_IR_IF, NULL, condition->loc); - hlsl_src_from_node(&iff->condition, not); list_add_tail(cond_list, &iff->node.entry); - if (!(iff->then_instrs = d3dcompiler_alloc(sizeof(*iff->then_instrs)))) - { - ERR("Out of memory.\n"); - return FALSE; - } - list_init(iff->then_instrs); - if (!(jump = d3dcompiler_alloc(sizeof(*jump)))) { ERR("Out of memory.\n"); @@ -325,7 +329,7 @@ static BOOL append_conditional_break(struct list *cond_list) } init_node(&jump->node, HLSL_IR_JUMP, NULL, condition->loc); jump->type = HLSL_IR_JUMP_BREAK; - list_add_head(iff->then_instrs, &jump->node.entry); + list_add_head(&iff->then_instrs, &jump->node.entry); return TRUE; } @@ -2211,18 +2215,15 @@ jump_statement: selection_statement: KW_IF '(' expr ')' if_body { - struct hlsl_ir_if *instr = d3dcompiler_alloc(sizeof(*instr)); struct hlsl_ir_node *condition = node_from_list($3); + struct hlsl_ir_if *instr; - if (!instr) - { - ERR("Out of memory\n"); + if (!(instr = new_if(condition, get_location(&@1)))) YYABORT; - } - init_node(&instr->node, HLSL_IR_IF, NULL, get_location(&@1)); - hlsl_src_from_node(&instr->condition, condition); - instr->then_instrs = $5.then_instrs; - instr->else_instrs = $5.else_instrs; + list_move_tail(&instr->then_instrs, $5.then_instrs); + list_move_tail(&instr->else_instrs, $5.else_instrs); + d3dcompiler_free($5.then_instrs); + d3dcompiler_free($5.else_instrs); if (condition->data_type->dimx > 1 || condition->data_type->dimy > 1) { hlsl_report_message(instr->node.loc, HLSL_LEVEL_ERROR, @@ -2851,9 +2852,8 @@ static unsigned int index_instructions(struct list *instrs, unsigned int index) if (instr->type == HLSL_IR_IF) { struct hlsl_ir_if *iff = if_from_node(instr); - index = index_instructions(iff->then_instrs, index); - if (iff->else_instrs) - index = index_instructions(iff->else_instrs, index); + index = index_instructions(&iff->then_instrs, index); + index = index_instructions(&iff->else_instrs, index); } else if (instr->type == HLSL_IR_LOOP) { @@ -2902,9 +2902,8 @@ static void compute_liveness_recurse(struct list *instrs, unsigned int loop_firs case HLSL_IR_IF: { struct hlsl_ir_if *iff = if_from_node(instr); - compute_liveness_recurse(iff->then_instrs, loop_first, loop_last); - if (iff->else_instrs) - compute_liveness_recurse(iff->else_instrs, loop_first, loop_last); + compute_liveness_recurse(&iff->then_instrs, loop_first, loop_last); + compute_liveness_recurse(&iff->else_instrs, loop_first, loop_last); iff->condition.node->last_read = instr->index; break; } diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 7f0c451ce9..8599ffe69a 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -2018,14 +2018,10 @@ static void debug_dump_ir_if(const struct hlsl_ir_if *if_node) wine_dbg_printf("if ("); debug_dump_src(&if_node->condition); wine_dbg_printf(")\n{\n"); - debug_dump_instr_list(if_node->then_instrs); + debug_dump_instr_list(&if_node->then_instrs); + wine_dbg_printf("}\nelse\n{\n"); + debug_dump_instr_list(&if_node->else_instrs); wine_dbg_printf("}\n"); - if (if_node->else_instrs) - { - wine_dbg_printf("else\n{\n"); - debug_dump_instr_list(if_node->else_instrs); - wine_dbg_printf("}\n"); - } } static void debug_dump_ir_loop(const struct hlsl_ir_loop *loop) @@ -2157,8 +2153,12 @@ static void free_ir_assignment(struct hlsl_ir_assignment *assignment) static void free_ir_if(struct hlsl_ir_if *if_node) { - free_instr_list(if_node->then_instrs); - free_instr_list(if_node->else_instrs); + struct hlsl_ir_node *node, *next_node; + + LIST_FOR_EACH_ENTRY_SAFE(node, next_node, &if_node->then_instrs, struct hlsl_ir_node, entry) + free_instr(node); + LIST_FOR_EACH_ENTRY_SAFE(node, next_node, &if_node->else_instrs, struct hlsl_ir_node, entry) + free_instr(node); hlsl_src_remove(&if_node->condition); d3dcompiler_free(if_node); }
1
0
0
0
Zebediah Figura : d3dcompiler: Allow hlsl_ir_constant to contain only scalar and vector constants.
by Alexandre Julliard
08 Jul '20
08 Jul '20
Module: wine Branch: master Commit: 2ccf1db285310abb86f3712703727ebcbf7f0916 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2ccf1db285310abb86f37127…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Jul 5 17:45:34 2020 -0500 d3dcompiler: Allow hlsl_ir_constant to contain only scalar and vector constants. We only emit scalar constants at parse time, and while there's certainly an advantage to vectorizing constant instructions, there's not much point in having hlsl_ir_constant hold matrices. Matrices should be lowered to vector operations first. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/d3dcompiler_private.h | 10 +++--- dlls/d3dcompiler_43/utils.c | 51 +++++++++++++------------------ 2 files changed, 27 insertions(+), 34 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 23eff21094..3e91f74645 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -874,11 +874,11 @@ struct hlsl_ir_constant struct hlsl_ir_node node; union { - unsigned u[16]; - int i[16]; - float f[16]; - double d[16]; - BOOL b[16]; + unsigned u[4]; + int i[4]; + float f[4]; + double d[4]; + BOOL b[4]; } value; }; diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 4bc3b9b0a6..7f0c451ce9 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1823,41 +1823,34 @@ static void debug_dump_deref(const struct hlsl_deref *deref) static void debug_dump_ir_constant(const struct hlsl_ir_constant *constant) { struct hlsl_type *type = constant->node.data_type; - unsigned int x, y; + unsigned int x; - if (type->dimy != 1) + if (type->dimx != 1) wine_dbg_printf("{"); - for (y = 0; y < type->dimy; ++y) + for (x = 0; x < type->dimx; ++x) { - if (type->dimx != 1) - wine_dbg_printf("{"); - for (x = 0; x < type->dimx; ++x) + switch (type->base_type) { - switch (type->base_type) - { - case HLSL_TYPE_FLOAT: - wine_dbg_printf("%.8e ", constant->value.f[y * type->dimx + x]); - break; - case HLSL_TYPE_DOUBLE: - wine_dbg_printf("%.16e ", constant->value.d[y * type->dimx + x]); - break; - case HLSL_TYPE_INT: - wine_dbg_printf("%d ", constant->value.i[y * type->dimx + x]); - break; - case HLSL_TYPE_UINT: - wine_dbg_printf("%u ", constant->value.u[y * type->dimx + x]); - break; - case HLSL_TYPE_BOOL: - wine_dbg_printf("%s ", constant->value.b[y * type->dimx + x] == FALSE ? "false" : "true"); - break; - default: - wine_dbg_printf("Constants of type %s not supported\n", debug_base_type(type)); - } + case HLSL_TYPE_FLOAT: + wine_dbg_printf("%.8e ", constant->value.f[x]); + break; + case HLSL_TYPE_DOUBLE: + wine_dbg_printf("%.16e ", constant->value.d[x]); + break; + case HLSL_TYPE_INT: + wine_dbg_printf("%d ", constant->value.i[x]); + break; + case HLSL_TYPE_UINT: + wine_dbg_printf("%u ", constant->value.u[x]); + break; + case HLSL_TYPE_BOOL: + wine_dbg_printf("%s ", constant->value.b[x] ? "true" : "false"); + break; + default: + wine_dbg_printf("Constants of type %s not supported\n", debug_base_type(type)); } - if (type->dimx != 1) - wine_dbg_printf("}"); } - if (type->dimy != 1) + if (type->dimx != 1) wine_dbg_printf("}"); }
1
0
0
0
Zebediah Figura : d3dcompiler/tests: Check the reflection type of bool variables.
by Alexandre Julliard
08 Jul '20
08 Jul '20
Module: wine Branch: master Commit: 6bae008f5556d22af24a7a81ad7e17bef06f0b62 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6bae008f5556d22af24a7a81…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Jul 5 17:45:33 2020 -0500 d3dcompiler/tests: Check the reflection type of bool variables. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/tests/hlsl_d3d11.c | 4 ++-- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d11.c b/dlls/d3dcompiler_43/tests/hlsl_d3d11.c index 0dbbcc8d02..72b64eb81d 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d11.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d11.c @@ -564,7 +564,7 @@ static void test_reflection(void) " float b;\n" " float c;\n" " } s;\n" - " float g;\n" + " bool g;\n" " float h[2];\n" " int i;\n" " uint_t j;\n" @@ -605,7 +605,7 @@ static void test_reflection(void) {{"c", 16, 16}, {D3D_SVC_VECTOR, D3D_SVT_FLOAT, 1, 4, 0, 0, 0, "float4"}}, {{"d", 32, 4}, {D3D_SVC_SCALAR, D3D_SVT_FLOAT, 1, 1, 0, 0, 0, "float"}}, {{"s", 48, 24}, {D3D_SVC_STRUCT, D3D_SVT_VOID, 1, 6, 0, 3, 0, "<unnamed>"}}, - {{"g", 72, 4}, {D3D_SVC_SCALAR, D3D_SVT_FLOAT, 1, 1, 0, 0, 0, "float"}}, + {{"g", 72, 4}, {D3D_SVC_SCALAR, D3D_SVT_BOOL, 1, 1, 0, 0, 0, "bool"}}, {{"h", 80, 20}, {D3D_SVC_SCALAR, D3D_SVT_FLOAT, 1, 1, 2, 0, 0, "float"}}, {{"i", 100, 4}, {D3D_SVC_SCALAR, D3D_SVT_INT, 1, 1, 0, 0, 0, "int"}}, {{"j", 104, 4}, {D3D_SVC_SCALAR, D3D_SVT_UINT, 1, 1, 0, 0, 0, "uint_t"}}, diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index 83f5b7bdd5..ed148ff112 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -1025,7 +1025,7 @@ static void test_constant_table(void) "#pragma pack_matrix(row_major)\n" " float2x2 d;\n" "} f;\n" - "uniform float2 g[5];\n" + "uniform bool2 g[5];\n" "uniform matrix_t i;\n" "uniform struct matrix_record j;\n" "uniform matrix<float,3,1> k;\n" @@ -1052,7 +1052,7 @@ static void test_constant_table(void) {"d", D3DXRS_FLOAT4, 0, 3, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 1, 0, 12}, {"e", D3DXRS_FLOAT4, 0, 1, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 1, 0, 4}, {"f", D3DXRS_FLOAT4, 0, 7, D3DXPC_STRUCT, D3DXPT_VOID, 1, 11, 1, 4, 44}, - {"g", D3DXRS_FLOAT4, 0, 5, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 5, 0, 40}, + {"g", D3DXRS_FLOAT4, 0, 5, D3DXPC_VECTOR, D3DXPT_BOOL, 1, 2, 5, 0, 40}, {"i", D3DXRS_FLOAT4, 0, 3, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 1, 0, 36}, {"j", D3DXRS_FLOAT4, 0, 3, D3DXPC_STRUCT, D3DXPT_VOID, 1, 9, 1, 1, 36}, {"k", D3DXRS_FLOAT4, 0, 3, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 1, 0, 12},
1
0
0
0
Zebediah Figura : winebuild: Fix a spelling error in a comment.
by Alexandre Julliard
08 Jul '20
08 Jul '20
Module: wine Branch: master Commit: d33474fa6bae057b6e7fd6acda76438d90dc66bc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d33474fa6bae057b6e7fd6ac…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Jul 7 18:56:19 2020 -0500 winebuild: Fix a spelling error in a comment. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c index 66454bad3c..9822456fe5 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -70,7 +70,7 @@ static const char * const FlagNames[] = "ordinal", /* FLAG_ORDINAL */ "thiscall", /* FLAG_THISCALL */ "fastcall", /* FLAG_FASTCALL */ - "syscall", /* FLAG_SYCALL */ + "syscall", /* FLAG_SYSCALL */ "import", /* FLAG_IMPORT */ NULL };
1
0
0
0
Rémi Bernon : user32: Use WM_INPUT message hw_id as RAWINPUT handle.
by Alexandre Julliard
07 Jul '20
07 Jul '20
Module: wine Branch: master Commit: e0e3b6bc91f7db956e3a66f2938eea45d4055a39 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e0e3b6bc91f7db956e3a66f2…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jul 6 12:04:50 2020 +0200 user32: Use WM_INPUT message hw_id as RAWINPUT handle. This fixes the GetRawInputData regression introduced with 359ee2ecc21b08e4118f0f77b3a208e4b5e1e63d where the message data couldn't be read twice, while keeping the overwrite logic it introduced. This also adds some SetLastError to fix some unit tests todos. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49522
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/message.c | 11 ++++++----- dlls/user32/rawinput.c | 43 ++++++++++++++++++++++++++++--------------- dlls/user32/tests/input.c | 7 ------- dlls/user32/user_private.h | 10 ++++++++-- 4 files changed, 42 insertions(+), 29 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 53e0b6495b..aadec28b55 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2283,13 +2283,14 @@ static void accept_hardware_message( UINT hw_id ) } -static BOOL process_rawinput_message( MSG *msg, const struct hardware_msg_data *msg_data ) +static BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data ) { - RAWINPUT *rawinput = rawinput_thread_data(); - if (!rawinput_from_hardware_message(rawinput, msg_data)) + struct rawinput_thread_data *thread_data = rawinput_thread_data(); + if (!rawinput_from_hardware_message( thread_data->buffer, msg_data )) return FALSE; - msg->lParam = (LPARAM)rawinput; + thread_data->hw_id = hw_id; + msg->lParam = (LPARAM)hw_id; msg->pt = point_phys_to_win_dpi( msg->hwnd, msg->pt ); return TRUE; } @@ -2610,7 +2611,7 @@ static BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardwar context = SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ); if (msg->message == WM_INPUT) - ret = process_rawinput_message( msg, msg_data ); + ret = process_rawinput_message( msg, hw_id, msg_data ); else if (is_keyboard_message( msg->message )) ret = process_keyboard_message( msg, hw_id, hwnd_filter, first, last, remove ); else if (is_mouse_message( msg->message )) diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c index b5af008e88..a4208bf140 100644 --- a/dlls/user32/rawinput.c +++ b/dlls/user32/rawinput.c @@ -223,12 +223,14 @@ static void find_devices(void) } -RAWINPUT *rawinput_thread_data(void) +struct rawinput_thread_data *rawinput_thread_data(void) { struct user_thread_info *thread_info = get_user_thread_info(); - RAWINPUT *rawinput = thread_info->rawinput; - if (!rawinput) rawinput = thread_info->rawinput = HeapAlloc( GetProcessHeap(), 0, RAWINPUT_BUFFER_SIZE ); - return rawinput; + struct rawinput_thread_data *data = thread_info->rawinput; + if (data) return data; + data = thread_info->rawinput = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + RAWINPUT_BUFFER_SIZE + sizeof(struct user_thread_info) ); + return data; } @@ -453,43 +455,51 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U */ UINT WINAPI GetRawInputData(HRAWINPUT rawinput, UINT command, void *data, UINT *data_size, UINT header_size) { - RAWINPUT *ri = (RAWINPUT *)rawinput; - UINT s; + struct rawinput_thread_data *thread_data = rawinput_thread_data(); + UINT size; TRACE("rawinput %p, command %#x, data %p, data_size %p, header_size %u.\n", rawinput, command, data, data_size, header_size); - if (!ri || !ri->header.dwSize) + if (!rawinput || thread_data->hw_id != (UINT_PTR)rawinput) + { + SetLastError(ERROR_INVALID_HANDLE); return ~0U; + } if (header_size != sizeof(RAWINPUTHEADER)) { WARN("Invalid structure size %u.\n", header_size); + SetLastError(ERROR_INVALID_PARAMETER); return ~0U; } switch (command) { case RID_INPUT: - s = ri->header.dwSize; + size = thread_data->buffer->header.dwSize; break; case RID_HEADER: - s = sizeof(RAWINPUTHEADER); + size = sizeof(RAWINPUTHEADER); break; default: + SetLastError(ERROR_INVALID_PARAMETER); return ~0U; } if (!data) { - *data_size = s; + *data_size = size; return 0; } - if (*data_size < s) return ~0U; - memcpy(data, ri, s); - ri->header.dwSize = 0; - return s; + if (*data_size < size) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return ~0U; + } + memcpy(data, thread_data->buffer, size); + return size; } #ifdef _WIN64 @@ -513,6 +523,7 @@ typedef struct UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(RAWINPUT *data, UINT *data_size, UINT header_size) { struct hardware_msg_data *msg_data; + struct rawinput_thread_data *thread_data; RAWINPUT *rawinput; UINT count = 0, rawinput_size, next_size, overhead; BOOL is_wow64; @@ -551,8 +562,10 @@ UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(RAWINPUT *data, UINT *data_size, return 0; } - if (!(rawinput = rawinput_thread_data())) return ~0U; + if (!(thread_data = rawinput_thread_data())) return ~0U; + rawinput = thread_data->buffer; + /* first RAWINPUT block in the buffer is used for WM_INPUT message data */ msg_data = (struct hardware_msg_data *)NEXTRAWINPUTBLOCK(rawinput); SERVER_START_REQ( get_rawinput_buffer ) { diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index fd401b330d..d4b0e34fa9 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1760,7 +1760,6 @@ static void test_GetRawInputData(void) SetLastError(0xdeadbeef); ret = GetRawInputData(NULL, RID_INPUT, NULL, &size, sizeof(RAWINPUTHEADER)); ok(ret == ~0U, "Expect ret %u, got %u\n", ~0U, ret); - todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "GetRawInputData returned %08x\n", GetLastError()); } @@ -1916,36 +1915,30 @@ static LRESULT CALLBACK rawinputbuffer_wndproc(HWND hwnd, UINT msg, WPARAM wpara SetLastError(0xdeadbeef); count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, 0); ok(count == ~0U, "GetRawInputData succeeded\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputData returned %08x\n", GetLastError()); SetLastError(0xdeadbeef); size = 0; count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER)); ok(count == ~0U, "GetRawInputData succeeded\n"); - todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetRawInputData returned %08x\n", GetLastError()); SetLastError(0xdeadbeef); size = sizeof(ri); count = GetRawInputData((HRAWINPUT)lparam, 0, &ri, &size, sizeof(RAWINPUTHEADER)); ok(count == ~0U, "GetRawInputData succeeded\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputData returned %08x\n", GetLastError()); SetLastError(0xdeadbeef); size = sizeof(ri); count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER)); - todo_wine ok(count == sizeof(ri), "GetRawInputData failed\n"); - todo_wine ok(ri.data.mouse.lLastX == 6, "Unexpected rawinput data: %d\n", ri.data.mouse.lLastX); ok(GetLastError() == 0xdeadbeef, "GetRawInputData returned %08x\n", GetLastError()); } else { ok(count == ~0U, "GetRawInputData succeeded\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "GetRawInputData returned %08x\n", GetLastError()); } diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index eb82820359..8fa54b9229 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -173,6 +173,12 @@ struct wm_char_mapping_data /* hold up to 10s of 1kHz mouse rawinput events */ #define RAWINPUT_BUFFER_SIZE (512*1024) +struct rawinput_thread_data +{ + UINT hw_id; /* current rawinput message id */ + RAWINPUT buffer[1]; /* rawinput message data buffer */ +}; + /* this is the structure stored in TEB->Win32ClientInfo */ /* no attempt is made to keep the layout compatible with the Windows one */ struct user_thread_info @@ -196,7 +202,7 @@ struct user_thread_info struct user_key_state_info *key_state; /* Cache of global key state */ HWND top_window; /* Desktop window */ HWND msg_window; /* HWND_MESSAGE parent window */ - RAWINPUT *rawinput; + struct rawinput_thread_data *rawinput; /* RawInput thread local data / buffer */ }; C_ASSERT( sizeof(struct user_thread_info) <= sizeof(((TEB *)0)->Win32ClientInfo) ); @@ -236,7 +242,7 @@ struct tagWND; struct hardware_msg_data; extern BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_msg_data *msg_data); -extern RAWINPUT *rawinput_thread_data(void); +extern struct rawinput_thread_data *rawinput_thread_data(void); extern void CLIPBOARD_ReleaseOwner( HWND hwnd ) DECLSPEC_HIDDEN; extern BOOL FOCUS_MouseActivate( HWND hwnd ) DECLSPEC_HIDDEN;
1
0
0
0
Rémi Bernon : user32/tests: Add more GetRawInputData tests.
by Alexandre Julliard
07 Jul '20
07 Jul '20
Module: wine Branch: master Commit: b58a899acc9b6c2c02c78223b74db2822fe1ebb4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b58a899acc9b6c2c02c78223…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jul 6 12:04:49 2020 +0200 user32/tests: Add more GetRawInputData tests. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/input.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index bab0fd9753..fd401b330d 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1757,8 +1757,11 @@ static void test_GetRawInputData(void) UINT ret; /* Null raw input handle */ + SetLastError(0xdeadbeef); ret = GetRawInputData(NULL, RID_INPUT, NULL, &size, sizeof(RAWINPUTHEADER)); ok(ret == ~0U, "Expect ret %u, got %u\n", ~0U, ret); + todo_wine + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetRawInputData returned %08x\n", GetLastError()); } static void test_RegisterRawInputDevices(void) @@ -1906,14 +1909,47 @@ static LRESULT CALLBACK rawinputbuffer_wndproc(HWND hwnd, UINT msg, WPARAM wpara * from the first message has been overwritten. */ size = sizeof(ri); memset(&ri, 0, sizeof(ri)); - count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER)); + SetLastError(0xdeadbeef); + count = GetRawInputData((HRAWINPUT)lparam, RID_HEADER, &ri, &size, sizeof(RAWINPUTHEADER)); if (iteration == 1) { + SetLastError(0xdeadbeef); + count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, 0); + ok(count == ~0U, "GetRawInputData succeeded\n"); + todo_wine + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputData returned %08x\n", GetLastError()); + + SetLastError(0xdeadbeef); + size = 0; + count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER)); + ok(count == ~0U, "GetRawInputData succeeded\n"); + todo_wine + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetRawInputData returned %08x\n", GetLastError()); + + SetLastError(0xdeadbeef); + size = sizeof(ri); + count = GetRawInputData((HRAWINPUT)lparam, 0, &ri, &size, sizeof(RAWINPUTHEADER)); + ok(count == ~0U, "GetRawInputData succeeded\n"); + todo_wine + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputData returned %08x\n", GetLastError()); + + SetLastError(0xdeadbeef); + size = sizeof(ri); + count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER)); + todo_wine ok(count == sizeof(ri), "GetRawInputData failed\n"); + todo_wine ok(ri.data.mouse.lLastX == 6, "Unexpected rawinput data: %d\n", ri.data.mouse.lLastX); + ok(GetLastError() == 0xdeadbeef, "GetRawInputData returned %08x\n", GetLastError()); } else + { ok(count == ~0U, "GetRawInputData succeeded\n"); + todo_wine + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetRawInputData returned %08x\n", GetLastError()); + } + + return 0; } return DefWindowProcA(hwnd, msg, wparam, lparam);
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
...
83
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
Results per page:
10
25
50
100
200