1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

windows.perception.stub: Add stub IHolographicSpaceInterop interface.

This commit is contained in:
Paul Gofman 2024-03-25 16:02:02 -06:00 committed by Alexandre Julliard
parent bb47eb9f72
commit ddff863355
5 changed files with 76 additions and 11 deletions

View File

@ -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,
};

View File

@ -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;

View File

@ -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 */

View File

@ -345,6 +345,7 @@ SOURCES = \
highlevelmonitorconfigurationapi.h \
hlguids.h \
hlink.idl \
holographicspaceinterop.idl \
hrtfapoapi.idl \
hstring.idl \
htiface.idl \

View File

@ -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);
}