Commit f082ff9e authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

twinapi.appcore: Stub Windows.System.Profile.AnalyticsInfo runtimeclass.

parent ced55e1d
......@@ -21,6 +21,98 @@
WINE_DEFAULT_DEBUG_CHANNEL(twinapi);
struct analytics_version_info
{
IAnalyticsVersionInfo IAnalyticsVersionInfo_iface;
LONG ref;
};
static inline struct analytics_version_info *impl_from_IAnalyticsVersionInfo( IAnalyticsVersionInfo *iface )
{
return CONTAINING_RECORD( iface, struct analytics_version_info, IAnalyticsVersionInfo_iface );
}
static HRESULT WINAPI analytics_version_info_QueryInterface( IAnalyticsVersionInfo *iface, REFIID iid, void **out )
{
struct analytics_version_info *impl = impl_from_IAnalyticsVersionInfo( 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_IAnalyticsVersionInfo ))
{
IAnalyticsVersionInfo_AddRef( (*out = &impl->IAnalyticsVersionInfo_iface) );
return S_OK;
}
FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) );
*out = NULL;
return E_NOINTERFACE;
}
static ULONG WINAPI analytics_version_info_AddRef( IAnalyticsVersionInfo *iface )
{
struct analytics_version_info *impl = impl_from_IAnalyticsVersionInfo( iface );
ULONG ref = InterlockedIncrement( &impl->ref );
TRACE( "iface %p, ref %lu.\n", iface, ref );
return ref;
}
static ULONG WINAPI analytics_version_info_Release( IAnalyticsVersionInfo *iface )
{
struct analytics_version_info *impl = impl_from_IAnalyticsVersionInfo( iface );
ULONG ref = InterlockedDecrement( &impl->ref );
TRACE( "iface %p, ref %lu.\n", iface, ref );
if (!ref) free( impl );
return ref;
}
static HRESULT WINAPI analytics_version_info_GetIids( IAnalyticsVersionInfo *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 analytics_version_info_GetRuntimeClassName( IAnalyticsVersionInfo *iface, HSTRING *class_name )
{
FIXME( "iface %p, class_name %p stub!\n", iface, class_name );
return E_NOTIMPL;
}
static HRESULT WINAPI analytics_version_info_GetTrustLevel( IAnalyticsVersionInfo *iface, TrustLevel *trust_level )
{
FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level );
return E_NOTIMPL;
}
static HRESULT WINAPI analytics_version_info_get_DeviceFamily( IAnalyticsVersionInfo *iface, HSTRING *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
}
static HRESULT WINAPI analytics_version_info_get_DeviceFamilyVersion( IAnalyticsVersionInfo *iface, HSTRING *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
}
static IAnalyticsVersionInfoVtbl analytics_version_info_vtbl =
{
analytics_version_info_QueryInterface,
analytics_version_info_AddRef,
analytics_version_info_Release,
/* IInspectable methods */
analytics_version_info_GetIids,
analytics_version_info_GetRuntimeClassName,
analytics_version_info_GetTrustLevel,
/* IAnalyticsVersionInfo methods */
analytics_version_info_get_DeviceFamily,
analytics_version_info_get_DeviceFamilyVersion,
};
struct analytics_info_factory
{
IActivationFactory IActivationFactory_iface;
......@@ -116,8 +208,16 @@ DEFINE_IINSPECTABLE( statics, IAnalyticsInfoStatics, struct analytics_info_facto
static HRESULT WINAPI statics_get_VersionInfo( IAnalyticsInfoStatics *iface, IAnalyticsVersionInfo **value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
struct analytics_version_info *info;
TRACE( "iface %p, out %p.\n", iface, value );
if (!(info = calloc( 1, sizeof(*info) ))) return E_OUTOFMEMORY;
info->IAnalyticsVersionInfo_iface.lpVtbl = &analytics_version_info_vtbl;
info->ref = 1;
*value = &info->IAnalyticsVersionInfo_iface;
return S_OK;
}
static HRESULT WINAPI statics_get_DeviceForm( IAnalyticsInfoStatics *iface, HSTRING *value )
......
......@@ -115,6 +115,7 @@ static void test_AnalyticsVersionInfo(void)
{
static const WCHAR *class_name = RuntimeClass_Windows_System_Profile_AnalyticsInfo;
IAnalyticsInfoStatics *analytics_info_statics;
IAnalyticsVersionInfo *analytics_version_info;
IActivationFactory *factory;
HSTRING str;
HRESULT hr;
......@@ -139,6 +140,16 @@ static void test_AnalyticsVersionInfo(void)
hr = IActivationFactory_QueryInterface( factory, &IID_IAnalyticsInfoStatics, (void **)&analytics_info_statics );
ok( hr == S_OK, "got hr %#lx.\n", hr );
hr = IAnalyticsInfoStatics_get_VersionInfo( analytics_info_statics, &analytics_version_info );
ok( hr == S_OK, "got hr %#lx.\n", hr );
check_interface( analytics_version_info, &IID_IUnknown, TRUE );
check_interface( analytics_version_info, &IID_IInspectable, TRUE );
check_interface( analytics_version_info, &IID_IAgileObject, TRUE );
ref = IAnalyticsVersionInfo_Release( analytics_version_info );
ok( ref == 0, "got ref %ld.\n", ref );
ref = IAnalyticsInfoStatics_Release( analytics_info_statics );
ok( ref == 2, "got ref %ld.\n", ref );
ref = IActivationFactory_Release( factory );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment