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
September 2019
----- 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
2 participants
629 discussions
Start a n
N
ew thread
Rémi Bernon : user32/tests: Add RegisterRawInputDevices parameter validation tests.
by Alexandre Julliard
12 Sep '19
12 Sep '19
Module: wine Branch: master Commit: d8b222548d6f6b626a644a585787bdef18467200 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d8b222548d6f6b626a644a58…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 10 19:02:30 2019 +0200 user32/tests: Add RegisterRawInputDevices parameter validation tests. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/Makefile.in | 1 + dlls/user32/tests/rawinput.c | 104 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in index 7149dc824e..26bc3b2bc6 100644 --- a/dlls/user32/tests/Makefile.in +++ b/dlls/user32/tests/Makefile.in @@ -17,6 +17,7 @@ C_SRCS = \ menu.c \ monitor.c \ msg.c \ + rawinput.c \ resource.c \ scroll.c \ static.c \ diff --git a/dlls/user32/tests/rawinput.c b/dlls/user32/tests/rawinput.c new file mode 100644 index 0000000000..4aa2a162f4 --- /dev/null +++ b/dlls/user32/tests/rawinput.c @@ -0,0 +1,104 @@ +/* Unit test suite for rawinput. + * + * Copyright 2019 Remi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include <stdio.h> + +#define STRICT +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +#include "wine/test.h" + +static void test_RegisterRawInputDevices(void) +{ + HWND hwnd; + RAWINPUTDEVICE raw_devices[1]; + BOOL res; + + raw_devices[0].usUsagePage = 0x01; + raw_devices[0].usUsage = 0x05; + + hwnd = CreateWindowExA(WS_EX_TOPMOST, "static", "dinput", WS_POPUP | WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindowExA failed\n"); + + + res = RegisterRawInputDevices(NULL, 0, 0); + ok(res == FALSE, "RegisterRawInputDevices succeeded\n"); + + + raw_devices[0].dwFlags = 0; + raw_devices[0].hwndTarget = 0; + + SetLastError(0xdeadbeef); + res = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), 0); + ok(res == FALSE, "RegisterRawInputDevices succeeded\n"); + todo_wine + ok(GetLastError() == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned %08x\n", GetLastError()); + + SetLastError(0xdeadbeef); + res = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); + ok(res == TRUE, "RegisterRawInputDevices failed\n"); + ok(GetLastError() == 0xdeadbeef, "RegisterRawInputDevices returned %08x\n", GetLastError()); + + + /* RIDEV_REMOVE requires hwndTarget == NULL */ + raw_devices[0].dwFlags = RIDEV_REMOVE; + raw_devices[0].hwndTarget = hwnd; + + SetLastError(0xdeadbeef); + res = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); + todo_wine + ok(res == FALSE, "RegisterRawInputDevices succeeded\n"); + todo_wine + ok(GetLastError() == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned %08x\n", GetLastError()); + + raw_devices[0].hwndTarget = 0; + + SetLastError(0xdeadbeef); + res = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); + ok(res == TRUE, "RegisterRawInputDevices failed\n"); + ok(GetLastError() == 0xdeadbeef, "RegisterRawInputDevices returned %08x\n", GetLastError()); + + + /* RIDEV_INPUTSINK requires hwndTarget != NULL */ + raw_devices[0].dwFlags = RIDEV_INPUTSINK; + raw_devices[0].hwndTarget = 0; + + 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; + + SetLastError(0xdeadbeef); + res = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); + ok(res == TRUE, "RegisterRawInputDevices succeeded\n"); + ok(GetLastError() == 0xdeadbeef, "RegisterRawInputDevices returned %08x\n", GetLastError()); + + DestroyWindow(hwnd); +} + +START_TEST(rawinput) +{ + test_RegisterRawInputDevices(); +}
1
0
0
0
Alistair Leslie-Hughes : wininet/tests: InternetQueryOption should return a valid value for username/password when using cached credentials.
by Alexandre Julliard
12 Sep '19
12 Sep '19
Module: wine Branch: master Commit: be2c77e6364324326a9bb583bb9dc9c2d66c64e8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=be2c77e6364324326a9bb583…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Thu Sep 12 03:29:54 2019 +0000 wininet/tests: InternetQueryOption should return a valid value for username/password when using cached credentials. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wininet/tests/http.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index a4521a94a4..80d2aad9f4 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -4425,6 +4425,7 @@ static void test_basic_auth_credentials_reuse(int port) HINTERNET ses, con, req; DWORD status, size; BOOL ret; + char buffer[0x40]; ses = InternetOpenA( "winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0 ); ok( ses != NULL, "InternetOpenA failed\n" ); @@ -4439,6 +4440,20 @@ static void test_basic_auth_credentials_reuse(int port) ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); + size = sizeof(buffer); + SetLastError(0xdeadbeef); + ret = InternetQueryOptionA(req, INTERNET_OPTION_USERNAME, buffer, &size); + ok(ret, "unexpected failure %u\n", GetLastError()); + ok(!strcmp(buffer, "user"), "got %s\n", buffer); + ok(size == 4, "got %u\n", size); + + size = sizeof(buffer); + SetLastError(0xdeadbeef); + ret = InternetQueryOptionA(req, INTERNET_OPTION_PASSWORD, buffer, &size); + ok(ret, "unexpected failure %u\n", GetLastError()); + ok(!strcmp(buffer, "pwd"), "got %s\n", buffer); + ok(size == 3, "got %u\n", size); + status = 0xdeadbeef; size = sizeof(status); ret = HttpQueryInfoA( req, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL ); @@ -4462,6 +4477,20 @@ static void test_basic_auth_credentials_reuse(int port) ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); + size = sizeof(buffer); + SetLastError(0xdeadbeef); + ret = InternetQueryOptionA(req, INTERNET_OPTION_USERNAME, buffer, &size); + ok(ret, "unexpected failure %u\n", GetLastError()); + todo_wine ok(!strcmp(buffer, "user"), "got %s\n", buffer); + todo_wine ok(size == 4, "got %u\n", size); + + size = sizeof(buffer); + SetLastError(0xdeadbeef); + ret = InternetQueryOptionA(req, INTERNET_OPTION_PASSWORD, buffer, &size); + ok(ret, "unexpected failure %u\n", GetLastError()); + todo_wine ok(!strcmp(buffer, "pwd"), "got %s\n", buffer); + todo_wine ok(size == 3, "got %u\n", size); + status = 0xdeadbeef; size = sizeof(status); ret = HttpQueryInfoA( req, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL );
1
0
0
0
Alex Henrie : winex11: Factor out array access in ConvertAttribWGLtoGLX (scan-build).
by Alexandre Julliard
12 Sep '19
12 Sep '19
Module: wine Branch: master Commit: a28980da5a83fe15be48bd4eb1bda98eb3520eaf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a28980da5a83fe15be48bd4e…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Wed Sep 11 21:06:10 2019 -0600 winex11: Factor out array access in ConvertAttribWGLtoGLX (scan-build). Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/opengl.c | 41 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index ee28a1d790..7fb97f5f44 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -751,7 +751,7 @@ static const char *debugstr_fbconfig( GLXFBConfig fbconfig ) static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_pbuffer* pbuf) { int nAttribs = 0; unsigned cur = 0; - int pop; + int attr, pop; int drawattrib = 0; int nvfloatattrib = GLX_DONT_CARE; int pixelattrib = GLX_DONT_CARE; @@ -759,62 +759,53 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_ /* The list of WGL attributes is allowed to be NULL. We don't return here for NULL * because we need to do fixups for GLX_DRAWABLE_TYPE/GLX_RENDER_TYPE/GLX_FLOAT_COMPONENTS_NV. */ while (iWGLAttr && 0 != iWGLAttr[cur]) { - TRACE("pAttr[%d] = %x\n", cur, iWGLAttr[cur]); + attr = iWGLAttr[cur]; + TRACE("pAttr[%d] = %x\n", cur, attr); + pop = iWGLAttr[++cur]; - switch (iWGLAttr[cur]) { + switch (attr) { case WGL_AUX_BUFFERS_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_AUX_BUFFERS, pop); TRACE("pAttr[%d] = GLX_AUX_BUFFERS: %d\n", cur, pop); break; case WGL_COLOR_BITS_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_BUFFER_SIZE, pop); TRACE("pAttr[%d] = GLX_BUFFER_SIZE: %d\n", cur, pop); break; case WGL_BLUE_BITS_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_BLUE_SIZE, pop); TRACE("pAttr[%d] = GLX_BLUE_SIZE: %d\n", cur, pop); break; case WGL_RED_BITS_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_RED_SIZE, pop); TRACE("pAttr[%d] = GLX_RED_SIZE: %d\n", cur, pop); break; case WGL_GREEN_BITS_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_GREEN_SIZE, pop); TRACE("pAttr[%d] = GLX_GREEN_SIZE: %d\n", cur, pop); break; case WGL_ALPHA_BITS_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_ALPHA_SIZE, pop); TRACE("pAttr[%d] = GLX_ALPHA_SIZE: %d\n", cur, pop); break; case WGL_DEPTH_BITS_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_DEPTH_SIZE, pop); TRACE("pAttr[%d] = GLX_DEPTH_SIZE: %d\n", cur, pop); break; case WGL_STENCIL_BITS_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_STENCIL_SIZE, pop); TRACE("pAttr[%d] = GLX_STENCIL_SIZE: %d\n", cur, pop); break; case WGL_DOUBLE_BUFFER_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_DOUBLEBUFFER, pop); TRACE("pAttr[%d] = GLX_DOUBLEBUFFER: %d\n", cur, pop); break; case WGL_STEREO_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_STEREO, pop); TRACE("pAttr[%d] = GLX_STEREO: %d\n", cur, pop); break; case WGL_PIXEL_TYPE_ARB: - pop = iWGLAttr[++cur]; TRACE("pAttr[%d] = WGL_PIXEL_TYPE_ARB: %d\n", cur, pop); switch (pop) { case WGL_TYPE_COLORINDEX_ARB: pixelattrib = GLX_COLOR_INDEX_BIT; break ; @@ -824,24 +815,20 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_ case WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT: pixelattrib = GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT; break ; default: ERR("unexpected PixelType(%x)\n", pop); - pop = 0; } break; case WGL_SUPPORT_GDI_ARB: /* This flag is set in a pixel format */ - pop = iWGLAttr[++cur]; TRACE("pAttr[%d] = WGL_SUPPORT_GDI_ARB: %d\n", cur, pop); break; case WGL_DRAW_TO_BITMAP_ARB: /* This flag is set in a pixel format */ - pop = iWGLAttr[++cur]; TRACE("pAttr[%d] = WGL_DRAW_TO_BITMAP_ARB: %d\n", cur, pop); break; case WGL_DRAW_TO_WINDOW_ARB: - pop = iWGLAttr[++cur]; TRACE("pAttr[%d] = WGL_DRAW_TO_WINDOW_ARB: %d\n", cur, pop); /* GLX_DRAWABLE_TYPE flags need to be OR'd together. See below. */ if (pop) { @@ -850,7 +837,6 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_ break; case WGL_DRAW_TO_PBUFFER_ARB: - pop = iWGLAttr[++cur]; TRACE("pAttr[%d] = WGL_DRAW_TO_PBUFFER_ARB: %d\n", cur, pop); /* GLX_DRAWABLE_TYPE flags need to be OR'd together. See below. */ if (pop) { @@ -860,18 +846,15 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_ case WGL_ACCELERATION_ARB: /* This flag is set in a pixel format */ - pop = iWGLAttr[++cur]; TRACE("pAttr[%d] = WGL_ACCELERATION_ARB: %d\n", cur, pop); break; case WGL_SUPPORT_OPENGL_ARB: - pop = iWGLAttr[++cur]; /** nothing to do, if we are here, supposing support Accelerated OpenGL */ TRACE("pAttr[%d] = WGL_SUPPORT_OPENGL_ARB: %d\n", cur, pop); break; case WGL_SWAP_METHOD_ARB: - pop = iWGLAttr[++cur]; TRACE("pAttr[%d] = WGL_SWAP_METHOD_ARB: %#x\n", cur, pop); if (has_swap_method) { @@ -899,19 +882,16 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_ break; case WGL_PBUFFER_LARGEST_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_LARGEST_PBUFFER, pop); TRACE("pAttr[%d] = GLX_LARGEST_PBUFFER: %x\n", cur, pop); break; case WGL_SAMPLE_BUFFERS_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_SAMPLE_BUFFERS_ARB, pop); TRACE("pAttr[%d] = GLX_SAMPLE_BUFFERS_ARB: %x\n", cur, pop); break; case WGL_SAMPLES_ARB: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_SAMPLES_ARB, pop); TRACE("pAttr[%d] = GLX_SAMPLES_ARB: %x\n", cur, pop); break; @@ -919,8 +899,7 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_ case WGL_TEXTURE_FORMAT_ARB: case WGL_TEXTURE_TARGET_ARB: case WGL_MIPMAP_TEXTURE_ARB: - TRACE("WGL_render_texture Attributes: %x as %x\n", iWGLAttr[cur], iWGLAttr[cur + 1]); - pop = iWGLAttr[++cur]; + TRACE("WGL_render_texture Attributes: %x as %x\n", iWGLAttr[cur - 1], iWGLAttr[cur]); if (NULL == pbuf) { ERR("trying to use GLX_Pbuffer Attributes without Pbuffer (was %x)\n", iWGLAttr[cur]); } @@ -934,7 +913,7 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_ } break ; case WGL_FLOAT_COMPONENTS_NV: - nvfloatattrib = iWGLAttr[++cur]; + nvfloatattrib = pop; TRACE("pAttr[%d] = WGL_FLOAT_COMPONENTS_NV: %x\n", cur, nvfloatattrib); break ; case WGL_BIND_TO_TEXTURE_DEPTH_NV: @@ -944,26 +923,22 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_ case WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV: case WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV: case WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV: - pop = iWGLAttr[++cur]; /** cannot be converted, see direct handling on * - wglGetPixelFormatAttribivARB * TODO: wglChoosePixelFormat */ break ; case WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, pop); TRACE("pAttr[%d] = GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT: %x\n", cur, pop); break ; case WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT: - pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT, pop); TRACE("pAttr[%d] = GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT: %x\n", cur, pop); break ; default: - FIXME("unsupported %x WGL Attribute\n", iWGLAttr[cur]); - cur++; + FIXME("unsupported %x WGL Attribute\n", attr); break; } ++cur;
1
0
0
0
Alex Henrie : gdi32: Handle HeapAlloc failure in SetEnhMetaFileBits (scan-build).
by Alexandre Julliard
12 Sep '19
12 Sep '19
Module: wine Branch: master Commit: 1fcae3c260a9a8809c733aa9c6b2b4c1c336f20c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1fcae3c260a9a8809c733aa9…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Wed Sep 11 21:05:49 2019 -0600 gdi32: Handle HeapAlloc failure in SetEnhMetaFileBits (scan-build). Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/enhmetafile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c index a3360c269a..fc3389ff23 100644 --- a/dlls/gdi32/enhmetafile.c +++ b/dlls/gdi32/enhmetafile.c @@ -480,7 +480,9 @@ HENHMETAFILE WINAPI SetEnhMetaFileBits(UINT bufsize, const BYTE *buf) { ENHMETAHEADER *emh = HeapAlloc( GetProcessHeap(), 0, bufsize ); HENHMETAFILE hmf; - memmove(emh, buf, bufsize); + + if (!emh) return 0; + memcpy(emh, buf, bufsize); hmf = EMF_Create_HENHMETAFILE( emh, bufsize, FALSE ); if (!hmf) HeapFree( GetProcessHeap(), 0, emh );
1
0
0
0
Alex Henrie : winedbg: Fix dependence on undefined left-shift behavior (scan-build).
by Alexandre Julliard
12 Sep '19
12 Sep '19
Module: wine Branch: master Commit: 0566ba9a5881dc4f29e7b87bf5b5cd74fa304526 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0566ba9a5881dc4f29e7b87b…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Wed Sep 11 21:05:15 2019 -0600 winedbg: Fix dependence on undefined left-shift behavior (scan-build). Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/winedbg/be_x86_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/winedbg/be_x86_64.c b/programs/winedbg/be_x86_64.c index 136229fbd6..2346bc4d1f 100644 --- a/programs/winedbg/be_x86_64.c +++ b/programs/winedbg/be_x86_64.c @@ -640,7 +640,7 @@ static BOOL be_x86_64_fetch_integer(const struct dbg_lvalue* lvalue, unsigned si if (!memory_read_value(lvalue, size, ret)) return FALSE; /* propagate sign information */ - if (is_signed && size < 16 && (*ret >> (size * 8 - 1)) != 0) + if (is_signed && size < sizeof(*ret) && (*ret >> (size * 8 - 1)) != 0) { ULONGLONG neg = -1; *ret |= neg << (size * 8);
1
0
0
0
Alex Henrie : server: Fix use after free in add_committed_range (scan-build).
by Alexandre Julliard
12 Sep '19
12 Sep '19
Module: wine Branch: master Commit: f3c9fdf8522040861a7a9bf96ba385fc166965fc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f3c9fdf8522040861a7a9bf9…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Wed Sep 11 21:05:06 2019 -0600 server: Fix use after free in add_committed_range (scan-build). Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/mapping.c b/server/mapping.c index 0728fdc14f..6990a1913d 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -404,7 +404,7 @@ static void add_committed_range( struct memory_view *view, file_pos_t start, fil struct range *new_ptr = realloc( committed->ranges, new_size * sizeof(*new_ptr) ); if (!new_ptr) return; committed->max = new_size; - committed->ranges = new_ptr; + ranges = committed->ranges = new_ptr; } memmove( &ranges[i + 1], &ranges[i], (committed->count - i) * sizeof(*ranges) ); ranges[i].start = start;
1
0
0
0
Dmitry Timoshkov : ntdll: Implement RtlUnicodeToUTF8N.
by Alexandre Julliard
12 Sep '19
12 Sep '19
Module: wine Branch: master Commit: 3b2937f7c7fb1d4081363ebfa213c0a8eefa81db URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3b2937f7c7fb1d4081363ebf…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Sep 12 18:09:59 2019 +0800 ntdll: Implement RtlUnicodeToUTF8N. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/rtlstr.c | 33 ++++++++++++++++++++++++++++++++ dlls/ntdll/tests/rtlstr.c | 48 +++++++++++++++++++++++++++++++---------------- include/winternl.h | 1 + 4 files changed, 67 insertions(+), 16 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 98a423adfb..5a6f4e4ed4 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -980,6 +980,7 @@ @ stdcall RtlUnicodeToMultiByteN(ptr long ptr ptr long) @ stdcall RtlUnicodeToMultiByteSize(ptr ptr long) @ stdcall RtlUnicodeToOemN(ptr long ptr ptr long) +@ stdcall RtlUnicodeToUTF8N(ptr long ptr ptr long) @ stdcall RtlUniform(ptr) # @ stub RtlUnlockBootStatusData @ stdcall RtlUnlockHeap(long) diff --git a/dlls/ntdll/rtlstr.c b/dlls/ntdll/rtlstr.c index 6b60d36a1c..977f57a907 100644 --- a/dlls/ntdll/rtlstr.c +++ b/dlls/ntdll/rtlstr.c @@ -908,6 +908,39 @@ NTSTATUS WINAPI RtlUnicodeToOemN( LPSTR dst, DWORD dstlen, LPDWORD reslen, } +/************************************************************************** + * RtlUnicodeToUTF8N (NTDLL.@) + * + * Converts a Unicode string to a UTF-8 string. + * + * RETURNS + * NTSTATUS code + */ +NTSTATUS WINAPI RtlUnicodeToUTF8N( LPSTR dst, DWORD dstlen, LPDWORD reslen, + LPCWSTR src, DWORD srclen) +{ + int ret; + + if (!src) return STATUS_INVALID_PARAMETER_4; + if (!reslen) return STATUS_INVALID_PARAMETER; + if (dst && (srclen & 1)) return STATUS_INVALID_PARAMETER_5; + + if (!dstlen && dst) + { + char c; + dst = &c; + ret = wine_utf8_wcstombs( 0, src, srclen / sizeof(WCHAR), dst, 1 ); + if (ret > 0) ret--; + } + else + ret = wine_utf8_wcstombs( 0, src, srclen / sizeof(WCHAR), dst, dstlen ); + if (reslen) + *reslen = (ret >= 0) ? ret : dstlen; /* overflow -> we filled up to dstlen */ + if (ret < 0) return STATUS_BUFFER_TOO_SMALL; + return STATUS_SUCCESS; +} + + /* CASE CONVERSIONS */ diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c index c2c82516cc..4583ddeb4b 100644 --- a/dlls/ntdll/tests/rtlstr.c +++ b/dlls/ntdll/tests/rtlstr.c @@ -2055,8 +2055,8 @@ static void utf8_expect_(const unsigned char *out_string, ULONG buflen, ULONG ou status = pRtlUnicodeToUTF8N( out_string ? buffer : NULL, buflen, &bytes_out, in_string, in_bytes); - ok_(__FILE__, line)(status == expect_status, "status = 0x%x\n", status); - ok_(__FILE__, line)(bytes_out == out_bytes, "bytes_out = %u\n", bytes_out); + ok_(__FILE__, line)(status == expect_status, "status 0x%x, expected 0x%x\n", status, expect_status); + ok_(__FILE__, line)(bytes_out == out_bytes, "bytes_out = %u, expected %u\n", bytes_out, out_bytes); if (out_string) { for (i = 0; i < bytes_out; i++) @@ -2082,6 +2082,7 @@ static void test_RtlUnicodeToUTF8N(void) const WCHAR empty_string[] = { 0 }; const WCHAR test_string[] = { 'A',0,'a','b','c','d','e','f','g',0 }; const WCHAR special_string[] = { 'X',0x80,0xd800,0 }; + const ULONG special_string_len[] = { 0, 1, 1, 3, 3, 3, 6, 7 }; const unsigned char special_expected[] = { 'X',0xc2,0x80,0xef,0xbf,0xbd,0 }; unsigned int input_len; const unsigned int test_count = ARRAY_SIZE(unicode_to_utf8); @@ -2151,25 +2152,33 @@ static void test_RtlUnicodeToUTF8N(void) length_expect(0, 0, STATUS_SUCCESS); length_expect(1, 1, STATUS_SUCCESS); length_expect(2, 3, STATUS_SUCCESS); +todo_wine +{ length_expect(3, 6, STATUS_SOME_NOT_MAPPED); length_expect(4, 7, STATUS_SOME_NOT_MAPPED); +} #undef length_expect - /* output truncation */ -#define truncate_expect(buflen, out_bytes, expect_status) \ - utf8_expect_(special_expected, buflen, out_bytes, \ - special_string, sizeof(special_string), \ - expect_status, __LINE__) + for (i = 0; i <= 6; i++) + { + memset(buffer, 0x55, sizeof(buffer)); + bytes_out = 0xdeadbeef; + status = pRtlUnicodeToUTF8N(buffer, i, &bytes_out, special_string, sizeof(special_string)); +todo_wine_if (i == 4 || i == 5 || i == 6) + ok(status == STATUS_BUFFER_TOO_SMALL, "%d: status = 0x%x\n", i, status); +todo_wine_if (bytes_out != special_string_len[i]) + ok(bytes_out == special_string_len[i], "%d: expected %u, got %u\n", i, special_string_len[i], bytes_out); +todo_wine_if (i == 6) + ok(memcmp(buffer, special_expected, special_string_len[i]) == 0, "%d: bad conversion\n", i); + } - truncate_expect(0, 0, STATUS_BUFFER_TOO_SMALL); - truncate_expect(1, 1, STATUS_BUFFER_TOO_SMALL); - truncate_expect(2, 1, STATUS_BUFFER_TOO_SMALL); - truncate_expect(3, 3, STATUS_BUFFER_TOO_SMALL); - truncate_expect(4, 3, STATUS_BUFFER_TOO_SMALL); - truncate_expect(5, 3, STATUS_BUFFER_TOO_SMALL); - truncate_expect(6, 6, STATUS_BUFFER_TOO_SMALL); - truncate_expect(7, 7, STATUS_SOME_NOT_MAPPED); -#undef truncate_expect + status = pRtlUnicodeToUTF8N(buffer, 7, &bytes_out, special_string, sizeof(special_string)); +todo_wine + ok(status == STATUS_SOME_NOT_MAPPED, "status = 0x%x\n", status); +todo_wine + ok(bytes_out == special_string_len[7], "expected %u, got %u\n", special_string_len[7], bytes_out); +todo_wine + ok(memcmp(buffer, special_expected, 7) == 0, "bad conversion\n"); /* conversion behavior with varying input length */ for (input_len = 0; input_len <= sizeof(test_string); input_len++) { @@ -2216,15 +2225,19 @@ static void test_RtlUnicodeToUTF8N(void) status = pRtlUnicodeToUTF8N( buffer, sizeof(buffer), &bytes_out, unicode_to_utf8[i].unicode, lstrlenW(unicode_to_utf8[i].unicode) * sizeof(WCHAR)); +todo_wine_if(unicode_to_utf8[i].status == STATUS_SOME_NOT_MAPPED) ok(status == unicode_to_utf8[i].status, "(test %d): status is 0x%x, expected 0x%x\n", i, status, unicode_to_utf8[i].status); +todo_wine_if(i == 9 || i == 10 || i == 11) +{ ok(bytes_out == strlen(unicode_to_utf8[i].expected), "(test %d): bytes_out is %u, expected %u\n", i, bytes_out, lstrlenA(unicode_to_utf8[i].expected)); ok(!memcmp(buffer, unicode_to_utf8[i].expected, bytes_out), "(test %d): got \"%.*s\", expected \"%s\"\n", i, bytes_out, buffer, unicode_to_utf8[i].expected); +} ok(buffer[bytes_out] == 0x55, "(test %d): behind string: 0x%x\n", i, buffer[bytes_out]); @@ -2234,6 +2247,8 @@ static void test_RtlUnicodeToUTF8N(void) status = pRtlUnicodeToUTF8N( buffer, sizeof(buffer), &bytes_out, unicode_to_utf8[i].unicode, (lstrlenW(unicode_to_utf8[i].unicode) + 1) * sizeof(WCHAR)); +todo_wine_if(i == 9 || i == 10 || i == 11) +{ ok(status == unicode_to_utf8[i].status, "(test %d): status is 0x%x, expected 0x%x\n", i, status, unicode_to_utf8[i].status); @@ -2243,6 +2258,7 @@ static void test_RtlUnicodeToUTF8N(void) ok(!memcmp(buffer, unicode_to_utf8[i].expected, bytes_out), "(test %d): got \"%.*s\", expected \"%s\"\n", i, bytes_out, buffer, unicode_to_utf8[i].expected); +} ok(buffer[bytes_out] == 0x55, "(test %d): behind string: 0x%x\n", i, buffer[bytes_out]); } diff --git a/include/winternl.h b/include/winternl.h index 3f2e07b7e2..4d58aebe21 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2863,6 +2863,7 @@ NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRI NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD); NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG); NTSYSAPI NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD); +NTSYSAPI NTSTATUS WINAPI RtlUnicodeToUTF8N(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD); NTSYSAPI ULONG WINAPI RtlUniform(PULONG); NTSYSAPI BOOLEAN WINAPI RtlUnlockHeap(HANDLE); NTSYSAPI void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
1
0
0
0
Dmitry Timoshkov : ntdll/tests: Fix compilation with PSDK compiler.
by Alexandre Julliard
12 Sep '19
12 Sep '19
Module: wine Branch: master Commit: 65e1ed3480929702f60ed8d1541e2cb0edc6d5eb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=65e1ed3480929702f60ed8d1…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Sep 12 18:09:55 2019 +0800 ntdll/tests: Fix compilation with PSDK compiler. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/rtlstr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c index 8b948fa82a..c2c82516cc 100644 --- a/dlls/ntdll/tests/rtlstr.c +++ b/dlls/ntdll/tests/rtlstr.c @@ -1970,7 +1970,7 @@ static void test_RtlHashUnicodeString(void) status = pRtlHashUnicodeString(NULL, FALSE, HASH_STRING_ALGORITHM_X65599, &hash); ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08x\n", status); - RtlInitUnicodeString(&str, strW); + pRtlInitUnicodeString(&str, strW); status = pRtlHashUnicodeString(&str, FALSE, HASH_STRING_ALGORITHM_X65599, NULL); ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08x\n", status); @@ -1988,7 +1988,7 @@ static void test_RtlHashUnicodeString(void) ptr = hash_test; while (*ptr->str) { - RtlInitUnicodeString(&str, ptr->str); + pRtlInitUnicodeString(&str, ptr->str); hash = 0; status = pRtlHashUnicodeString(&str, ptr->case_insensitive, HASH_STRING_ALGORITHM_X65599, &hash); ok(status == STATUS_SUCCESS, "got status 0x%08x for %s\n", status, wine_dbgstr_w(ptr->str));
1
0
0
0
Alexandre Julliard : ntdll: Remove no longer needed function argument from setup_raise_exception() on ARM64.
by Alexandre Julliard
12 Sep '19
12 Sep '19
Module: wine Branch: master Commit: 2201229086da312c8b21ab0ff9f757fc4940b96e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2201229086da312c8b21ab0f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 12 21:26:42 2019 +0200 ntdll: Remove no longer needed function argument from setup_raise_exception() on ARM64. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_arm64.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 4b47b2aa94..25ac7dac02 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -113,8 +113,6 @@ static DWORD64 get_fault_esr( ucontext_t *sigcontext ) static const size_t teb_size = 0x2000; /* we reserve two pages for the TEB */ static const size_t signal_stack_size = max( MINSIGSTKSZ, 8192 ); -typedef void (WINAPI *raise_func)( EXCEPTION_RECORD *rec, CONTEXT *context ); - /* stack layout when calling an exception raise function */ struct stack_layout { @@ -503,19 +501,6 @@ static struct stack_layout *setup_exception( ucontext_t *sigcontext ) return stack; } -/*********************************************************************** - * setup_raise_exception - * - * Modify the signal context to call the exception raise function. - */ -static void setup_raise_exception( ucontext_t *sigcontext, struct stack_layout *stack, raise_func func ) -{ - SP_sig(sigcontext) = (ULONG_PTR)stack; - PC_sig(sigcontext) = (ULONG_PTR)func; - REGn_sig(0, sigcontext) = (ULONG_PTR)&stack->rec; /* first arg for raise_func */ - REGn_sig(1, sigcontext) = (ULONG_PTR)&stack->context; /* second arg for raise_func */ -} - /********************************************************************** * raise_generic_exception */ @@ -525,6 +510,19 @@ static void WINAPI raise_generic_exception( EXCEPTION_RECORD *rec, CONTEXT *cont raise_status( status, rec ); } +/*********************************************************************** + * setup_raise_exception + * + * Modify the signal context to call the exception raise function. + */ +static void setup_raise_exception( ucontext_t *sigcontext, struct stack_layout *stack ) +{ + SP_sig(sigcontext) = (ULONG_PTR)stack; + PC_sig(sigcontext) = (ULONG_PTR)raise_generic_exception; + REGn_sig(0, sigcontext) = (ULONG_PTR)&stack->rec; /* first arg for raise_generic_exception */ + REGn_sig(1, sigcontext) = (ULONG_PTR)&stack->context; /* second arg for raise_generic_exception */ +} + /*********************************************************************** * libunwind_virtual_unwind * @@ -1056,7 +1054,7 @@ static void segv_handler( int signal, siginfo_t *info, void *ucontext ) break; } done: - setup_raise_exception( context, stack, raise_generic_exception ); + setup_raise_exception( context, stack ); } /********************************************************************** @@ -1080,7 +1078,7 @@ static void trap_handler( int signal, siginfo_t *info, void *ucontext ) stack->context.Pc += 4; break; } - setup_raise_exception( context, stack, raise_generic_exception ); + setup_raise_exception( context, stack ); } /********************************************************************** @@ -1136,7 +1134,7 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext ) stack->rec.ExceptionCode = EXCEPTION_FLT_INVALID_OPERATION; break; } - setup_raise_exception( sigcontext, stack, raise_generic_exception ); + setup_raise_exception( sigcontext, stack ); } /********************************************************************** @@ -1151,7 +1149,7 @@ static void int_handler( int signal, siginfo_t *siginfo, void *sigcontext ) struct stack_layout *stack = setup_exception( sigcontext ); stack->rec.ExceptionCode = CONTROL_C_EXIT; - setup_raise_exception( sigcontext, stack, raise_generic_exception ); + setup_raise_exception( sigcontext, stack ); } } @@ -1167,7 +1165,7 @@ static void abrt_handler( int signal, siginfo_t *siginfo, void *sigcontext ) stack->rec.ExceptionCode = EXCEPTION_WINE_ASSERTION; stack->rec.ExceptionFlags = EH_NONCONTINUABLE; - setup_raise_exception( sigcontext, stack, raise_generic_exception ); + setup_raise_exception( sigcontext, stack ); }
1
0
0
0
Alexandre Julliard : ntdll: Handle page fault in signal handler on ARM64.
by Alexandre Julliard
12 Sep '19
12 Sep '19
Module: wine Branch: master Commit: 60eb37c6bedaad6fe6ca028c217595dba98714e1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=60eb37c6bedaad6fe6ca028c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 12 21:25:42 2019 +0200 ntdll: Handle page fault in signal handler on ARM64. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_arm64.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 40ef517d22..4b47b2aa94 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -516,30 +516,6 @@ static void setup_raise_exception( ucontext_t *sigcontext, struct stack_layout * REGn_sig(1, sigcontext) = (ULONG_PTR)&stack->context; /* second arg for raise_func */ } -/********************************************************************** - * raise_segv_exception - */ -static void WINAPI raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) -{ - NTSTATUS status; - - switch(rec->ExceptionCode) - { - case EXCEPTION_ACCESS_VIOLATION: - if (rec->NumberParameters == 2) - { - if (!(rec->ExceptionCode = virtual_handle_fault( (void *)rec->ExceptionInformation[1], - rec->ExceptionInformation[0], FALSE ))) - goto done; - } - break; - } - status = NtRaiseException( rec, context, TRUE ); - raise_status( status, rec ); -done: - set_cpu_context( context ); -} - /********************************************************************** * raise_generic_exception */ @@ -1064,10 +1040,12 @@ static void segv_handler( int signal, siginfo_t *info, void *ucontext ) stack->rec.ExceptionCode = EXCEPTION_ILLEGAL_INSTRUCTION; break; case SIGSEGV: /* Segmentation fault */ - stack->rec.ExceptionCode = EXCEPTION_ACCESS_VIOLATION; stack->rec.NumberParameters = 2; stack->rec.ExceptionInformation[0] = (get_fault_esr( context ) & 0x40) != 0; stack->rec.ExceptionInformation[1] = (ULONG_PTR)info->si_addr; + if (!(stack->rec.ExceptionCode = virtual_handle_fault( (void *)stack->rec.ExceptionInformation[1], + stack->rec.ExceptionInformation[0], FALSE ))) + return; break; case SIGBUS: /* Alignment check exception */ stack->rec.ExceptionCode = EXCEPTION_DATATYPE_MISALIGNMENT; @@ -1078,7 +1056,7 @@ static void segv_handler( int signal, siginfo_t *info, void *ucontext ) break; } done: - setup_raise_exception( context, stack, raise_segv_exception ); + setup_raise_exception( context, stack, raise_generic_exception ); } /**********************************************************************
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
63
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
Results per page:
10
25
50
100
200