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
Jacek Caban : server: Introduce IOCTL_CONDRV_READ_OUTPUT ioctl.
by Alexandre Julliard
28 Jul '20
28 Jul '20
Module: wine Branch: master Commit: 44052219aa0e6412a0f595f830c0cdf6e82ea70c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=44052219aa0e6412a0f595f8…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Jul 28 17:10:23 2020 +0200 server: Introduce IOCTL_CONDRV_READ_OUTPUT ioctl. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/wine/condrv.h | 3 +- server/console.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++-- server/trace.c | 1 + 3 files changed, 90 insertions(+), 4 deletions(-) diff --git a/include/wine/condrv.h b/include/wine/condrv.h index a47a4f2775..839db84ea5 100644 --- a/include/wine/condrv.h +++ b/include/wine/condrv.h @@ -37,6 +37,7 @@ #define IOCTL_CONDRV_SET_TITLE CTL_CODE(FILE_DEVICE_CONSOLE, 16, METHOD_BUFFERED, FILE_WRITE_PROPERTIES) /* console output ioctls */ +#define IOCTL_CONDRV_READ_OUTPUT CTL_CODE(FILE_DEVICE_CONSOLE, 30, METHOD_BUFFERED, FILE_READ_DATA) #define IOCTL_CONDRV_WRITE_OUTPUT CTL_CODE(FILE_DEVICE_CONSOLE, 31, METHOD_BUFFERED, FILE_WRITE_DATA) #define IOCTL_CONDRV_GET_OUTPUT_INFO CTL_CODE(FILE_DEVICE_CONSOLE, 32, METHOD_BUFFERED, FILE_READ_PROPERTIES) #define IOCTL_CONDRV_SET_OUTPUT_INFO CTL_CODE(FILE_DEVICE_CONSOLE, 33, METHOD_BUFFERED, FILE_WRITE_PROPERTIES) @@ -83,7 +84,7 @@ struct condrv_input_info_params struct condrv_input_info info; /* input_info */ }; -/* IOCTL_CONDRV_WRITE_OUTPUT */ +/* IOCTL_CONDRV_WRITE_OUTPUT and IOCTL_CONDRV_READ_OUTPUT params */ struct condrv_output_params { unsigned int x; /* destination position */ diff --git a/server/console.c b/server/console.c index 14fbd67e22..207e333ec3 100644 --- a/server/console.c +++ b/server/console.c @@ -1248,6 +1248,73 @@ static struct fd *screen_buffer_get_fd( struct object *obj ) return NULL; } +/* read data from a screen buffer */ +static void read_console_output( struct screen_buffer *screen_buffer, unsigned int x, unsigned int y, + enum char_info_mode mode, unsigned int width ) +{ + unsigned int i, count; + char_info_t *src; + + if (x >= screen_buffer->width || y >= screen_buffer->height) + { + if (width) set_error( STATUS_INVALID_PARAMETER ); + return; + } + src = screen_buffer->data + y * screen_buffer->width + x; + + switch(mode) + { + case CHAR_INFO_MODE_TEXT: + { + WCHAR *data; + count = min( screen_buffer->data + screen_buffer->height * screen_buffer->width - src, + get_reply_max_size() / sizeof(*data) ); + if ((data = set_reply_data_size( count * sizeof(*data) ))) + { + for (i = 0; i < count; i++) data[i] = src[i].ch; + } + } + break; + case CHAR_INFO_MODE_ATTR: + { + unsigned short *data; + count = min( screen_buffer->data + screen_buffer->height * screen_buffer->width - src, + get_reply_max_size() / sizeof(*data) ); + if ((data = set_reply_data_size( count * sizeof(*data) ))) + { + for (i = 0; i < count; i++) data[i] = src[i].attr; + } + } + break; + case CHAR_INFO_MODE_TEXTATTR: + { + char_info_t *data; + SMALL_RECT *region; + if (!width || get_reply_max_size() < sizeof(*region)) + { + set_error( STATUS_INVALID_PARAMETER ); + return; + } + count = min( (get_reply_max_size() - sizeof(*region)) / (width * sizeof(*data)), screen_buffer->height - y ); + width = min( width, screen_buffer->width - x ); + if (!(region = set_reply_data_size( sizeof(*region) + width * count * sizeof(*data) ))) return; + region->Left = x; + region->Top = y; + region->Right = x + width - 1; + region->Bottom = y + count - 1; + data = (char_info_t *)(region + 1); + for (i = 0; i < count; i++) + { + memcpy( &data[i * width], &src[i * screen_buffer->width], width * sizeof(*data) ); + } + } + break; + default: + set_error( STATUS_INVALID_PARAMETER ); + break; + } +} + /* write data into a screen buffer */ static void write_console_output( struct screen_buffer *screen_buffer, const struct condrv_output_params *params, data_size_t size ) @@ -1378,8 +1445,8 @@ static int fill_console_output( struct screen_buffer *screen_buffer, char_info_t } /* read data from a screen buffer */ -static void read_console_output( struct screen_buffer *screen_buffer, int x, int y, - enum char_info_mode mode, int wrap ) +static void read_console_output_req( struct screen_buffer *screen_buffer, int x, int y, + enum char_info_mode mode, int wrap ) { int i; char_info_t *end, *src = screen_buffer->data + y * screen_buffer->width + x; @@ -1676,6 +1743,23 @@ static int screen_buffer_ioctl( struct fd *fd, ioctl_code_t code, struct async * screen_buffer->mode = *(unsigned int *)get_req_data(); return 1; + case IOCTL_CONDRV_READ_OUTPUT: + { + const struct condrv_output_params *params = get_req_data(); + if (get_req_data_size() != sizeof(*params)) + { + set_error( STATUS_INVALID_PARAMETER ); + return 0; + } + if (console_input_is_bare( screen_buffer->input )) + { + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + return 0; + } + read_console_output( screen_buffer, params->x, params->y, params->mode, params->width ); + return !get_error(); + } + case IOCTL_CONDRV_WRITE_OUTPUT: if (get_req_data_size() < sizeof(struct condrv_output_params) || (get_reply_max_size() != sizeof(SMALL_RECT) && get_reply_max_size() != sizeof(unsigned int))) @@ -2150,7 +2234,7 @@ DECL_HANDLER(read_console_output) release_object( screen_buffer ); return; } - read_console_output( screen_buffer, req->x, req->y, req->mode, req->wrap ); + read_console_output_req( screen_buffer, req->x, req->y, req->mode, req->wrap ); reply->width = screen_buffer->width; reply->height = screen_buffer->height; release_object( screen_buffer ); diff --git a/server/trace.c b/server/trace.c index 7cff5bf5f4..ab5a40bef8 100644 --- a/server/trace.c +++ b/server/trace.c @@ -124,6 +124,7 @@ static void dump_ioctl_code( const char *prefix, const ioctl_code_t *code ) CASE(IOCTL_CONDRV_GET_TITLE); CASE(IOCTL_CONDRV_PEEK); CASE(IOCTL_CONDRV_READ_INPUT); + CASE(IOCTL_CONDRV_READ_OUTPUT); CASE(IOCTL_CONDRV_SET_MODE); CASE(IOCTL_CONDRV_SET_OUTPUT_INFO); CASE(IOCTL_CONDRV_WRITE_INPUT);
1
0
0
0
Jacek Caban : condrv: Rename condrv_write_output_params to condrv_output_params.
by Alexandre Julliard
28 Jul '20
28 Jul '20
Module: wine Branch: master Commit: 7a31d401391c9c66173a599cadbbb6946f607927 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7a31d401391c9c66173a599c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Jul 28 17:09:57 2020 +0200 condrv: Rename condrv_write_output_params to condrv_output_params. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/console.c | 2 +- dlls/kernelbase/console.c | 6 +++--- include/wine/condrv.h | 2 +- server/console.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 8fc158ac22..c4583d1d9c 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -691,7 +691,7 @@ LONG CALLBACK CONSOLE_HandleCtrlC( EXCEPTION_POINTERS *eptr ) */ static int CONSOLE_WriteChars(HANDLE handle, const WCHAR *str, size_t length, COORD *coord) { - struct condrv_write_output_params *params; + struct condrv_output_params *params; DWORD written = 0, size; if (!length) return 0; diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c index b7443ce9ae..23f0696124 100644 --- a/dlls/kernelbase/console.c +++ b/dlls/kernelbase/console.c @@ -1486,7 +1486,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputA( HANDLE handle, const CHAR_INF BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputW( HANDLE handle, const CHAR_INFO *buffer, COORD size, COORD coord, SMALL_RECT *region ) { - struct condrv_write_output_params *params; + struct condrv_output_params *params; unsigned int width, height, y; size_t params_size; BOOL ret; @@ -1533,7 +1533,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputW( HANDLE handle, const CHAR_INF BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputAttribute( HANDLE handle, const WORD *attr, DWORD length, COORD coord, DWORD *written ) { - struct condrv_write_output_params *params; + struct condrv_output_params *params; size_t size; BOOL ret; @@ -1600,7 +1600,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputCharacterA( HANDLE handle, LPCST BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputCharacterW( HANDLE handle, LPCWSTR str, DWORD length, COORD coord, DWORD *written ) { - struct condrv_write_output_params *params; + struct condrv_output_params *params; size_t size; BOOL ret; diff --git a/include/wine/condrv.h b/include/wine/condrv.h index 922550f6f5..a47a4f2775 100644 --- a/include/wine/condrv.h +++ b/include/wine/condrv.h @@ -84,7 +84,7 @@ struct condrv_input_info_params }; /* IOCTL_CONDRV_WRITE_OUTPUT */ -struct condrv_write_output_params +struct condrv_output_params { unsigned int x; /* destination position */ unsigned int y; diff --git a/server/console.c b/server/console.c index e74340d122..14fbd67e22 100644 --- a/server/console.c +++ b/server/console.c @@ -1249,7 +1249,7 @@ static struct fd *screen_buffer_get_fd( struct object *obj ) } /* write data into a screen buffer */ -static void write_console_output( struct screen_buffer *screen_buffer, const struct condrv_write_output_params *params, +static void write_console_output( struct screen_buffer *screen_buffer, const struct condrv_output_params *params, data_size_t size ) { unsigned int i, entry_size, entry_cnt, x, y; @@ -1677,7 +1677,7 @@ static int screen_buffer_ioctl( struct fd *fd, ioctl_code_t code, struct async * return 1; case IOCTL_CONDRV_WRITE_OUTPUT: - if (get_req_data_size() < sizeof(struct condrv_write_output_params) || + if (get_req_data_size() < sizeof(struct condrv_output_params) || (get_reply_max_size() != sizeof(SMALL_RECT) && get_reply_max_size() != sizeof(unsigned int))) { set_error( STATUS_INVALID_PARAMETER ); @@ -1688,7 +1688,7 @@ static int screen_buffer_ioctl( struct fd *fd, ioctl_code_t code, struct async * set_error( STATUS_OBJECT_TYPE_MISMATCH ); return 0; } - write_console_output( screen_buffer, get_req_data(), get_req_data_size() - sizeof(struct condrv_write_output_params) ); + write_console_output( screen_buffer, get_req_data(), get_req_data_size() - sizeof(struct condrv_output_params) ); return !get_error(); case IOCTL_CONDRV_GET_OUTPUT_INFO:
1
0
0
0
Gijs Vermeulen : qdvd: Add a stub IDvdInfo2 interface.
by Alexandre Julliard
28 Jul '20
28 Jul '20
Module: wine Branch: master Commit: d05ec6b2780144c5f1c56a702e0c1c502c6cb78a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d05ec6b2780144c5f1c56a70…
Author: Gijs Vermeulen <gijsvrm(a)gmail.com> Date: Tue Jul 28 10:29:58 2020 +0200 qdvd: Add a stub IDvdInfo2 interface. Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qdvd/navigator.c | 436 ++++++++++++++++++++++++++++++++++++++++++++ dlls/qdvd/tests/navigator.c | 2 +- 2 files changed, 437 insertions(+), 1 deletion(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d05ec6b2780144c5f1c5…
1
0
0
0
Alexandre Julliard : ntdll/tests: Add thread context test for ARM platforms.
by Alexandre Julliard
28 Jul '20
28 Jul '20
Module: wine Branch: master Commit: eee92591bcf4eb7e1f0d91e24c47b5021a9c81fe URL:
https://source.winehq.org/git/wine.git/?a=commit;h=eee92591bcf4eb7e1f0d91e2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 28 14:16:53 2020 +0200 ntdll/tests: Add thread context test for ARM platforms. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_arm.c | 3 +- dlls/ntdll/signal_arm64.c | 1 + dlls/ntdll/tests/exception.c | 262 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 261 insertions(+), 5 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=eee92591bcf4eb7e1f0d…
1
0
0
0
Alexandre Julliard : ntdll/tests: Add tests for RtlCaptureContext() and NtGetContextThread() on x86_64.
by Alexandre Julliard
28 Jul '20
28 Jul '20
Module: wine Branch: master Commit: 06c09fca3127fce9d3a3d1b4714173404ee58629 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=06c09fca3127fce9d3a3d1b4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 28 13:41:11 2020 +0200 ntdll/tests: Add tests for RtlCaptureContext() and NtGetContextThread() on x86_64. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_x86_64.c | 2 +- dlls/ntdll/tests/exception.c | 202 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 196 insertions(+), 8 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=06c09fca3127fce9d3a3…
1
0
0
0
Alexandre Julliard : ntdll/tests: Enable more exception tests on ARM platforms.
by Alexandre Julliard
28 Jul '20
28 Jul '20
Module: wine Branch: master Commit: 8e5c11b964e844696c7f5882d3b8dd7ff70a7869 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8e5c11b964e844696c7f5882…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 28 13:40:06 2020 +0200 ntdll/tests: Enable more exception tests on ARM platforms. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/exception.c | 239 +++++++++++++++++++++-------------------- dlls/ntdll/unix/signal_arm.c | 1 + dlls/ntdll/unix/signal_arm64.c | 1 + 3 files changed, 124 insertions(+), 117 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=8e5c11b964e844696c7f…
1
0
0
0
Alexandre Julliard : ntdll/tests: Fix vectored exception handler usage.
by Alexandre Julliard
28 Jul '20
28 Jul '20
Module: wine Branch: master Commit: 94ca95a6d444e8cd1592bd41f09cba2e1ae49902 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=94ca95a6d444e8cd1592bd41…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 28 14:12:36 2020 +0200 ntdll/tests: Fix vectored exception handler usage. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/exception.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index fce1de385e..c498d628ff 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -1747,6 +1747,7 @@ void CDECL hook_KiUserExceptionDispatcher(EXCEPTION_RECORD *rec, CONTEXT *contex static void test_kiuserexceptiondispatcher(void) { + PVOID vectored_handler; HMODULE hntdll = GetModuleHandleA("ntdll.dll"); static BYTE except_code[] = { @@ -1874,7 +1875,7 @@ static void test_kiuserexceptiondispatcher(void) record.ExceptionAddress = NULL; /* does not matter, copied return address */ record.NumberParameters = 0; - AddVectoredExceptionHandler(TRUE, dbg_except_continue_vectored_handler); + vectored_handler = AddVectoredExceptionHandler(TRUE, dbg_except_continue_vectored_handler); memcpy(pKiUserExceptionDispatcher, patched_KiUserExceptionDispatcher_bytes, sizeof(patched_KiUserExceptionDispatcher_bytes)); @@ -1886,7 +1887,7 @@ static void test_kiuserexceptiondispatcher(void) ok(got_exception, "Handler was not called.\n"); ok(hook_called || broken(!hook_called) /* 2003 */, "Hook was not called.\n"); - RemoveVectoredExceptionHandler(dbg_except_continue_vectored_handler); + RemoveVectoredExceptionHandler(vectored_handler); ret = VirtualProtect(pKiUserExceptionDispatcher, sizeof(saved_KiUserExceptionDispatcher_bytes), old_protect2, &old_protect2); ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); @@ -2971,6 +2972,7 @@ void WINAPI hook_KiUserExceptionDispatcher(EXCEPTION_RECORD *rec, CONTEXT *conte static void test_kiuserexceptiondispatcher(void) { + LPVOID vectored_handler; HMODULE hntdll = GetModuleHandleA("ntdll.dll"); static BYTE except_code[] = { @@ -3099,7 +3101,7 @@ static void test_kiuserexceptiondispatcher(void) record.ExceptionAddress = NULL; record.NumberParameters = 0; - AddVectoredExceptionHandler(TRUE, dbg_except_continue_vectored_handler); + vectored_handler = AddVectoredExceptionHandler(TRUE, dbg_except_continue_vectored_handler); memcpy(pKiUserExceptionDispatcher, patched_KiUserExceptionDispatcher_bytes, sizeof(patched_KiUserExceptionDispatcher_bytes)); @@ -3126,7 +3128,7 @@ static void test_kiuserexceptiondispatcher(void) || broken(!hook_exception_address) /* 2008 */, "Got unexpected addresses %p, %p.\n", hook_KiUserExceptionDispatcher_rip, hook_exception_address); - RemoveVectoredExceptionHandler(dbg_except_continue_vectored_handler); + RemoveVectoredExceptionHandler(vectored_handler); memcpy(pKiUserExceptionDispatcher, patched_KiUserExceptionDispatcher_bytes, sizeof(patched_KiUserExceptionDispatcher_bytes));
1
0
0
0
Alexandre Julliard : ntdll: Reimplement RtlRaiseException() to build a correct context on ARM.
by Alexandre Julliard
28 Jul '20
28 Jul '20
Module: wine Branch: master Commit: d775b9fd93ecfbbd12945f1e167e4bb381612c69 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d775b9fd93ecfbbd12945f1e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 28 13:40:13 2020 +0200 ntdll: Reimplement RtlRaiseException() to build a correct context on ARM. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_arm.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 8e1df477ff..e9f6cc6212 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -239,14 +239,21 @@ void WINAPI RtlUnwind( void *endframe, void *target_ip, EXCEPTION_RECORD *rec, v /*********************************************************************** * RtlRaiseException (NTDLL.@) */ -void WINAPI RtlRaiseException( EXCEPTION_RECORD *rec ) -{ - CONTEXT context; - - RtlCaptureContext( &context ); - rec->ExceptionAddress = (LPVOID)context.Pc; - RtlRaiseStatus( NtRaiseException( rec, &context, TRUE )); -} +__ASM_STDCALL_FUNC( RtlRaiseException, 4, + "push {r0, lr}\n\t" + "sub sp, sp, #0x1a0\n\t" /* sizeof(CONTEXT) */ + "mov r0, sp\n\t" /* context */ + "bl " __ASM_NAME("RtlCaptureContext") "\n\t" + "ldr r0, [sp, #0x1a0]\n\t" /* rec */ + "ldr r1, [sp, #0x1a4]\n\t" + "str r1, [sp, #0x40]\n\t" /* context->Pc */ + "str r1, [r0, #12]\n\t" /* rec->ExceptionAddress */ + "add r1, sp, #0x1a8\n\t" + "str r1, [sp, #0x38]\n\t" /* context->Sp */ + "mov r1, sp\n\t" + "mov r2, #1\n\t" + "bl " __ASM_NAME("NtRaiseException") "\n\t" + "bl " __ASM_NAME("RtlRaiseStatus") ) /************************************************************************* * RtlCaptureStackBackTrace (NTDLL.@)
1
0
0
0
Alexandre Julliard : ntdll: Use a syscall thunk for NtGetContextThread().
by Alexandre Julliard
28 Jul '20
28 Jul '20
Module: wine Branch: master Commit: 57f419993eb8088ef210e8a56b07acf63509b159 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=57f419993eb8088ef210e8a5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 28 13:26:48 2020 +0200 ntdll: Use a syscall thunk for NtGetContextThread(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 4 +- dlls/ntdll/signal_i386.c | 49 ------------------ dlls/ntdll/thread.c | 12 ----- dlls/ntdll/unix/loader.c | 1 - dlls/ntdll/unix/signal_arm.c | 74 +++++++++++---------------- dlls/ntdll/unix/signal_arm64.c | 65 ++++++++---------------- dlls/ntdll/unix/signal_i386.c | 10 +++- dlls/ntdll/unix/signal_x86_64.c | 108 ++++++++++++++++------------------------ dlls/ntdll/unixlib.h | 1 - 9 files changed, 104 insertions(+), 220 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=57f419993eb8088ef210…
1
0
0
0
Alexandre Julliard : winebuild: Store the syscall frame in the thread data on ARM64.
by Alexandre Julliard
28 Jul '20
28 Jul '20
Module: wine Branch: master Commit: 15b3584603205b93e6e6a0bace6159438ce22ffb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=15b3584603205b93e6e6a0ba…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 28 13:03:00 2020 +0200 winebuild: Store the syscall frame in the thread data on ARM64. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_arm64.c | 19 +++++++++++--- tools/winebuild/import.c | 59 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 69 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index 2930833908..b8f1176871 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -116,18 +116,31 @@ static DWORD64 get_fault_esr( ucontext_t *sigcontext ) static pthread_key_t teb_key; +struct syscall_frame +{ + ULONG64 x29; + ULONG64 thunk_addr; + ULONG64 x0, x1, x2, x3, x4, x5, x6, x7, x8; + struct syscall_frame *prev_frame; + ULONG64 x19, x20, x21, x22, x23, x24, x25, x26, x27, x28; + ULONG64 thunk_x29; + ULONG64 ret_addr; +}; + struct arm64_thread_data { - void *exit_frame; /* 02f0 exit frame pointer */ - CONTEXT *context; /* 02f8 context to set with SIGUSR2 */ + void *exit_frame; /* 02f0 exit frame pointer */ + struct syscall_frame *syscall_frame; /* 02f8 frame pointer on syscall entry */ + CONTEXT *context; /* 0300 context to set with SIGUSR2 */ }; C_ASSERT( sizeof(struct arm64_thread_data) <= sizeof(((struct ntdll_thread_data *)0)->cpu_data) ); C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct arm64_thread_data, exit_frame ) == 0x2f0 ); +C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct arm64_thread_data, syscall_frame ) == 0x2f8 ); static inline struct arm64_thread_data *arm64_thread_data(void) { - return (struct x86_thread_data *)ntdll_get_thread_data()->cpu_data; + return (struct arm64_thread_data *)ntdll_get_thread_data()->cpu_data; } diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 3819225c7c..34761ea4c5 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1594,7 +1594,7 @@ void output_syscalls( DLLSPEC *spec ) output( "\tstr r8, [r7]\n" ); /* prev frame */ output( "\tsub sp, r6, #40\n" ); output( "\tpop {r5-r11,pc}\n" ); - output( "5:\tldr r0,9f\n" ); + output( "5:\tldr r0, 9f\n" ); output( "\tpop {r5-r11,pc}\n" ); output( "6:\t.long .Lsyscall_table-4b\n" ); output( "7:\t.long .Lsyscall_args-1b\n" ); @@ -1603,12 +1603,56 @@ void output_syscalls( DLLSPEC *spec ) break; case CPU_ARM64: output( "\tcmp x8, %u\n", count ); - output( "\tbcs 1f\n" ); - output( "\tadrp x16, .Lsyscall_table\n" ); + output( "\tbcs 3f\n" ); + output( "\tstp x29, x30, [sp,#-176]!\n" ); + output( "\tmov x29, sp\n" ); + output( "\tstp x27, x28, [sp, #160]\n" ); + output( "\tstp x25, x26, [sp, #144]\n" ); + output( "\tstp x23, x24, [sp, #128]\n" ); + output( "\tstp x21, x22, [sp, #112]\n" ); + output( "\tstp x19, x20, [sp, #96]\n" ); + output( "\tstr x8, [sp, #80]\n" ); + output( "\tstp x6, x7, [sp, #64]\n" ); + output( "\tstp x4, x5, [sp, #48]\n" ); + output( "\tstp x2, x3, [sp, #32]\n" ); + output( "\tstp x0, x1, [sp, #16]\n" ); + output( "\tbl %s\n", asm_name("NtCurrentTeb") ); + output( "\tadd x19, x0, #0x2f8\n" ); /* arm64_thread_data()->syscall_frame */ + output( "\tldp x0, x1, [sp, #16]\n" ); + output( "\tldp x2, x3, [sp, #32]\n" ); + output( "\tldp x4, x5, [sp, #48]\n" ); + output( "\tldp x6, x7, [sp, #64]\n" ); + output( "\tldr x8, [sp, #80]\n" ); + output( "\tldr x20, [x19]\n" ); /* prev frame */ + output( "\tstr x20, [sp, #88]\n" ); + output( "\tstr x29, [x19]\n" ); /* syscall frame */ + output( "\tadrp x16, .Lsyscall_args\n" ); + output( "\tadd x16, x16, #:lo12:.Lsyscall_args\n" ); + output( "\tldrb w9, [x16, x8]\n" ); + output( "\tsubs x9, x9, #64\n" ); + output( "\tbls 2f\n" ); + output( "\tadd x11, x29, #192\n" ); + output( "\tsub sp, sp, x9\n" ); + output( "\ttbz x9, #3, 1f\n" ); + output( "\tsub SP, SP, #8\n" ); + output( "1:\tsub x9, x9, #8\n" ); + output( "\tldr x10, [x11, x9]\n" ); + output( "\tstr x10, [sp, x9]\n" ); + output( "\tcbnz x9, 1b\n" ); + output( "2:\tadrp x16, .Lsyscall_table\n" ); output( "\tadd x16, x16, #:lo12:.Lsyscall_table\n" ); output( "\tldr x16, [x16, x8, lsl 3]\n" ); - output( "\tbr x16\n" ); - output( "1:\tmov x0, #0x%x\n", invalid_param & 0xffff0000 ); + output( "\tblr x16\n" ); + output( "\tmov sp, x29\n" ); + output( "\tstr x20, [x19]\n" ); /* prev frame */ + output( "\tldp x19, x20, [sp, #96]\n" ); + output( "\tldp x21, x22, [sp, #112]\n" ); + output( "\tldp x23, x24, [sp, #128]\n" ); + output( "\tldp x25, x26, [sp, #144]\n" ); + output( "\tldp x27, x28, [sp, #160]\n" ); + output( "\tldp x29, x30, [sp], #176\n" ); + output( "\tret\n" ); + output( "3:\tmov x0, #0x%x\n", invalid_param & 0xffff0000 ); output( "\tmovk x0, #0x%x\n", invalid_param & 0x0000ffff ); output( "\tret\n" ); break; @@ -1694,10 +1738,13 @@ void output_syscalls( DLLSPEC *spec ) output( "3:\t.long %u\n", i ); break; case CPU_ARM64: + output( "\tstp x29, x30, [sp,#-16]!\n" ); output( "\tmov x8, #%u\n", i ); output( "\tadrp x16, %s\n", asm_name("__wine_syscall_dispatcher") ); output( "\tldr x16, [x16, #:lo12:%s]\n", asm_name("__wine_syscall_dispatcher") ); - output( "\tbr x16\n"); + output( "\tblr x16\n"); + output( "\tldp x29, x30, [sp], #16\n" ); + output( "\tret\n" ); break; default: assert(0);
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
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