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
Brendan Shanks : user32: Implement GetDisplayConfigBufferSizes().
by Alexandre Julliard
01 Jul '20
01 Jul '20
Module: wine Branch: master Commit: a94101672e1f98a364e0605bf8299474cf950821 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a94101672e1f98a364e0605b…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Mon Jun 29 21:55:21 2020 -0700 user32: Implement GetDisplayConfigBufferSizes(). Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/sysparams.c | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 768aeb5d4f..402a8309eb 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -4504,14 +4504,56 @@ BOOL WINAPI PhysicalToLogicalPoint( HWND hwnd, POINT *point ) */ LONG WINAPI GetDisplayConfigBufferSizes(UINT32 flags, UINT32 *num_path_info, UINT32 *num_mode_info) { - FIXME("(0x%x %p %p): stub\n", flags, num_path_info, num_mode_info); + LONG ret = ERROR_GEN_FAILURE; + HANDLE mutex; + HDEVINFO devinfo; + SP_DEVINFO_DATA device_data = {sizeof(device_data)}; + DWORD monitor_index = 0, state_flags, type; + + FIXME("(0x%x %p %p): semi-stub\n", flags, num_path_info, num_mode_info); if (!num_path_info || !num_mode_info) return ERROR_INVALID_PARAMETER; *num_path_info = 0; - *num_mode_info = 0; - return ERROR_NOT_SUPPORTED; + + if (flags != QDC_ALL_PATHS && + flags != QDC_ONLY_ACTIVE_PATHS && + flags != QDC_DATABASE_CURRENT) + return ERROR_INVALID_PARAMETER; + + if (flags != QDC_ONLY_ACTIVE_PATHS) + FIXME("only returning active paths\n"); + + wait_graphics_driver_ready(); + mutex = get_display_device_init_mutex(); + + /* Iterate through "targets"/monitors. + * Each target corresponds to a path, and each path references a source and a target mode. + */ + devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_MONITOR, DISPLAY, NULL, DIGCF_PRESENT); + if (devinfo == INVALID_HANDLE_VALUE) + goto done; + + while (SetupDiEnumDeviceInfo(devinfo, monitor_index++, &device_data)) + { + /* Only count active monitors */ + if (!SetupDiGetDevicePropertyW(devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_STATEFLAGS, + &type, (BYTE *)&state_flags, sizeof(state_flags), NULL, 0)) + goto done; + + if (state_flags & DISPLAY_DEVICE_ACTIVE) + (*num_path_info)++; + } + + *num_mode_info = *num_path_info * 2; + ret = ERROR_SUCCESS; + TRACE("returning %u path(s) %u mode(s)\n", *num_path_info, *num_mode_info); + +done: + SetupDiDestroyDeviceInfoList(devinfo); + release_display_device_init_mutex(mutex); + return ret; } /***********************************************************************
1
0
0
0
Brendan Shanks : include: Add d3dkmdt.h.
by Alexandre Julliard
01 Jul '20
01 Jul '20
Module: wine Branch: master Commit: 1899830b02218b89bb1669c265bd04d6750347fb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1899830b02218b89bb1669c2…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Mon Jun 29 21:55:19 2020 -0700 include: Add d3dkmdt.h. Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/Makefile.in | 1 + include/d3dkmdt.h | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/include/Makefile.in b/include/Makefile.in index 90fb873f20..56c5220daf 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -119,6 +119,7 @@ SOURCES = \ d3dcommon.idl \ d3dcompiler.h \ d3dhal.h \ + d3dkmdt.h \ d3drm.h \ d3drmdef.h \ d3drmobj.h \ diff --git a/include/d3dkmdt.h b/include/d3dkmdt.h new file mode 100644 index 0000000000..f47688cf40 --- /dev/null +++ b/include/d3dkmdt.h @@ -0,0 +1,59 @@ +/* + * Copyright 2020 Brendan Shanks 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 + */ + +#ifndef __WINE_D3DKMDT_H +#define __WINE_D3DKMDT_H + +typedef enum _D3DKMDT_VIDEO_SIGNAL_STANDARD +{ + D3DKMDT_VSS_UNINITIALIZED = 0, + D3DKMDT_VSS_VESA_DMT = 1, + D3DKMDT_VSS_VESA_GTF = 2, + D3DKMDT_VSS_VESA_CVT = 3, + D3DKMDT_VSS_IBM = 4, + D3DKMDT_VSS_APPLE = 5, + D3DKMDT_VSS_NTSC_M = 6, + D3DKMDT_VSS_NTSC_J = 7, + D3DKMDT_VSS_NTSC_443 = 8, + D3DKMDT_VSS_PAL_B = 9, + D3DKMDT_VSS_PAL_B1 = 10, + D3DKMDT_VSS_PAL_G = 11, + D3DKMDT_VSS_PAL_H = 12, + D3DKMDT_VSS_PAL_I = 13, + D3DKMDT_VSS_PAL_D = 14, + D3DKMDT_VSS_PAL_N = 15, + D3DKMDT_VSS_PAL_NC = 16, + D3DKMDT_VSS_SECAM_B = 17, + D3DKMDT_VSS_SECAM_D = 18, + D3DKMDT_VSS_SECAM_G = 19, + D3DKMDT_VSS_SECAM_H = 20, + D3DKMDT_VSS_SECAM_K = 21, + D3DKMDT_VSS_SECAM_K1 = 22, + D3DKMDT_VSS_SECAM_L = 23, + D3DKMDT_VSS_SECAM_L1 = 24, + D3DKMDT_VSS_EIA_861 = 25, + D3DKMDT_VSS_EIA_861A = 26, + D3DKMDT_VSS_EIA_861B = 27, + D3DKMDT_VSS_PAL_K = 28, + D3DKMDT_VSS_PAL_K1 = 29, + D3DKMDT_VSS_PAL_L = 30, + D3DKMDT_VSS_PAL_M = 31, + D3DKMDT_VSS_OTHER = 255 +} D3DKMDT_VIDEO_SIGNAL_STANDARD; + +#endif /* __WINE_D3DKMDT_H */
1
0
0
0
Paul Gofman : ntdll/tests: Add test for x86_64 KiUserExceptionDispatcher().
by Alexandre Julliard
01 Jul '20
01 Jul '20
Module: wine Branch: master Commit: 824f40596cfa68b41156e579a8003bd282abd114 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=824f40596cfa68b41156e579…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jun 30 23:34:35 2020 +0300 ntdll/tests: Add test for x86_64 KiUserExceptionDispatcher(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/exception.c | 114 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 411439f180..95d25375f7 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -2659,6 +2659,119 @@ static void test_wow64_context(void) pNtTerminateProcess(pi.hProcess, 0); } +static BYTE saved_KiUserExceptionDispatcher_bytes[12]; +static void *pKiUserExceptionDispatcher; +static BOOL hook_called; +static void *hook_KiUserExceptionDispatcher_rip; +static void *dbg_except_continue_handler_rip; +static void *hook_exception_address; + +static DWORD dbg_except_continue_handler(EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame, + CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher) +{ + ok(hook_called, "Hook was not called.\n"); + got_exception = 1; + dbg_except_continue_handler_rip = (void *)context->Rip; + ++context->Rip; + return ExceptionContinueExecution; +} + +void WINAPI hook_KiUserExceptionDispatcher(EXCEPTION_RECORD *rec, CONTEXT *context) +{ + trace("rec %p, context %p.\n", rec, context); + trace("context->Rip %#lx, context->Rsp %#lx, ContextFlags %#lx.\n", sizeof(*context), + context->Rip, context->Rsp, context->ContextFlags); + + hook_called = TRUE; + /* Broken on Win2008, probably rec offset in stack is different. */ + ok(rec->ExceptionCode == 0x80000003 || broken(!rec->ExceptionCode), + "Got unexpected ExceptionCode %#x.\n", rec->ExceptionCode); + + hook_KiUserExceptionDispatcher_rip = (void *)context->Rip; + hook_exception_address = rec->ExceptionAddress; + memcpy(pKiUserExceptionDispatcher, saved_KiUserExceptionDispatcher_bytes, sizeof(saved_KiUserExceptionDispatcher_bytes)); +} + +static void test_kiuserexceptiondispatcher(void) +{ + HMODULE hntdll = GetModuleHandleA("ntdll.dll"); + static const BYTE except_code[] = + { + 0xcc, /* int3 */ + 0xc3, /* ret */ + }; + static BYTE hook_trampoline[] = + { + 0x48, 0x89, 0xe2, /* mov %rsp,%rdx */ + 0x48, 0x8d, 0x8c, 0x24, 0xf0, 0x04, 0x00, 0x00, + /* lea 0x4f0(%rsp),%rcx */ + + 0xff, 0x14, 0x25, + /* offset: 14 bytes */ + 0x00, 0x00, 0x00, 0x00, /* callq *addr */ /* call hook implementation. */ + 0x48, 0x31, 0xc9, /* xor %rcx, %rcx */ + 0x48, 0x31, 0xd2, /* xor %rdx, %rdx */ + + 0xff, 0x24, 0x25, + /* offset: 27 bytes */ + 0x00, 0x00, 0x00, 0x00, /* jmpq *addr */ /* jump to original function. */ + }; + void *phook_KiUserExceptionDispatcher = hook_KiUserExceptionDispatcher; + DWORD old_protect1, old_protect2; + BYTE *ptr; + BOOL ret; + + pKiUserExceptionDispatcher = (void *)GetProcAddress(hntdll, "KiUserExceptionDispatcher"); + if (!pKiUserExceptionDispatcher) + { + win_skip("KiUserExceptionDispatcher is not available.\n"); + return; + } + + ok(((ULONG64)&phook_KiUserExceptionDispatcher & 0xffffffff) == ((ULONG64)&phook_KiUserExceptionDispatcher), + "Address is too long.\n"); + ok(((ULONG64)&pKiUserExceptionDispatcher & 0xffffffff) == ((ULONG64)&pKiUserExceptionDispatcher), + "Address is too long.\n"); + + *(unsigned int *)(hook_trampoline + 14) = (unsigned int)(ULONG_PTR)&phook_KiUserExceptionDispatcher; + *(unsigned int *)(hook_trampoline + 27) = (unsigned int)(ULONG_PTR)&pKiUserExceptionDispatcher; + + ret = VirtualProtect(hook_trampoline, ARRAY_SIZE(hook_trampoline), PAGE_EXECUTE_READWRITE, &old_protect1); + ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + + ret = VirtualProtect(pKiUserExceptionDispatcher, 5, PAGE_EXECUTE_READWRITE, &old_protect2); + ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + + memcpy(saved_KiUserExceptionDispatcher_bytes, pKiUserExceptionDispatcher, sizeof(saved_KiUserExceptionDispatcher_bytes)); + ptr = (BYTE *)pKiUserExceptionDispatcher; + /* mov hook_trampoline, %rax */ + *ptr++ = 0x48; + *ptr++ = 0xb8; + *(void **)ptr = hook_trampoline; + ptr += sizeof(ULONG64); + /* jmp *rax */ + *ptr++ = 0xff; + *ptr++ = 0xe0; + + got_exception = 0; + run_exception_test(dbg_except_continue_handler, NULL, except_code, ARRAY_SIZE(except_code), PAGE_EXECUTE_READ); + ok(got_exception, "Handler was not called.\n"); + ok(hook_called, "Hook was not called.\n"); + + ok(hook_exception_address == code_mem || broken(!hook_exception_address) /* Win2008 */, + "Got unexpected exception address %p, expected %p.\n", + hook_exception_address, code_mem); + todo_wine ok(hook_KiUserExceptionDispatcher_rip == code_mem, "Got unexpected exception address %p, expected %p.\n", + hook_KiUserExceptionDispatcher_rip, code_mem); + ok(dbg_except_continue_handler_rip == code_mem, "Got unexpected exception address %p, expected %p.\n", + dbg_except_continue_handler_rip, code_mem); + + ret = VirtualProtect(pKiUserExceptionDispatcher, 5, old_protect2, &old_protect2); + ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ret = VirtualProtect(hook_trampoline, ARRAY_SIZE(hook_trampoline), old_protect1, &old_protect1); + ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); +} + #endif /* __x86_64__ */ #if defined(__i386__) || defined(__x86_64__) @@ -3638,6 +3751,7 @@ START_TEST(exception) test_suspend_thread(); test_suspend_process(); test_unload_trace(); + test_kiuserexceptiondispatcher(); if (pRtlAddFunctionTable && pRtlDeleteFunctionTable && pRtlInstallFunctionTableCallback && pRtlLookupFunctionEntry) test_dynamic_unwind();
1
0
0
0
Paul Gofman : ntdll: Fix KiUserExceptionDispatcher ABI on x86_64.
by Alexandre Julliard
01 Jul '20
01 Jul '20
Module: wine Branch: master Commit: 887332f9c7bf0d75f53f88a9739b77b12463d636 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=887332f9c7bf0d75f53f88a9…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jun 30 23:34:34 2020 +0300 ntdll: Fix KiUserExceptionDispatcher ABI on x86_64. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49436
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_x86_64.c | 27 ++++++++++++++++++---- dlls/ntdll/unix/signal_arm.c | 4 ++++ dlls/ntdll/unix/signal_arm64.c | 5 ++++ dlls/ntdll/unix/signal_i386.c | 4 ++++ dlls/ntdll/unix/signal_x86_64.c | 51 +++++++++++++++++++++++++---------------- dlls/ntdll/unix/thread.c | 2 +- dlls/ntdll/unix/unix_private.h | 2 ++ 7 files changed, 70 insertions(+), 25 deletions(-) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 3f3c449d52..b575d63857 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -530,10 +530,7 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_contex } -/******************************************************************* - * KiUserExceptionDispatcher (NTDLL.@) - */ -NTSTATUS WINAPI KiUserExceptionDispatcher( EXCEPTION_RECORD *rec, CONTEXT *context ) +NTSTATUS WINAPI dispatch_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) { NTSTATUS status; DWORD c; @@ -581,6 +578,28 @@ NTSTATUS WINAPI KiUserExceptionDispatcher( EXCEPTION_RECORD *rec, CONTEXT *conte } +/******************************************************************* + * KiUserExceptionDispatcher (NTDLL.@) + */ +__ASM_GLOBAL_FUNC( KiUserExceptionDispatcher, + "mov 0x98(%rsp),%rcx\n\t" /* context->Rsp */ + "mov 0xf8(%rsp),%rdx\n\t" /* context->Rip */ + "mov %rdx,-0x8(%rcx)\n\t" + "mov %rbp,-0x10(%rcx)\n\t" + "mov %rdi,-0x18(%rcx)\n\t" + "mov %rsi,-0x20(%rcx)\n\t" + "mov %rcx,%rbp\n\t" + "mov %rsp,%rdx\n\t" /* context */ + "lea 0x4f0(%rsp),%rcx\n\t" /* rec */ + __ASM_CFI(".cfi_signal_frame\n\t") + __ASM_CFI(".cfi_def_cfa %rbp,0\n\t") + __ASM_CFI(".cfi_rel_offset %rip,-0x8\n\t") + __ASM_CFI(".cfi_rel_offset %rbp,-0x10\n\t") + __ASM_CFI(".cfi_rel_offset %rdi,-0x18\n\t") + __ASM_CFI(".cfi_rel_offset %rsi,-0x20\n\t") + "call " __ASM_NAME("dispatch_exception") "\n\t" + "int3") + static ULONG64 get_int_reg( CONTEXT *context, int reg ) { return *(&context->Rax + reg); diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index 265836499d..611d1ab819 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -531,6 +531,10 @@ static EXCEPTION_RECORD *setup_exception( ucontext_t *sigcontext, raise_func fun return &stack->rec; } +void WINAPI call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context ) +{ + pKiUserExceptionDispatcher( rec, context ); +} /********************************************************************** * raise_segv_exception diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index b15f64110d..47b52f0131 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -602,6 +602,11 @@ static void setup_raise_exception( ucontext_t *sigcontext, struct stack_layout * REGn_sig(18, sigcontext) = (ULONG_PTR)NtCurrentTeb(); } +void WINAPI call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context ) +{ + pKiUserExceptionDispatcher( rec, context ); +} + /********************************************************************** * segv_handler * diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index ea9bfbeb3b..730d0b1cb3 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1588,6 +1588,10 @@ static void setup_raise_exception( ucontext_t *sigcontext, struct stack_layout * stack->context_ptr = &stack->context; } +void WINAPI call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context ) +{ + pKiUserExceptionDispatcher( rec, context ); +} /********************************************************************** * get_fpu_code diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 47f3650b42..5334a4d7cc 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -233,6 +233,7 @@ typedef void (*raise_func)( EXCEPTION_RECORD *rec, CONTEXT *context ); struct stack_layout { CONTEXT context; + ULONG64 unknown[4]; EXCEPTION_RECORD rec; ULONG64 rsi; ULONG64 rdi; @@ -241,6 +242,8 @@ struct stack_layout ULONG64 red_zone[16]; }; +C_ASSERT( sizeof(struct stack_layout) == 0x630 ); /* Should match the size in call_user_exception_dispatcher(). */ + struct amd64_thread_data { DWORD_PTR dr0; /* debug registers */ @@ -1843,16 +1846,10 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) } -extern void CDECL raise_func_trampoline( EXCEPTION_RECORD *rec, CONTEXT *context, raise_func func ); +extern void CDECL raise_func_trampoline( raise_func func ); + __ASM_GLOBAL_FUNC( raise_func_trampoline, - __ASM_CFI(".cfi_signal_frame\n\t") - __ASM_CFI(".cfi_def_cfa %rbp,160\n\t") /* red zone + rip + rbp + rdi + rsi */ - __ASM_CFI(".cfi_rel_offset %rip,24\n\t") - __ASM_CFI(".cfi_rel_offset %rbp,16\n\t") - __ASM_CFI(".cfi_rel_offset %rdi,8\n\t") - __ASM_CFI(".cfi_rel_offset %rsi,0\n\t") - "call *%r8\n\t" - "int $3") + "jmpq *%r8\n\t") /*********************************************************************** * setup_exception @@ -1934,7 +1931,6 @@ static struct stack_layout *setup_exception( ucontext_t *sigcontext ) static void setup_raise_exception( ucontext_t *sigcontext, struct stack_layout *stack ) { - ULONG64 *rsp_ptr; NTSTATUS status; if (stack->rec.ExceptionCode == EXCEPTION_SINGLE_STEP) @@ -1962,24 +1958,39 @@ static void setup_raise_exception( ucontext_t *sigcontext, struct stack_layout * return; } - /* store return address and %rbp without aligning, so that the offset is fixed */ - rsp_ptr = (ULONG64 *)RSP_sig(sigcontext) - 16; - *(--rsp_ptr) = stack->context.Rip; - *(--rsp_ptr) = stack->context.Rbp; - *(--rsp_ptr) = stack->context.Rdi; - *(--rsp_ptr) = stack->context.Rsi; - /* now modify the sigcontext to return to the raise function */ RIP_sig(sigcontext) = (ULONG_PTR)raise_func_trampoline; - RCX_sig(sigcontext) = (ULONG_PTR)&stack->rec; - RDX_sig(sigcontext) = (ULONG_PTR)&stack->context; R8_sig(sigcontext) = (ULONG_PTR)pKiUserExceptionDispatcher; - RBP_sig(sigcontext) = (ULONG_PTR)rsp_ptr; RSP_sig(sigcontext) = (ULONG_PTR)stack; /* clear single-step, direction, and align check flag */ EFL_sig(sigcontext) &= ~(0x100|0x400|0x40000); } +extern void WINAPI user_exception_dispatcher_trampoline( struct stack_layout *stack, + void *pKiUserExceptionDispatcher ); + +__ASM_GLOBAL_FUNC( user_exception_dispatcher_trampoline, + "movq %rcx,%rsp\n\t" + "movq 0x98(%rsp),%rcx\n\t" /* context->Rsp */ + "movq 0xa0(%rsp),%rbp\n\t" + "movq 0xa8(%rsp),%rsi\n\t" + "movq 0xb0(%rsp),%rdi\n\t" + "jmpq *%rdx") + +void WINAPI do_call_user_exception_dispatcher(EXCEPTION_RECORD *rec, CONTEXT *context, struct stack_layout *stack) +{ + memcpy(&stack->context, context, sizeof(*context)); + memcpy(&stack->rec, rec, sizeof(*rec)); + + user_exception_dispatcher_trampoline( stack, pKiUserExceptionDispatcher ); +} + +__ASM_GLOBAL_FUNC( call_user_exception_dispatcher, + "movq 0x98(%rdx),%rsp\n\t" /* context->Rsp */ + "and $~0xf,%rsp\n\t" + "sub $0x630,%rsp\n\t" /* sizeof(struct stack_layout) */ + "movq %rsp,%r8\n\t" + "jmp " __ASM_NAME("do_call_user_exception_dispatcher") "\n\t") /*********************************************************************** * is_privileged_instr diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 5f6841b0e8..686d3991b7 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -415,7 +415,7 @@ NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED) NtSetContextThread( GetCurrentThread(), context ); - if (first_chance) pKiUserExceptionDispatcher( rec, context ); + if (first_chance) call_user_exception_dispatcher( rec, context ); if (rec->ExceptionFlags & EH_STACK_INVALID) ERR("Exception frame is not in stack limits => unable to dispatch exception.\n"); diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 4f93aa2c54..e6c8d5764e 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -241,6 +241,8 @@ extern void init_cpu_info(void) DECLSPEC_HIDDEN; extern void dbg_init(void) DECLSPEC_HIDDEN; +extern void WINAPI call_user_exception_dispatcher(EXCEPTION_RECORD *rec, CONTEXT *context) DECLSPEC_HIDDEN; + #define TICKSPERSEC 10000000 #define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)86400) #define TICKS_1601_TO_1970 (SECS_1601_TO_1970 * TICKSPERSEC)
1
0
0
0
Alexandre Julliard : ntdll: Fix uninitialized buffer in locale initialization.
by Alexandre Julliard
01 Jul '20
01 Jul '20
Module: wine Branch: master Commit: 21f1fa82a8c7bd1b077f0289141972ed619c5a5f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=21f1fa82a8c7bd1b077f0289…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 1 13:32:09 2020 +0200 ntdll: Fix uninitialized buffer in locale initialization. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49494
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/env.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index e285bbbef0..789a398405 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -836,6 +836,8 @@ static BOOL unix_to_win_locale( const char *unix_name, char *win_name ) if (!unix_name || !unix_name[0]) return FALSE; } + if (strlen( unix_name ) >= LOCALE_NAME_MAX_LENGTH) return FALSE; + strcpy( buffer, unix_name ); if (!(p = strpbrk( buffer, sep ))) { if (!strcmp( buffer, "POSIX" ) || !strcmp( buffer, "C" )) @@ -1247,6 +1249,6 @@ USHORT * CDECL get_unix_codepage_data(void) */ void CDECL get_locales( WCHAR *sys, WCHAR *user ) { - ntdll_umbstowcs( system_locale, ARRAY_SIZE(system_locale), sys, LOCALE_NAME_MAX_LENGTH * sizeof(WCHAR) ); - ntdll_umbstowcs( user_locale, ARRAY_SIZE(user_locale), user, LOCALE_NAME_MAX_LENGTH * sizeof(WCHAR) ); + ntdll_umbstowcs( system_locale, strlen(system_locale) + 1, sys, LOCALE_NAME_MAX_LENGTH ); + ntdll_umbstowcs( user_locale, strlen(user_locale) + 1, user, LOCALE_NAME_MAX_LENGTH ); }
1
0
0
0
Alexandre Julliard : ntdll: Avoid importing the codepage functions from the Unix library.
by Alexandre Julliard
01 Jul '20
01 Jul '20
Module: wine Branch: master Commit: 520040dc4a287fd62d7d5161c083cee990c3d6e6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=520040dc4a287fd62d7d5161…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 1 10:37:16 2020 +0200 ntdll: Avoid importing the codepage functions from the Unix library. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/locale.c | 3 +- dlls/ntdll/unix/env.c | 243 +++++++++++++++++++++++++++++++++++------ dlls/ntdll/unix/loader.c | 2 +- dlls/ntdll/unix/unix_private.h | 2 +- dlls/ntdll/unixlib.h | 4 +- 5 files changed, 215 insertions(+), 39 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=520040dc4a287fd62d7d…
1
0
0
0
Alexandre Julliard : ntdll: Get rid of DllMain in the Unix library.
by Alexandre Julliard
01 Jul '20
01 Jul '20
Module: wine Branch: master Commit: 8885a51347a768d8a9125d573963d12ac67d4715 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8885a51347a768d8a9125d57…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 1 10:36:59 2020 +0200 ntdll: Get rid of DllMain in the Unix library. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/loader.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 590d1b544a..3ea7adf9f0 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1830,10 +1830,3 @@ void __wine_main( int argc, char *argv[], char *envp[] ) #endif start_main_thread(); } - - -BOOL WINAPI DECLSPEC_HIDDEN DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) -{ - if (reason == DLL_PROCESS_ATTACH) LdrDisableThreadCalloutsForDll( inst ); - return TRUE; -}
1
0
0
0
Alexandre Julliard : winebuild: Don't use a dll entry point for Unix libraries.
by Alexandre Julliard
01 Jul '20
01 Jul '20
Module: wine Branch: master Commit: e6632e0412663da0d1c1a4a453462d745160ba4e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e6632e0412663da0d1c1a4a4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 1 10:36:55 2020 +0200 winebuild: Don't use a dll entry point for Unix libraries. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index c1858a4b4d..0e5e1627dd 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -680,7 +680,7 @@ int main(int argc, char **argv) case MODE_EXE: load_resources( argv, spec ); if (spec_file_name && !parse_input_file( spec )) break; - if (!spec->init_func) spec->init_func = xstrdup( get_default_entry_point( spec )); + if (!spec->init_func && !unix_lib) spec->init_func = xstrdup( get_default_entry_point( spec )); if (fake_module) {
1
0
0
0
Alexandre Julliard : makefiles: Use -munix when building a Unix library.
by Alexandre Julliard
01 Jul '20
01 Jul '20
Module: wine Branch: master Commit: 2cf256686e5f5c314bbdda16e91327a636cad4b8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2cf256686e5f5c314bbdda16…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 1 10:36:51 2020 +0200 makefiles: Use -munix when building a Unix library. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/makedep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/makedep.c b/tools/makedep.c index 743eaf6e35..bdeae8f65a 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -3355,6 +3355,7 @@ static void output_module( struct makefile *make ) output_filename( tools_path( make, "winegcc" )); output( "\n" ); output_winegcc_command( make, 0 ); + output_filename( "-munix" ); output_filename( "-shared" ); if (strarray_exists( &make->extradllflags, "-nodefaultlibs" )) output_filename( "-nodefaultlibs" ); output_filenames_obj_dir( make, make->unixobj_files );
1
0
0
0
Alexandre Julliard : winegcc: Pass -mno-cygwin and -munix flags directly to winebuild.
by Alexandre Julliard
01 Jul '20
01 Jul '20
Module: wine Branch: master Commit: cbc35152c4c4b053d6ff48601c3eead71f083b21 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cbc35152c4c4b053d6ff4860…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 1 10:36:42 2020 +0200 winegcc: Pass -mno-cygwin and -munix flags directly to winebuild. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winegcc/winegcc.c | 10 +++++++++- tools/winegcc/winegcc.man.in | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 776d2b6473..29c1b0549d 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -207,6 +207,7 @@ struct options int nostartfiles; int nodefaultlibs; int noshortwchar; + int unix_lib; int gui_app; int unicode_app; int win16_app; @@ -964,7 +965,8 @@ static strarray *get_winebuild_args(struct options *opts) for (i = 0; i < opts->prefix->size; i++) strarray_add( spec_args, strmake( "-B%s", opts->prefix->base[i] )); } - if (!opts->use_msvcrt) strarray_add( spec_args, "-munix" ); + if (opts->use_msvcrt) strarray_add( spec_args, "-mno-cygwin" ); + if (opts->unix_lib) strarray_add( spec_args, "-munix" ); if (opts->unwind_tables) strarray_add( spec_args, "-fasynchronous-unwind-tables" ); else strarray_add( spec_args, "-fno-asynchronous-unwind-tables" ); return spec_args; @@ -1790,6 +1792,7 @@ int main(int argc, char **argv) { opts.use_msvcrt = 1; raw_compiler_arg = 0; + strarray_add( opts.winebuild_args, opts.args->base[i] ); } else if (strcmp("-mwindows", opts.args->base[i]) == 0) { @@ -1810,6 +1813,11 @@ int main(int argc, char **argv) { raw_compiler_arg = 0; } + else if (strcmp("-munix", opts.args->base[i]) == 0) + { + opts.unix_lib = 1; + raw_compiler_arg = 0; + } else if (strcmp("-m16", opts.args->base[i]) == 0) { opts.win16_app = 1; diff --git a/tools/winegcc/winegcc.man.in b/tools/winegcc/winegcc.man.in index 5550767299..8a14dd59fd 100644 --- a/tools/winegcc/winegcc.man.in +++ b/tools/winegcc/winegcc.man.in @@ -59,6 +59,9 @@ Set the default entry point of the application to be the Unicode This option adds -lgdi32, -lcomdlg32, and -lshell32 to the list of default libraries, and passes '--subsystem windows' to winebuild to build graphical applications. +.B \-munix +Set when building the Unix counterpart of a builtin module. +.TP .IP \fB-nodefaultlibs\fR Do not use the standard system libraries when linking. These include at a minimum -lkernel32, -luser32, -ladvapi32, and
1
0
0
0
← Newer
1
...
78
79
80
81
82
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