Needed for MS Office 365.
-- v2: hvsimanagementapi: Implement IIsolatedWindowsEnvironmentHostStatics::get_IsReady(). hvsimanagementapi/tests: Add IIsolatedWindowsEnvironmentHostStatics::get_IsReady() tests.
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- include/Makefile.in | 1 + include/windows.security.isolation.idl | 79 ++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 include/windows.security.isolation.idl
diff --git a/include/Makefile.in b/include/Makefile.in index b810f7e8442..96f79518c2e 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -844,6 +844,7 @@ SOURCES = \ windows.perception.spatial.surfaces.idl \ windows.security.credentials.idl \ windows.security.cryptography.idl \ + windows.security.isolation.idl \ windows.storage.idl \ windows.storage.streams.idl \ windows.system.idl \ diff --git a/include/windows.security.isolation.idl b/include/windows.security.isolation.idl new file mode 100644 index 00000000000..4147aefd646 --- /dev/null +++ b/include/windows.security.isolation.idl @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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 + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; + +namespace Windows.Security.Isolation { + typedef enum IsolatedWindowsEnvironmentHostError IsolatedWindowsEnvironmentHostError; + + interface IIsolatedWindowsEnvironmentHostStatics; + + runtimeclass IsolatedWindowsEnvironmentHost; + + declare { + interface Windows.Foundation.Collections.IVectorView<Windows.Security.Isolation.IsolatedWindowsEnvironmentHostError>; + } + + [ + contractversion(3.0) + ] + apicontract IsolatedWindowsEnvironmentContract + { + } + + [ + contract(Windows.Security.Isolation.IsolatedWindowsEnvironmentContract, 1.0) + ] + enum IsolatedWindowsEnvironmentHostError + { + AdminPolicyIsDisabledOrNotPresent = 0, + FeatureNotInstalled = 1, + HardwareRequirementsNotMet = 2, + RebootRequired = 3, + UnknownError = 4, + }; + + [ + contract(Windows.Security.Isolation.IsolatedWindowsEnvironmentContract, 1.0), + exclusiveto(Windows.Security.Isolation.IsolatedWindowsEnvironmentHost), + uuid(2c0e22c7-05a0-517a-b81c-6ee8790c381f) + ] + interface IIsolatedWindowsEnvironmentHostStatics : IInspectable + { + [propget] HRESULT IsReady([out, retval] boolean *value); + [propget] HRESULT HostErrors([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Security.Isolation.IsolatedWindowsEnvironmentHostError> **value); + } + + [ + contract(Windows.Security.Isolation.IsolatedWindowsEnvironmentContract, 1.0), + marshaling_behavior(agile), + static(Windows.Security.Isolation.IIsolatedWindowsEnvironmentHostStatics, Windows.Security.Isolation.IsolatedWindowsEnvironmentContract, 1.0), + threading(both) + ] + runtimeclass IsolatedWindowsEnvironmentHost + { + } +}
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- configure.ac | 2 + dlls/hvsimanagementapi/Makefile.in | 9 ++ dlls/hvsimanagementapi/classes.idl | 23 ++++ dlls/hvsimanagementapi/host.c | 116 ++++++++++++++++++ dlls/hvsimanagementapi/hvsimanagementapi.spec | 3 + dlls/hvsimanagementapi/main.c | 46 +++++++ dlls/hvsimanagementapi/private.h | 40 ++++++ dlls/hvsimanagementapi/tests/Makefile.in | 5 + dlls/hvsimanagementapi/tests/isolation.c | 87 +++++++++++++ 9 files changed, 331 insertions(+) create mode 100644 dlls/hvsimanagementapi/Makefile.in create mode 100644 dlls/hvsimanagementapi/classes.idl create mode 100644 dlls/hvsimanagementapi/host.c create mode 100644 dlls/hvsimanagementapi/hvsimanagementapi.spec create mode 100644 dlls/hvsimanagementapi/main.c create mode 100644 dlls/hvsimanagementapi/private.h create mode 100644 dlls/hvsimanagementapi/tests/Makefile.in create mode 100644 dlls/hvsimanagementapi/tests/isolation.c
diff --git a/configure.ac b/configure.ac index cf26113ca06..38e61526a06 100644 --- a/configure.ac +++ b/configure.ac @@ -2665,6 +2665,8 @@ WINE_CONFIG_MAKEFILE(dlls/hrtfapo) WINE_CONFIG_MAKEFILE(dlls/http.sys) WINE_CONFIG_MAKEFILE(dlls/httpapi) WINE_CONFIG_MAKEFILE(dlls/httpapi/tests) +WINE_CONFIG_MAKEFILE(dlls/hvsimanagementapi) +WINE_CONFIG_MAKEFILE(dlls/hvsimanagementapi/tests) WINE_CONFIG_MAKEFILE(dlls/ia2comproxy) WINE_CONFIG_MAKEFILE(dlls/iccvid) WINE_CONFIG_MAKEFILE(dlls/icmp) diff --git a/dlls/hvsimanagementapi/Makefile.in b/dlls/hvsimanagementapi/Makefile.in new file mode 100644 index 00000000000..c2a67062fad --- /dev/null +++ b/dlls/hvsimanagementapi/Makefile.in @@ -0,0 +1,9 @@ +MODULE = hvsimanagementapi.dll +IMPORTS = combase + +C_SRCS = \ + host.c \ + main.c + +IDL_SRCS = \ + classes.idl diff --git a/dlls/hvsimanagementapi/classes.idl b/dlls/hvsimanagementapi/classes.idl new file mode 100644 index 00000000000..d4f582812b6 --- /dev/null +++ b/dlls/hvsimanagementapi/classes.idl @@ -0,0 +1,23 @@ +/* + * Runtime Classes for hvsimanagementapi.dll + * + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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 + */ + +#pragma makedep register + +#include "windows.security.isolation.idl" diff --git a/dlls/hvsimanagementapi/host.c b/dlls/hvsimanagementapi/host.c new file mode 100644 index 00000000000..e41e2ef7e99 --- /dev/null +++ b/dlls/hvsimanagementapi/host.c @@ -0,0 +1,116 @@ +/* WinRT Windows.Security.Isolation IsolatedWindowsEnvironmentHost Implementation + * + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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" + +WINE_DEFAULT_DEBUG_CHANNEL(hvsi); + +struct isolated_host_statics +{ + IActivationFactory IActivationFactory_iface; + LONG ref; +}; + +static inline struct isolated_host_statics *impl_from_IActivationFactory( IActivationFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct isolated_host_statics, IActivationFactory_iface ); +} + +static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID iid, void **out ) +{ + struct isolated_host_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 )) + { + *out = &impl->IActivationFactory_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 factory_AddRef( IActivationFactory *iface ) +{ + struct isolated_host_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 isolated_host_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, +}; + +static struct isolated_host_statics isolated_host_statics = +{ + {&factory_vtbl}, + 1, +}; + +IActivationFactory *isolated_host_factory = &isolated_host_statics.IActivationFactory_iface; diff --git a/dlls/hvsimanagementapi/hvsimanagementapi.spec b/dlls/hvsimanagementapi/hvsimanagementapi.spec new file mode 100644 index 00000000000..20a8bfa98ea --- /dev/null +++ b/dlls/hvsimanagementapi/hvsimanagementapi.spec @@ -0,0 +1,3 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetActivationFactory(ptr ptr) +@ stdcall -private DllGetClassObject(ptr ptr ptr) diff --git a/dlls/hvsimanagementapi/main.c b/dlls/hvsimanagementapi/main.c new file mode 100644 index 00000000000..b5758af4a45 --- /dev/null +++ b/dlls/hvsimanagementapi/main.c @@ -0,0 +1,46 @@ +/* WinRT Windows.Security.Isolation Implementation + * + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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 "initguid.h" +#include "private.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(hvsi); + +HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID riid, void **out ) +{ + FIXME( "clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out ); + return CLASS_E_CLASSNOTAVAILABLE; +} + +HRESULT WINAPI DllGetActivationFactory( HSTRING classid, IActivationFactory **factory ) +{ + const WCHAR *buffer = WindowsGetStringRawBuffer( classid, NULL ); + + TRACE( "class %s, factory %p.\n", debugstr_hstring(classid), factory ); + + *factory = NULL; + + if (!wcscmp( buffer, RuntimeClass_Windows_Security_Isolation_IsolatedWindowsEnvironmentHost )) + IActivationFactory_QueryInterface( isolated_host_factory, &IID_IActivationFactory, (void **)factory ); + + if (*factory) return S_OK; + return CLASS_E_CLASSNOTAVAILABLE; +} diff --git a/dlls/hvsimanagementapi/private.h b/dlls/hvsimanagementapi/private.h new file mode 100644 index 00000000000..af18f54c077 --- /dev/null +++ b/dlls/hvsimanagementapi/private.h @@ -0,0 +1,40 @@ +/* WinRT Windows.Security.Isolation Implementation + * + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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 + */ + +#ifndef __WINE_WINDOWS_SECURITY_ISOLATION_PRIVATE_H +#define __WINE_WINDOWS_SECURITY_ISOLATION_PRIVATE_H + +#include <stdarg.h> + +#define COBJMACROS +#include "windef.h" +#include "winbase.h" +#include "winstring.h" + +#include "activation.h" + +#define WIDL_using_Windows_Foundation +#define WIDL_using_Windows_Foundation_Collections +#include "windows.foundation.h" +#define WIDL_using_Windows_Security_Isolation +#include "windows.security.isolation.h" + +extern IActivationFactory *isolated_host_factory; + +#endif diff --git a/dlls/hvsimanagementapi/tests/Makefile.in b/dlls/hvsimanagementapi/tests/Makefile.in new file mode 100644 index 00000000000..1823284773c --- /dev/null +++ b/dlls/hvsimanagementapi/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = hvsimanagementapi.dll +IMPORTS = combase + +C_SRCS = \ + isolation.c diff --git a/dlls/hvsimanagementapi/tests/isolation.c b/dlls/hvsimanagementapi/tests/isolation.c new file mode 100644 index 00000000000..d08f6ecb645 --- /dev/null +++ b/dlls/hvsimanagementapi/tests/isolation.c @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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 + */ + +#define COBJMACROS +#include "initguid.h" +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winstring.h" + +#include "roapi.h" + +#define WIDL_using_Windows_Foundation +#define WIDL_using_Windows_Foundation_Collections +#include "windows.foundation.h" +#define WIDL_using_Windows_Security_Isolation +#include "windows.security.isolation.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 ) +{ + 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 ); +} + +static void test_IsolatedWindowsEnvironmentHostStatics(void) +{ + static const WCHAR *isolated_host_statics_name = L"Windows.Security.Isolation.IsolatedWindowsEnvironmentHost"; + IActivationFactory *factory; + HSTRING str; + HRESULT hr; + LONG ref; + + hr = WindowsCreateString( isolated_host_statics_name, wcslen( isolated_host_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( isolated_host_statics_name ) ); + return; + } + + check_interface( factory, &IID_IUnknown ); + check_interface( factory, &IID_IInspectable ); + check_interface( factory, &IID_IAgileObject ); + + ref = IActivationFactory_Release( factory ); + ok( ref == 1, "got ref %ld.\n", ref ); +} + +START_TEST(isolation) +{ + HRESULT hr; + + hr = RoInitialize( RO_INIT_MULTITHREADED ); + ok( hr == S_OK, "RoInitialize failed, hr %#lx\n", hr ); + + test_IsolatedWindowsEnvironmentHostStatics(); + + RoUninitialize(); +}
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/hvsimanagementapi/host.c | 38 ++++++++++++++++++++++++ dlls/hvsimanagementapi/private.h | 38 ++++++++++++++++++++++++ dlls/hvsimanagementapi/tests/isolation.c | 6 ++++ 3 files changed, 82 insertions(+)
diff --git a/dlls/hvsimanagementapi/host.c b/dlls/hvsimanagementapi/host.c index e41e2ef7e99..37120d9ee94 100644 --- a/dlls/hvsimanagementapi/host.c +++ b/dlls/hvsimanagementapi/host.c @@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(hvsi); struct isolated_host_statics { IActivationFactory IActivationFactory_iface; + IIsolatedWindowsEnvironmentHostStatics IIsolatedWindowsEnvironmentHostStatics_iface; LONG ref; };
@@ -49,6 +50,13 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID return S_OK; }
+ if (IsEqualGUID( iid, &IID_IIsolatedWindowsEnvironmentHostStatics )) + { + *out = &impl->IIsolatedWindowsEnvironmentHostStatics_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,39 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, };
+DEFINE_IINSPECTABLE( isolated_host_statics, IIsolatedWindowsEnvironmentHostStatics, struct isolated_host_statics, IActivationFactory_iface ) + +static HRESULT WINAPI isolated_host_statics_get_IsReady( IIsolatedWindowsEnvironmentHostStatics *iface, boolean *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI isolated_host_statics_get_HostErrors( IIsolatedWindowsEnvironmentHostStatics *iface, + IVectorView_IsolatedWindowsEnvironmentHostError **value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static const struct IIsolatedWindowsEnvironmentHostStaticsVtbl isolated_host_statics_vtbl = +{ + isolated_host_statics_QueryInterface, + isolated_host_statics_AddRef, + isolated_host_statics_Release, + /* IInspectable methods */ + isolated_host_statics_GetIids, + isolated_host_statics_GetRuntimeClassName, + isolated_host_statics_GetTrustLevel, + /* IIsolatedWindowsEnvironmentHostStatics methods */ + isolated_host_statics_get_IsReady, + isolated_host_statics_get_HostErrors, +}; + static struct isolated_host_statics isolated_host_statics = { {&factory_vtbl}, + {&isolated_host_statics_vtbl}, 1, };
diff --git a/dlls/hvsimanagementapi/private.h b/dlls/hvsimanagementapi/private.h index af18f54c077..4799a654176 100644 --- a/dlls/hvsimanagementapi/private.h +++ b/dlls/hvsimanagementapi/private.h @@ -37,4 +37,42 @@
extern IActivationFactory *isolated_host_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/hvsimanagementapi/tests/isolation.c b/dlls/hvsimanagementapi/tests/isolation.c index d08f6ecb645..8e0dc75c005 100644 --- a/dlls/hvsimanagementapi/tests/isolation.c +++ b/dlls/hvsimanagementapi/tests/isolation.c @@ -49,6 +49,7 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid ) static void test_IsolatedWindowsEnvironmentHostStatics(void) { static const WCHAR *isolated_host_statics_name = L"Windows.Security.Isolation.IsolatedWindowsEnvironmentHost"; + IIsolatedWindowsEnvironmentHostStatics *isolated_host_statics; IActivationFactory *factory; HSTRING str; HRESULT hr; @@ -70,6 +71,11 @@ static void test_IsolatedWindowsEnvironmentHostStatics(void) check_interface( factory, &IID_IInspectable ); check_interface( factory, &IID_IAgileObject );
+ hr = IActivationFactory_QueryInterface( factory, &IID_IIsolatedWindowsEnvironmentHostStatics, (void **)&isolated_host_statics ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + ref = IIsolatedWindowsEnvironmentHostStatics_Release( isolated_host_statics ); + ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory ); ok( ref == 1, "got ref %ld.\n", ref ); }
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/hvsimanagementapi/tests/isolation.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/hvsimanagementapi/tests/isolation.c b/dlls/hvsimanagementapi/tests/isolation.c index 8e0dc75c005..7554ea74873 100644 --- a/dlls/hvsimanagementapi/tests/isolation.c +++ b/dlls/hvsimanagementapi/tests/isolation.c @@ -51,6 +51,7 @@ static void test_IsolatedWindowsEnvironmentHostStatics(void) static const WCHAR *isolated_host_statics_name = L"Windows.Security.Isolation.IsolatedWindowsEnvironmentHost"; IIsolatedWindowsEnvironmentHostStatics *isolated_host_statics; IActivationFactory *factory; + BOOLEAN value = 0; HSTRING str; HRESULT hr; LONG ref; @@ -74,6 +75,10 @@ static void test_IsolatedWindowsEnvironmentHostStatics(void) hr = IActivationFactory_QueryInterface( factory, &IID_IIsolatedWindowsEnvironmentHostStatics, (void **)&isolated_host_statics ); ok( hr == S_OK, "got hr %#lx.\n", hr );
+ hr = IIsolatedWindowsEnvironmentHostStatics_get_IsReady( isolated_host_statics, &value ); + todo_wine ok( hr == S_OK || broken( hr == E_NOTIMPL /* Win10 2004 */ ), "got hr %#lx.\n", hr ); + todo_wine ok( !value, "got %d.\n", value ); + ref = IIsolatedWindowsEnvironmentHostStatics_Release( isolated_host_statics ); ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed for MS Office 365. --- dlls/hvsimanagementapi/host.c | 6 ++++-- dlls/hvsimanagementapi/tests/isolation.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/hvsimanagementapi/host.c b/dlls/hvsimanagementapi/host.c index 37120d9ee94..c4d8b5b34db 100644 --- a/dlls/hvsimanagementapi/host.c +++ b/dlls/hvsimanagementapi/host.c @@ -119,8 +119,10 @@ DEFINE_IINSPECTABLE( isolated_host_statics, IIsolatedWindowsEnvironmentHostStati
static HRESULT WINAPI isolated_host_statics_get_IsReady( IIsolatedWindowsEnvironmentHostStatics *iface, boolean *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + TRACE( "iface %p, value %p\n", iface, value ); + + *value = FALSE; + return S_OK; }
static HRESULT WINAPI isolated_host_statics_get_HostErrors( IIsolatedWindowsEnvironmentHostStatics *iface, diff --git a/dlls/hvsimanagementapi/tests/isolation.c b/dlls/hvsimanagementapi/tests/isolation.c index 7554ea74873..4df8ce33004 100644 --- a/dlls/hvsimanagementapi/tests/isolation.c +++ b/dlls/hvsimanagementapi/tests/isolation.c @@ -76,8 +76,8 @@ static void test_IsolatedWindowsEnvironmentHostStatics(void) ok( hr == S_OK, "got hr %#lx.\n", hr );
hr = IIsolatedWindowsEnvironmentHostStatics_get_IsReady( isolated_host_statics, &value ); - todo_wine ok( hr == S_OK || broken( hr == E_NOTIMPL /* Win10 2004 */ ), "got hr %#lx.\n", hr ); - todo_wine ok( !value, "got %d.\n", value ); + ok( hr == S_OK || broken( hr == E_NOTIMPL /* Win10 2004 */ ), "got hr %#lx.\n", hr ); + ok( !value, "got %d.\n", value );
ref = IIsolatedWindowsEnvironmentHostStatics_Release( isolated_host_statics ); ok( ref == 2, "got ref %ld.\n", ref );
This merge request was approved by Rémi Bernon.