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
Hans Leidekker : winhttp: Set socket state before sending notifications.
by Alexandre Julliard
25 Jun '20
25 Jun '20
Module: wine Branch: master Commit: b9038c736b829a3cd5b615d6c41df8b71f938f54 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b9038c736b829a3cd5b615d6…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Jun 25 11:00:23 2020 +0200 winhttp: Set socket state before sending notifications. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/request.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 457abb9f84..623fdf5db5 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -3372,10 +3372,11 @@ static DWORD receive_frame( struct netconn *netconn, DWORD *ret_len, enum socket static DWORD socket_receive( struct socket *socket, void *buf, DWORD len, DWORD *ret_len, WINHTTP_WEB_SOCKET_BUFFER_TYPE *ret_type, BOOL async ) { + struct netconn *netconn = socket->request->netconn; DWORD count, ret = ERROR_SUCCESS; - if (!socket->read_size) ret = receive_frame( socket->request->netconn, &socket->read_size, &socket->opcode ); - if (!ret) ret = receive_bytes( socket->request->netconn, buf, min(len, socket->read_size), &count ); + if (!socket->read_size) ret = receive_frame( netconn, &socket->read_size, &socket->opcode ); + if (!ret) ret = receive_bytes( netconn, buf, min(len, socket->read_size), &count ); if (!ret) { socket->read_size -= count; @@ -3385,7 +3386,6 @@ static DWORD socket_receive( struct socket *socket, void *buf, DWORD len, DWORD *ret_type = map_opcode( socket->opcode, socket->read_size != 0 ); } } - if (async) { if (!ret) @@ -3458,9 +3458,13 @@ DWORD WINAPI WinHttpWebSocketReceive( HINTERNET hsocket, void *buf, DWORD len, D static DWORD socket_shutdown( struct socket *socket, USHORT status, const void *reason, DWORD len, BOOL async ) { + struct netconn *netconn = socket->request->netconn; DWORD ret; - ret = send_frame( socket->request->netconn, WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE, status, reason, len, TRUE ); + if (!(ret = send_frame( netconn, WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE, status, reason, len, TRUE ))) + { + socket->state = SOCKET_STATE_SHUTDOWN; + } if (async) { if (!ret) send_callback( &socket->hdr, WINHTTP_CALLBACK_STATUS_SHUTDOWN_COMPLETE, NULL, 0 ); @@ -3473,8 +3477,6 @@ static DWORD socket_shutdown( struct socket *socket, USHORT status, const void * send_callback( &socket->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, &result, sizeof(result) ); } } - - if (!ret) socket->state = SOCKET_STATE_SHUTDOWN; return ret; } @@ -3559,7 +3561,10 @@ static DWORD socket_close( struct socket *socket, USHORT status, const void *rea goto done; } socket->status = RtlUshortByteSwap( socket->status ); - ret = receive_bytes( netconn, socket->reason, sizeof(socket->reason), &socket->reason_len ); + if (!(ret = receive_bytes( netconn, socket->reason, sizeof(socket->reason), &socket->reason_len ))) + { + socket->state = SOCKET_STATE_CLOSED; + } done: if (async) @@ -3574,8 +3579,6 @@ done: send_callback( &socket->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, &result, sizeof(result) ); } } - - if (!ret) socket->state = SOCKET_STATE_CLOSED; return ret; }
1
0
0
0
Dmitry Kislyuk : vbscript: Parse empty CASE ELSE clause.
by Alexandre Julliard
25 Jun '20
25 Jun '20
Module: wine Branch: master Commit: 18e7e07a77a754c4b48c6c9bde225ad5c7295944 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=18e7e07a77a754c4b48c6c9b…
Author: Dmitry Kislyuk <dimaki(a)rocketmail.com> Date: Thu Jun 25 00:50:46 2020 -0500 vbscript: Parse empty CASE ELSE clause. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49439
Signed-off-by: Dmitry Kislyuk <dimaki(a)rocketmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/parser.y | 2 +- dlls/vbscript/tests/lang.vbs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 5c18af13d4..71bea72b1b 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -301,7 +301,7 @@ Else_opt CaseClausules : /* empty */ { $$ = NULL; } - | tCASE tELSE StSep StatementsNl { $$ = new_case_clausule(ctx, NULL, $4, NULL); } + | tCASE tELSE StSep StatementsNl_opt { $$ = new_case_clausule(ctx, NULL, $4, NULL); } | tCASE ExpressionList StSep StatementsNl_opt CaseClausules { $$ = new_case_clausule(ctx, $2, $4, $5); } diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index c50b8bbe59..94e2bbd436 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -681,6 +681,14 @@ select case 1 : end select Call ok(x, "wrong case") +select case 0 + case 1 + case else + 'empty else with comment test +end select + +select case 0 : case 1 : case else : end select + if false then Sub testsub x = true
1
0
0
0
Alexandre Julliard : ntdll: Move RtlGetSystemTimePrecise() to the Unix library.
by Alexandre Julliard
25 Jun '20
25 Jun '20
Module: wine Branch: master Commit: b8dc6b241204f5348563a23f51765234ef19f044 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b8dc6b241204f5348563a23f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 25 18:07:38 2020 +0200 ntdll: Move RtlGetSystemTimePrecise() to the Unix library. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/time.c | 25 +------------------------ dlls/ntdll/unix/loader.c | 1 + dlls/ntdll/unix/server.c | 2 +- dlls/ntdll/unix/sync.c | 21 +++++++++++++++++++-- dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unixlib.h | 3 ++- 6 files changed, 25 insertions(+), 28 deletions(-) diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c index 3174a39c2c..d6466b9dd1 100644 --- a/dlls/ntdll/time.c +++ b/dlls/ntdll/time.c @@ -32,9 +32,6 @@ #include <string.h> #include <limits.h> #include <time.h> -#ifdef HAVE_SYS_TIME_H -# include <sys/time.h> -#endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif @@ -399,27 +396,7 @@ NTSTATUS WINAPI NtQuerySystemTime( LARGE_INTEGER *time ) */ LONGLONG WINAPI RtlGetSystemTimePrecise( void ) { - LONGLONG time; - -#ifdef HAVE_CLOCK_GETTIME - struct timespec ts; - - if (!clock_gettime( CLOCK_REALTIME, &ts )) - { - time = ts.tv_sec * (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970; - time += (ts.tv_nsec + 50) / 100; - } - else -#endif - { - struct timeval now; - - gettimeofday( &now, 0 ); - time = now.tv_sec * (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970; - time += now.tv_usec * 10; - } - - return time; + return unix_funcs->RtlGetSystemTimePrecise(); } /****************************************************************************** diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index d8f7ab1bf0..68018b49fb 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1450,6 +1450,7 @@ static struct unix_funcs unix_funcs = NtWriteVirtualMemory, NtYieldExecution, DbgUiIssueRemoteBreakin, + RtlGetSystemTimePrecise, RtlWaitOnAddress, RtlWakeAddressAll, RtlWakeAddressSingle, diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index 299a311496..f02d1ed8a2 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -679,7 +679,7 @@ unsigned int server_wait( const select_op_t *select_op, data_size_t size, UINT f { LARGE_INTEGER now; - RtlQueryPerformanceCounter(&now); + NtQueryPerformanceCounter( &now, NULL ); abs_timeout -= now.QuadPart; } diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index bcf5fef017..4402584f28 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -1044,7 +1044,7 @@ NTSTATUS WINAPI NtQueryTimer( HANDLE handle, TIMER_INFORMATION_CLASS class, if (basic_info->RemainingTime.QuadPart > 0) NtQuerySystemTime( &now ); else { - RtlQueryPerformanceCounter( &now ); + NtQueryPerformanceCounter( &now, NULL ); basic_info->RemainingTime.QuadPart = -basic_info->RemainingTime.QuadPart; } @@ -1242,6 +1242,23 @@ ULONG WINAPI NtGetTickCount(void) } +/****************************************************************************** + * RtlGetSystemTimePrecise (NTDLL.@) + */ +LONGLONG WINAPI RtlGetSystemTimePrecise(void) +{ + struct timeval now; +#ifdef HAVE_CLOCK_GETTIME + struct timespec ts; + + if (!clock_gettime( CLOCK_REALTIME, &ts )) + return ts.tv_sec * (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970 + (ts.tv_nsec + 50) / 100; +#endif + gettimeofday( &now, 0 ); + return now.tv_sec * (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970 + now.tv_usec * 10; +} + + /****************************************************************************** * NtCreateKeyedEvent (NTDLL.@) */ @@ -2248,7 +2265,7 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size { LARGE_INTEGER now; - RtlQueryPerformanceCounter(&now); + NtQueryPerformanceCounter( &now, NULL ); abs_timeout -= now.QuadPart; } diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 1f06c91eff..ee6caaec8f 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -89,6 +89,7 @@ extern NTSTATUS CDECL fast_RtlSleepConditionVariableCS( RTL_CONDITION_VARIABLE * RTL_CRITICAL_SECTION *cs, const LARGE_INTEGER *timeout ) DECLSPEC_HIDDEN; extern NTSTATUS CDECL fast_RtlWakeConditionVariable( RTL_CONDITION_VARIABLE *variable, int count ) DECLSPEC_HIDDEN; +extern LONGLONG CDECL fast_RtlGetSystemTimePrecise(void) DECLSPEC_HIDDEN; void CDECL mmap_add_reserved_area( void *addr, SIZE_T size ) DECLSPEC_HIDDEN; void CDECL mmap_remove_reserved_area( void *addr, SIZE_T size ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index 3f93b961a6..62117eabb6 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 62 +#define NTDLL_UNIXLIB_VERSION 63 struct unix_funcs { @@ -261,6 +261,7 @@ struct unix_funcs /* other Win32 API functions */ NTSTATUS (WINAPI *DbgUiIssueRemoteBreakin)( HANDLE process ); + LONGLONG (WINAPI *RtlGetSystemTimePrecise)(void); NTSTATUS (WINAPI *RtlWaitOnAddress)( const void *addr, const void *cmp, SIZE_T size, const LARGE_INTEGER *timeout ); void (WINAPI *RtlWakeAddressAll)( const void *addr );
1
0
0
0
Alexandre Julliard : ntdll: Move the timezone detection code to the Unix library.
by Alexandre Julliard
25 Jun '20
25 Jun '20
Module: wine Branch: master Commit: 13c1f008c0d8beca934ebfd347dc8354f4c9db05 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=13c1f008c0d8beca934ebfd3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 25 15:28:26 2020 +0200 ntdll: Move the timezone detection code to the Unix library. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/time.c | 36 +++- dlls/ntdll/time.c | 453 +---------------------------------------- dlls/ntdll/unix/system.c | 398 ++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/unix_private.h | 6 + include/winternl.h | 1 + 5 files changed, 440 insertions(+), 454 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=13c1f008c0d8beca934e…
1
0
0
0
Alexandre Julliard : ntdll: Return the current time and timezone bias in NtQuerySystemInformation(SystemTimeOfDayInformation).
by Alexandre Julliard
25 Jun '20
25 Jun '20
Module: wine Branch: master Commit: 7161dcd42653452a2373a7595a7020d0a59722f4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7161dcd42653452a2373a759…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 25 12:30:00 2020 +0200 ntdll: Return the current time and timezone bias in NtQuerySystemInformation(SystemTimeOfDayInformation). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/time.c | 50 ++++++--------------------------------------- dlls/ntdll/unix/system.c | 12 +++++++++-- dlls/wbemprox/builtin.c | 2 +- include/winternl.h | 8 ++++---- programs/taskmgr/perfdata.c | 4 ++-- 5 files changed, 23 insertions(+), 53 deletions(-) diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c index 4d3c8afae6..96b8ceab3b 100644 --- a/dlls/ntdll/time.c +++ b/dlls/ntdll/time.c @@ -228,44 +228,6 @@ BOOLEAN WINAPI RtlTimeFieldsToTime( return TRUE; } -/*********************************************************************** - * TIME_GetBias [internal] - * - * Helper function calculates delta local time from UTC. - * - * PARAMS - * utc [I] The current utc time. - * pdaylight [I] Local daylight. - * - * RETURNS - * The bias for the current timezone. - */ -static LONG TIME_GetBias(void) -{ - static time_t last_utc; - static LONG last_bias; - LONG ret; - time_t utc; - - utc = time( NULL ); - - RtlEnterCriticalSection( &TIME_tz_section ); - if (utc != last_utc) - { - RTL_DYNAMIC_TIME_ZONE_INFORMATION tzi; - int is_dst = init_tz_info( &tzi ); - - last_utc = utc; - last_bias = tzi.Bias; - last_bias += is_dst ? tzi.DaylightBias : tzi.StandardBias; - last_bias *= SECSPERMIN; - } - - ret = last_bias; - - RtlLeaveCriticalSection( &TIME_tz_section ); - return ret; -} /****************************************************************************** * RtlLocalTimeToSystemTime [NTDLL.@] @@ -283,12 +245,12 @@ static LONG TIME_GetBias(void) NTSTATUS WINAPI RtlLocalTimeToSystemTime( const LARGE_INTEGER *LocalTime, PLARGE_INTEGER SystemTime) { - LONG bias; + SYSTEM_TIMEOFDAY_INFORMATION info; TRACE("(%p, %p)\n", LocalTime, SystemTime); - bias = TIME_GetBias(); - SystemTime->QuadPart = LocalTime->QuadPart + bias * (LONGLONG)TICKSPERSEC; + NtQuerySystemInformation( SystemTimeOfDayInformation, &info, sizeof(info), NULL ); + SystemTime->QuadPart = LocalTime->QuadPart + info.TimeZoneBias.QuadPart; return STATUS_SUCCESS; } @@ -308,12 +270,12 @@ NTSTATUS WINAPI RtlLocalTimeToSystemTime( const LARGE_INTEGER *LocalTime, NTSTATUS WINAPI RtlSystemTimeToLocalTime( const LARGE_INTEGER *SystemTime, PLARGE_INTEGER LocalTime ) { - LONG bias; + SYSTEM_TIMEOFDAY_INFORMATION info; TRACE("(%p, %p)\n", SystemTime, LocalTime); - bias = TIME_GetBias(); - LocalTime->QuadPart = SystemTime->QuadPart - bias * (LONGLONG)TICKSPERSEC; + NtQuerySystemInformation( SystemTimeOfDayInformation, &info, sizeof(info), NULL ); + LocalTime->QuadPart = SystemTime->QuadPart - info.TimeZoneBias.QuadPart; return STATUS_SUCCESS; } diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 68de16b7e5..1d81e8a04f 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -1690,10 +1690,18 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, case SystemTimeOfDayInformation: { + struct tm *tm; + time_t now; SYSTEM_TIMEOFDAY_INFORMATION sti = {{{ 0 }}}; - /* liKeSystemTime, liExpTimeZoneBias, uCurrentTimeZoneId */ - sti.liKeBootTime.QuadPart = server_start_time; + sti.BootTime.QuadPart = server_start_time; + now = time( NULL ); + tm = gmtime( &now ); + sti.TimeZoneBias.QuadPart = mktime( tm ) - now; + tm = localtime( &now ); + if (tm->tm_isdst) sti.TimeZoneBias.QuadPart -= 3600; + sti.TimeZoneBias.QuadPart *= TICKSPERSEC; + NtQuerySystemTime( &sti.SystemTime ); if (size <= sizeof(sti)) { diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 466611721a..2ff3131936 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -3275,7 +3275,7 @@ static WCHAR *get_lastbootuptime(void) if (!(ret = heap_alloc( 26 * sizeof(WCHAR) ))) return NULL; NtQuerySystemInformation( SystemTimeOfDayInformation, &ti, sizeof(ti), NULL ); - RtlTimeToTimeFields( &ti.liKeBootTime, &tf ); + RtlTimeToTimeFields( &ti.BootTime, &tf ); swprintf( ret, 26, L"%04u%02u%02u%02u%02u%02u.%06u+000", tf.Year, tf.Month, tf.Day, tf.Hour, tf.Minute, tf.Second, tf.Milliseconds * 1000 ); return ret; diff --git a/include/winternl.h b/include/winternl.h index 3ff15f28c1..ae41af85b3 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -1482,10 +1482,10 @@ typedef struct _SYSTEM_PERFORMANCE_INFORMATION { typedef struct _SYSTEM_TIMEOFDAY_INFORMATION { #ifdef __WINESRC__ - LARGE_INTEGER liKeBootTime; - LARGE_INTEGER liKeSystemTime; - LARGE_INTEGER liExpTimeZoneBias; - ULONG uCurrentTimeZoneId; + LARGE_INTEGER BootTime; + LARGE_INTEGER SystemTime; + LARGE_INTEGER TimeZoneBias; + ULONG TimeZoneId; ULONG Reserved; ULONGLONG BootTimeBias; ULONGLONG SleepTimeBias; diff --git a/programs/taskmgr/perfdata.c b/programs/taskmgr/perfdata.c index 3b5997d759..d81ab10248 100644 --- a/programs/taskmgr/perfdata.c +++ b/programs/taskmgr/perfdata.c @@ -199,7 +199,7 @@ void PerfDataRefresh(void) /* CurrentValue = NewValue - OldValue */ dbIdleTime = Li2Double(SysPerfInfo.IdleTime) - Li2Double(liOldIdleTime); dbKernelTime = CurrentKernelTime - OldKernelTime; - dbSystemTime = Li2Double(SysTimeInfo.liKeSystemTime) - Li2Double(liOldSystemTime); + dbSystemTime = Li2Double(SysTimeInfo.SystemTime) - Li2Double(liOldSystemTime); /* CurrentCpuIdle = IdleTime / SystemTime */ dbIdleTime = dbIdleTime / dbSystemTime; @@ -212,7 +212,7 @@ void PerfDataRefresh(void) /* Store new CPU's idle and system time */ liOldIdleTime = SysPerfInfo.IdleTime; - liOldSystemTime = SysTimeInfo.liKeSystemTime; + liOldSystemTime = SysTimeInfo.SystemTime; OldKernelTime = CurrentKernelTime; /* Determine the process count
1
0
0
0
Alexandre Julliard : ntdll: Always set the thread context through NtSetContextThread().
by Alexandre Julliard
25 Jun '20
25 Jun '20
Module: wine Branch: master Commit: c031662fd0bf1bc366185fe85a342bf60a9fc0bc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c031662fd0bf1bc366185fe8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 25 10:33:31 2020 +0200 ntdll: Always set the thread context through NtSetContextThread(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_arm.c | 21 --------- dlls/ntdll/signal_arm64.c | 28 +----------- dlls/ntdll/signal_x86_64.c | 106 +-------------------------------------------- 3 files changed, 2 insertions(+), 153 deletions(-) diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index adac496525..77c6676cce 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -85,27 +85,6 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4, ) -/*********************************************************************** - * set_cpu_context - * - * Set the new CPU context. - */ -void DECLSPEC_HIDDEN set_cpu_context( const CONTEXT *context ); -__ASM_GLOBAL_FUNC( set_cpu_context, - ".arm\n\t" - "ldr r2, [r0, #0x44]\n\t" /* context->Cpsr */ - "tst r2, #0x20\n\t" /* thumb? */ - "ldr r1, [r0, #0x40]\n\t" /* context->Pc */ - "orrne r1, r1, #1\n\t" /* Adjust PC according to thumb */ - "biceq r1, r1, #1\n\t" /* Adjust PC according to arm */ - "msr CPSR_f, r2\n\t" - "ldr lr, [r0, #0x3c]\n\t" /* context->Lr */ - "ldr sp, [r0, #0x38]\n\t" /* context->Sp */ - "push {r1}\n\t" - "ldmib r0, {r0-r12}\n\t" /* context->R0..R12 */ - "pop {pc}" ) - - /********************************************************************** * call_stack_handlers * diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index f396504ae6..798ebe3013 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -68,20 +68,6 @@ struct MSVCRT_JUMP_BUFFER double D[8]; }; -struct arm64_thread_data -{ - void *exit_frame; /* exit frame pointer */ - CONTEXT *context; /* context to set with SIGUSR2 */ -}; - -C_ASSERT( sizeof(struct arm64_thread_data) <= sizeof(((TEB *)0)->SystemReserved2) ); -C_ASSERT( offsetof( TEB, SystemReserved2 ) + offsetof( struct arm64_thread_data, exit_frame ) == 0x300 ); - -static inline struct arm64_thread_data *arm64_thread_data(void) -{ - return (struct arm64_thread_data *)NtCurrentTeb()->SystemReserved2; -} - /******************************************************************* * is_valid_frame @@ -122,18 +108,6 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 8, "str w1, [x0, #0x4]\n\t" /* context->Cpsr */ "ret" ) -/*********************************************************************** - * set_cpu_context - * - * Set the new CPU context. - */ -static void set_cpu_context( const CONTEXT *context ) -{ - InterlockedExchangePointer( (void **)&arm64_thread_data()->context, (void *)context ); - raise( SIGUSR2 ); -} - - /********************************************************************** * virtual_unwind @@ -1039,7 +1013,7 @@ void CDECL RtlRestoreContext( CONTEXT *context, EXCEPTION_RECORD *rec ) } TRACE( "returning to %lx stack %lx\n", context->Pc, context->Sp ); - set_cpu_context( context ); + NtSetContextThread( GetCurrentThread(), context ); } /******************************************************************* diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 1f97fbcedb..ec1c0f2d0b 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -222,25 +222,6 @@ struct MSVCRT_JUMP_BUFFER #error You must define the signal context functions for your platform #endif -struct amd64_thread_data -{ - DWORD_PTR dr0; /* debug registers */ - DWORD_PTR dr1; - DWORD_PTR dr2; - DWORD_PTR dr3; - DWORD_PTR dr6; - DWORD_PTR dr7; - void *exit_frame; /* exit frame pointer */ -}; - -C_ASSERT( sizeof(struct amd64_thread_data) <= sizeof(((TEB *)0)->SystemReserved2) ); -C_ASSERT( offsetof( TEB, SystemReserved2 ) + offsetof( struct amd64_thread_data, exit_frame ) == 0x330 ); - -static inline struct amd64_thread_data *amd64_thread_data(void) -{ - return (struct amd64_thread_data *)NtCurrentTeb()->SystemReserved2; -} - /*********************************************************************** * Definitions for Win32 unwind tables @@ -525,91 +506,6 @@ __ASM_GLOBAL_FUNC( RtlCaptureContext, "movdqa %xmm15,0x290(%rcx)\n\t" /* context->Xmm15 */ "ret" ); -/*********************************************************************** - * set_full_cpu_context - * - * Set the new CPU context. - */ -extern void set_full_cpu_context( const CONTEXT *context ); -__ASM_GLOBAL_FUNC( set_full_cpu_context, - "subq $40,%rsp\n\t" - __ASM_SEH(".seh_stackalloc 0x40\n\t") - __ASM_SEH(".seh_endprologue\n\t") - __ASM_CFI(".cfi_adjust_cfa_offset 40\n\t") - "ldmxcsr 0x34(%rdi)\n\t" /* context->MxCsr */ - "movw 0x38(%rdi),%ax\n\t" /* context->SegCs */ - "movq %rax,8(%rsp)\n\t" - "movw 0x42(%rdi),%ax\n\t" /* context->SegSs */ - "movq %rax,32(%rsp)\n\t" - "movq 0x44(%rdi),%rax\n\t" /* context->Eflags */ - "movq %rax,16(%rsp)\n\t" - "movq 0x80(%rdi),%rcx\n\t" /* context->Rcx */ - "movq 0x88(%rdi),%rdx\n\t" /* context->Rdx */ - "movq 0x90(%rdi),%rbx\n\t" /* context->Rbx */ - "movq 0x98(%rdi),%rax\n\t" /* context->Rsp */ - "movq %rax,24(%rsp)\n\t" - "movq 0xa0(%rdi),%rbp\n\t" /* context->Rbp */ - "movq 0xa8(%rdi),%rsi\n\t" /* context->Rsi */ - "movq 0xb8(%rdi),%r8\n\t" /* context->R8 */ - "movq 0xc0(%rdi),%r9\n\t" /* context->R9 */ - "movq 0xc8(%rdi),%r10\n\t" /* context->R10 */ - "movq 0xd0(%rdi),%r11\n\t" /* context->R11 */ - "movq 0xd8(%rdi),%r12\n\t" /* context->R12 */ - "movq 0xe0(%rdi),%r13\n\t" /* context->R13 */ - "movq 0xe8(%rdi),%r14\n\t" /* context->R14 */ - "movq 0xf0(%rdi),%r15\n\t" /* context->R15 */ - "movq 0xf8(%rdi),%rax\n\t" /* context->Rip */ - "movq %rax,(%rsp)\n\t" - "fxrstor 0x100(%rdi)\n\t" /* context->FtlSave */ - "movdqa 0x1a0(%rdi),%xmm0\n\t" /* context->Xmm0 */ - "movdqa 0x1b0(%rdi),%xmm1\n\t" /* context->Xmm1 */ - "movdqa 0x1c0(%rdi),%xmm2\n\t" /* context->Xmm2 */ - "movdqa 0x1d0(%rdi),%xmm3\n\t" /* context->Xmm3 */ - "movdqa 0x1e0(%rdi),%xmm4\n\t" /* context->Xmm4 */ - "movdqa 0x1f0(%rdi),%xmm5\n\t" /* context->Xmm5 */ - "movdqa 0x200(%rdi),%xmm6\n\t" /* context->Xmm6 */ - "movdqa 0x210(%rdi),%xmm7\n\t" /* context->Xmm7 */ - "movdqa 0x220(%rdi),%xmm8\n\t" /* context->Xmm8 */ - "movdqa 0x230(%rdi),%xmm9\n\t" /* context->Xmm9 */ - "movdqa 0x240(%rdi),%xmm10\n\t" /* context->Xmm10 */ - "movdqa 0x250(%rdi),%xmm11\n\t" /* context->Xmm11 */ - "movdqa 0x260(%rdi),%xmm12\n\t" /* context->Xmm12 */ - "movdqa 0x270(%rdi),%xmm13\n\t" /* context->Xmm13 */ - "movdqa 0x280(%rdi),%xmm14\n\t" /* context->Xmm14 */ - "movdqa 0x290(%rdi),%xmm15\n\t" /* context->Xmm15 */ - "movq 0x78(%rdi),%rax\n\t" /* context->Rax */ - "movq 0xb0(%rdi),%rdi\n\t" /* context->Rdi */ - "iretq" ); - - -/*********************************************************************** - * set_cpu_context - * - * Set the new CPU context. Used by NtSetContextThread. - */ -void DECLSPEC_HIDDEN set_cpu_context( const CONTEXT *context ) -{ - DWORD flags = context->ContextFlags & ~CONTEXT_AMD64; - - if (flags & CONTEXT_DEBUG_REGISTERS) - { - amd64_thread_data()->dr0 = context->Dr0; - amd64_thread_data()->dr1 = context->Dr1; - amd64_thread_data()->dr2 = context->Dr2; - amd64_thread_data()->dr3 = context->Dr3; - amd64_thread_data()->dr6 = context->Dr6; - amd64_thread_data()->dr7 = context->Dr7; - } - if (flags & CONTEXT_FULL) - { - if (!(flags & CONTEXT_CONTROL)) - FIXME( "setting partial context (%x) not supported\n", flags ); - else - set_full_cpu_context( context ); - } -} - - /****************************************************************************** * RtlWow64GetThreadContext (NTDLL.@) */ @@ -1320,7 +1216,7 @@ void CDECL RtlRestoreContext( CONTEXT *context, EXCEPTION_RECORD *rec ) } TRACE( "returning to %lx stack %lx\n", context->Rip, context->Rsp ); - set_cpu_context( context ); + NtSetContextThread( GetCurrentThread(), context ); }
1
0
0
0
Alexandre Julliard : ntdll: Move the libunwind support to the Unix library.
by Alexandre Julliard
25 Jun '20
25 Jun '20
Module: wine Branch: master Commit: 10dbd1edd19008bc8eaeb55446e1e5fd87a12814 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=10dbd1edd19008bc8eaeb554…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 25 10:32:47 2020 +0200 ntdll: Move the libunwind support to the Unix library. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_arm64.c | 137 +---- dlls/ntdll/signal_x86_64.c | 1124 +-------------------------------------- dlls/ntdll/unix/loader.c | 1 + dlls/ntdll/unix/signal_arm.c | 9 + dlls/ntdll/unix/signal_arm64.c | 115 ++++ dlls/ntdll/unix/signal_i386.c | 9 + dlls/ntdll/unix/signal_x86_64.c | 1080 +++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/unix_private.h | 2 + dlls/ntdll/unixlib.h | 5 +- 9 files changed, 1226 insertions(+), 1256 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=10dbd1edd19008bc8eae…
1
0
0
0
Rémi Bernon : server: Implement RegisterRawInputDevices RIDEV_INPUTSINK flag.
by Alexandre Julliard
25 Jun '20
25 Jun '20
Module: wine Branch: master Commit: 27a52d0414b68eb9d74c058afc4775b43f151263 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=27a52d0414b68eb9d74c058a…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Jun 24 15:28:42 2020 +0200 server: Implement RegisterRawInputDevices RIDEV_INPUTSINK flag. This flag allows applications to receive rawinput messages while in background. They have to specify a target hwnd, which will receive them, and the messages will carry a RIM_INPUTSINK wparam if the process wasn't foreground. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/rawinput.c | 9 ++++++++- dlls/user32/tests/input.c | 8 +++----- server/queue.c | 24 ++++++++++++++++++++---- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c index 7a9eb6ced1..103835e0e3 100644 --- a/dlls/user32/rawinput.c +++ b/dlls/user32/rawinput.c @@ -291,6 +291,13 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U for (i = 0; i < device_count; ++i) { + if ((devices[i].dwFlags & RIDEV_INPUTSINK) && + (devices[i].hwndTarget == NULL)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if ((devices[i].dwFlags & RIDEV_REMOVE) && (devices[i].hwndTarget != NULL)) { @@ -306,7 +313,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U TRACE("device %u: page %#x, usage %#x, flags %#x, target %p.\n", i, devices[i].usUsagePage, devices[i].usUsage, devices[i].dwFlags, devices[i].hwndTarget); - if (devices[i].dwFlags & ~(RIDEV_REMOVE|RIDEV_NOLEGACY)) + if (devices[i].dwFlags & ~(RIDEV_REMOVE|RIDEV_NOLEGACY|RIDEV_INPUTSINK)) FIXME("Unhandled flags %#x for device %u.\n", devices[i].dwFlags, i); d[i].usage_page = devices[i].usUsagePage; diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 0c14de7d78..3130f3987e 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1807,9 +1807,7 @@ static void test_RegisterRawInputDevices(void) SetLastError(0xdeadbeef); res = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); - todo_wine ok(res == FALSE, "RegisterRawInputDevices failed\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned %08x\n", GetLastError()); raw_devices[0].hwndTarget = hwnd; @@ -1884,13 +1882,13 @@ struct rawinput_test rawinput_tests[] = /* cross-process foreground tests */ { TRUE, TRUE, 0, FALSE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, - { TRUE, TRUE, RIDEV_INPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, TRUE, FALSE }, + { TRUE, TRUE, RIDEV_INPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, { TRUE, TRUE, 0, FALSE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, /* multi-process rawinput tests */ { TRUE, TRUE, 0, FALSE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, - { TRUE, TRUE, RIDEV_INPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, TRUE, FALSE }, - { TRUE, TRUE, RIDEV_INPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, TRUE, FALSE }, + { TRUE, TRUE, RIDEV_INPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, + { TRUE, TRUE, RIDEV_INPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, { TRUE, TRUE, RIDEV_EXINPUTSINK, FALSE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, { TRUE, TRUE, RIDEV_EXINPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, TRUE, FALSE }, diff --git a/server/queue.c b/server/queue.c index 92a9c5f2c2..c3925dd664 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1656,7 +1656,10 @@ static int queue_rawinput_message( struct process* process, void *arg ) { const struct rawinput_message* raw_msg = arg; const struct rawinput_device *device = NULL; + struct desktop *target_desktop = NULL; + struct thread *target_thread = NULL; struct message *msg; + int wparam = RIM_INPUT; if (raw_msg->data.rawinput.type == RIM_TYPEMOUSE) device = process->rawinput_mouse; @@ -1664,16 +1667,29 @@ static int queue_rawinput_message( struct process* process, void *arg ) device = process->rawinput_kbd; if (!device) return 0; + if (process != raw_msg->foreground->process) + { + if (!(device->flags & RIDEV_INPUTSINK)) goto done; + if (!(target_thread = get_window_thread( device->target ))) goto done; + if (!(target_desktop = get_thread_desktop( target_thread, 0 ))) goto done; + if (target_desktop != raw_msg->desktop) goto done; + wparam = RIM_INPUTSINK; + } + if (!(msg = alloc_hardware_message( raw_msg->data.info, raw_msg->source, raw_msg->time ))) - return 0; + goto done; msg->win = device->target; msg->msg = WM_INPUT; - msg->wparam = RIM_INPUT; + msg->wparam = wparam; msg->lparam = 0; memcpy( msg->data, &raw_msg->data, sizeof(raw_msg->data) ); queue_hardware_message( raw_msg->desktop, msg, 1 ); + +done: + if (target_thread) release_object( target_thread ); + if (target_desktop) release_object( target_desktop ); return 0; } @@ -1749,7 +1765,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons msg_data->rawinput.mouse.y = y - desktop->cursor.y; msg_data->rawinput.mouse.data = input->mouse.data; - queue_rawinput_message( foreground->process, &raw_msg ); + enum_processes( queue_rawinput_message, &raw_msg ); release_object( foreground ); } @@ -1883,7 +1899,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c msg_data->rawinput.kbd.vkey = vkey; msg_data->rawinput.kbd.scan = input->kbd.scan; - queue_rawinput_message( foreground->process, &raw_msg ); + enum_processes( queue_rawinput_message, &raw_msg ); release_object( foreground ); }
1
0
0
0
Rémi Bernon : server: Implement RegisterRawInputDevices RIDEV_NOLEGACY flag.
by Alexandre Julliard
25 Jun '20
25 Jun '20
Module: wine Branch: master Commit: 8cf7fe3b7c20665ad308ce3010cd635ac63da6b7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8cf7fe3b7c20665ad308ce30…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Jun 24 15:28:41 2020 +0200 server: Implement RegisterRawInputDevices RIDEV_NOLEGACY flag. This makes legacy mouse window messages such as WM_MOUSEMOVE and others, to stop being sent, including to low-level hooks. The desktop mouse state should still be udpated. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/rawinput.c | 2 +- dlls/user32/tests/input.c | 2 +- server/queue.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c index dd2ac2e208..7a9eb6ced1 100644 --- a/dlls/user32/rawinput.c +++ b/dlls/user32/rawinput.c @@ -306,7 +306,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U TRACE("device %u: page %#x, usage %#x, flags %#x, target %p.\n", i, devices[i].usUsagePage, devices[i].usUsage, devices[i].dwFlags, devices[i].hwndTarget); - if (devices[i].dwFlags & ~RIDEV_REMOVE) + if (devices[i].dwFlags & ~(RIDEV_REMOVE|RIDEV_NOLEGACY)) FIXME("Unhandled flags %#x for device %u.\n", devices[i].dwFlags, i); d[i].usage_page = devices[i].usUsagePage; diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index e43e72532a..0c14de7d78 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1876,7 +1876,7 @@ struct rawinput_test rawinput_tests[] = { FALSE, FALSE, 0, TRUE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, { TRUE, FALSE, 0, TRUE, TRUE, TRUE, /* todos: */ FALSE, FALSE, FALSE }, { TRUE, TRUE, 0, TRUE, TRUE, TRUE, /* todos: */ FALSE, FALSE, FALSE }, - { TRUE, TRUE, RIDEV_NOLEGACY, FALSE, TRUE, TRUE, /* todos: */ TRUE, FALSE, FALSE }, + { TRUE, TRUE, RIDEV_NOLEGACY, FALSE, TRUE, TRUE, /* todos: */ FALSE, FALSE, FALSE }, /* same-process foreground tests */ { TRUE, FALSE, 0, FALSE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, diff --git a/server/queue.c b/server/queue.c index 5b018085cc..92a9c5f2c2 100644 --- a/server/queue.c +++ b/server/queue.c @@ -384,8 +384,15 @@ static int update_desktop_cursor_pos( struct desktop *desktop, int x, int y ) static void set_cursor_pos( struct desktop *desktop, int x, int y ) { static const struct hw_msg_source source = { IMDT_UNAVAILABLE, IMO_SYSTEM }; + const struct rawinput_device *device; struct message *msg; + if ((device = current->process->rawinput_mouse) && (device->flags & RIDEV_NOLEGACY)) + { + update_desktop_cursor_pos( desktop, x, y ); + return; + } + if (!(msg = alloc_hardware_message( 0, source, get_tick_count() ))) return; msg->msg = WM_MOUSEMOVE; @@ -1352,6 +1359,30 @@ static void update_input_key_state( struct desktop *desktop, unsigned char *keys } } +/* update the desktop key state according to a mouse message flags */ +static void update_desktop_mouse_state( struct desktop *desktop, unsigned int flags, + int x, int y, lparam_t wparam ) +{ + if (flags & MOUSEEVENTF_MOVE) + update_desktop_cursor_pos( desktop, x, y ); + if (flags & MOUSEEVENTF_LEFTDOWN) + update_input_key_state( desktop, desktop->keystate, WM_LBUTTONDOWN, wparam ); + if (flags & MOUSEEVENTF_LEFTUP) + update_input_key_state( desktop, desktop->keystate, WM_LBUTTONUP, wparam ); + if (flags & MOUSEEVENTF_RIGHTDOWN) + update_input_key_state( desktop, desktop->keystate, WM_RBUTTONDOWN, wparam ); + if (flags & MOUSEEVENTF_RIGHTUP) + update_input_key_state( desktop, desktop->keystate, WM_RBUTTONUP, wparam ); + if (flags & MOUSEEVENTF_MIDDLEDOWN) + update_input_key_state( desktop, desktop->keystate, WM_MBUTTONDOWN, wparam ); + if (flags & MOUSEEVENTF_MIDDLEUP) + update_input_key_state( desktop, desktop->keystate, WM_MBUTTONUP, wparam ); + if (flags & MOUSEEVENTF_XDOWN) + update_input_key_state( desktop, desktop->keystate, WM_XBUTTONDOWN, wparam ); + if (flags & MOUSEEVENTF_XUP) + update_input_key_state( desktop, desktop->keystate, WM_XBUTTONUP, wparam ); +} + /* release the hardware message currently being processed by the given thread */ static void release_hardware_message( struct msg_queue *queue, unsigned int hw_id, int remove ) @@ -1650,6 +1681,7 @@ static int queue_rawinput_message( struct process* process, void *arg ) static int queue_mouse_message( struct desktop *desktop, user_handle_t win, const hw_input_t *input, unsigned int origin, struct msg_queue *sender ) { + const struct rawinput_device *device; struct hardware_msg_data *msg_data; struct rawinput_message raw_msg; struct message *msg; @@ -1721,6 +1753,12 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons release_object( foreground ); } + if ((device = current->process->rawinput_mouse) && (device->flags & RIDEV_NOLEGACY)) + { + update_desktop_mouse_state( desktop, flags, x, y, input->mouse.data << 16 ); + return 0; + } + for (i = 0; i < ARRAY_SIZE( messages ); i++) { if (!messages[i]) continue; @@ -1755,6 +1793,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c unsigned int origin, struct msg_queue *sender ) { struct hw_msg_source source = { IMDT_KEYBOARD, origin }; + const struct rawinput_device *device; struct hardware_msg_data *msg_data; struct rawinput_message raw_msg; struct message *msg; @@ -1848,6 +1887,12 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c release_object( foreground ); } + if ((device = current->process->rawinput_kbd) && (device->flags & RIDEV_NOLEGACY)) + { + update_input_key_state( desktop, desktop->keystate, message_code, vkey ); + return 0; + } + if (!(msg = alloc_hardware_message( input->kbd.info, source, time ))) return 0; msg_data = msg->data;
1
0
0
0
Rémi Bernon : server: Pass msg and wparam to update_input_key_state helper.
by Alexandre Julliard
25 Jun '20
25 Jun '20
Module: wine Branch: master Commit: 4d844b449e7fe8b57798ce3a1fdefb1f122ece6a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4d844b449e7fe8b57798ce3a…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Jun 24 15:28:40 2020 +0200 server: Pass msg and wparam to update_input_key_state helper. So that we can update individual states in next patch. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/queue.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/server/queue.c b/server/queue.c index 7fd3be1662..5b018085cc 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1290,12 +1290,12 @@ static void set_input_key_state( unsigned char *keystate, unsigned char key, int /* update the input key state for a keyboard message */ static void update_input_key_state( struct desktop *desktop, unsigned char *keystate, - const struct message *msg ) + unsigned int msg, lparam_t wparam ) { unsigned char key; int down = 0; - switch (msg->msg) + switch (msg) { case WM_LBUTTONDOWN: down = (keystate == desktop->keystate) ? 0xc0 : 0x80; @@ -1319,8 +1319,8 @@ static void update_input_key_state( struct desktop *desktop, unsigned char *keys down = (keystate == desktop->keystate) ? 0xc0 : 0x80; /* fall through */ case WM_XBUTTONUP: - if (msg->wparam >> 16 == XBUTTON1) set_input_key_state( keystate, VK_XBUTTON1, down ); - else if (msg->wparam >> 16 == XBUTTON2) set_input_key_state( keystate, VK_XBUTTON2, down ); + if (wparam >> 16 == XBUTTON1) set_input_key_state( keystate, VK_XBUTTON1, down ); + else if (wparam >> 16 == XBUTTON2) set_input_key_state( keystate, VK_XBUTTON2, down ); break; case WM_KEYDOWN: case WM_SYSKEYDOWN: @@ -1328,7 +1328,7 @@ static void update_input_key_state( struct desktop *desktop, unsigned char *keys /* fall through */ case WM_KEYUP: case WM_SYSKEYUP: - key = (unsigned char)msg->wparam; + key = (unsigned char)wparam; set_input_key_state( keystate, key, down ); switch(key) { @@ -1382,7 +1382,7 @@ static void release_hardware_message( struct msg_queue *queue, unsigned int hw_i } if (clr_bit) clear_queue_bits( queue, clr_bit ); - update_input_key_state( input->desktop, input->keystate, msg ); + update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); list_remove( &msg->entry ); free_message( msg ); } @@ -1501,7 +1501,7 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg struct thread_input *input; unsigned int msg_code; - update_input_key_state( desktop, desktop->keystate, msg ); + update_input_key_state( desktop, desktop->keystate, msg->msg, msg->wparam ); last_input_time = get_tick_count(); if (msg->msg != WM_MOUSEMOVE) always_queue = 1; @@ -1536,7 +1536,7 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg win = find_hardware_message_window( desktop, input, msg, &msg_code, &thread ); if (!win || !thread) { - if (input) update_input_key_state( input->desktop, input->keystate, msg ); + if (input) update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); free_message( msg ); return; } @@ -1973,7 +1973,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user if (!win || !win_thread) { /* no window at all, remove it */ - update_input_key_state( input->desktop, input->keystate, msg ); + update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); list_remove( &msg->entry ); free_message( msg ); continue; @@ -1989,7 +1989,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user else { /* for another thread input, drop it */ - update_input_key_state( input->desktop, input->keystate, msg ); + update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); list_remove( &msg->entry ); free_message( msg ); }
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
18
...
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