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
June
May
April
March
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
January 2024
----- 2025 -----
June 2025
May 2025
April 2025
March 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
711 discussions
Start a n
N
ew thread
Fabian Maurer : include: Add Windows.UI.ViewManagement.InputPane definitions.
by Alexandre Julliard
22 Jan '24
22 Jan '24
Module: wine Branch: master Commit: 5de5ae4eb112cceb3a5deeb563b686497dd19fe7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5de5ae4eb112cceb3a5deeb563b686…
Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Thu Nov 2 05:47:00 2023 +0100 include: Add Windows.UI.ViewManagement.InputPane definitions. --- include/Makefile.in | 1 + include/inputpaneinterop.idl | 27 +++++++++ include/windows.ui.viewmanagement.idl | 100 ++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) diff --git a/include/Makefile.in b/include/Makefile.in index bd72fe86975..f70aeb9414b 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -375,6 +375,7 @@ SOURCES = \ inaddr.h \ indexsrv.idl \ initguid.h \ + inputpaneinterop.idl \ inputscope.idl \ inseng.idl \ inspectable.idl \ diff --git a/include/inputpaneinterop.idl b/include/inputpaneinterop.idl new file mode 100644 index 00000000000..bd327c66cd4 --- /dev/null +++ b/include/inputpaneinterop.idl @@ -0,0 +1,27 @@ +/* + * Copyright 2023 Fabian Maurer + * + * 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 + */ + +import "inspectable.idl"; + +[ + uuid(75cf2c57-9195-4931-8332-f0b409e916af) +] +interface IInputPaneInterop : IInspectable +{ + HRESULT GetForWindow([in] HWND window, [in] REFIID riid, [out, retval, iid_is(riid)] void **inputpane); +} diff --git a/include/windows.ui.viewmanagement.idl b/include/windows.ui.viewmanagement.idl index b98d34ff685..1076d287183 100644 --- a/include/windows.ui.viewmanagement.idl +++ b/include/windows.ui.viewmanagement.idl @@ -45,10 +45,20 @@ namespace Windows.UI.ViewManagement interface IUISettings5; interface IUISettings6; + interface IInputPane; + interface IInputPane2; + interface IInputPaneControl; + interface IInputPaneVisibilityEventArgs; + interface IInputPaneStatics; + interface IInputPaneStatics2; + runtimeclass UISettings; + runtimeclass InputPane; + runtimeclass InputPaneVisibilityEventArgs; declare { interface Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.UISettings *, IInspectable *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.InputPane*, Windows.UI.ViewManagement.InputPaneVisibilityEventArgs*>; } [ @@ -171,6 +181,74 @@ namespace Windows.UI.ViewManagement [eventremove] HRESULT ColorValuesChanged([in] EventRegistrationToken cookie); } + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.InputPane), + uuid(640ada70-06f3-4c87-a678-9829c9127c28) + ] + interface IInputPane : IInspectable + { + [eventadd] HRESULT Showing([in] Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.InputPane*, Windows.UI.ViewManagement.InputPaneVisibilityEventArgs*> *handler, [out, retval] EventRegistrationToken *token); + [eventremove] HRESULT Showing([in] EventRegistrationToken token); + [eventadd] HRESULT Hiding([in] Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.InputPane*, Windows.UI.ViewManagement.InputPaneVisibilityEventArgs*> *handler, [out, retval] EventRegistrationToken *token); + [eventremove] HRESULT Hiding([in] EventRegistrationToken token); + [propget] HRESULT OccludedRect([out, retval] Windows.Foundation.Rect *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.InputPane), + uuid(8a6b3f26-7090-4793-944c-c3f2cde26276) + ] + interface IInputPane2 : IInspectable + { + HRESULT TryShow([out, retval] boolean *result); + HRESULT TryHide([out, retval] boolean *result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.InputPane), + uuid(088bb24f-962f-489d-aa6e-c6be1a0a6e52) + ] + interface IInputPaneControl : IInspectable + { + [propget] HRESULT Visible([out, retval] boolean *value); + [propput] HRESULT Visible([in] boolean value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.InputPaneVisibilityEventArgs), + uuid(d243e016-d907-4fcc-bb8d-f77baa5028f1) + ] + interface IInputPaneVisibilityEventArgs : IInspectable + { + [propget] HRESULT OccludedRect([out, retval] Windows.Foundation.Rect *value); + [propput] HRESULT EnsuredFocusedElementInView([in] boolean value); + [propget] HRESULT EnsuredFocusedElementInView([out, retval] boolean *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.InputPane), + uuid(95f4af3a-ef47-424a-9741-fd2815eba2bd) + ] + interface IInputPaneStatics : IInspectable + { + HRESULT GetForCurrentView([out, retval] Windows.UI.ViewManagement.InputPane **input_pane); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.ViewManagement.InputPane), + uuid(1b63529b-d9ec-4531-8445-71bab9fb828e) + ] + interface IInputPaneStatics2 : IInspectable + { + HRESULT GetForUIContext([in] Windows.UI.UIContext *context, [out, retval] Windows.UI.ViewManagement.InputPane **result); + } + [ activatable(Windows.Foundation.UniversalApiContract, 1.0), contract(Windows.Foundation.UniversalApiContract, 1.0), @@ -182,4 +260,26 @@ namespace Windows.UI.ViewManagement [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.UI.ViewManagement.IUISettings2; [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.UI.ViewManagement.IUISettings3; } + + [ + static(Windows.UI.ViewManagement.IInputPaneStatics, Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.UI.ViewManagement.IInputPaneStatics2, Windows.Foundation.UniversalApiContract, 8.0), + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(standard) + ] + runtimeclass InputPane + { + [default] interface Windows.UI.ViewManagement.IInputPane; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.UI.ViewManagement.IInputPane2; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.UI.ViewManagement.IInputPaneControl; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(standard) + ] + runtimeclass InputPaneVisibilityEventArgs + { + [default] interface Windows.UI.ViewManagement.IInputPaneVisibilityEventArgs; + } }
1
0
0
0
Alexandre Julliard : ntdll: Use a .seh handler for KiUserCallbackDispatcher exceptions.
by Alexandre Julliard
22 Jan '24
22 Jan '24
Module: wine Branch: master Commit: 78c2b7dfe2f2d5d76400564be547fd8287d62d67 URL:
https://gitlab.winehq.org/wine/wine/-/commit/78c2b7dfe2f2d5d76400564be547fd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 22 11:35:47 2024 +0100 ntdll: Use a .seh handler for KiUserCallbackDispatcher exceptions. --- dlls/ntdll/exception.c | 21 +++++++++++++++++++++ dlls/ntdll/ntdll_misc.h | 2 ++ dlls/ntdll/signal_arm.c | 15 ++++++++++++--- dlls/ntdll/signal_arm64.c | 14 +++++++++----- dlls/ntdll/signal_arm64ec.c | 14 +++++++++----- dlls/ntdll/signal_x86_64.c | 10 ++++++++++ 6 files changed, 63 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 98733045e17..69f061768bd 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -185,6 +185,26 @@ LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ) } +#if defined(__WINE_PE_BUILD) && !defined(__i386__) + +/******************************************************************* + * user_callback_handler + * + * Exception handler for KiUserCallbackDispatcher. + */ +EXCEPTION_DISPOSITION WINAPI user_callback_handler( EXCEPTION_RECORD *record, void *frame, + CONTEXT *context, void *dispatch ) +{ + if (!(record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND))) + { + ERR( "ignoring exception %lx\n", record->ExceptionCode ); + RtlUnwind( frame, KiUserCallbackDispatcherReturn, record, ULongToPtr(record->ExceptionCode) ); + } + return ExceptionContinueSearch; +} + +#else + /******************************************************************* * dispatch_user_callback * @@ -208,6 +228,7 @@ NTSTATUS WINAPI dispatch_user_callback( void *args, ULONG len, ULONG id ) return status; } +#endif /******************************************************************* * raise_status diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 1512bc17132..da49c14e682 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -50,6 +50,8 @@ extern UINT_PTR page_size; /* exceptions */ extern LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ); extern NTSTATUS WINAPI dispatch_user_callback( void *args, ULONG len, ULONG id ); +extern EXCEPTION_DISPOSITION WINAPI user_callback_handler( EXCEPTION_RECORD *record, void *frame, + CONTEXT *context, void *dispatch ); extern void DECLSPEC_NORETURN raise_status( NTSTATUS status, EXCEPTION_RECORD *rec ); extern LONG WINAPI call_unhandled_exception_filter( PEXCEPTION_POINTERS eptr ); diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index ccb3f10b9f5..78db61fc764 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -585,10 +585,19 @@ __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, __ASM_EHABI(".save {sp, pc}\n\t") __ASM_EHABI(".save {lr}\n\t") __ASM_EHABI(".pad #0x0c\n\t") - "ldr r0, [sp]\n\t" /* args */ - "ldr r1, [sp, #0x04]\n\t" /* len */ - "ldr r2, [sp, #0x08]\n\t" /* id */ + "ldr r0, [sp]\n\t" /* args */ + "ldr r1, [sp, #0x04]\n\t" /* len */ + "ldr r2, [sp, #0x08]\n\t" /* id */ +#ifdef __WINE_PE_BUILD + "mrc p15, 0, r3, c13, c0, 2\n\t" /* NtCurrentTeb() */ + "ldr r3, [r3, 0x30]\n\t" /* peb */ + "ldr r3, [r3, 0x2c]\n\t" /* peb->KernelCallbackTable */ + "ldr ip, [r3, r2, lsl #3]\n\t" + "blx ip\n\t" + ".seh_handler " __ASM_NAME("user_callback_handler") ", %except\n\t" +#else "bl " __ASM_NAME("dispatch_user_callback") "\n\t" +#endif ".globl " __ASM_NAME("KiUserCallbackDispatcherReturn") "\n" __ASM_NAME("KiUserCallbackDispatcherReturn") ":\n\t" "mov r2, r0\n\t" /* status */ diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 8a59f9050b1..2d150528610 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -606,15 +606,19 @@ __ASM_GLOBAL_FUNC( KiUserApcDispatcher, * KiUserCallbackDispatcher (NTDLL.@) */ __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, - __ASM_SEH(".seh_pushframe\n\t") + ".seh_pushframe\n\t" "nop\n\t" - __ASM_SEH(".seh_stackalloc 0x20\n\t") + ".seh_stackalloc 0x20\n\t" "nop\n\t" - __ASM_SEH(".seh_save_reg lr, 0x18\n\t") - __ASM_SEH(".seh_endprologue\n\t") + ".seh_save_reg lr, 0x18\n\t" + ".seh_endprologue\n\t" + ".seh_handler " __ASM_NAME("user_callback_handler") ", @except\n\t" "ldr x0, [sp]\n\t" /* args */ "ldp w1, w2, [sp, #0x08]\n\t" /* len, id */ - "bl " __ASM_NAME("dispatch_user_callback") "\n\t" + "ldr x3, [x18, 0x60]\n\t" /* peb */ + "ldr x3, [x3, 0x58]\n\t" /* peb->KernelCallbackTable */ + "ldr x15, [x3, x2, lsl #3]\n\t" + "blr x15\n\t" ".globl " __ASM_NAME("KiUserCallbackDispatcherReturn") "\n" __ASM_NAME("KiUserCallbackDispatcherReturn") ":\n\t" "mov x2, x0\n\t" /* status */ diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index fb6654f4340..a54a5eeaceb 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -1717,15 +1717,19 @@ __ASM_GLOBAL_FUNC( "#KiUserApcDispatcher", * KiUserCallbackDispatcher (NTDLL.@) */ __ASM_GLOBAL_FUNC( "#KiUserCallbackDispatcher", - __ASM_SEH(".seh_pushframe\n\t") + ".seh_pushframe\n\t" "nop\n\t" - __ASM_SEH(".seh_stackalloc 0x20\n\t") + ".seh_stackalloc 0x20\n\t" "nop\n\t" - __ASM_SEH(".seh_save_reg lr, 0x18\n\t") - __ASM_SEH(".seh_endprologue\n\t") + ".seh_save_reg lr, 0x18\n\t" + ".seh_endprologue\n\t" + ".seh_handler " __ASM_NAME("user_callback_handler") ", @except\n\t" "ldr x0, [sp]\n\t" /* args */ "ldp w1, w2, [sp, #0x08]\n\t" /* len, id */ - "bl " __ASM_NAME("dispatch_user_callback") "\n\t" + "ldr x3, [x18, 0x60]\n\t" /* peb */ + "ldr x3, [x3, 0x58]\n\t" /* peb->KernelCallbackTable */ + "ldr x15, [x3, x2, lsl #3]\n\t" + "blr x15\n\t" ".globl \"#KiUserCallbackDispatcherReturn\"\n" "\"#KiUserCallbackDispatcherReturn\":\n\t" "mov x2, x0\n\t" /* status */ diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index c56552a74a7..b253c0b4f17 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -702,7 +702,17 @@ __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, "movq 0x20(%rsp),%rcx\n\t" /* args */ "movl 0x28(%rsp),%edx\n\t" /* len */ "movl 0x2c(%rsp),%r8d\n\t" /* id */ +#ifdef __WINE_PE_BUILD + "movq %gs:0x30,%rax\n\t" /* NtCurrentTeb() */ + "movq 0x60(%rax),%rax\n\t" /* peb */ + "movq 0x58(%rax),%rax\n\t" /* peb->KernelCallbackTable */ + "call *(%rax,%r8,8)\n\t" /* KernelCallbackTable[id] */ + ".seh_handler " __ASM_NAME("user_callback_handler") ", @except\n\t" + ".globl " __ASM_NAME("KiUserCallbackDispatcherReturn") "\n" + __ASM_NAME("KiUserCallbackDispatcherReturn") ":\n\t" +#else "call " __ASM_NAME("dispatch_user_callback") "\n\t" +#endif "xorq %rcx,%rcx\n\t" /* ret_ptr */ "xorl %edx,%edx\n\t" /* ret_len */ "movl %eax,%r8d\n\t" /* status */
1
0
0
0
Alexandre Julliard : ntdll: Export KiUserCallbackDispatcherReturn.
by Alexandre Julliard
22 Jan '24
22 Jan '24
Module: wine Branch: master Commit: 47aebf67a5149ab9953944fa5e6729b9b71a5c31 URL:
https://gitlab.winehq.org/wine/wine/-/commit/47aebf67a5149ab9953944fa5e6729…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 22 11:28:41 2024 +0100 ntdll: Export KiUserCallbackDispatcherReturn. --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/ntdll_misc.h | 1 + dlls/ntdll/signal_arm.c | 2 ++ dlls/ntdll/signal_arm64.c | 2 ++ dlls/ntdll/signal_arm64ec.c | 2 ++ 5 files changed, 8 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 90b64627ce5..18dddf928cf 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -70,6 +70,7 @@ @ stdcall -norelay KiRaiseUserExceptionDispatcher() @ stdcall -norelay KiUserApcDispatcher(ptr long long long ptr) @ stdcall -norelay KiUserCallbackDispatcher(long ptr long) +@ stdcall -norelay -arch=arm,arm64,arm64ec KiUserCallbackDispatcherReturn() @ stdcall -norelay KiUserExceptionDispatcher(ptr ptr) # @ stub LdrAccessOutOfProcessResource @ stdcall LdrAccessResource(long ptr ptr ptr) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 11cf2b39e1a..1512bc17132 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -57,6 +57,7 @@ extern void WINAPI LdrInitializeThunk(CONTEXT*,ULONG_PTR,ULONG_PTR,ULONG_PTR); extern NTSTATUS WINAPI KiUserExceptionDispatcher(EXCEPTION_RECORD*,CONTEXT*); extern void WINAPI KiUserApcDispatcher(CONTEXT*,ULONG_PTR,ULONG_PTR,ULONG_PTR,PNTAPCFUNC); extern void WINAPI KiUserCallbackDispatcher(ULONG,void*,ULONG); +extern void WINAPI KiUserCallbackDispatcherReturn(void); extern void (WINAPI *pWow64PrepareForException)( EXCEPTION_RECORD *rec, CONTEXT *context ); #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 0b711481e98..ccb3f10b9f5 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -589,6 +589,8 @@ __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, "ldr r1, [sp, #0x04]\n\t" /* len */ "ldr r2, [sp, #0x08]\n\t" /* id */ "bl " __ASM_NAME("dispatch_user_callback") "\n\t" + ".globl " __ASM_NAME("KiUserCallbackDispatcherReturn") "\n" + __ASM_NAME("KiUserCallbackDispatcherReturn") ":\n\t" "mov r2, r0\n\t" /* status */ "mov r1, #0\n\t" /* ret_len */ "mov r0, r1\n\t" /* ret_ptr */ diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index a731dc77795..8a59f9050b1 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -615,6 +615,8 @@ __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, "ldr x0, [sp]\n\t" /* args */ "ldp w1, w2, [sp, #0x08]\n\t" /* len, id */ "bl " __ASM_NAME("dispatch_user_callback") "\n\t" + ".globl " __ASM_NAME("KiUserCallbackDispatcherReturn") "\n" + __ASM_NAME("KiUserCallbackDispatcherReturn") ":\n\t" "mov x2, x0\n\t" /* status */ "mov x1, #0\n\t" /* ret_len */ "mov x0, x1\n\t" /* ret_ptr */ diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index 1974ed63dd9..fb6654f4340 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -1726,6 +1726,8 @@ __ASM_GLOBAL_FUNC( "#KiUserCallbackDispatcher", "ldr x0, [sp]\n\t" /* args */ "ldp w1, w2, [sp, #0x08]\n\t" /* len, id */ "bl " __ASM_NAME("dispatch_user_callback") "\n\t" + ".globl \"#KiUserCallbackDispatcherReturn\"\n" + "\"#KiUserCallbackDispatcherReturn\":\n\t" "mov x2, x0\n\t" /* status */ "mov x1, #0\n\t" /* ret_len */ "mov x0, x1\n\t" /* ret_ptr */
1
0
0
0
Alexandre Julliard : ntdll: Report failure in KiUserCallbackDispatcher when catching an exception.
by Alexandre Julliard
22 Jan '24
22 Jan '24
Module: wine Branch: master Commit: 7344a124d7f6607991ce9dccc1600c4adc9eae04 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7344a124d7f6607991ce9dccc1600c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 22 11:26:41 2024 +0100 ntdll: Report failure in KiUserCallbackDispatcher when catching an exception. --- dlls/ntdll/exception.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 1691680d3c6..98733045e17 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -201,8 +201,8 @@ NTSTATUS WINAPI dispatch_user_callback( void *args, ULONG len, ULONG id ) } __EXCEPT_ALL { - ERR( "ignoring exception\n" ); - status = STATUS_SUCCESS; + status = GetExceptionCode(); + ERR( "ignoring exception %lx\n", status ); } __ENDTRY return status;
1
0
0
0
Alexandre Julliard : ntdll: Share KiUserCallbackDispatcher implementation across platforms.
by Alexandre Julliard
22 Jan '24
22 Jan '24
Module: wine Branch: master Commit: d89037a826ae5cd7d006e2f98b1a6a33d9afa084 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d89037a826ae5cd7d006e2f98b1a6a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 22 11:06:41 2024 +0100 ntdll: Share KiUserCallbackDispatcher implementation across platforms. --- dlls/ntdll/exception.c | 24 ++++++++++++++++++++++++ dlls/ntdll/ntdll_misc.h | 1 + dlls/ntdll/signal_arm.c | 25 ++++++------------------- dlls/ntdll/signal_arm64.c | 25 ++++++------------------- dlls/ntdll/signal_arm64ec.c | 25 ++++++------------------- dlls/ntdll/signal_i386.c | 18 +++--------------- dlls/ntdll/signal_x86_64.c | 27 ++++++++------------------- 7 files changed, 54 insertions(+), 91 deletions(-) diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 7a230237f0c..1691680d3c6 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -185,6 +185,30 @@ LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ) } +/******************************************************************* + * dispatch_user_callback + * + * Implementation of KiUserCallbackDispatcher. + */ +NTSTATUS WINAPI dispatch_user_callback( void *args, ULONG len, ULONG id ) +{ + NTSTATUS status; + + __TRY + { + KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id]; + status = func( args, len ); + } + __EXCEPT_ALL + { + ERR( "ignoring exception\n" ); + status = STATUS_SUCCESS; + } + __ENDTRY + return status; +} + + /******************************************************************* * raise_status * diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index a7967a6c242..11cf2b39e1a 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -49,6 +49,7 @@ extern UINT_PTR page_size; /* exceptions */ extern LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ); +extern NTSTATUS WINAPI dispatch_user_callback( void *args, ULONG len, ULONG id ); extern void DECLSPEC_NORETURN raise_status( NTSTATUS status, EXCEPTION_RECORD *rec ); extern LONG WINAPI call_unhandled_exception_filter( PEXCEPTION_POINTERS eptr ); diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index f29d7f0ba6f..0b711481e98 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -575,24 +575,6 @@ __ASM_GLOBAL_FUNC( KiUserApcDispatcher, /******************************************************************* * KiUserCallbackDispatcher (NTDLL.@) */ -void WINAPI dispatch_callback( void *args, ULONG len, ULONG id ) -{ - NTSTATUS status; - - __TRY - { - KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id]; - status = NtCallbackReturn( NULL, 0, func( args, len )); - } - __EXCEPT_ALL - { - ERR_(seh)( "ignoring exception\n" ); - status = NtCallbackReturn( 0, 0, 0 ); - } - __ENDTRY - - RtlRaiseStatus( status ); -} __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, __ASM_SEH(".seh_custom 0xee,0x01\n\t") /* MSFT_OP_MACHINE_FRAME */ "nop\n\t" @@ -606,7 +588,12 @@ __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, "ldr r0, [sp]\n\t" /* args */ "ldr r1, [sp, #0x04]\n\t" /* len */ "ldr r2, [sp, #0x08]\n\t" /* id */ - "bl " __ASM_NAME("dispatch_callback") "\n\t" + "bl " __ASM_NAME("dispatch_user_callback") "\n\t" + "mov r2, r0\n\t" /* status */ + "mov r1, #0\n\t" /* ret_len */ + "mov r0, r1\n\t" /* ret_ptr */ + "bl " __ASM_NAME("NtCallbackReturn") "\n\t" + "bl " __ASM_NAME("RtlRaiseStatus") "\n\t" "udf #1" ) diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 2fd56ed5ddc..a731dc77795 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -605,24 +605,6 @@ __ASM_GLOBAL_FUNC( KiUserApcDispatcher, /******************************************************************* * KiUserCallbackDispatcher (NTDLL.@) */ -void WINAPI dispatch_callback( void *args, ULONG len, ULONG id ) -{ - NTSTATUS status; - - __TRY - { - KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id]; - status = NtCallbackReturn( NULL, 0, func( args, len )); - } - __EXCEPT_ALL - { - ERR_(seh)( "ignoring exception\n" ); - status = NtCallbackReturn( 0, 0, 0 ); - } - __ENDTRY - - RtlRaiseStatus( status ); -} __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, __ASM_SEH(".seh_pushframe\n\t") "nop\n\t" @@ -632,7 +614,12 @@ __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, __ASM_SEH(".seh_endprologue\n\t") "ldr x0, [sp]\n\t" /* args */ "ldp w1, w2, [sp, #0x08]\n\t" /* len, id */ - "bl " __ASM_NAME("dispatch_callback") "\n\t" + "bl " __ASM_NAME("dispatch_user_callback") "\n\t" + "mov x2, x0\n\t" /* status */ + "mov x1, #0\n\t" /* ret_len */ + "mov x0, x1\n\t" /* ret_ptr */ + "bl " __ASM_NAME("NtCallbackReturn") "\n\t" + "bl " __ASM_NAME("RtlRaiseStatus") "\n\t" "brk #1" ) diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index 9953ab8e60d..1974ed63dd9 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -1716,24 +1716,6 @@ __ASM_GLOBAL_FUNC( "#KiUserApcDispatcher", /******************************************************************* * KiUserCallbackDispatcher (NTDLL.@) */ -void WINAPI dispatch_callback( void *args, ULONG len, ULONG id ) -{ - NTSTATUS status; - - __TRY - { - KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id]; - status = NtCallbackReturn( NULL, 0, func( args, len )); - } - __EXCEPT_ALL - { - ERR_(seh)( "ignoring exception\n" ); - status = NtCallbackReturn( 0, 0, 0 ); - } - __ENDTRY - - RtlRaiseStatus( status ); -} __ASM_GLOBAL_FUNC( "#KiUserCallbackDispatcher", __ASM_SEH(".seh_pushframe\n\t") "nop\n\t" @@ -1743,7 +1725,12 @@ __ASM_GLOBAL_FUNC( "#KiUserCallbackDispatcher", __ASM_SEH(".seh_endprologue\n\t") "ldr x0, [sp]\n\t" /* args */ "ldp w1, w2, [sp, #0x08]\n\t" /* len, id */ - "bl " __ASM_NAME("dispatch_callback") "\n\t" + "bl " __ASM_NAME("dispatch_user_callback") "\n\t" + "mov x2, x0\n\t" /* status */ + "mov x1, #0\n\t" /* ret_len */ + "mov x0, x1\n\t" /* ret_ptr */ + "bl " __ASM_NAME("NtCallbackReturn") "\n\t" + "bl " __ASM_NAME("RtlRaiseStatus") "\n\t" "brk #1" ) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index c4aaba5e0a8..865faa93ea9 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -294,21 +294,9 @@ __ASM_STDCALL_FUNC( KiUserApcDispatcher, 20, */ void WINAPI KiUserCallbackDispatcher( ULONG id, void *args, ULONG len ) { - NTSTATUS status; - - __TRY - { - KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id]; - status = NtCallbackReturn( NULL, 0, func( args, len )); - } - __EXCEPT_ALL - { - ERR_(seh)( "ignoring exception\n" ); - status = NtCallbackReturn( 0, 0, 0 ); - } - __ENDTRY - - RtlRaiseStatus( status ); + NTSTATUS status = dispatch_user_callback( args, len, id ); + status = NtCallbackReturn( NULL, 0, status ); + for (;;) RtlRaiseStatus( status ); } diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 9c6049552b2..c56552a74a7 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -691,24 +691,6 @@ __ASM_GLOBAL_FUNC( KiUserApcDispatcher, /******************************************************************* * KiUserCallbackDispatcher (NTDLL.@) */ -void WINAPI dispatch_callback( void *args, ULONG len, ULONG id ) -{ - NTSTATUS status; - - __TRY - { - KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id]; - status = NtCallbackReturn( NULL, 0, func( args, len )); - } - __EXCEPT_ALL - { - ERR_(seh)( "ignoring exception\n" ); - status = NtCallbackReturn( 0, 0, 0 ); - } - __ENDTRY - - RtlRaiseStatus( status ); -} __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, __ASM_SEH(".seh_pushframe\n\t") __ASM_SEH(".seh_stackalloc 0x30\n\t") @@ -720,7 +702,14 @@ __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, "movq 0x20(%rsp),%rcx\n\t" /* args */ "movl 0x28(%rsp),%edx\n\t" /* len */ "movl 0x2c(%rsp),%r8d\n\t" /* id */ - "call " __ASM_NAME("dispatch_callback") ) + "call " __ASM_NAME("dispatch_user_callback") "\n\t" + "xorq %rcx,%rcx\n\t" /* ret_ptr */ + "xorl %edx,%edx\n\t" /* ret_len */ + "movl %eax,%r8d\n\t" /* status */ + "call " __ASM_NAME("NtCallbackReturn") "\n\t" + "movl %eax,%ecx\n\t" /* status */ + "call " __ASM_NAME("RtlRaiseStatus") "\n\t" + "int3" ) /**************************************************************************
1
0
0
0
Alexandre Julliard : include: Add a typedef for user callback function pointers.
by Alexandre Julliard
22 Jan '24
22 Jan '24
Module: wine Branch: master Commit: 3031f15784b556cd3ff773960d4dd7b0b4eeee7e URL:
https://gitlab.winehq.org/wine/wine/-/commit/3031f15784b556cd3ff773960d4dd7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 22 10:26:59 2024 +0100 include: Add a typedef for user callback function pointers. --- dlls/ntdll/signal_arm.c | 2 +- dlls/ntdll/signal_arm64.c | 2 +- dlls/ntdll/signal_arm64ec.c | 2 +- dlls/ntdll/signal_i386.c | 2 +- dlls/ntdll/signal_x86_64.c | 2 +- dlls/ntdll/tests/exception.c | 8 ++++---- dlls/opengl32/wgl.c | 2 +- dlls/user.exe16/message.c | 2 +- dlls/user32/user_main.c | 19 +++++++++++-------- dlls/wineandroid.drv/dllmain.c | 2 +- dlls/winemac.drv/dllmain.c | 5 ++--- dlls/winevulkan/loader.c | 2 +- dlls/winex11.drv/dllmain.c | 5 ++--- include/winternl.h | 4 +++- 14 files changed, 31 insertions(+), 28 deletions(-)
1
0
0
0
Alexandre Julliard : msvcp: Consistently use __int64 types in number conversion functions.
by Alexandre Julliard
22 Jan '24
22 Jan '24
Module: wine Branch: master Commit: c7c862425008c84ae001d68227bd2a0d3adb7c2e URL:
https://gitlab.winehq.org/wine/wine/-/commit/c7c862425008c84ae001d68227bd2a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 22 11:17:32 2024 +0100 msvcp: Consistently use __int64 types in number conversion functions. This avoids unaligned access warnings with clang. --- dlls/msvcp60/msvcp.h | 8 ++++---- dlls/msvcp90/locale.c | 40 ++++++++++++++++++++-------------------- dlls/msvcp90/msvcp90.h | 8 ++++---- 3 files changed, 28 insertions(+), 28 deletions(-)
1
0
0
0
Nikolay Sivov : d2d1/effect: Recreate transform graph when input count changes.
by Alexandre Julliard
22 Jan '24
22 Jan '24
Module: wine Branch: master Commit: d46021bab993fffbf27a872f5827db987888c183 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d46021bab993fffbf27a872f5827db…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 3 02:10:29 2024 +0100 d2d1/effect: Recreate transform graph when input count changes. --- dlls/d2d1/effect.c | 40 ++++++++++++++++++++++++++++------------ dlls/d2d1/tests/d2d1.c | 14 +++++++++++++- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c index f857afb401d..755b2821df4 100644 --- a/dlls/d2d1/effect.c +++ b/dlls/d2d1/effect.c @@ -189,7 +189,7 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_impl_PrepareForRender(ID2D1EffectImp static HRESULT STDMETHODCALLTYPE d2d_effect_impl_SetGraph(ID2D1EffectImpl *iface, ID2D1TransformGraph *graph) { - return E_NOTIMPL; + return S_OK; } static const ID2D1EffectImplVtbl d2d_effect_impl_vtbl = @@ -1045,7 +1045,8 @@ static void d2d_effect_cleanup(struct d2d_effect *effect) } free(effect->inputs); ID2D1EffectContext_Release(&effect->effect_context->ID2D1EffectContext_iface); - ID2D1TransformGraph_Release(&effect->graph->ID2D1TransformGraph_iface); + if (effect->graph) + ID2D1TransformGraph_Release(&effect->graph->ID2D1TransformGraph_iface); d2d_effect_properties_cleanup(&effect->properties); if (effect->impl) ID2D1EffectImpl_Release(effect->impl); @@ -1239,6 +1240,8 @@ static void STDMETHODCALLTYPE d2d_effect_SetInput(ID2D1Effect *iface, UINT32 ind static HRESULT d2d_effect_set_input_count(struct d2d_effect *effect, UINT32 count) { + bool initialized = effect->inputs != NULL; + HRESULT hr = S_OK; unsigned int i; if (count == effect->input_count) @@ -1251,21 +1254,34 @@ static HRESULT d2d_effect_set_input_count(struct d2d_effect *effect, UINT32 coun if (effect->inputs[i]) ID2D1Image_Release(effect->inputs[i]); } - effect->input_count = count; - return S_OK; } - - if (!d2d_array_reserve((void **)&effect->inputs, &effect->inputs_size, - count, sizeof(*effect->inputs))) + else { - ERR("Failed to resize inputs array.\n"); - return E_OUTOFMEMORY; - } + if (!d2d_array_reserve((void **)&effect->inputs, &effect->inputs_size, + count, sizeof(*effect->inputs))) + { + ERR("Failed to resize inputs array.\n"); + return E_OUTOFMEMORY; + } - memset(&effect->inputs[effect->input_count], 0, sizeof(*effect->inputs) * (count - effect->input_count)); + memset(&effect->inputs[effect->input_count], 0, sizeof(*effect->inputs) * (count - effect->input_count)); + } effect->input_count = count; - return S_OK; + if (initialized) + { + ID2D1TransformGraph_Release(&effect->graph->ID2D1TransformGraph_iface); + effect->graph = NULL; + + if (!(effect->graph = calloc(1, sizeof(*effect->graph)))) + return E_OUTOFMEMORY; + d2d_transform_graph_init(effect->graph); + + if (FAILED(hr = ID2D1EffectImpl_SetGraph(effect->impl, &effect->graph->ID2D1TransformGraph_iface))) + WARN("Failed to set a new transform graph, hr %#lx.\n", hr); + } + + return hr; } static HRESULT STDMETHODCALLTYPE d2d_effect_SetInputCount(ID2D1Effect *iface, UINT32 count) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 6586f61bc6a..efa4da54fd2 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -11166,7 +11166,12 @@ static HRESULT STDMETHODCALLTYPE effect_impl_PrepareForRender(ID2D1EffectImpl *i static HRESULT STDMETHODCALLTYPE effect_impl_SetGraph(ID2D1EffectImpl *iface, ID2D1TransformGraph *graph) { - return E_NOTIMPL; + struct effect_impl *effect_impl = impl_from_ID2D1EffectImpl(iface); + + ID2D1TransformGraph_Release(effect_impl->transform_graph); + ID2D1TransformGraph_AddRef(effect_impl->transform_graph = graph); + + return S_OK; } static const ID2D1EffectImplVtbl effect_impl_vtbl = @@ -11496,6 +11501,13 @@ static void test_effect_register(BOOL d3d11) (BYTE *)&integer, sizeof(integer)); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(integer == 3, "Unexpected data %u.\n", integer); + hr = ID2D1Effect_SetInputCount(effect, 4); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_INPUTS, D2D1_PROPERTY_TYPE_ARRAY, + (BYTE *)&integer, sizeof(integer)); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(integer == 3, "Unexpected data %u.\n", integer); + ID2D1Effect_Release(effect); hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
1
0
0
0
Nikolay Sivov : d2d1/effect: Use XML description for builtin effects.
by Alexandre Julliard
22 Jan '24
22 Jan '24
Module: wine Branch: master Commit: 167103114389c7f487f7d6aa398f56abf9cc5572 URL:
https://gitlab.winehq.org/wine/wine/-/commit/167103114389c7f487f7d6aa398f56…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 3 01:03:32 2024 +0100 d2d1/effect: Use XML description for builtin effects. --- dlls/d2d1/d2d1_private.h | 5 +- dlls/d2d1/effect.c | 176 +++++++++++++++++++++++++++++++++-------------- dlls/d2d1/factory.c | 76 ++++++++++++++------ dlls/d2d1/tests/d2d1.c | 73 +++++++++++++++----- 4 files changed, 240 insertions(+), 90 deletions(-)
1
0
0
0
Nikolay Sivov : d2d1/effect: Handle variable input count attributes in the description.
by Alexandre Julliard
22 Jan '24
22 Jan '24
Module: wine Branch: master Commit: 9b32b18b08434fd3f4cc6e33d92f98e393434901 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9b32b18b08434fd3f4cc6e33d92f98…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jan 2 00:37:28 2024 +0100 d2d1/effect: Handle variable input count attributes in the description. --- dlls/d2d1/d2d1_private.h | 2 ++ dlls/d2d1/effect.c | 7 ++++ dlls/d2d1/factory.c | 90 +++++++++++++++++++++++++++++++++++++++--------- dlls/d2d1/tests/d2d1.c | 2 -- 4 files changed, 83 insertions(+), 18 deletions(-) diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 36bedf8331c..645fea197f6 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -707,6 +707,8 @@ struct d2d_effect_registration * d2d_factory_get_registered_effect(ID2D1Factory const GUID *effect_id); void d2d_factory_register_effect(struct d2d_factory *factory, struct d2d_effect_registration *effect); +HRESULT d2d_effect_property_get_uint32_value(const struct d2d_effect_properties *properties, + const struct d2d_effect_property *prop, UINT32 *value); struct d2d_transform_graph { diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c index ddc9eee9236..a3de883dfbe 100644 --- a/dlls/d2d1/effect.c +++ b/dlls/d2d1/effect.c @@ -570,6 +570,13 @@ static HRESULT d2d_effect_property_get_value(const struct d2d_effect_properties return S_OK; } +HRESULT d2d_effect_property_get_uint32_value(const struct d2d_effect_properties *properties, + const struct d2d_effect_property *prop, UINT32 *value) +{ + return d2d_effect_property_get_value(properties, prop, D2D1_PROPERTY_TYPE_UINT32, + (BYTE *)value, sizeof(*value)); +} + static HRESULT d2d_effect_property_set_value(struct d2d_effect_properties *properties, struct d2d_effect_property *prop, D2D1_PROPERTY_TYPE type, const BYTE *value, UINT32 size) { diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c index d349da376fc..938c62e4fb0 100644 --- a/dlls/d2d1/factory.c +++ b/dlls/d2d1/factory.c @@ -788,12 +788,13 @@ static HRESULT parse_effect_property(IXmlReader *reader, struct d2d_effect_regis static HRESULT parse_effect_inputs(IXmlReader *reader, struct d2d_effect_registration *effect) { + struct d2d_effect_property *inputs, *min_inputs, *max_inputs; struct d2d_effect_properties *subproperties; + UINT32 min_inputs_value, max_inputs_value; unsigned int depth, input_count = 0; - struct d2d_effect_property *inputs; XmlNodeType node_type; - WCHAR nameW[16]; - WCHAR *name; + WCHAR *name, *value; + WCHAR buffW[16]; HRESULT hr; if (FAILED(hr = d2d_effect_properties_add(&effect->properties, L"Inputs", @@ -811,28 +812,85 @@ static HRESULT parse_effect_inputs(IXmlReader *reader, struct d2d_effect_registr d2d_effect_subproperties_add(subproperties, L"DisplayName", D2D1_SUBPROPERTY_DISPLAYNAME, D2D1_PROPERTY_TYPE_STRING, L"Inputs"); - if (IXmlReader_IsEmptyElement(reader)) return S_OK; + if (SUCCEEDED(parse_effect_get_attribute(reader, L"minimum", &value))) + { + hr = d2d_effect_properties_add(&effect->properties, L"MinInputs", D2D1_PROPERTY_MIN_INPUTS, + D2D1_PROPERTY_TYPE_UINT32, value); + free(value); + if (FAILED(hr)) return hr; + } + if (SUCCEEDED(parse_effect_get_attribute(reader, L"maximum", &value))) + { + hr = d2d_effect_properties_add(&effect->properties, L"MaxInputs", D2D1_PROPERTY_MAX_INPUTS, + D2D1_PROPERTY_TYPE_UINT32, value); + free(value); + if (FAILED(hr)) return hr; + } + + min_inputs = d2d_effect_properties_get_property_by_name(&effect->properties, L"MinInputs"); + max_inputs = d2d_effect_properties_get_property_by_name(&effect->properties, L"MaxInputs"); - while (parse_effect_get_next_xml_node(reader, XmlNodeType_None, L"Input", &depth) == S_OK) + if (!IXmlReader_IsEmptyElement(reader)) { + while (parse_effect_get_next_xml_node(reader, XmlNodeType_None, L"Input", &depth) == S_OK) + { + if (FAILED(hr = IXmlReader_GetNodeType(reader, &node_type))) return hr; + if (node_type == XmlNodeType_EndElement) continue; + if (node_type != XmlNodeType_Element) return HRESULT_FROM_WIN32(ERROR_NOT_FOUND); + + if (FAILED(hr = parse_effect_get_attribute(reader, L"name", &name))) return hr; + + swprintf(buffW, ARRAY_SIZE(buffW), L"%lu", input_count); + d2d_effect_subproperties_add(subproperties, buffW, input_count, D2D1_PROPERTY_TYPE_STRING, name); + input_count++; + + free(name); + } + *(UINT32 *)(effect->properties.data.ptr + inputs->data.offset) = input_count; + if (FAILED(hr = IXmlReader_GetNodeType(reader, &node_type))) return hr; - if (node_type == XmlNodeType_EndElement) continue; - if (node_type != XmlNodeType_Element) return HRESULT_FROM_WIN32(ERROR_NOT_FOUND); + if (node_type != XmlNodeType_EndElement) return HRESULT_FROM_WIN32(ERROR_NOT_FOUND); + } - if (FAILED(hr = parse_effect_get_attribute(reader, L"name", &name))) return hr; + if (min_inputs) + d2d_effect_property_get_uint32_value(&effect->properties, min_inputs, &min_inputs_value); + if (max_inputs) + d2d_effect_property_get_uint32_value(&effect->properties, max_inputs, &max_inputs_value); - swprintf(nameW, ARRAY_SIZE(nameW), L"%lu", input_count); - d2d_effect_subproperties_add(subproperties, nameW, input_count, D2D1_PROPERTY_TYPE_STRING, name); - input_count++; + /* Validate the range */ + if (min_inputs && max_inputs) + { + if (min_inputs_value > max_inputs_value) + { + WARN("Invalid input count range %u - %u.\n", min_inputs_value, max_inputs_value); + return E_INVALIDARG; + } + } - free(name); + /* Validate actual input count with specified range. */ + if (min_inputs && min_inputs_value > input_count) + { + WARN("Too few inputs were declared, expected at least %u.\n", min_inputs_value); + return E_INVALIDARG; + } + + if (max_inputs && max_inputs_value < input_count) + { + WARN("Too many inputs were declared, expected at most %u.\n", max_inputs_value); + return E_INVALIDARG; } - *(UINT32 *)(effect->properties.data.ptr + inputs->data.offset) = input_count; - if (FAILED(hr = IXmlReader_GetNodeType(reader, &node_type))) return hr; - if (node_type != XmlNodeType_EndElement) return HRESULT_FROM_WIN32(ERROR_NOT_FOUND); + /* Apply default value to a missing property. */ + if (min_inputs != max_inputs) + { + swprintf(buffW, ARRAY_SIZE(buffW), L"%lu", min_inputs ? min_inputs_value : max_inputs_value); + if (min_inputs) + hr = d2d_effect_properties_add(&effect->properties, L"MaxInputs", D2D1_PROPERTY_MAX_INPUTS, D2D1_PROPERTY_TYPE_UINT32, buffW); + else + hr = d2d_effect_properties_add(&effect->properties, L"MinInputs", D2D1_PROPERTY_MIN_INPUTS, D2D1_PROPERTY_TYPE_UINT32, buffW); + } - return S_OK; + return hr; } static HRESULT parse_effect_xml(IXmlReader *reader, struct d2d_effect_registration *effect) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 935cb73e7fa..ef4187d50c0 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -11477,12 +11477,10 @@ static void test_effect_register(BOOL d3d11) hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_MIN_INPUTS, D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&integer, sizeof(integer)); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - todo_wine ok(integer == 2, "Unexpected value %u.\n", integer); hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_MAX_INPUTS, D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&integer, sizeof(integer)); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - todo_wine ok(integer == 5, "Unexpected value %u.\n", integer); hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_INPUTS, D2D1_PROPERTY_TYPE_ARRAY, (BYTE *)&integer, sizeof(integer));
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
72
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
Results per page:
10
25
50
100
200