Skip to content
Snippets Groups Projects
Commit 34ff248b authored by Mohamad Al-Jaf's avatar Mohamad Al-Jaf Committed by Alexandre Julliard
Browse files

windows.system.profile.systemmanufacturers: Stub ISmbiosInformationStatics interface.

parent db684bff
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ static const char *debugstr_hstring( HSTRING hstr )
struct smbios_statics
{
IActivationFactory IActivationFactory_iface;
ISmbiosInformationStatics ISmbiosInformationStatics_iface;
LONG ref;
};
......@@ -60,6 +61,13 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID
return S_OK;
}
if (IsEqualGUID( iid, &IID_ISmbiosInformationStatics ))
{
*out = &impl->ISmbiosInformationStatics_iface;
IInspectable_AddRef( *out );
return S_OK;
}
FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) );
*out = NULL;
return E_NOINTERFACE;
......@@ -118,9 +126,31 @@ static const struct IActivationFactoryVtbl factory_vtbl =
factory_ActivateInstance,
};
DEFINE_IINSPECTABLE( statics, ISmbiosInformationStatics, struct smbios_statics, IActivationFactory_iface )
static HRESULT WINAPI statics_get_SerialNumber( ISmbiosInformationStatics *iface, HSTRING *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
}
static const struct ISmbiosInformationStaticsVtbl statics_vtbl =
{
statics_QueryInterface,
statics_AddRef,
statics_Release,
/* IInspectable methods */
statics_GetIids,
statics_GetRuntimeClassName,
statics_GetTrustLevel,
/* ISmbiosInformationStatics methods */
statics_get_SerialNumber,
};
static struct smbios_statics smbios_statics =
{
{&factory_vtbl},
{&statics_vtbl},
1,
};
......
......@@ -29,3 +29,41 @@
#define WIDL_using_Windows_System_Profile_SystemManufacturers
#include "windows.system.profile.systemmanufacturers.h"
#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 )
......@@ -45,6 +45,7 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid )
static void test_Smbios_Statics(void)
{
static const WCHAR *smbios_statics_name = L"Windows.System.Profile.SystemManufacturers.SmbiosInformation";
ISmbiosInformationStatics *smbios_statics;
IActivationFactory *factory;
HSTRING str;
HRESULT hr;
......@@ -66,6 +67,12 @@ static void test_Smbios_Statics(void)
check_interface( factory, &IID_IInspectable );
check_interface( factory, &IID_IAgileObject );
hr = IActivationFactory_QueryInterface( factory, &IID_ISmbiosInformationStatics, (void **)&smbios_statics );
ok( hr == S_OK, "got hr %#lx.\n", hr );
ref = ISmbiosInformationStatics_Release( smbios_statics );
ok( ref == 2, "got ref %ld.\n", ref );
ref = IActivationFactory_Release( factory );
ok( ref == 1, "got ref %ld.\n", ref );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment