Module: wine Branch: master Commit: 006bc33c57c96bd733147c4088d36bfc14da907e URL: https://gitlab.winehq.org/wine/wine/-/commit/006bc33c57c96bd733147c4088d36bf...
Author: Mohamad Al-Jaf mohamadaljaf@gmail.com Date: Thu Feb 23 03:50:15 2023 -0500
windows.perception.stub: Add ISpatialSurfaceObserverStatics2 stub interface.
---
dlls/windows.perception.stub/observer.c | 30 +++++++++++++++++++++++++ dlls/windows.perception.stub/tests/perception.c | 6 +++++ 2 files changed, 36 insertions(+)
diff --git a/dlls/windows.perception.stub/observer.c b/dlls/windows.perception.stub/observer.c index e5cb0bac3ea..16f573e4d84 100644 --- a/dlls/windows.perception.stub/observer.c +++ b/dlls/windows.perception.stub/observer.c @@ -27,6 +27,7 @@ struct observer { IActivationFactory IActivationFactory_iface; ISpatialSurfaceObserverStatics ISpatialSurfaceObserverStatics_iface; + ISpatialSurfaceObserverStatics2 ISpatialSurfaceObserverStatics2_iface; LONG ref; };
@@ -58,6 +59,13 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID return S_OK; }
+ if (IsEqualGUID( iid, &IID_ISpatialSurfaceObserverStatics2 )) + { + *out = &impl->ISpatialSurfaceObserverStatics2_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -137,10 +145,32 @@ static const struct ISpatialSurfaceObserverStaticsVtbl observer_statics_vtbl = observer_statics_RequestAccessAsync, };
+DEFINE_IINSPECTABLE( observer_statics2, ISpatialSurfaceObserverStatics2, struct observer, IActivationFactory_iface ) + +static HRESULT WINAPI observer_statics2_IsSupported( ISpatialSurfaceObserverStatics2 *iface, boolean *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static const struct ISpatialSurfaceObserverStatics2Vtbl observer_statics2_vtbl = +{ + observer_statics2_QueryInterface, + observer_statics2_AddRef, + observer_statics2_Release, + /* IInspectable methods */ + observer_statics2_GetIids, + observer_statics2_GetRuntimeClassName, + observer_statics2_GetTrustLevel, + /* ISpatialSurfaceObserverStatics2 methods */ + observer_statics2_IsSupported, +}; + static struct observer observer_statics = { {&factory_vtbl}, {&observer_statics_vtbl}, + {&observer_statics2_vtbl}, 1, };
diff --git a/dlls/windows.perception.stub/tests/perception.c b/dlls/windows.perception.stub/tests/perception.c index 8b075042f72..9b7b7a07eaf 100644 --- a/dlls/windows.perception.stub/tests/perception.c +++ b/dlls/windows.perception.stub/tests/perception.c @@ -48,6 +48,7 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid ) static void test_ObserverStatics(void) { static const WCHAR *observer_statics_name = L"Windows.Perception.Spatial.Surfaces.SpatialSurfaceObserver"; + ISpatialSurfaceObserverStatics2 *observer_statics2; IActivationFactory *factory; HSTRING str; HRESULT hr; @@ -70,6 +71,11 @@ static void test_ObserverStatics(void) check_interface( factory, &IID_IAgileObject ); check_interface( factory, &IID_ISpatialSurfaceObserverStatics );
+ hr = IActivationFactory_QueryInterface( factory, &IID_ISpatialSurfaceObserverStatics2, (void **)&observer_statics2 ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + ref = ISpatialSurfaceObserverStatics2_Release( observer_statics2 ); + ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory ); ok( ref == 1, "got ref %ld.\n", ref ); }