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
October 2023
----- 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
702 discussions
Start a n
N
ew thread
Mohamad Al-Jaf : windows.storage.applicationdata: Implement IApplicationDataStatics::get_Current().
by Alexandre Julliard
02 Oct '23
02 Oct '23
Module: wine Branch: master Commit: ab9e29b0a7b11bf9d52b11015fb383497089f909 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ab9e29b0a7b11bf9d52b11015fb383…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Sat Aug 5 20:17:52 2023 -0400 windows.storage.applicationdata: Implement IApplicationDataStatics::get_Current(). Needed for Minecraft Windows 10. --- dlls/windows.applicationmodel/tests/application.c | 9 +- .../applicationdata.c | 189 ++++++++++++++++++++- dlls/windows.storage.applicationdata/tests/data.c | 2 +- 3 files changed, 193 insertions(+), 7 deletions(-) diff --git a/dlls/windows.applicationmodel/tests/application.c b/dlls/windows.applicationmodel/tests/application.c index 5dcd5a19121..ee357ecb264 100644 --- a/dlls/windows.applicationmodel/tests/application.c +++ b/dlls/windows.applicationmodel/tests/application.c @@ -85,12 +85,13 @@ static void test_ApplicationDataStatics(void) ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = IApplicationDataStatics_get_Current( application_data_statics, NULL ); - todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); hr = IApplicationDataStatics_get_Current( application_data_statics, &application_data ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); - todo_wine ok( application_data != NULL, "got NULL application_data %p.\n", application_data ); - if (application_data) IApplicationData_Release( application_data ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( application_data != NULL, "got NULL application_data %p.\n", application_data ); + ref = IApplicationData_Release( application_data ); + ok( ref == 1, "got ref %ld.\n", ref ); ref = IApplicationDataStatics_Release( application_data_statics ); ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory ); diff --git a/dlls/windows.storage.applicationdata/applicationdata.c b/dlls/windows.storage.applicationdata/applicationdata.c index 6296253eee1..dbe42b3a8d6 100644 --- a/dlls/windows.storage.applicationdata/applicationdata.c +++ b/dlls/windows.storage.applicationdata/applicationdata.c @@ -115,14 +115,199 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, }; -DEFINE_IINSPECTABLE( application_data_statics, IApplicationDataStatics, struct application_data_statics, IActivationFactory_iface ) +struct application_data +{ + IApplicationData IApplicationData_iface; + LONG ref; +}; -static HRESULT WINAPI application_data_statics_get_Current( IApplicationDataStatics *iface, IApplicationData **value ) +static inline struct application_data *impl_from_IApplicationData( IApplicationData *iface ) +{ + return CONTAINING_RECORD( iface, struct application_data, IApplicationData_iface ); +} + +static HRESULT WINAPI application_data_QueryInterface( IApplicationData *iface, REFIID iid, void **out ) +{ + struct application_data *impl = impl_from_IApplicationData( 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_IApplicationData )) + { + *out = &impl->IApplicationData_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI application_data_AddRef( IApplicationData *iface ) +{ + struct application_data *impl = impl_from_IApplicationData( iface ); + ULONG ref = InterlockedIncrement( &impl->ref ); + TRACE( "iface %p increasing refcount to %lu.\n", iface, ref ); + return ref; +} + +static ULONG WINAPI application_data_Release( IApplicationData *iface ) +{ + struct application_data *impl = impl_from_IApplicationData( iface ); + ULONG ref = InterlockedDecrement( &impl->ref ); + + TRACE( "iface %p decreasing refcount to %lu.\n", iface, ref ); + + if (!ref) free( impl ); + return ref; +} + +static HRESULT WINAPI application_data_GetIids( IApplicationData *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 application_data_GetRuntimeClassName( IApplicationData *iface, HSTRING *class_name ) +{ + FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_GetTrustLevel( IApplicationData *iface, TrustLevel *trust_level ) +{ + FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_get_Version( IApplicationData *iface, UINT32 *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_SetVersionAsync( IApplicationData *iface, UINT32 version, IApplicationDataSetVersionHandler *handler, + IAsyncAction **operation ) +{ + FIXME( "iface %p, version %d, handler %p, operation %p stub!\n", iface, version, handler, operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_ClearAllAsync( IApplicationData *iface, IAsyncAction **operation ) +{ + FIXME( "iface %p, operation %p stub!\n", iface, operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_ClearAsync( IApplicationData *iface, ApplicationDataLocality locality, IAsyncAction **operation ) +{ + FIXME( "iface %p, %d locality, operation %p stub!\n", iface, locality, operation ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_get_LocalSettings( IApplicationData *iface, IApplicationDataContainer **value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_get_RoamingSettings( IApplicationData *iface, IApplicationDataContainer **value ) { FIXME( "iface %p, value %p stub!\n", iface, value ); return E_NOTIMPL; } +static HRESULT WINAPI application_data_get_LocalFolder( IApplicationData *iface, IStorageFolder **value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_get_RoamingFolder( IApplicationData *iface, IStorageFolder **value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_get_TemporaryFolder( IApplicationData *iface, IStorageFolder **value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_add_DataChanged( IApplicationData *iface, ITypedEventHandler_ApplicationData_IInspectable *handler, + EventRegistrationToken *token ) +{ + FIXME( "iface %p, handler %p, token %p stub!\n", iface, handler, token ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_remove_DataChanged( IApplicationData *iface, EventRegistrationToken token ) +{ + FIXME( "iface %p, token %#I64x stub!\n", iface, token.value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_SignalDataChanged( IApplicationData *iface ) +{ + FIXME( "iface %p stub!\n", iface ); + return E_NOTIMPL; +} + +static HRESULT WINAPI application_data_get_RoamingStorageQuota( IApplicationData *iface, UINT64 *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static const struct IApplicationDataVtbl application_data_vtbl = +{ + application_data_QueryInterface, + application_data_AddRef, + application_data_Release, + /* IInspectable methods */ + application_data_GetIids, + application_data_GetRuntimeClassName, + application_data_GetTrustLevel, + /* IApplicationData methods */ + application_data_get_Version, + application_data_SetVersionAsync, + application_data_ClearAllAsync, + application_data_ClearAsync, + application_data_get_LocalSettings, + application_data_get_RoamingSettings, + application_data_get_LocalFolder, + application_data_get_RoamingFolder, + application_data_get_TemporaryFolder, + application_data_add_DataChanged, + application_data_remove_DataChanged, + application_data_SignalDataChanged, + application_data_get_RoamingStorageQuota, +}; + +DEFINE_IINSPECTABLE( application_data_statics, IApplicationDataStatics, struct application_data_statics, IActivationFactory_iface ) + +static HRESULT WINAPI application_data_statics_get_Current( IApplicationDataStatics *iface, IApplicationData **value ) +{ + struct application_data *impl; + + TRACE( "iface %p, value %p\n", iface, value ); + + if (!value) return E_INVALIDARG; + if (!(impl = calloc( 1, sizeof(*impl) ))) return E_OUTOFMEMORY; + + impl->IApplicationData_iface.lpVtbl = &application_data_vtbl; + impl->ref = 1; + + *value = &impl->IApplicationData_iface; + TRACE( "created IApplicationData %p.\n", *value ); + return S_OK; +} + static const struct IApplicationDataStaticsVtbl application_data_statics_vtbl = { application_data_statics_QueryInterface, diff --git a/dlls/windows.storage.applicationdata/tests/data.c b/dlls/windows.storage.applicationdata/tests/data.c index 2dd832b2f15..18145a4b14d 100644 --- a/dlls/windows.storage.applicationdata/tests/data.c +++ b/dlls/windows.storage.applicationdata/tests/data.c @@ -75,7 +75,7 @@ static void test_ApplicationDataStatics(void) ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = IApplicationDataStatics_get_Current( application_data_statics, NULL ); - todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); hr = IApplicationDataStatics_get_Current( application_data_statics, &application_data ); todo_wine ok( hr == 0x80073d54, "got hr %#lx.\n", hr ); todo_wine ok( !application_data, "got application_data %p.\n", application_data );
1
0
0
0
Mohamad Al-Jaf : windows.storage.applicationdata/tests: Add IApplicationDataStatics::get_Current() tests.
by Alexandre Julliard
02 Oct '23
02 Oct '23
Module: wine Branch: master Commit: c4d5e8ded56128f00d5586e7a2211b509837541b URL:
https://gitlab.winehq.org/wine/wine/-/commit/c4d5e8ded56128f00d5586e7a2211b…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Sat Aug 5 20:16:59 2023 -0400 windows.storage.applicationdata/tests: Add IApplicationDataStatics::get_Current() tests. --- dlls/windows.applicationmodel/tests/application.c | 43 +++++++++++++++++++++++ dlls/windows.applicationmodel/tests/model.c | 1 + dlls/windows.storage.applicationdata/tests/data.c | 8 +++++ 3 files changed, 52 insertions(+) diff --git a/dlls/windows.applicationmodel/tests/application.c b/dlls/windows.applicationmodel/tests/application.c index 68abcc14450..5dcd5a19121 100644 --- a/dlls/windows.applicationmodel/tests/application.c +++ b/dlls/windows.applicationmodel/tests/application.c @@ -55,6 +55,48 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid ) IUnknown_Release( unk ); } +static void test_ApplicationDataStatics(void) +{ + static const WCHAR *application_data_statics_name = L"Windows.Storage.ApplicationData"; + IApplicationDataStatics *application_data_statics; + IApplicationData *application_data; + IActivationFactory *factory; + HSTRING str; + HRESULT hr; + LONG ref; + + hr = WindowsCreateString( application_data_statics_name, wcslen( application_data_statics_name ), &str ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + hr = RoGetActivationFactory( str, &IID_IActivationFactory, (void **)&factory ); + WindowsDeleteString( str ); + ok( hr == S_OK || broken( hr == REGDB_E_CLASSNOTREG ), "got hr %#lx.\n", hr ); + if (hr == REGDB_E_CLASSNOTREG) + { + win_skip( "%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w( application_data_statics_name ) ); + return; + } + + check_interface( factory, &IID_IUnknown ); + check_interface( factory, &IID_IInspectable ); + check_interface( factory, &IID_IAgileObject ); + + hr = IActivationFactory_QueryInterface( factory, &IID_IApplicationDataStatics, (void **)&application_data_statics ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + hr = IApplicationDataStatics_get_Current( application_data_statics, NULL ); + todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + hr = IApplicationDataStatics_get_Current( application_data_statics, &application_data ); + todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + todo_wine ok( application_data != NULL, "got NULL application_data %p.\n", application_data ); + if (application_data) IApplicationData_Release( application_data ); + + ref = IApplicationDataStatics_Release( application_data_statics ); + ok( ref == 2, "got ref %ld.\n", ref ); + ref = IActivationFactory_Release( factory ); + ok( ref == 1, "got ref %ld.\n", ref ); +} + static void test_PackageStatics(void) { static const WCHAR *package_statics_name = L"Windows.ApplicationModel.Package"; @@ -143,6 +185,7 @@ int main( int argc, char const *argv[] ) hr = RoInitialize( RO_INIT_MULTITHREADED ); ok( hr == S_OK, "RoInitialize failed, hr %#lx\n", hr ); + test_ApplicationDataStatics(); test_PackageStatics(); RoUninitialize(); diff --git a/dlls/windows.applicationmodel/tests/model.c b/dlls/windows.applicationmodel/tests/model.c index b603e4c551e..0bd5050432b 100644 --- a/dlls/windows.applicationmodel/tests/model.c +++ b/dlls/windows.applicationmodel/tests/model.c @@ -571,6 +571,7 @@ static void test_PackageStatics(void) hr = IPackageStatics_get_Current( package_statics, &package ); todo_wine ok( hr == 0x80073d54, "got hr %#lx.\n", hr ); todo_wine ok( !package, "got package %p.\n", package ); + if (package) IPackage_Release( package ); ref = IPackageStatics_Release( package_statics ); ok( ref == 2, "got ref %ld.\n", ref ); diff --git a/dlls/windows.storage.applicationdata/tests/data.c b/dlls/windows.storage.applicationdata/tests/data.c index 4365671e63d..2dd832b2f15 100644 --- a/dlls/windows.storage.applicationdata/tests/data.c +++ b/dlls/windows.storage.applicationdata/tests/data.c @@ -49,6 +49,7 @@ static void test_ApplicationDataStatics(void) { static const WCHAR *application_data_statics_name = L"Windows.Storage.ApplicationData"; IApplicationDataStatics *application_data_statics; + IApplicationData *application_data = NULL; IActivationFactory *factory; HSTRING str; HRESULT hr; @@ -73,6 +74,13 @@ static void test_ApplicationDataStatics(void) hr = IActivationFactory_QueryInterface( factory, &IID_IApplicationDataStatics, (void **)&application_data_statics ); ok( hr == S_OK, "got hr %#lx.\n", hr ); + hr = IApplicationDataStatics_get_Current( application_data_statics, NULL ); + todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + hr = IApplicationDataStatics_get_Current( application_data_statics, &application_data ); + todo_wine ok( hr == 0x80073d54, "got hr %#lx.\n", hr ); + todo_wine ok( !application_data, "got application_data %p.\n", application_data ); + if (application_data) IApplicationData_Release( application_data ); + ref = IApplicationDataStatics_Release( application_data_statics ); ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory );
1
0
0
0
Mohamad Al-Jaf : windows.storage.applicationdata: Add IApplicationDataStatics stub interface.
by Alexandre Julliard
02 Oct '23
02 Oct '23
Module: wine Branch: master Commit: f36a84d7728f99a1d7c002864dc3476c52d2ca84 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f36a84d7728f99a1d7c002864dc347…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Sat Aug 5 19:47:50 2023 -0400 windows.storage.applicationdata: Add IApplicationDataStatics stub interface. --- .../applicationdata.c | 30 +++++++++++++++++ dlls/windows.storage.applicationdata/private.h | 38 ++++++++++++++++++++++ dlls/windows.storage.applicationdata/tests/data.c | 6 ++++ 3 files changed, 74 insertions(+) diff --git a/dlls/windows.storage.applicationdata/applicationdata.c b/dlls/windows.storage.applicationdata/applicationdata.c index 3c70a63e94b..6296253eee1 100644 --- a/dlls/windows.storage.applicationdata/applicationdata.c +++ b/dlls/windows.storage.applicationdata/applicationdata.c @@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(data); struct application_data_statics { IActivationFactory IActivationFactory_iface; + IApplicationDataStatics IApplicationDataStatics_iface; LONG ref; }; @@ -49,6 +50,13 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID return S_OK; } + if (IsEqualGUID( iid, &IID_IApplicationDataStatics )) + { + *out = &impl->IApplicationDataStatics_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -107,9 +115,31 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, }; +DEFINE_IINSPECTABLE( application_data_statics, IApplicationDataStatics, struct application_data_statics, IActivationFactory_iface ) + +static HRESULT WINAPI application_data_statics_get_Current( IApplicationDataStatics *iface, IApplicationData **value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static const struct IApplicationDataStaticsVtbl application_data_statics_vtbl = +{ + application_data_statics_QueryInterface, + application_data_statics_AddRef, + application_data_statics_Release, + /* IInspectable methods */ + application_data_statics_GetIids, + application_data_statics_GetRuntimeClassName, + application_data_statics_GetTrustLevel, + /* IApplicationDataStatics methods */ + application_data_statics_get_Current, +}; + static struct application_data_statics application_data_statics = { {&factory_vtbl}, + {&application_data_statics_vtbl}, 1, }; diff --git a/dlls/windows.storage.applicationdata/private.h b/dlls/windows.storage.applicationdata/private.h index 1bfaf012b85..6eebc9b25be 100644 --- a/dlls/windows.storage.applicationdata/private.h +++ b/dlls/windows.storage.applicationdata/private.h @@ -37,4 +37,42 @@ extern IActivationFactory *application_data_factory; +#define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \ + static inline impl_type *impl_from( iface_type *iface ) \ + { \ + return CONTAINING_RECORD( iface, impl_type, iface_mem ); \ + } \ + static HRESULT WINAPI pfx##_QueryInterface( iface_type *iface, REFIID iid, void **out ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_QueryInterface( (IInspectable *)(expr), iid, out ); \ + } \ + static ULONG WINAPI pfx##_AddRef( iface_type *iface ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_AddRef( (IInspectable *)(expr) ); \ + } \ + static ULONG WINAPI pfx##_Release( iface_type *iface ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_Release( (IInspectable *)(expr) ); \ + } \ + static HRESULT WINAPI pfx##_GetIids( iface_type *iface, ULONG *iid_count, IID **iids ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_GetIids( (IInspectable *)(expr), iid_count, iids ); \ + } \ + static HRESULT WINAPI pfx##_GetRuntimeClassName( iface_type *iface, HSTRING *class_name ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_GetRuntimeClassName( (IInspectable *)(expr), class_name ); \ + } \ + static HRESULT WINAPI pfx##_GetTrustLevel( iface_type *iface, TrustLevel *trust_level ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_GetTrustLevel( (IInspectable *)(expr), trust_level ); \ + } +#define DEFINE_IINSPECTABLE( pfx, iface_type, impl_type, base_iface ) \ + DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, &impl->base_iface ) + #endif diff --git a/dlls/windows.storage.applicationdata/tests/data.c b/dlls/windows.storage.applicationdata/tests/data.c index 1e2a5383358..4365671e63d 100644 --- a/dlls/windows.storage.applicationdata/tests/data.c +++ b/dlls/windows.storage.applicationdata/tests/data.c @@ -48,6 +48,7 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid ) static void test_ApplicationDataStatics(void) { static const WCHAR *application_data_statics_name = L"Windows.Storage.ApplicationData"; + IApplicationDataStatics *application_data_statics; IActivationFactory *factory; HSTRING str; HRESULT hr; @@ -69,6 +70,11 @@ static void test_ApplicationDataStatics(void) check_interface( factory, &IID_IInspectable ); check_interface( factory, &IID_IAgileObject ); + hr = IActivationFactory_QueryInterface( factory, &IID_IApplicationDataStatics, (void **)&application_data_statics ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + ref = IApplicationDataStatics_Release( application_data_statics ); + ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory ); ok( ref == 1, "got ref %ld.\n", ref ); }
1
0
0
0
Mohamad Al-Jaf : windows.storage.applicationdata: Add stub DLL.
by Alexandre Julliard
02 Oct '23
02 Oct '23
Module: wine Branch: master Commit: 2f3aa0e2f6dce9b9b9223e87268819f14410a9da URL:
https://gitlab.winehq.org/wine/wine/-/commit/2f3aa0e2f6dce9b9b9223e87268819…
Author: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Date: Thu Jul 27 22:38:39 2023 -0400 windows.storage.applicationdata: Add stub DLL. --- configure | 3 + configure.ac | 2 + dlls/windows.storage.applicationdata/Makefile.in | 9 ++ .../applicationdata.c | 116 +++++++++++++++++++++ dlls/windows.storage.applicationdata/classes.idl | 23 ++++ dlls/windows.storage.applicationdata/main.c | 46 ++++++++ dlls/windows.storage.applicationdata/private.h | 40 +++++++ .../tests/Makefile.in | 5 + dlls/windows.storage.applicationdata/tests/data.c | 86 +++++++++++++++ .../windows.storage.applicationdata.spec | 4 + 10 files changed, 334 insertions(+)
1
0
0
0
Connor McAdams : uiautomationcore: Add support for raising events passed to our IProxyProviderWinEventSink interface.
by Alexandre Julliard
02 Oct '23
02 Oct '23
Module: wine Branch: master Commit: 60ff77754a4bf6326747f990c998c7c88fffda08 URL:
https://gitlab.winehq.org/wine/wine/-/commit/60ff77754a4bf6326747f990c998c7…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Wed Sep 27 14:17:46 2023 -0400 uiautomationcore: Add support for raising events passed to our IProxyProviderWinEventSink interface. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 33 ++++------- dlls/uiautomationcore/uia_event.c | 91 +++++++++++++++++++++++++----- 2 files changed, 90 insertions(+), 34 deletions(-)
1
0
0
0
Connor McAdams : uiautomationcore: Pass WinEvent data to IProxyProviderWinEventHandler::RespondToWinEvent.
by Alexandre Julliard
02 Oct '23
02 Oct '23
Module: wine Branch: master Commit: 7aaf77a514df071f6229950dfce30b9ee61e3ee5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7aaf77a514df071f6229950dfce30b…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Thu Sep 14 15:07:59 2023 -0400 uiautomationcore: Pass WinEvent data to IProxyProviderWinEventHandler::RespondToWinEvent. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 16 +++- dlls/uiautomationcore/uia_classes.idl | 3 + dlls/uiautomationcore/uia_client.c | 44 ++++++++++ dlls/uiautomationcore/uia_event.c | 133 ++++++++++++++++++++++++++++- dlls/uiautomationcore/uia_private.h | 3 + 5 files changed, 192 insertions(+), 7 deletions(-)
1
0
0
0
Connor McAdams : uiautomationcore: Add support for marking the root IAccessible as known on non-root IAccessibles upon proxy provider creation.
by Alexandre Julliard
02 Oct '23
02 Oct '23
Module: wine Branch: master Commit: 0254db3492b410e855528789b0a4cb852b1be773 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0254db3492b410e855528789b0a4cb…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Mon Sep 25 12:33:07 2023 -0400 uiautomationcore: Add support for marking the root IAccessible as known on non-root IAccessibles upon proxy provider creation. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/uia_client.c | 2 +- dlls/uiautomationcore/uia_event.c | 2 +- dlls/uiautomationcore/uia_private.h | 4 ++-- dlls/uiautomationcore/uia_provider.c | 25 ++++++++++++++----------- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index 36157ee70ba..1ff3e1a9a46 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -3013,7 +3013,7 @@ static SAFEARRAY WINAPI *default_uia_provider_callback(HWND hwnd, enum ProviderT if (FAILED(hr) || !acc) break; - hr = create_msaa_provider(acc, CHILDID_SELF, hwnd, TRUE, &elprov); + hr = create_msaa_provider(acc, CHILDID_SELF, hwnd, TRUE, TRUE, &elprov); if (FAILED(hr)) WARN("Failed to create MSAA proxy provider with hr %#lx\n", hr); diff --git a/dlls/uiautomationcore/uia_event.c b/dlls/uiautomationcore/uia_event.c index 8edbc70f54f..f5bb5656876 100644 --- a/dlls/uiautomationcore/uia_event.c +++ b/dlls/uiautomationcore/uia_event.c @@ -564,7 +564,7 @@ static HRESULT create_msaa_provider_from_hwnd(HWND hwnd, int in_child_id, IRawEl } } - hr = create_msaa_provider(acc, child_id, hwnd, in_child_id == CHILDID_SELF, &elprov); + hr = create_msaa_provider(acc, child_id, hwnd, TRUE, in_child_id == CHILDID_SELF, &elprov); IAccessible_Release(acc); if (FAILED(hr)) return hr; diff --git a/dlls/uiautomationcore/uia_private.h b/dlls/uiautomationcore/uia_private.h index 7ac2335dd77..abd03ce308e 100644 --- a/dlls/uiautomationcore/uia_private.h +++ b/dlls/uiautomationcore/uia_private.h @@ -243,8 +243,8 @@ HRESULT create_base_hwnd_provider(HWND hwnd, IRawElementProviderSimple **elprov) void uia_stop_provider_thread(void) DECLSPEC_HIDDEN; void uia_provider_thread_remove_node(HUIANODE node) DECLSPEC_HIDDEN; LRESULT uia_lresult_from_node(HUIANODE huianode) DECLSPEC_HIDDEN; -HRESULT create_msaa_provider(IAccessible *acc, LONG child_id, HWND hwnd, BOOL known_root_acc, - IRawElementProviderSimple **elprov) DECLSPEC_HIDDEN; +HRESULT create_msaa_provider(IAccessible *acc, LONG child_id, HWND hwnd, BOOL root_acc_known, + BOOL is_root_acc, IRawElementProviderSimple **elprov) DECLSPEC_HIDDEN; /* uia_utils.c */ HRESULT register_interface_in_git(IUnknown *iface, REFIID riid, DWORD *ret_cookie) DECLSPEC_HIDDEN; diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 22eba343511..917d21d8a82 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -855,7 +855,7 @@ static HRESULT WINAPI msaa_fragment_Navigate(IRawElementProviderFragment *iface, else acc = msaa_prov->acc; - hr = create_msaa_provider(acc, CHILDID_SELF, NULL, FALSE, &elprov); + hr = create_msaa_provider(acc, CHILDID_SELF, NULL, FALSE, FALSE, &elprov); if (SUCCEEDED(hr)) { struct msaa_provider *prov = impl_from_msaa_provider(elprov); @@ -886,7 +886,7 @@ static HRESULT WINAPI msaa_fragment_Navigate(IRawElementProviderFragment *iface, if (FAILED(hr) || !acc) break; - hr = create_msaa_provider(acc, child_id, NULL, FALSE, &elprov); + hr = create_msaa_provider(acc, child_id, NULL, FALSE, FALSE, &elprov); if (SUCCEEDED(hr)) { struct msaa_provider *prov = impl_from_msaa_provider(elprov); @@ -936,7 +936,7 @@ static HRESULT WINAPI msaa_fragment_Navigate(IRawElementProviderFragment *iface, if (FAILED(hr) || !acc) break; - hr = create_msaa_provider(acc, child_id, NULL, FALSE, &elprov); + hr = create_msaa_provider(acc, child_id, NULL, FALSE, FALSE, &elprov); if (SUCCEEDED(hr)) { struct msaa_provider *prov = impl_from_msaa_provider(elprov); @@ -1031,7 +1031,7 @@ static HRESULT WINAPI msaa_fragment_get_FragmentRoot(IRawElementProviderFragment if (FAILED(hr) || !acc) return hr; - hr = create_msaa_provider(acc, CHILDID_SELF, msaa_prov->hwnd, TRUE, &elprov); + hr = create_msaa_provider(acc, CHILDID_SELF, msaa_prov->hwnd, TRUE, TRUE, &elprov); IAccessible_Release(acc); if (FAILED(hr)) return hr; @@ -1154,7 +1154,7 @@ static HRESULT msaa_acc_get_focus(struct msaa_provider *prov, struct msaa_provid } } - hr = create_msaa_provider(focus_acc, focus_cid, hwnd, FALSE, &elprov); + hr = create_msaa_provider(focus_acc, focus_cid, hwnd, FALSE, FALSE, &elprov); IAccessible_Release(focus_acc); if (SUCCEEDED(hr)) *out_prov = impl_from_msaa_provider(elprov); @@ -1176,7 +1176,7 @@ static HRESULT WINAPI msaa_fragment_root_GetFocus(IRawElementProviderFragmentRoo if (V_I4(&msaa_prov->cid) != CHILDID_SELF) return S_OK; - hr = create_msaa_provider(msaa_prov->acc, CHILDID_SELF, msaa_prov->hwnd, FALSE, &elprov); + hr = create_msaa_provider(msaa_prov->acc, CHILDID_SELF, msaa_prov->hwnd, FALSE, FALSE, &elprov); if (FAILED(hr)) return hr; @@ -1440,8 +1440,8 @@ static const IProxyProviderWinEventHandlerVtbl msaa_winevent_handler_vtbl = { msaa_winevent_handler_RespondToWinEvent, }; -HRESULT create_msaa_provider(IAccessible *acc, LONG child_id, HWND hwnd, BOOL known_root_acc, - IRawElementProviderSimple **elprov) +HRESULT create_msaa_provider(IAccessible *acc, LONG child_id, HWND hwnd, BOOL root_acc_known, + BOOL is_root_acc, IRawElementProviderSimple **elprov) { struct msaa_provider *msaa_prov = calloc(1, sizeof(*msaa_prov)); @@ -1470,8 +1470,11 @@ HRESULT create_msaa_provider(IAccessible *acc, LONG child_id, HWND hwnd, BOOL kn else msaa_prov->hwnd = hwnd; - if (known_root_acc) - msaa_prov->root_acc_check_ran = msaa_prov->is_root_acc = TRUE; + if (root_acc_known) + { + msaa_prov->root_acc_check_ran = TRUE; + msaa_prov->is_root_acc = is_root_acc; + } *elprov = &msaa_prov->IRawElementProviderSimple_iface; @@ -1515,7 +1518,7 @@ HRESULT WINAPI UiaProviderFromIAccessible(IAccessible *acc, LONG child_id, DWORD if (!hwnd) return E_FAIL; - return create_msaa_provider(acc, child_id, hwnd, FALSE, elprov); + return create_msaa_provider(acc, child_id, hwnd, FALSE, FALSE, elprov); } static HRESULT uia_get_hr_for_last_error(void)
1
0
0
0
Connor McAdams : uiautomationcore: Add support for ignoring ProviderOptions_UseComThreading when creating an HUIANODE.
by Alexandre Julliard
02 Oct '23
02 Oct '23
Module: wine Branch: master Commit: a2bf252c4b50332dc0a8081b26cdb6f62410d596 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a2bf252c4b50332dc0a8081b26cdb6…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Mon Aug 21 11:04:31 2023 -0400 uiautomationcore: Add support for ignoring ProviderOptions_UseComThreading when creating an HUIANODE. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 6 ------ dlls/uiautomationcore/uia_client.c | 15 ++++++++++----- dlls/uiautomationcore/uia_event.c | 4 ++-- dlls/uiautomationcore/uia_private.h | 4 +++- dlls/uiautomationcore/uia_provider.c | 4 ++-- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 452587970d9..3b9887d4917 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -16717,12 +16717,6 @@ static const struct prov_method_sequence win_event_handler_seq[] = { { &Provider_hwnd2, PROV_GET_HOST_RAW_ELEMENT_PROVIDER, METHOD_OPTIONAL }, /* Only done on Win10v1809+. */ { &Provider_nc2, FRAG_NAVIGATE }, /* NavigateDirection_Parent */ { &Provider_hwnd2, FRAG_NAVIGATE }, /* NavigateDirection_Parent */ - /* - * The following two are currently only done on Wine. Windows doesn't do - * this because the node created is never passed out of the event thread. - */ - { &Provider_nc2, PROV_GET_PROVIDER_OPTIONS, METHOD_OPTIONAL }, - { &Provider_hwnd2, PROV_GET_PROVIDER_OPTIONS, METHOD_OPTIONAL }, { &Provider_nc2, WINEVENT_HANDLER_RESPOND_TO_WINEVENT, METHOD_TODO }, { &Provider_hwnd2, WINEVENT_HANDLER_RESPOND_TO_WINEVENT, METHOD_TODO }, NODE_CREATE_SEQ_TODO(&Provider_child), diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index 09e0d179172..36157ee70ba 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -613,6 +613,8 @@ static HRESULT create_uia_node(struct uia_node **out_node, int node_flags) node->ignore_clientside_hwnd_provs = TRUE; if (node_flags & NODE_FLAG_NO_PREPARE) node->no_prepare = TRUE; + if (node_flags & NODE_FLAG_IGNORE_COM_THREADING) + node->ignore_com_threading = TRUE; *out_node = node; return S_OK; @@ -664,6 +666,9 @@ static HRESULT prepare_uia_node(struct uia_node *node) prov_idx++; } + if (node->ignore_com_threading) + return S_OK; + for (i = 0; i < PROV_TYPE_COUNT; i++) { enum ProviderOptions prov_opts; @@ -1361,7 +1366,7 @@ static HRESULT get_variant_for_elprov_node(IRawElementProviderSimple *elprov, BO VariantInit(v); - hr = create_uia_node_from_elprov(elprov, &node, !refuse_hwnd_providers); + hr = create_uia_node_from_elprov(elprov, &node, !refuse_hwnd_providers, 0); IRawElementProviderSimple_Release(elprov); if (SUCCEEDED(hr)) { @@ -1910,7 +1915,7 @@ static HRESULT WINAPI uia_provider_attach_event(IWineUiaProvider *iface, LONG_PT if (FAILED(hr)) goto exit; - hr = create_uia_node_from_elprov(elprov, &node, !prov->refuse_hwnd_node_providers); + hr = create_uia_node_from_elprov(elprov, &node, !prov->refuse_hwnd_node_providers, 0); IRawElementProviderSimple_Release(elprov); if (SUCCEEDED(hr)) { @@ -1969,7 +1974,7 @@ static HRESULT create_wine_uia_provider(struct uia_node *node, IRawElementProvid static HRESULT uia_get_providers_for_hwnd(struct uia_node *node); HRESULT create_uia_node_from_elprov(IRawElementProviderSimple *elprov, HUIANODE *out_node, - BOOL get_hwnd_providers) + BOOL get_hwnd_providers, int node_flags) { static const int unsupported_prov_opts = ProviderOptions_ProviderOwnsSetFocus | ProviderOptions_HasNativeIAccessible | ProviderOptions_UseClientCoordinates; @@ -1998,7 +2003,7 @@ HRESULT create_uia_node_from_elprov(IRawElementProviderSimple *elprov, HUIANODE else prov_type = PROV_TYPE_MAIN; - hr = create_uia_node(&node, 0); + hr = create_uia_node(&node, node_flags); if (FAILED(hr)) return hr; @@ -2040,7 +2045,7 @@ HRESULT WINAPI UiaNodeFromProvider(IRawElementProviderSimple *elprov, HUIANODE * if (!elprov || !huianode) return E_INVALIDARG; - return create_uia_node_from_elprov(elprov, huianode, TRUE); + return create_uia_node_from_elprov(elprov, huianode, TRUE, 0); } /* diff --git a/dlls/uiautomationcore/uia_event.c b/dlls/uiautomationcore/uia_event.c index 59b6d71c6c2..8edbc70f54f 100644 --- a/dlls/uiautomationcore/uia_event.c +++ b/dlls/uiautomationcore/uia_event.c @@ -600,7 +600,7 @@ static HRESULT uia_win_event_for_each_callback(struct uia_event *event, void *da if (FAILED(hr)) return hr; - hr = create_uia_node_from_elprov(elprov, &node, TRUE); + hr = create_uia_node_from_elprov(elprov, &node, TRUE, NODE_FLAG_IGNORE_COM_THREADING); IRawElementProviderSimple_Release(elprov); if (FAILED(hr)) return hr; @@ -1700,7 +1700,7 @@ static HRESULT uia_raise_elprov_event_callback(struct uia_event *event, void *da * For events raised on server-side providers, we don't want to add any * clientside HWND providers. */ - hr = create_uia_node_from_elprov(event_data->elprov, &event_data->node, event_data->clientside_only); + hr = create_uia_node_from_elprov(event_data->elprov, &event_data->node, event_data->clientside_only, 0); if (FAILED(hr)) return hr; diff --git a/dlls/uiautomationcore/uia_private.h b/dlls/uiautomationcore/uia_private.h index 218392ef06c..7ac2335dd77 100644 --- a/dlls/uiautomationcore/uia_private.h +++ b/dlls/uiautomationcore/uia_private.h @@ -57,6 +57,7 @@ enum uia_node_prov_type { enum uia_node_flags { NODE_FLAG_IGNORE_CLIENTSIDE_HWND_PROVS = 0x01, NODE_FLAG_NO_PREPARE = 0x02, + NODE_FLAG_IGNORE_COM_THREADING = 0x04, }; struct uia_node { @@ -74,6 +75,7 @@ struct uia_node { BOOL nested_node; BOOL disconnected; int creator_prov_type; + BOOL ignore_com_threading; BOOL ignore_clientside_hwnd_provs; struct list prov_thread_list_entry; @@ -212,7 +214,7 @@ HRESULT attach_event_to_uia_node(HUIANODE node, struct uia_event *event) DECLSPE HRESULT clone_uia_node(HUIANODE in_node, HUIANODE *out_node) DECLSPEC_HIDDEN; HRESULT navigate_uia_node(struct uia_node *node, int nav_dir, HUIANODE *out_node) DECLSPEC_HIDDEN; HRESULT create_uia_node_from_elprov(IRawElementProviderSimple *elprov, HUIANODE *out_node, - BOOL get_hwnd_providers) DECLSPEC_HIDDEN; + BOOL get_hwnd_providers, int node_flags) DECLSPEC_HIDDEN; HRESULT uia_node_from_lresult(LRESULT lr, HUIANODE *huianode) DECLSPEC_HIDDEN; HRESULT uia_condition_check(HUIANODE node, struct UiaCondition *condition) DECLSPEC_HIDDEN; BOOL uia_condition_matched(HRESULT hr) DECLSPEC_HIDDEN; diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 6a3b2d061fe..22eba343511 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -2275,7 +2275,7 @@ LRESULT WINAPI UiaReturnRawElementProvider(HWND hwnd, WPARAM wparam, return 0; } - hr = create_uia_node_from_elprov(elprov, &node, FALSE); + hr = create_uia_node_from_elprov(elprov, &node, FALSE, 0); if (FAILED(hr)) { WARN("Failed to create HUIANODE with hr %#lx\n", hr); @@ -2296,7 +2296,7 @@ HRESULT WINAPI UiaDisconnectProvider(IRawElementProviderSimple *elprov) TRACE("(%p)\n", elprov); - hr = create_uia_node_from_elprov(elprov, &node, FALSE); + hr = create_uia_node_from_elprov(elprov, &node, FALSE, 0); if (FAILED(hr)) return hr;
1
0
0
0
Connor McAdams : uiautomationcore: Create HUIANODE for WinEvents that should invoke IProxyProviderWinEventHandler::RespondToWinEvent.
by Alexandre Julliard
02 Oct '23
02 Oct '23
Module: wine Branch: master Commit: 01d9a5ea2b1d6ecf69a3b2ddd06e45a299a47212 URL:
https://gitlab.winehq.org/wine/wine/-/commit/01d9a5ea2b1d6ecf69a3b2ddd06e45…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Thu Sep 14 13:12:25 2023 -0400 uiautomationcore: Create HUIANODE for WinEvents that should invoke IProxyProviderWinEventHandler::RespondToWinEvent. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 44 +++++++++++++-------- dlls/uiautomationcore/uia_event.c | 62 ++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 15 deletions(-) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 2685aba1b15..452587970d9 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -1761,6 +1761,15 @@ static struct prov_method_sequence *sequence; { prov , FRAG_NAVIGATE }, /* NavigateDirection_Parent */ \ { prov , PROV_GET_PROVIDER_OPTIONS, METHOD_OPTIONAL } \ +#define NODE_CREATE_SEQ_TODO(prov) \ + { prov , PROV_GET_PROVIDER_OPTIONS, METHOD_TODO }, \ + /* Win10v1507 and below call this. */ \ + { prov , PROV_GET_PROPERTY_VALUE, METHOD_OPTIONAL }, /* UIA_NativeWindowHandlePropertyId */ \ + { prov , PROV_GET_HOST_RAW_ELEMENT_PROVIDER, METHOD_TODO }, \ + { prov , PROV_GET_PROPERTY_VALUE, METHOD_TODO }, \ + { prov , FRAG_NAVIGATE, METHOD_TODO }, /* NavigateDirection_Parent */ \ + { prov , PROV_GET_PROVIDER_OPTIONS, METHOD_OPTIONAL } \ + #define NODE_CREATE_SEQ_OPTIONAL(prov) \ { prov , PROV_GET_PROVIDER_OPTIONS, METHOD_OPTIONAL }, \ /* Win10v1507 and below call this. */ \ @@ -16708,11 +16717,17 @@ static const struct prov_method_sequence win_event_handler_seq[] = { { &Provider_hwnd2, PROV_GET_HOST_RAW_ELEMENT_PROVIDER, METHOD_OPTIONAL }, /* Only done on Win10v1809+. */ { &Provider_nc2, FRAG_NAVIGATE }, /* NavigateDirection_Parent */ { &Provider_hwnd2, FRAG_NAVIGATE }, /* NavigateDirection_Parent */ - { &Provider_nc2, WINEVENT_HANDLER_RESPOND_TO_WINEVENT }, - { &Provider_hwnd2, WINEVENT_HANDLER_RESPOND_TO_WINEVENT }, - NODE_CREATE_SEQ(&Provider_child), - { &Provider_child, FRAG_GET_RUNTIME_ID }, - { &Provider_child, PROV_GET_PROPERTY_VALUE }, /* UIA_ProviderDescriptionPropertyId */ + /* + * The following two are currently only done on Wine. Windows doesn't do + * this because the node created is never passed out of the event thread. + */ + { &Provider_nc2, PROV_GET_PROVIDER_OPTIONS, METHOD_OPTIONAL }, + { &Provider_hwnd2, PROV_GET_PROVIDER_OPTIONS, METHOD_OPTIONAL }, + { &Provider_nc2, WINEVENT_HANDLER_RESPOND_TO_WINEVENT, METHOD_TODO }, + { &Provider_hwnd2, WINEVENT_HANDLER_RESPOND_TO_WINEVENT, METHOD_TODO }, + NODE_CREATE_SEQ_TODO(&Provider_child), + { &Provider_child, FRAG_GET_RUNTIME_ID, METHOD_TODO }, + { &Provider_child, PROV_GET_PROPERTY_VALUE, METHOD_TODO }, /* UIA_ProviderDescriptionPropertyId */ { 0 } }; @@ -16846,9 +16861,8 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para set_uia_hwnd_expects(1, 1, 1, 4, 3); test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, hwnd[0], OBJID_WINDOW, CHILDID_SELF, event_handles, 1, TRUE, FALSE, TRUE); - if (CALLED_COUNT(winproc_GETOBJECT_CLIENT)) - ok_method_sequence(win_event_handler_seq, "win_event_handler_seq"); - check_uia_hwnd_expects_at_least(1, TRUE, 1, TRUE, 1, TRUE, 1, FALSE, 1, TRUE); + ok_method_sequence(win_event_handler_seq, "win_event_handler_seq"); + check_uia_hwnd_expects_at_least(1, TRUE, 1, FALSE, 1, FALSE, 1, FALSE, 1, FALSE); method_sequences_enabled = FALSE; /* @@ -16894,7 +16908,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para SET_EXPECT_MULTI(child_winproc_GETOBJECT_UiaRoot, 4); /* Only sent 4 times on Win11. */ test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, hwnd[1], OBJID_WINDOW, CHILDID_SELF, event_handles, 1, TRUE, FALSE, TRUE); - check_uia_hwnd_expects_at_least(0, FALSE, 1, TRUE, 1, TRUE, 1, TRUE, 0, FALSE); + check_uia_hwnd_expects_at_least(0, FALSE, 1, FALSE, 1, FALSE, 1, TRUE, 0, FALSE); CHECK_CALLED(child_winproc_GETOBJECT_UiaRoot); /* @@ -16940,7 +16954,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para set_uia_hwnd_expects(1, 1, 1, 4, 3); test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, hwnd[0], OBJID_WINDOW, CHILDID_SELF, event_handles, 1, TRUE, FALSE, TRUE); - check_uia_hwnd_expects_at_least(1, TRUE, 1, TRUE, 1, TRUE, 1, FALSE, 1, TRUE); + check_uia_hwnd_expects_at_least(1, TRUE, 1, FALSE, 1, FALSE, 1, FALSE, 1, FALSE); /* Raise a WinEvent on our test child HWND, both event callbacks invoked. */ child_win_prov_root = NULL; @@ -16951,7 +16965,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, hwnd[1], OBJID_WINDOW, CHILDID_SELF, event_handles, ARRAY_SIZE(event_handles), TRUE, TRUE, TRUE); CHECK_CALLED_AT_LEAST(child_winproc_GETOBJECT_UiaRoot, 2); - check_uia_hwnd_expects_at_least(0, FALSE, 2, TRUE, 2, TRUE, 2, TRUE, 0, FALSE); + check_uia_hwnd_expects_at_least(0, FALSE, 2, FALSE, 2, FALSE, 2, TRUE, 0, FALSE); /* * Raise a WinEvent on a descendant HWND of our test HWND. If any ancestor @@ -16971,7 +16985,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, tmp_hwnd2, OBJID_WINDOW, CHILDID_SELF, event_handles, ARRAY_SIZE(event_handles), TRUE, TRUE, TRUE); CHECK_CALLED_AT_LEAST(child_winproc_GETOBJECT_UiaRoot, 2); - check_uia_hwnd_expects_at_least(0, FALSE, 2, TRUE, 2, TRUE, 0, FALSE, 0, FALSE); + check_uia_hwnd_expects_at_least(0, FALSE, 2, FALSE, 2, FALSE, 0, FALSE, 0, FALSE); DestroyWindow(tmp_hwnd); Provider_nc3.hwnd = Provider_hwnd3.hwnd = hwnd[1]; @@ -17018,7 +17032,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para set_uia_hwnd_expects(0, 1, 1, 0, 0); test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, GetDesktopWindow(), OBJID_WINDOW, CHILDID_SELF, event_handles, 1, TRUE, FALSE, TRUE); - check_uia_hwnd_expects(0, FALSE, 1, TRUE, 1, TRUE, 0, FALSE, 0, FALSE); + check_uia_hwnd_expects(0, FALSE, 1, FALSE, 1, FALSE, 0, FALSE, 0, FALSE); /* * Top-level HWND, a child of the desktop HWND. Will not have an event @@ -17059,14 +17073,14 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para set_uia_hwnd_expects(1, 1, 1, 2, 1); test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, hwnd[0], OBJID_WINDOW, CHILDID_SELF, event_handles, 1, TRUE, FALSE, TRUE); - check_uia_hwnd_expects(1, TRUE, 1, TRUE, 1, TRUE, 2, TRUE, 1, TRUE); + check_uia_hwnd_expects(1, TRUE, 1, FALSE, 1, FALSE, 2, FALSE, 1, FALSE); /* Child HWNDs of our test window are handled as well. */ SET_EXPECT_MULTI(child_winproc_GETOBJECT_UiaRoot, 2); set_uia_hwnd_expects(0, 1, 1, 1, 0); test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, hwnd[1], OBJID_WINDOW, CHILDID_SELF, event_handles, 1, TRUE, FALSE, TRUE); - check_uia_hwnd_expects(0, FALSE, 1, TRUE, 1, TRUE, 1, TRUE, 0, FALSE); + check_uia_hwnd_expects(0, FALSE, 1, FALSE, 1, FALSE, 1, TRUE, 0, FALSE); hr = UiaRemoveEvent(event); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); diff --git a/dlls/uiautomationcore/uia_event.c b/dlls/uiautomationcore/uia_event.c index 59f52cdcf3d..59b6d71c6c2 100644 --- a/dlls/uiautomationcore/uia_event.c +++ b/dlls/uiautomationcore/uia_event.c @@ -528,9 +528,57 @@ static BOOL uia_win_event_hwnd_map_contains_ancestors(struct rb_tree *hwnd_map, return FALSE; } +static HRESULT create_msaa_provider_from_hwnd(HWND hwnd, int in_child_id, IRawElementProviderSimple **ret_elprov) +{ + IRawElementProviderSimple *elprov; + IAccessible *acc; + int child_id; + HRESULT hr; + + *ret_elprov = NULL; + hr = AccessibleObjectFromWindow(hwnd, OBJID_CLIENT, &IID_IAccessible, (void **)&acc); + if (FAILED(hr)) + return hr; + + child_id = in_child_id; + if (in_child_id != CHILDID_SELF) + { + IDispatch *disp; + VARIANT cid; + + disp = NULL; + variant_init_i4(&cid, in_child_id); + hr = IAccessible_get_accChild(acc, cid, &disp); + if (FAILED(hr)) + TRACE("get_accChild failed with %#lx!\n", hr); + + if (SUCCEEDED(hr) && disp) + { + IAccessible_Release(acc); + hr = IDispatch_QueryInterface(disp, &IID_IAccessible, (void **)&acc); + IDispatch_Release(disp); + if (FAILED(hr)) + return hr; + + child_id = CHILDID_SELF; + } + } + + hr = create_msaa_provider(acc, child_id, hwnd, in_child_id == CHILDID_SELF, &elprov); + IAccessible_Release(acc); + if (FAILED(hr)) + return hr; + + *ret_elprov = elprov; + return S_OK; +} + static HRESULT uia_win_event_for_each_callback(struct uia_event *event, void *data) { struct uia_queue_win_event *win_event = (struct uia_queue_win_event *)data; + IRawElementProviderSimple *elprov; + HUIANODE node; + HRESULT hr; /* * Check if this HWND, or any of it's ancestors (excluding the desktop) @@ -544,8 +592,22 @@ static HRESULT uia_win_event_for_each_callback(struct uia_event *event, void *da if (UiaHasServerSideProvider(win_event->hwnd)) return S_OK; + /* + * Regardless of the object ID of the WinEvent, OBJID_CLIENT is queried + * for the HWND with the same child ID as the WinEvent. + */ + hr = create_msaa_provider_from_hwnd(win_event->hwnd, win_event->child_id, &elprov); + if (FAILED(hr)) + return hr; + + hr = create_uia_node_from_elprov(elprov, &node, TRUE); + IRawElementProviderSimple_Release(elprov); + if (FAILED(hr)) + return hr; + FIXME("IProxyProviderWinEventHandler usage is currently unimplemented.\n"); + UiaNodeRelease(node); return S_OK; }
1
0
0
0
Connor McAdams : uiautomationcore: Check if we should try to invoke IProxyProviderWinEventHandler::RespondToWinEvent for registered UIA events.
by Alexandre Julliard
02 Oct '23
02 Oct '23
Module: wine Branch: master Commit: bc063b67ab87695048a69636373ec9c3c71b0298 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bc063b67ab87695048a69636373ec9…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Thu Sep 14 13:05:31 2023 -0400 uiautomationcore: Check if we should try to invoke IProxyProviderWinEventHandler::RespondToWinEvent for registered UIA events. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 14 ++++----- dlls/uiautomationcore/uia_event.c | 47 ++++++++++++++++++++++++++++++ dlls/uiautomationcore/uia_private.h | 2 ++ dlls/uiautomationcore/uia_provider.c | 11 ++----- dlls/uiautomationcore/uia_utils.c | 7 ++++- 5 files changed, 65 insertions(+), 16 deletions(-) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 0e623c9a2bf..2685aba1b15 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -16823,7 +16823,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para SET_EXPECT_MULTI(winproc_GETOBJECT_UiaRoot, 2); /* Only called twice on Win11. */ test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, hwnd[0], OBJID_WINDOW, CHILDID_SELF, event_handles, 1, FALSE, FALSE, FALSE); - todo_wine CHECK_CALLED(winproc_GETOBJECT_UiaRoot); + CHECK_CALLED(winproc_GETOBJECT_UiaRoot); /* * Get rid of our serverside provider and raise EVENT_OBJECT_FOCUS @@ -16848,7 +16848,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para 1, TRUE, FALSE, TRUE); if (CALLED_COUNT(winproc_GETOBJECT_CLIENT)) ok_method_sequence(win_event_handler_seq, "win_event_handler_seq"); - check_uia_hwnd_expects_at_least(1, TRUE, 1, TRUE, 1, TRUE, 1, TRUE, 1, TRUE); + check_uia_hwnd_expects_at_least(1, TRUE, 1, TRUE, 1, TRUE, 1, FALSE, 1, TRUE); method_sequences_enabled = FALSE; /* @@ -16895,7 +16895,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, hwnd[1], OBJID_WINDOW, CHILDID_SELF, event_handles, 1, TRUE, FALSE, TRUE); check_uia_hwnd_expects_at_least(0, FALSE, 1, TRUE, 1, TRUE, 1, TRUE, 0, FALSE); - todo_wine CHECK_CALLED(child_winproc_GETOBJECT_UiaRoot); + CHECK_CALLED(child_winproc_GETOBJECT_UiaRoot); /* * Child HWND now has a serverside provider, WinEvent is ignored. @@ -16906,7 +16906,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para SET_EXPECT_MULTI(child_winproc_GETOBJECT_UiaRoot, 2); /* Only sent 2 times on Win11. */ test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, hwnd[1], OBJID_WINDOW, CHILDID_SELF, event_handles, 1, FALSE, FALSE, FALSE); - todo_wine CHECK_CALLED(child_winproc_GETOBJECT_UiaRoot); + CHECK_CALLED(child_winproc_GETOBJECT_UiaRoot); CHECK_CALLED_AT_MOST(winproc_GETOBJECT_UiaRoot, 1); /* @@ -16940,7 +16940,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para set_uia_hwnd_expects(1, 1, 1, 4, 3); test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, hwnd[0], OBJID_WINDOW, CHILDID_SELF, event_handles, 1, TRUE, FALSE, TRUE); - check_uia_hwnd_expects_at_least(1, TRUE, 1, TRUE, 1, TRUE, 1, TRUE, 1, TRUE); + check_uia_hwnd_expects_at_least(1, TRUE, 1, TRUE, 1, TRUE, 1, FALSE, 1, TRUE); /* Raise a WinEvent on our test child HWND, both event callbacks invoked. */ child_win_prov_root = NULL; @@ -16950,7 +16950,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para SET_EXPECT_MULTI(child_winproc_GETOBJECT_UiaRoot, 8); /* Only sent 8 times on Win11. */ test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, hwnd[1], OBJID_WINDOW, CHILDID_SELF, event_handles, ARRAY_SIZE(event_handles), TRUE, TRUE, TRUE); - todo_wine CHECK_CALLED_AT_LEAST(child_winproc_GETOBJECT_UiaRoot, 2); + CHECK_CALLED_AT_LEAST(child_winproc_GETOBJECT_UiaRoot, 2); check_uia_hwnd_expects_at_least(0, FALSE, 2, TRUE, 2, TRUE, 2, TRUE, 0, FALSE); /* @@ -16970,7 +16970,7 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para SET_EXPECT_MULTI(child_winproc_GETOBJECT_UiaRoot, 12); /* Only sent 12 times on Win11. */ test_uia_event_win_event_mapping(EVENT_OBJECT_FOCUS, tmp_hwnd2, OBJID_WINDOW, CHILDID_SELF, event_handles, ARRAY_SIZE(event_handles), TRUE, TRUE, TRUE); - todo_wine CHECK_CALLED_AT_LEAST(child_winproc_GETOBJECT_UiaRoot, 2); + CHECK_CALLED_AT_LEAST(child_winproc_GETOBJECT_UiaRoot, 2); check_uia_hwnd_expects_at_least(0, FALSE, 2, TRUE, 2, TRUE, 0, FALSE, 0, FALSE); DestroyWindow(tmp_hwnd); diff --git a/dlls/uiautomationcore/uia_event.c b/dlls/uiautomationcore/uia_event.c index d493ab0a243..59f52cdcf3d 100644 --- a/dlls/uiautomationcore/uia_event.c +++ b/dlls/uiautomationcore/uia_event.c @@ -511,6 +511,44 @@ static HRESULT uia_raise_serverside_event(struct uia_queue_uia_event *event) return hr; } +/* Check the parent chain of HWNDs, excluding the desktop. */ +static BOOL uia_win_event_hwnd_map_contains_ancestors(struct rb_tree *hwnd_map, HWND hwnd) +{ + HWND parent = GetAncestor(hwnd, GA_PARENT); + const HWND desktop = GetDesktopWindow(); + + while (parent && (parent != desktop)) + { + if (uia_hwnd_map_check_hwnd(hwnd_map, parent)) + return TRUE; + + parent = GetAncestor(parent, GA_PARENT); + } + + return FALSE; +} + +static HRESULT uia_win_event_for_each_callback(struct uia_event *event, void *data) +{ + struct uia_queue_win_event *win_event = (struct uia_queue_win_event *)data; + + /* + * Check if this HWND, or any of it's ancestors (excluding the desktop) + * are in our scope. + */ + if (!uia_hwnd_map_check_hwnd(&event->u.clientside.win_event_hwnd_map, win_event->hwnd) && + !uia_win_event_hwnd_map_contains_ancestors(&event->u.clientside.win_event_hwnd_map, win_event->hwnd)) + return S_OK; + + /* Has a native serverside provider, no need to do WinEvent translation. */ + if (UiaHasServerSideProvider(win_event->hwnd)) + return S_OK; + + FIXME("IProxyProviderWinEventHandler usage is currently unimplemented.\n"); + + return S_OK; +} + static void uia_event_thread_process_queue(struct list *event_queue) { while (1) @@ -538,6 +576,15 @@ static void uia_event_thread_process_queue(struct list *event_queue) break; } + case QUEUE_EVENT_TYPE_WIN_EVENT: + { + struct uia_queue_win_event *win_event = (struct uia_queue_win_event *)event; + + hr = uia_event_for_each(win_event_to_uia_event_id(win_event->event_id), uia_win_event_for_each_callback, + (void *)win_event, TRUE); + break; + } + default: break; } diff --git a/dlls/uiautomationcore/uia_private.h b/dlls/uiautomationcore/uia_private.h index c298967be00..218392ef06c 100644 --- a/dlls/uiautomationcore/uia_private.h +++ b/dlls/uiautomationcore/uia_private.h @@ -255,6 +255,8 @@ HRESULT get_safearray_dim_bounds(SAFEARRAY *sa, UINT dim, LONG *lbound, LONG *el HRESULT get_safearray_bounds(SAFEARRAY *sa, LONG *lbound, LONG *elems) DECLSPEC_HIDDEN; int uia_compare_safearrays(SAFEARRAY *sa1, SAFEARRAY *sa2, int prop_type) DECLSPEC_HIDDEN; BOOL uia_hwnd_is_visible(HWND hwnd) DECLSPEC_HIDDEN; +BOOL uia_is_top_level_hwnd(HWND hwnd) DECLSPEC_HIDDEN; +BOOL uia_hwnd_map_check_hwnd(struct rb_tree *hwnd_map, HWND hwnd) DECLSPEC_HIDDEN; HRESULT uia_hwnd_map_add_hwnd(struct rb_tree *hwnd_map, HWND hwnd) DECLSPEC_HIDDEN; void uia_hwnd_map_init(struct rb_tree *hwnd_map) DECLSPEC_HIDDEN; void uia_hwnd_map_destroy(struct rb_tree *hwnd_map) DECLSPEC_HIDDEN; diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 269ce63a2fd..6a3b2d061fe 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -1545,11 +1545,6 @@ static HRESULT uia_send_message_timeout(HWND hwnd, UINT msg, WPARAM wparam, LPAR return S_OK; } -static BOOL is_top_level_hwnd(HWND hwnd) -{ - return GetAncestor(hwnd, GA_PARENT) == GetDesktopWindow(); -} - static HRESULT get_uia_control_type_for_hwnd(HWND hwnd, int *control_type) { LONG_PTR style, ex_style; @@ -1576,7 +1571,7 @@ static HRESULT get_uia_control_type_for_hwnd(HWND hwnd, int *control_type) } /* Non top-level HWNDs are considered panes as well. */ - if (!is_top_level_hwnd(hwnd)) + if (!uia_is_top_level_hwnd(hwnd)) *control_type = UIA_PaneControlTypeId; else *control_type = UIA_WindowControlTypeId; @@ -1816,7 +1811,7 @@ static HRESULT WINAPI base_hwnd_fragment_Navigate(IRawElementProviderFragment *i * Top level owned windows have their owner window as a parent instead * of the desktop window. */ - if (is_top_level_hwnd(base_hwnd_prov->hwnd) && (owner = GetWindow(base_hwnd_prov->hwnd, GW_OWNER))) + if (uia_is_top_level_hwnd(base_hwnd_prov->hwnd) && (owner = GetWindow(base_hwnd_prov->hwnd, GW_OWNER))) parent = owner; else parent = GetAncestor(base_hwnd_prov->hwnd, GA_PARENT); @@ -1866,7 +1861,7 @@ static HRESULT WINAPI base_hwnd_fragment_get_BoundingRectangle(IRawElementProvid memset(ret_val, 0, sizeof(*ret_val)); /* Top level minimized window - Return empty rect. */ - if (is_top_level_hwnd(base_hwnd_prov->hwnd) && IsIconic(base_hwnd_prov->hwnd)) + if (uia_is_top_level_hwnd(base_hwnd_prov->hwnd) && IsIconic(base_hwnd_prov->hwnd)) return S_OK; if (!GetWindowRect(base_hwnd_prov->hwnd, &rect)) diff --git a/dlls/uiautomationcore/uia_utils.c b/dlls/uiautomationcore/uia_utils.c index 9840fe4fe40..866358f97c8 100644 --- a/dlls/uiautomationcore/uia_utils.c +++ b/dlls/uiautomationcore/uia_utils.c @@ -404,6 +404,11 @@ BOOL uia_hwnd_is_visible(HWND hwnd) return TRUE; } +BOOL uia_is_top_level_hwnd(HWND hwnd) +{ + return GetAncestor(hwnd, GA_PARENT) == GetDesktopWindow(); +} + /* * rbtree to efficiently store a collection of HWNDs. */ @@ -429,7 +434,7 @@ static void uia_hwnd_map_free(struct rb_entry *entry, void *context) free(hwnd_entry); } -static BOOL uia_hwnd_map_check_hwnd(struct rb_tree *hwnd_map, HWND hwnd) +BOOL uia_hwnd_map_check_hwnd(struct rb_tree *hwnd_map, HWND hwnd) { return !!rb_get(hwnd_map, hwnd); }
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
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
Results per page:
10
25
50
100
200