From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- .../main.c | 30 +++++++++++++++++++ .../tests/smbios.c | 7 +++++ 2 files changed, 37 insertions(+)
diff --git a/dlls/windows.system.profile.systemmanufacturers/main.c b/dlls/windows.system.profile.systemmanufacturers/main.c index 3f5e937392e..35b4529ad7a 100644 --- a/dlls/windows.system.profile.systemmanufacturers/main.c +++ b/dlls/windows.system.profile.systemmanufacturers/main.c @@ -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, };
diff --git a/dlls/windows.system.profile.systemmanufacturers/tests/smbios.c b/dlls/windows.system.profile.systemmanufacturers/tests/smbios.c index 628c5f689bc..a9cf1d2b6d8 100644 --- a/dlls/windows.system.profile.systemmanufacturers/tests/smbios.c +++ b/dlls/windows.system.profile.systemmanufacturers/tests/smbios.c @@ -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 ); }