From: Paul Gofman pgofman@codeweavers.com
--- .../holographicspace.c | 33 +++++++++++++++++++ dlls/windows.perception.stub/private.h | 1 + .../tests/perception.c | 25 +++++++------- include/Makefile.in | 1 + include/holographicspaceinterop.idl | 27 +++++++++++++++ 5 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 include/holographicspaceinterop.idl
diff --git a/dlls/windows.perception.stub/holographicspace.c b/dlls/windows.perception.stub/holographicspace.c index 8a12147f4a8..53e6be0e712 100644 --- a/dlls/windows.perception.stub/holographicspace.c +++ b/dlls/windows.perception.stub/holographicspace.c @@ -27,6 +27,7 @@ struct holographicspace IActivationFactory IActivationFactory_iface; IHolographicSpaceStatics2 IHolographicSpaceStatics2_iface; IHolographicSpaceStatics3 IHolographicSpaceStatics3_iface; + IHolographicSpaceInterop IHolographicSpaceInterop_iface; LONG ref; };
@@ -65,6 +66,13 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID return S_OK; }
+ if (IsEqualGUID( iid, &IID_IHolographicSpaceInterop )) + { + *out = &impl->IHolographicSpaceInterop_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -193,11 +201,36 @@ static const struct IHolographicSpaceStatics3Vtbl holographicspace_statics3_vtbl holographicspace_statics3_get_IsConfigured, };
+DEFINE_IINSPECTABLE( holographicspace_interop, IHolographicSpaceInterop, struct holographicspace, IActivationFactory_iface ) + +static HRESULT WINAPI holographicspace_interop_CreateForWindow( IHolographicSpaceInterop *iface, + HWND window, REFIID iid, void **holographic_space ) +{ + FIXME( "iface %p, window %p, iid %s, holographic_space %p.\n", iface, window, debugstr_guid( iid ), holographic_space ); + + *holographic_space = NULL; + return E_NOTIMPL; +} + +static const struct IHolographicSpaceInteropVtbl holographicspace_interop_vtbl = +{ + holographicspace_interop_QueryInterface, + holographicspace_interop_AddRef, + holographicspace_interop_Release, + /* IInspectable methods */ + holographicspace_interop_GetIids, + holographicspace_interop_GetRuntimeClassName, + holographicspace_interop_GetTrustLevel, + /* IHolographicSpaceInterop methods */ + holographicspace_interop_CreateForWindow, +}; + static struct holographicspace holographicspace_statics = { {&factory_vtbl}, {&holographicspace_statics2_vtbl}, {&holographicspace_statics3_vtbl}, + {&holographicspace_interop_vtbl}, 1, };
diff --git a/dlls/windows.perception.stub/private.h b/dlls/windows.perception.stub/private.h index a6ae62916e1..ceaa2944174 100644 --- a/dlls/windows.perception.stub/private.h +++ b/dlls/windows.perception.stub/private.h @@ -36,6 +36,7 @@ #include "windows.perception.spatial.surfaces.h" #define WIDL_using_Windows_Graphics_Holographic #include "windows.graphics.holographic.h" +#include "holographicspaceinterop.h"
extern IActivationFactory *observer_factory; extern IActivationFactory *holographicspace_factory; diff --git a/dlls/windows.perception.stub/tests/perception.c b/dlls/windows.perception.stub/tests/perception.c index d0bee4eb247..29d7f1ea475 100644 --- a/dlls/windows.perception.stub/tests/perception.c +++ b/dlls/windows.perception.stub/tests/perception.c @@ -32,19 +32,21 @@ #include "windows.perception.spatial.surfaces.h" #define WIDL_using_Windows_Graphics_Holographic #include "windows.graphics.holographic.h" +#include "holographicspaceinterop.h"
#include "wine/test.h"
-#define check_interface( obj, iid ) check_interface_( __LINE__, obj, iid ) -static void check_interface_( unsigned int line, void *obj, const IID *iid ) +#define check_interface( obj, iid, can_be_broken ) check_interface_( __LINE__, obj, iid, can_be_broken ) +static void check_interface_( unsigned int line, void *obj, const IID *iid, BOOL can_be_broken ) { IUnknown *iface = obj; IUnknown *unk; HRESULT hr;
hr = IUnknown_QueryInterface( iface, iid, (void **)&unk ); - ok_(__FILE__, line)( hr == S_OK, "got hr %#lx.\n", hr ); - IUnknown_Release( unk ); + ok_(__FILE__, line)( hr == S_OK || broken( can_be_broken && hr == E_NOINTERFACE ), "got hr %#lx.\n", hr ); + if (SUCCEEDED(hr)) + IUnknown_Release( unk ); }
static void test_ObserverStatics(void) @@ -69,10 +71,10 @@ static void test_ObserverStatics(void) return; }
- check_interface( factory, &IID_IUnknown ); - check_interface( factory, &IID_IInspectable ); - check_interface( factory, &IID_IAgileObject ); - check_interface( factory, &IID_ISpatialSurfaceObserverStatics ); + check_interface( factory, &IID_IUnknown, FALSE ); + check_interface( factory, &IID_IInspectable, FALSE ); + check_interface( factory, &IID_IAgileObject, FALSE ); + check_interface( factory, &IID_ISpatialSurfaceObserverStatics, FALSE );
hr = IActivationFactory_QueryInterface( factory, &IID_ISpatialSurfaceObserverStatics2, (void **)&observer_statics2 ); if (hr == E_NOINTERFACE) /* win1607 */ @@ -118,9 +120,10 @@ static void test_HolographicSpaceStatics(void) return; }
- check_interface( factory, &IID_IUnknown ); - check_interface( factory, &IID_IInspectable ); - check_interface( factory, &IID_IAgileObject ); + check_interface( factory, &IID_IUnknown, FALSE ); + check_interface( factory, &IID_IInspectable, FALSE ); + check_interface( factory, &IID_IAgileObject, FALSE ); + check_interface( factory, &IID_IHolographicSpaceInterop, TRUE /* broken on Testbot Win1607 */ );
hr = IActivationFactory_QueryInterface( factory, &IID_IHolographicSpaceStatics2, (void **)&holographicspace_statics2 ); if (hr == E_NOINTERFACE) /* win1607 */ diff --git a/include/Makefile.in b/include/Makefile.in index 391ce3c190b..c527a17cec4 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -345,6 +345,7 @@ SOURCES = \ highlevelmonitorconfigurationapi.h \ hlguids.h \ hlink.idl \ + holographicspaceinterop.idl \ hrtfapoapi.idl \ hstring.idl \ htiface.idl \ diff --git a/include/holographicspaceinterop.idl b/include/holographicspaceinterop.idl new file mode 100644 index 00000000000..913f60bc7a0 --- /dev/null +++ b/include/holographicspaceinterop.idl @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2024 Paul Gofman 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 + */ + +import "inspectable.idl"; + +[ + uuid(5c4ee536-6a98-4b86-a170-587013d6fd4b), +] +interface IHolographicSpaceInterop : IInspectable +{ + HRESULT CreateForWindow( [in] HWND window, [in] REFIID iid, [out, iid_is(iid)] void **holographic_space); +}
Used by Iragon 18+.