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
March 2022
----- 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
1138 discussions
Start a n
N
ew thread
Rémi Bernon : dinput/tests: Add tests for IGameControllerFactoryManagerStatics_RegisterCustomFactoryForHardwareId.
by Alexandre Julliard
02 Mar '22
02 Mar '22
Module: wine Branch: master Commit: e1b8de1a2de1b60629e9b8f67c41843d8d8cc5d6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e1b8de1a2de1b60629e9b8f6…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Mar 2 14:03:04 2022 +0100 dinput/tests: Add tests for IGameControllerFactoryManagerStatics_RegisterCustomFactoryForHardwareId. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/tests/hotplug.c | 141 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 139 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/tests/hotplug.c b/dlls/dinput/tests/hotplug.c index 2f30cc19d9d..e8f5157d73f 100644 --- a/dlls/dinput/tests/hotplug.c +++ b/dlls/dinput/tests/hotplug.c @@ -45,7 +45,8 @@ #define WIDL_using_Windows_Foundation_Collections #include "windows.foundation.h" #define WIDL_using_Windows_Gaming_Input -#include "windows.gaming.input.h" +#define WIDL_using_Windows_Gaming_Input_Custom +#include "windows.gaming.input.custom.h" #define MAKE_FUNC(f) static typeof(f) *p ## f MAKE_FUNC( RoGetActivationFactory ); @@ -527,6 +528,104 @@ static const IEventHandler_RawGameControllerVtbl controller_handler_vtbl = static struct controller_handler controller_removed = {{&controller_handler_vtbl}}; static struct controller_handler controller_added = {{&controller_handler_vtbl}}; +struct custom_factory +{ + ICustomGameControllerFactory ICustomGameControllerFactory_iface; + BOOL create_controller_called; +}; + +static inline struct custom_factory *impl_from_ICustomGameControllerFactory( ICustomGameControllerFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct custom_factory, ICustomGameControllerFactory_iface ); +} + +static HRESULT WINAPI custom_factory_QueryInterface( ICustomGameControllerFactory *iface, REFIID iid, void **out ) +{ + struct custom_factory *impl = impl_from_ICustomGameControllerFactory( iface ); + + if (IsEqualGUID( iid, &IID_IUnknown ) || + IsEqualGUID( iid, &IID_IInspectable ) || + IsEqualGUID( iid, &IID_IAgileObject ) || + IsEqualGUID( iid, &IID_ICustomGameControllerFactory )) + { + IInspectable_AddRef( (*out = &impl->ICustomGameControllerFactory_iface) ); + return S_OK; + } + + ok( 0, "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI custom_factory_AddRef( ICustomGameControllerFactory *iface ) +{ + return 2; +} + +static ULONG WINAPI custom_factory_Release( ICustomGameControllerFactory *iface ) +{ + return 1; +} + +static HRESULT WINAPI custom_factory_GetIids( ICustomGameControllerFactory *iface, ULONG *iid_count, IID **iids ) +{ + ok( 0, "unexpected call\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI custom_factory_GetRuntimeClassName( ICustomGameControllerFactory *iface, HSTRING *class_name ) +{ + ok( 0, "unexpected call\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI custom_factory_GetTrustLevel( ICustomGameControllerFactory *iface, TrustLevel *trust_level ) +{ + ok( 0, "unexpected call\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI custom_factory_CreateGameController( ICustomGameControllerFactory *iface, IGameControllerProvider *provider, + IInspectable **value ) +{ + struct custom_factory *impl = impl_from_ICustomGameControllerFactory( iface ); + + ok( !controller_added.invoked, "controller added handler invoked\n" ); + ok( !impl->create_controller_called, "unexpected call\n" ); + impl->create_controller_called = TRUE; + + return E_NOTIMPL; +} + +static HRESULT WINAPI custom_factory_OnGameControllerAdded( ICustomGameControllerFactory *iface, IGameController *value ) +{ + ok( 0, "unexpected call\n" ); + return E_NOTIMPL; +} + +static HRESULT WINAPI custom_factory_OnGameControllerRemoved( ICustomGameControllerFactory *iface, IGameController *value ) +{ + ok( 0, "unexpected call\n" ); + return E_NOTIMPL; +} + +static const struct ICustomGameControllerFactoryVtbl custom_factory_vtbl = +{ + custom_factory_QueryInterface, + custom_factory_AddRef, + custom_factory_Release, + /* IInspectable methods */ + custom_factory_GetIids, + custom_factory_GetRuntimeClassName, + custom_factory_GetTrustLevel, + /* ICustomGameControllerFactory methods */ + custom_factory_CreateGameController, + custom_factory_OnGameControllerAdded, + custom_factory_OnGameControllerRemoved, +}; + +static struct custom_factory custom_factory = {{&custom_factory_vtbl}}; + static LRESULT CALLBACK windows_gaming_input_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { if (msg == WM_DEVICECHANGE) @@ -552,6 +651,7 @@ static LRESULT CALLBACK windows_gaming_input_wndproc( HWND hwnd, UINT msg, WPARA static void test_windows_gaming_input(void) { + static const WCHAR *manager_class_name = RuntimeClass_Windows_Gaming_Input_Custom_GameControllerFactoryManager; static const WCHAR *class_name = RuntimeClass_Windows_Gaming_Input_RawGameController; DEV_BROADCAST_DEVICEINTERFACE_A iface_filter_a = { @@ -566,6 +666,10 @@ static void test_windows_gaming_input(void) .lpszClassName = L"devnotify", .lpfnWndProc = windows_gaming_input_wndproc, }; + IGameControllerFactoryManagerStatics2 *manager_statics2; + IRawGameController *raw_controller, *tmp_raw_controller; + IGameController *game_controller, *tmp_game_controller; + IGameControllerFactoryManagerStatics *manager_statics; EventRegistrationToken controller_removed_token; IVectorView_RawGameController *controller_view; EventRegistrationToken controller_added_token; @@ -594,11 +698,24 @@ static void test_windows_gaming_input(void) return; } + hr = pWindowsCreateString( manager_class_name, wcslen( manager_class_name ), &str ); + ok( hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr ); + hr = pRoGetActivationFactory( str, &IID_IGameControllerFactoryManagerStatics, (void **)&manager_statics ); + ok( hr == S_OK, "RoGetActivationFactory failed, hr %#lx\n", hr ); + hr = pRoGetActivationFactory( str, &IID_IGameControllerFactoryManagerStatics2, (void **)&manager_statics2 ); + ok( hr == S_OK, "RoGetActivationFactory failed, hr %#lx\n", hr ); + pWindowsDeleteString( str ); + controller_added.event = CreateEventW( NULL, FALSE, FALSE, NULL ); ok( !!controller_added.event, "CreateEventW failed, error %lu\n", GetLastError() ); controller_removed.event = CreateEventW( NULL, FALSE, FALSE, NULL ); ok( !!controller_removed.event, "CreateEventW failed, error %lu\n", GetLastError() ); + hr = IGameControllerFactoryManagerStatics_RegisterCustomFactoryForHardwareId( manager_statics, &custom_factory.ICustomGameControllerFactory_iface, + LOWORD(EXPECT_VIDPID), HIWORD(EXPECT_VIDPID) ); + todo_wine + ok( hr == S_OK, "RegisterCustomFactoryForHardwareId returned %#lx\n", hr ); + hr = IRawGameControllerStatics_add_RawGameControllerAdded( statics, &controller_added.IEventHandler_RawGameController_iface, &controller_added_token ); ok( hr == S_OK, "add_RawGameControllerAdded returned %#lx\n", hr ); @@ -633,6 +750,7 @@ static void test_windows_gaming_input(void) ok( controller_added.invoked, "controller added handler not invoked\n" ); ok( !controller_removed.invoked, "controller removed handler invoked\n" ); + ok( custom_factory.create_controller_called, "CreateGameController not called\n" ); hr = IVectorView_RawGameController_get_Size( controller_view, &size ); ok( hr == S_OK, "get_Size returned %#lx\n", hr ); @@ -645,6 +763,23 @@ static void test_windows_gaming_input(void) hr = IVectorView_RawGameController_get_Size( controller_view, &size ); ok( hr == S_OK, "get_Size returned %#lx\n", hr ); ok( size == 1, "got size %u\n", size ); + hr = IVectorView_RawGameController_GetAt( controller_view, 0, &raw_controller ); + ok( hr == S_OK, "GetAt returned %#lx\n", hr ); + hr = IRawGameController_QueryInterface( raw_controller, &IID_IGameController, (void **)&game_controller ); + ok( hr == S_OK, "QueryInterface returned %#lx\n", hr ); + + hr = IGameControllerFactoryManagerStatics2_TryGetFactoryControllerFromGameController( manager_statics2, + &custom_factory.ICustomGameControllerFactory_iface, game_controller, &tmp_game_controller ); + ok( hr == S_OK, "TryGetFactoryControllerFromGameController returned %#lx\n", hr ); + ok( !tmp_game_controller, "got controller %p\n", tmp_game_controller ); + + hr = IRawGameControllerStatics_FromGameController( statics, game_controller, &tmp_raw_controller ); + ok( hr == S_OK, "FromGameController returned %#lx\n", hr ); + ok( tmp_raw_controller == raw_controller, "got controller %p\n", tmp_raw_controller ); + IRawGameController_Release( tmp_raw_controller ); + + IGameController_Release( game_controller ); + IRawGameController_Release( raw_controller ); SetEvent( stop_event ); wait_for_events( 1, &controller_removed.event, INFINITE ); @@ -672,8 +807,10 @@ static void test_windows_gaming_input(void) ok( hr == S_OK, "remove_RawGameControllerRemoved returned %#lx\n", hr ); IVectorView_RawGameController_Release( controller_view ); - IRawGameControllerStatics_Release( statics ); + IGameControllerFactoryManagerStatics2_Release( manager_statics2 ); + IGameControllerFactoryManagerStatics_Release( manager_statics ); + IRawGameControllerStatics_Release( statics ); WaitForSingleObject( thread, INFINITE ); CloseHandle( thread ); CloseHandle( stop_event );
1
0
0
0
Rémi Bernon : windows.gaming.input: Register Windows.Gaming.Input.Custom classes.
by Alexandre Julliard
02 Mar '22
02 Mar '22
Module: wine Branch: master Commit: 350c8ec3ba7f4c0ac3c174e9f02faf777eb87f3d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=350c8ec3ba7f4c0ac3c174e9…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Mar 2 14:03:03 2022 +0100 windows.gaming.input: Register Windows.Gaming.Input.Custom classes. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.gaming.input/classes.idl | 15 +++++++++++++++ include/windows.gaming.input.custom.idl | 2 ++ include/windows.gaming.input.idl | 2 ++ 3 files changed, 19 insertions(+) diff --git a/dlls/windows.gaming.input/classes.idl b/dlls/windows.gaming.input/classes.idl index c9cb91e3182..fd52d8ebf66 100644 --- a/dlls/windows.gaming.input/classes.idl +++ b/dlls/windows.gaming.input/classes.idl @@ -20,4 +20,19 @@ #pragma makedep register +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; +import "windows.devices.haptics.idl"; +import "windows.gaming.input.forcefeedback.idl"; +import "windows.system.idl"; + +#define DO_NO_IMPORTS #include "windows.gaming.input.idl" +#include "windows.gaming.input.custom.idl" diff --git a/include/windows.gaming.input.custom.idl b/include/windows.gaming.input.custom.idl index 0811b991091..8347f4663d3 100644 --- a/include/windows.gaming.input.custom.idl +++ b/include/windows.gaming.input.custom.idl @@ -20,6 +20,7 @@ #pragma winrt ns_prefix #endif +#ifndef DO_NO_IMPORTS import "inspectable.idl"; import "asyncinfo.idl"; import "eventtoken.idl"; @@ -27,6 +28,7 @@ import "windowscontracts.idl"; import "windows.foundation.idl"; import "windows.gaming.input.idl"; import "windows.storage.streams.idl"; +#endif namespace Windows.Gaming.Input.Custom { typedef enum XusbDeviceSubtype XusbDeviceSubtype; diff --git a/include/windows.gaming.input.idl b/include/windows.gaming.input.idl index a7d5e71381d..90253b3a8f6 100644 --- a/include/windows.gaming.input.idl +++ b/include/windows.gaming.input.idl @@ -20,6 +20,7 @@ #pragma winrt ns_prefix #endif +#ifndef DO_NO_IMPORTS import "inspectable.idl"; import "asyncinfo.idl"; import "eventtoken.idl"; @@ -28,6 +29,7 @@ import "windows.foundation.idl"; import "windows.devices.haptics.idl"; import "windows.gaming.input.forcefeedback.idl"; import "windows.system.idl"; +#endif namespace Windows.Gaming.Input { typedef enum GamepadButtons GamepadButtons;
1
0
0
0
Rémi Bernon : windows.gaming.input: Stub GameControllerFactoryManager runtimeclass.
by Alexandre Julliard
02 Mar '22
02 Mar '22
Module: wine Branch: master Commit: 435ac84c217f3e5de50bd895a59441d163cf95de URL:
https://source.winehq.org/git/wine.git/?a=commit;h=435ac84c217f3e5de50bd895…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Mar 2 14:03:02 2022 +0100 windows.gaming.input: Stub GameControllerFactoryManager runtimeclass. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.gaming.input/Makefile.in | 1 + dlls/windows.gaming.input/main.c | 2 + dlls/windows.gaming.input/manager.c | 201 ++++++++++++++++++++++++++++++++++ dlls/windows.gaming.input/private.h | 4 +- 4 files changed, 207 insertions(+), 1 deletion(-) diff --git a/dlls/windows.gaming.input/Makefile.in b/dlls/windows.gaming.input/Makefile.in index 5031e72f08d..d7f93283bec 100644 --- a/dlls/windows.gaming.input/Makefile.in +++ b/dlls/windows.gaming.input/Makefile.in @@ -5,6 +5,7 @@ C_SRCS = \ controller.c \ gamepad.c \ main.c \ + manager.c \ vector.c IDL_SRCS = classes.idl diff --git a/dlls/windows.gaming.input/main.c b/dlls/windows.gaming.input/main.c index aac21a0c33c..c050d1d5113 100644 --- a/dlls/windows.gaming.input/main.c +++ b/dlls/windows.gaming.input/main.c @@ -49,6 +49,8 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING class_str, IActivationFactory ** IActivationFactory_AddRef( (*factory = controller_factory) ); if (!wcscmp( buffer, RuntimeClass_Windows_Gaming_Input_Gamepad )) IActivationFactory_AddRef( (*factory = gamepad_factory) ); + if (!wcscmp( buffer, RuntimeClass_Windows_Gaming_Input_Custom_GameControllerFactoryManager )) + IActivationFactory_AddRef( (*factory = manager_factory) ); if (*factory) return S_OK; return REGDB_E_CLASSNOTREG; diff --git a/dlls/windows.gaming.input/manager.c b/dlls/windows.gaming.input/manager.c new file mode 100644 index 00000000000..61f639b8e7e --- /dev/null +++ b/dlls/windows.gaming.input/manager.c @@ -0,0 +1,201 @@ +/* WinRT Windows.Gaming.Input implementation + * + * Copyright 2022 Rémi 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 "private.h" + +#include "wine/debug.h" +#include "wine/list.h" + +WINE_DEFAULT_DEBUG_CHANNEL(input); + +struct manager_statics +{ + IActivationFactory IActivationFactory_iface; + IGameControllerFactoryManagerStatics IGameControllerFactoryManagerStatics_iface; + IGameControllerFactoryManagerStatics2 IGameControllerFactoryManagerStatics2_iface; + LONG ref; +}; + +static inline struct manager_statics *impl_from_IActivationFactory( IActivationFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct manager_statics, IActivationFactory_iface ); +} + +static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID iid, void **out ) +{ + struct manager_statics *impl = impl_from_IActivationFactory( iface ); + + TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out ); + + if (IsEqualGUID( iid, &IID_IUnknown ) || + IsEqualGUID( iid, &IID_IInspectable ) || + IsEqualGUID( iid, &IID_IAgileObject ) || + IsEqualGUID( iid, &IID_IActivationFactory )) + { + IInspectable_AddRef( (*out = &impl->IActivationFactory_iface) ); + return S_OK; + } + + if (IsEqualGUID( iid, &IID_IGameControllerFactoryManagerStatics )) + { + IInspectable_AddRef( (*out = &impl->IGameControllerFactoryManagerStatics_iface) ); + return S_OK; + } + + if (IsEqualGUID( iid, &IID_IGameControllerFactoryManagerStatics2 )) + { + IInspectable_AddRef( (*out = &impl->IGameControllerFactoryManagerStatics2_iface) ); + return S_OK; + } + + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI factory_AddRef( IActivationFactory *iface ) +{ + struct manager_statics *impl = impl_from_IActivationFactory( iface ); + ULONG ref = InterlockedIncrement( &impl->ref ); + TRACE( "iface %p increasing refcount to %lu.\n", iface, ref ); + return ref; +} + +static ULONG WINAPI factory_Release( IActivationFactory *iface ) +{ + struct manager_statics *impl = impl_from_IActivationFactory( iface ); + ULONG ref = InterlockedDecrement( &impl->ref ); + TRACE( "iface %p decreasing refcount to %lu.\n", iface, ref ); + return ref; +} + +static HRESULT WINAPI factory_GetIids( IActivationFactory *iface, ULONG *iid_count, IID **iids ) +{ + FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids ); + return E_NOTIMPL; +} + +static HRESULT WINAPI factory_GetRuntimeClassName( IActivationFactory *iface, HSTRING *class_name ) +{ + FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); + return E_NOTIMPL; +} + +static HRESULT WINAPI factory_GetTrustLevel( IActivationFactory *iface, TrustLevel *trust_level ) +{ + FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInspectable **instance ) +{ + FIXME( "iface %p, instance %p stub!\n", iface, instance ); + return E_NOTIMPL; +} + +static const struct IActivationFactoryVtbl factory_vtbl = +{ + factory_QueryInterface, + factory_AddRef, + factory_Release, + /* IInspectable methods */ + factory_GetIids, + factory_GetRuntimeClassName, + factory_GetTrustLevel, + /* IActivationFactory methods */ + factory_ActivateInstance, +}; + +DEFINE_IINSPECTABLE( statics, IGameControllerFactoryManagerStatics, struct manager_statics, IActivationFactory_iface ) + +static HRESULT WINAPI +statics_RegisterCustomFactoryForGipInterface( IGameControllerFactoryManagerStatics *iface, + ICustomGameControllerFactory *factory, + GUID interface_id ) +{ + FIXME( "iface %p, factory %p, interface_id %s stub!\n", iface, factory, debugstr_guid(&interface_id) ); + return E_NOTIMPL; +} + +static HRESULT WINAPI +statics_RegisterCustomFactoryForHardwareId( IGameControllerFactoryManagerStatics *iface, + ICustomGameControllerFactory *factory, + UINT16 vendor_id, UINT16 product_id ) +{ + FIXME( "iface %p, factory %p, vendor_id %u, product_id %u stub!\n", iface, factory, vendor_id, product_id ); + return E_NOTIMPL; +} + +static HRESULT WINAPI +statics_RegisterCustomFactoryForXusbType( IGameControllerFactoryManagerStatics *iface, + ICustomGameControllerFactory *factory, + XusbDeviceType type, XusbDeviceSubtype subtype ) +{ + FIXME( "iface %p, factory %p, type %d, subtype %d stub!\n", iface, factory, type, subtype ); + return E_NOTIMPL; +} + +static const struct IGameControllerFactoryManagerStaticsVtbl statics_vtbl = +{ + statics_QueryInterface, + statics_AddRef, + statics_Release, + /* IInspectable methods */ + statics_GetIids, + statics_GetRuntimeClassName, + statics_GetTrustLevel, + /* IGameControllerFactoryManagerStatics methods */ + statics_RegisterCustomFactoryForGipInterface, + statics_RegisterCustomFactoryForHardwareId, + statics_RegisterCustomFactoryForXusbType, +}; + +DEFINE_IINSPECTABLE( statics2, IGameControllerFactoryManagerStatics2, struct manager_statics, IActivationFactory_iface ) + +static HRESULT WINAPI +statics2_TryGetFactoryControllerFromGameController( IGameControllerFactoryManagerStatics2 *iface, + ICustomGameControllerFactory *factory, + IGameController *controller, IGameController **value ) +{ + FIXME( "iface %p, factory %p, controller %p, value %p stub!\n", iface, factory, controller, value ); + return E_NOTIMPL; +} + +static const struct IGameControllerFactoryManagerStatics2Vtbl statics2_vtbl = +{ + statics2_QueryInterface, + statics2_AddRef, + statics2_Release, + /* IInspectable methods */ + statics2_GetIids, + statics2_GetRuntimeClassName, + statics2_GetTrustLevel, + /* IGameControllerFactoryManagerStatics2 methods */ + statics2_TryGetFactoryControllerFromGameController, +}; + +static struct manager_statics manager_statics = +{ + {&factory_vtbl}, + {&statics_vtbl}, + {&statics2_vtbl}, + 1, +}; + +IActivationFactory *manager_factory = &manager_statics.IActivationFactory_iface; diff --git a/dlls/windows.gaming.input/private.h b/dlls/windows.gaming.input/private.h index d36f88d58e4..c6dd1105896 100644 --- a/dlls/windows.gaming.input/private.h +++ b/dlls/windows.gaming.input/private.h @@ -32,10 +32,12 @@ #define WIDL_using_Windows_Foundation_Collections #include "windows.foundation.h" #define WIDL_using_Windows_Gaming_Input -#include "windows.gaming.input.h" +#define WIDL_using_Windows_Gaming_Input_Custom +#include "windows.gaming.input.custom.h" extern IActivationFactory *controller_factory; extern IActivationFactory *gamepad_factory; +extern IActivationFactory *manager_factory; extern HRESULT vector_create( REFIID iid, REFIID view_iid, void **out );
1
0
0
0
Rémi Bernon : windows.gaming.input: Introduce helpers to define IInspectable interface boilerplate.
by Alexandre Julliard
02 Mar '22
02 Mar '22
Module: wine Branch: master Commit: 45eb5d090907575a3639f3bd540f645e1773df3e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=45eb5d090907575a3639f3bd…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Mar 2 14:03:01 2022 +0100 windows.gaming.input: Introduce helpers to define IInspectable interface boilerplate. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.gaming.input/controller.c | 41 +--------------------------------- dlls/windows.gaming.input/gamepad.c | 41 +--------------------------------- dlls/windows.gaming.input/private.h | 36 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 80 deletions(-) diff --git a/dlls/windows.gaming.input/controller.c b/dlls/windows.gaming.input/controller.c index 00ab9c5d91c..654d0795eac 100644 --- a/dlls/windows.gaming.input/controller.c +++ b/dlls/windows.gaming.input/controller.c @@ -35,11 +35,6 @@ static inline struct controller_statics *impl_from_IActivationFactory( IActivati return CONTAINING_RECORD( iface, struct controller_statics, IActivationFactory_iface ); } -static inline struct controller_statics *impl_from_IRawGameControllerStatics( IRawGameControllerStatics *iface ) -{ - return CONTAINING_RECORD( iface, struct controller_statics, IRawGameControllerStatics_iface ); -} - static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID iid, void **out ) { struct controller_statics *impl = impl_from_IActivationFactory( iface ); @@ -121,41 +116,7 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, }; -static HRESULT WINAPI statics_QueryInterface( IRawGameControllerStatics *iface, REFIID iid, void **out ) -{ - struct controller_statics *impl = impl_from_IRawGameControllerStatics( iface ); - return IActivationFactory_QueryInterface( &impl->IActivationFactory_iface, iid, out ); -} - -static ULONG WINAPI statics_AddRef( IRawGameControllerStatics *iface ) -{ - struct controller_statics *impl = impl_from_IRawGameControllerStatics( iface ); - return IActivationFactory_AddRef( &impl->IActivationFactory_iface ); -} - -static ULONG WINAPI statics_Release( IRawGameControllerStatics *iface ) -{ - struct controller_statics *impl = impl_from_IRawGameControllerStatics( iface ); - return IActivationFactory_Release( &impl->IActivationFactory_iface ); -} - -static HRESULT WINAPI statics_GetIids( IRawGameControllerStatics *iface, ULONG *iid_count, IID **iids ) -{ - struct controller_statics *impl = impl_from_IRawGameControllerStatics( iface ); - return IActivationFactory_Release( &impl->IActivationFactory_iface ); -} - -static HRESULT WINAPI statics_GetRuntimeClassName( IRawGameControllerStatics *iface, HSTRING *class_name ) -{ - struct controller_statics *impl = impl_from_IRawGameControllerStatics( iface ); - return IActivationFactory_Release( &impl->IActivationFactory_iface ); -} - -static HRESULT WINAPI statics_GetTrustLevel( IRawGameControllerStatics *iface, TrustLevel *trust_level ) -{ - struct controller_statics *impl = impl_from_IRawGameControllerStatics( iface ); - return IActivationFactory_Release( &impl->IActivationFactory_iface ); -} +DEFINE_IINSPECTABLE( statics, IRawGameControllerStatics, struct controller_statics, IActivationFactory_iface ) static HRESULT WINAPI statics_add_RawGameControllerAdded( IRawGameControllerStatics *iface, IEventHandler_RawGameController *value, EventRegistrationToken *token ) diff --git a/dlls/windows.gaming.input/gamepad.c b/dlls/windows.gaming.input/gamepad.c index e69568e2fb1..231e923b5e8 100644 --- a/dlls/windows.gaming.input/gamepad.c +++ b/dlls/windows.gaming.input/gamepad.c @@ -35,11 +35,6 @@ static inline struct gamepad_statics *impl_from_IActivationFactory( IActivationF return CONTAINING_RECORD( iface, struct gamepad_statics, IActivationFactory_iface ); } -static inline struct gamepad_statics *impl_from_IGamepadStatics( IGamepadStatics *iface ) -{ - return CONTAINING_RECORD( iface, struct gamepad_statics, IGamepadStatics_iface ); -} - static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID iid, void **out ) { struct gamepad_statics *impl = impl_from_IActivationFactory( iface ); @@ -121,41 +116,7 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, }; -static HRESULT WINAPI statics_QueryInterface( IGamepadStatics *iface, REFIID iid, void **out ) -{ - struct gamepad_statics *impl = impl_from_IGamepadStatics( iface ); - return IActivationFactory_QueryInterface( &impl->IActivationFactory_iface, iid, out ); -} - -static ULONG WINAPI statics_AddRef( IGamepadStatics *iface ) -{ - struct gamepad_statics *impl = impl_from_IGamepadStatics( iface ); - return IActivationFactory_AddRef( &impl->IActivationFactory_iface ); -} - -static ULONG WINAPI statics_Release( IGamepadStatics *iface ) -{ - struct gamepad_statics *impl = impl_from_IGamepadStatics( iface ); - return IActivationFactory_Release( &impl->IActivationFactory_iface ); -} - -static HRESULT WINAPI statics_GetIids( IGamepadStatics *iface, ULONG *iid_count, IID **iids ) -{ - struct gamepad_statics *impl = impl_from_IGamepadStatics( iface ); - return IActivationFactory_Release( &impl->IActivationFactory_iface ); -} - -static HRESULT WINAPI statics_GetRuntimeClassName( IGamepadStatics *iface, HSTRING *class_name ) -{ - struct gamepad_statics *impl = impl_from_IGamepadStatics( iface ); - return IActivationFactory_Release( &impl->IActivationFactory_iface ); -} - -static HRESULT WINAPI statics_GetTrustLevel( IGamepadStatics *iface, TrustLevel *trust_level ) -{ - struct gamepad_statics *impl = impl_from_IGamepadStatics( iface ); - return IActivationFactory_Release( &impl->IActivationFactory_iface ); -} +DEFINE_IINSPECTABLE( statics, IGamepadStatics, struct gamepad_statics, IActivationFactory_iface ) static HRESULT WINAPI statics_add_GamepadAdded( IGamepadStatics *iface, IEventHandler_Gamepad *value, EventRegistrationToken *token ) diff --git a/dlls/windows.gaming.input/private.h b/dlls/windows.gaming.input/private.h index 612d11135f4..d36f88d58e4 100644 --- a/dlls/windows.gaming.input/private.h +++ b/dlls/windows.gaming.input/private.h @@ -38,3 +38,39 @@ extern IActivationFactory *controller_factory; extern IActivationFactory *gamepad_factory; extern HRESULT vector_create( REFIID iid, REFIID view_iid, void **out ); + +#define DEFINE_IINSPECTABLE( pfx, iface_type, impl_type, base_iface ) \ + static inline impl_type *impl_from_##iface_type( iface_type *iface ) \ + { \ + return CONTAINING_RECORD( iface, impl_type, iface_type##_iface ); \ + } \ + static HRESULT WINAPI pfx##_QueryInterface( iface_type *iface, REFIID iid, void **out ) \ + { \ + impl_type *impl = impl_from_##iface_type( iface ); \ + return IInspectable_QueryInterface( (IInspectable *)&impl->base_iface, iid, out ); \ + } \ + static ULONG WINAPI pfx##_AddRef( iface_type *iface ) \ + { \ + impl_type *impl = impl_from_##iface_type( iface ); \ + return IInspectable_AddRef( (IInspectable *)&impl->base_iface ); \ + } \ + static ULONG WINAPI pfx##_Release( iface_type *iface ) \ + { \ + impl_type *impl = impl_from_##iface_type( iface ); \ + return IInspectable_Release( (IInspectable *)&impl->base_iface ); \ + } \ + static HRESULT WINAPI pfx##_GetIids( iface_type *iface, ULONG *iid_count, IID **iids ) \ + { \ + impl_type *impl = impl_from_##iface_type( iface ); \ + return IInspectable_GetIids( (IInspectable *)&impl->base_iface, iid_count, iids ); \ + } \ + static HRESULT WINAPI pfx##_GetRuntimeClassName( iface_type *iface, HSTRING *class_name ) \ + { \ + impl_type *impl = impl_from_##iface_type( iface ); \ + return IInspectable_GetRuntimeClassName( (IInspectable *)&impl->base_iface, class_name ); \ + } \ + static HRESULT WINAPI pfx##_GetTrustLevel( iface_type *iface, TrustLevel *trust_level ) \ + { \ + impl_type *impl = impl_from_##iface_type( iface ); \ + return IInspectable_GetTrustLevel( (IInspectable *)&impl->base_iface, trust_level ); \ + }
1
0
0
0
Paul Gofman : win32u: Move wine_get_wgl_driver() from DC driver.
by Alexandre Julliard
02 Mar '22
02 Mar '22
Module: wine Branch: master Commit: e53b68acec63eee0c7b8558c211aa2a27d51892d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e53b68acec63eee0c7b8558c…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Mar 1 23:59:23 2022 +0300 win32u: Move wine_get_wgl_driver() from DC driver. To get rid of get_dc_ptr() and thus not to fail concurrent __wine_get_wgl_driver(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/driver.c | 4 +++- dlls/win32u/dc.c | 33 +++++++++++++++++++++++++++++++++ dlls/win32u/dibdrv/dc.c | 18 ++---------------- dlls/win32u/driver.c | 31 ++++++++----------------------- dlls/win32u/emfdrv.c | 1 - dlls/win32u/font.c | 1 - dlls/win32u/ntgdi_private.h | 2 ++ dlls/win32u/path.c | 1 - dlls/wineandroid.drv/init.c | 13 +++---------- dlls/winemac.drv/gdi.c | 2 +- dlls/winemac.drv/macdrv.h | 2 +- dlls/winemac.drv/opengl.c | 2 +- dlls/wineps.drv/init.c | 1 - dlls/winex11.drv/init.c | 13 +++---------- dlls/winex11.drv/xrender.c | 1 - include/wine/gdi_driver.h | 5 +++-- 16 files changed, 60 insertions(+), 70 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=e53b68acec63eee0c7b8…
1
0
0
0
Hugh McMaster : conhost: Don't compare the console config if the user cancels the dialog.
by Alexandre Julliard
02 Mar '22
02 Mar '22
Module: wine Branch: master Commit: dfb7428f20086d96bd43210593af11ec1dc196ef URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dfb7428f20086d96bd432105…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Wed Mar 2 23:54:19 2022 +1100 conhost: Don't compare the console config if the user cancels the dialog. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/conhost/window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/programs/conhost/window.c b/programs/conhost/window.c index 33ffb3915ed..abfc791c1ef 100644 --- a/programs/conhost/window.c +++ b/programs/conhost/window.c @@ -2036,7 +2036,8 @@ static BOOL config_dialog( struct console *console, BOOL current ) header.hwndParent = console->win; header.u3.phpage = pages; header.dwFlags = PSH_NOAPPLYNOW; - PropertySheetW( &header ); + if (PropertySheetW( &header ) < 1) + return TRUE; if (!memcmp( &prev_config, &di.config, sizeof(prev_config) )) return TRUE;
1
0
0
0
Paul Gofman : win32u: Set BAD_EDID registry value for empty EDID.
by Alexandre Julliard
02 Mar '22
02 Mar '22
Module: wine Branch: master Commit: 7a49ff107e2fd28d366099133eeac153da4115f7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7a49ff107e2fd28d36609913…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Mar 2 19:02:43 2022 +0300 win32u: Set BAD_EDID registry value for empty EDID. Fixes a regression introduced by commit 548bc54bf396d74b5b928bf9be835272ddda1886. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/sysparams.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index cd4ff91255e..b981faef335 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1120,8 +1120,13 @@ static void add_monitor( const struct gdi_monitor *monitor, void *param ) if ((subkey = reg_create_key( hkey, device_parametersW, sizeof(device_parametersW), 0, NULL ))) { + static const WCHAR bad_edidW[] = {'B','A','D','_','E','D','I','D',0}; static const WCHAR edidW[] = {'E','D','I','D',0}; - set_reg_value( subkey, edidW, REG_BINARY, monitor->edid, monitor->edid_len ); + + if (monitor->edid_len) + set_reg_value( subkey, edidW, REG_BINARY, monitor->edid, monitor->edid_len ); + else + set_reg_value( subkey, bad_edidW, REG_BINARY, NULL, 0 ); NtClose( subkey ); } @@ -1327,7 +1332,6 @@ static BOOL update_display_cache(void) ERR( "failed to read display config\n" ); return FALSE; } - return TRUE; }
1
0
0
0
Paul Gofman : winhttp: Return default value for WINHTTP_OPTION_WORKER_THREAD_COUNT.
by Alexandre Julliard
02 Mar '22
02 Mar '22
Module: wine Branch: master Commit: 2934ce5cd467ee12f2ed7235f1de445a268e9f63 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2934ce5cd467ee12f2ed7235…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Mar 2 18:28:21 2022 +0300 winhttp: Return default value for WINHTTP_OPTION_WORKER_THREAD_COUNT. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/session.c | 9 +++++++++ dlls/winhttp/tests/winhttp.c | 27 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 971c51ada4f..7c55adb8475 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -1224,6 +1224,15 @@ static BOOL query_option( struct object_header *hdr, DWORD option, void *buffer, switch (option) { + case WINHTTP_OPTION_WORKER_THREAD_COUNT: + { + FIXME( "WINHTTP_OPTION_WORKER_THREAD_COUNT semi-stub.\n" ); + if (!validate_buffer( buffer, buflen, sizeof(DWORD) )) return FALSE; + + *(DWORD *)buffer = 0; + *buflen = sizeof(DWORD); + return TRUE; + } case WINHTTP_OPTION_CONTEXT_VALUE: { if (!validate_buffer( buffer, buflen, sizeof(DWORD_PTR) )) return FALSE; diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 35f6bc5cf26..9dc8ece3069 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -94,6 +94,15 @@ static void test_WinHttpQueryOption(void) ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError() ); ok( size == 4, "expected 4, got %lu\n", size ); + feature = 0xdeadbeef; + size = sizeof(feature) + 1; + SetLastError(0xdeadbeef); + ret = WinHttpQueryOption(session, WINHTTP_OPTION_WORKER_THREAD_COUNT, &feature, &size); + ok(ret, "failed to query option %lu\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "got %lu\n", GetLastError()); + ok(size == sizeof(feature), "WinHttpQueryOption should set the size: %lu\n", size); + ok(feature == 0, "got unexpected WINHTTP_OPTION_WORKER_THREAD_COUNT %#lx\n", feature); + feature = 0xdeadbeef; size = sizeof(feature) + 1; SetLastError(0xdeadbeef); @@ -165,6 +174,24 @@ static void test_WinHttpQueryOption(void) goto done; } + feature = 0xdeadbeef; + size = sizeof(feature); + SetLastError(0xdeadbeef); + ret = WinHttpQueryOption(connection, WINHTTP_OPTION_WORKER_THREAD_COUNT, &feature, &size); + ok(ret, "query WINHTTP_OPTION_WORKER_THREAD_COUNT failed for a request\n"); + ok(GetLastError() == ERROR_SUCCESS, "got unexpected error %lu\n", GetLastError()); + ok(size == sizeof(feature), "WinHttpQueryOption should set the size: %lu\n", size); + ok(feature == 0, "got unexpected WINHTTP_OPTION_WORKER_THREAD_COUNT %#lx\n", feature); + + feature = 0xdeadbeef; + size = sizeof(feature); + SetLastError(0xdeadbeef); + ret = WinHttpQueryOption(request, WINHTTP_OPTION_WORKER_THREAD_COUNT, &feature, &size); + ok(ret, "query WINHTTP_OPTION_WORKER_THREAD_COUNT failed for a request\n"); + ok(GetLastError() == ERROR_SUCCESS, "got unexpected error %lu\n", GetLastError()); + ok(size == sizeof(feature), "WinHttpQueryOption should set the size: %lu\n", size); + ok(feature == 0, "got unexpected WINHTTP_OPTION_WORKER_THREAD_COUNT %#lx\n", feature); + feature = 0xdeadbeef; size = sizeof(feature); SetLastError(0xdeadbeef);
1
0
0
0
Jacek Caban : win32u: Move accelerators object implementation from user32.
by Alexandre Julliard
02 Mar '22
02 Mar '22
Module: wine Branch: master Commit: 9759ed143a12e61349de156b54d9f7a9b9155714 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9759ed143a12e61349de156b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 2 15:06:33 2022 +0100 win32u: Move accelerators object implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/menu.c | 4 +- dlls/user32/resource.c | 95 ++------------------------------------ dlls/user32/user32.spec | 6 +-- dlls/win32u/Makefile.in | 1 + dlls/win32u/menu.c | 107 +++++++++++++++++++++++++++++++++++++++++++ dlls/win32u/ntgdi_private.h | 1 - dlls/win32u/syscall.c | 3 ++ dlls/win32u/win32u.spec | 6 +-- dlls/win32u/win32u_private.h | 1 + dlls/wow64win/syscall.h | 3 ++ dlls/wow64win/user.c | 24 ++++++++++ include/ntuser.h | 3 ++ 12 files changed, 154 insertions(+), 100 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=9759ed143a12e61349de…
1
0
0
0
Jacek Caban : user32: Use CreateAcceleratorTableW in CreateAcceleratorTableA.
by Alexandre Julliard
02 Mar '22
02 Mar '22
Module: wine Branch: master Commit: e58b561ced05410f638927540544fbe84b47906e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e58b561ced05410f63892754…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 2 15:06:17 2022 +0100 user32: Use CreateAcceleratorTableW in CreateAcceleratorTableA. Instead of accessing accelerators object directly. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/resource.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/dlls/user32/resource.c b/dlls/user32/resource.c index ce64833e413..7c15e1905a5 100644 --- a/dlls/user32/resource.c +++ b/dlls/user32/resource.c @@ -152,10 +152,10 @@ INT WINAPI CopyAcceleratorTableW(HACCEL src, LPACCEL dst, INT count) /********************************************************************* * CreateAcceleratorTableA (USER32.@) */ -HACCEL WINAPI CreateAcceleratorTableA(LPACCEL lpaccel, INT count) +HACCEL WINAPI CreateAcceleratorTableA( ACCEL *accel, INT count ) { - struct accelerator *accel; HACCEL handle; + ACCEL *table; int i; if (count < 1) @@ -163,22 +163,21 @@ HACCEL WINAPI CreateAcceleratorTableA(LPACCEL lpaccel, INT count) SetLastError( ERROR_INVALID_PARAMETER ); return 0; } - accel = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( struct accelerator, table[count] )); - if (!accel) return 0; - accel->count = count; + table = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*table) ); + if (!table) return 0; for (i = 0; i < count; i++) { - accel->table[i].fVirt = lpaccel[i].fVirt; - accel->table[i].cmd = lpaccel[i].cmd; - if (!(lpaccel[i].fVirt & FVIRTKEY)) + table[i].fVirt = accel[i].fVirt; + table[i].cmd = accel[i].cmd; + if (!(accel[i].fVirt & FVIRTKEY)) { - char ch = lpaccel[i].key; - MultiByteToWideChar( CP_ACP, 0, &ch, 1, &accel->table[i].key, 1 ); + char ch = accel[i].key; + MultiByteToWideChar( CP_ACP, 0, &ch, 1, &table[i].key, 1 ); } - else accel->table[i].key = lpaccel[i].key; + else table[i].key = accel[i].key; } - if (!(handle = alloc_user_handle( &accel->obj, NTUSER_OBJ_ACCEL ))) - HeapFree( GetProcessHeap(), 0, accel ); + handle = CreateAcceleratorTableW( table, count ); + HeapFree( GetProcessHeap(), 0, table ); TRACE_(accel)("returning %p\n", handle ); return handle; }
1
0
0
0
← Newer
1
...
99
100
101
102
103
104
105
...
114
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
Results per page:
10
25
50
100
200