Commit cf7048d6 authored by Mohamad Al-Jaf's avatar Mohamad Al-Jaf Committed by Alexandre Julliard

windows.devices.enumeration: Add IDeviceInformationStatics stub interface.

parent ebb0a399
...@@ -220,6 +220,7 @@ static const struct IDeviceWatcherVtbl device_watcher_vtbl = ...@@ -220,6 +220,7 @@ static const struct IDeviceWatcherVtbl device_watcher_vtbl =
struct device_information_statics struct device_information_statics
{ {
IActivationFactory IActivationFactory_iface; IActivationFactory IActivationFactory_iface;
IDeviceInformationStatics IDeviceInformationStatics_iface;
IDeviceInformationStatics2 IDeviceInformationStatics2_iface; IDeviceInformationStatics2 IDeviceInformationStatics2_iface;
LONG ref; LONG ref;
}; };
...@@ -243,6 +244,12 @@ static HRESULT WINAPI activation_factory_QueryInterface( IActivationFactory *ifa ...@@ -243,6 +244,12 @@ static HRESULT WINAPI activation_factory_QueryInterface( IActivationFactory *ifa
return S_OK; return S_OK;
} }
if (IsEqualGUID( iid, &IID_IDeviceInformationStatics ))
{
IInspectable_AddRef( (*out = &impl->IDeviceInformationStatics_iface) );
return S_OK;
}
if (IsEqualGUID( iid, &IID_IDeviceInformationStatics2 )) if (IsEqualGUID( iid, &IID_IDeviceInformationStatics2 ))
{ {
IInspectable_AddRef( (*out = &impl->IDeviceInformationStatics2_iface) ); IInspectable_AddRef( (*out = &impl->IDeviceInformationStatics2_iface) );
...@@ -307,6 +314,99 @@ static const struct IActivationFactoryVtbl activation_factory_vtbl = ...@@ -307,6 +314,99 @@ static const struct IActivationFactoryVtbl activation_factory_vtbl =
activation_factory_ActivateInstance, activation_factory_ActivateInstance,
}; };
DEFINE_IINSPECTABLE( device_statics, IDeviceInformationStatics, struct device_information_statics, IActivationFactory_iface );
static HRESULT WINAPI device_statics_CreateFromIdAsync( IDeviceInformationStatics *iface, HSTRING id,
IAsyncOperation_DeviceInformation **op )
{
FIXME( "iface %p, id %s, op %p stub!\n", iface, debugstr_hstring(id), op );
return E_NOTIMPL;
}
static HRESULT WINAPI device_statics_CreateFromIdAsyncAdditionalProperties( IDeviceInformationStatics *iface, HSTRING id,
IIterable_HSTRING *additional_properties,
IAsyncOperation_DeviceInformation **op )
{
FIXME( "iface %p, id %s, additional_properties %p, op %p stub!\n", iface, debugstr_hstring(id), additional_properties, op );
return E_NOTIMPL;
}
static HRESULT WINAPI device_statics_FindAllAsync( IDeviceInformationStatics *iface,
IAsyncOperation_DeviceInformationCollection **op )
{
FIXME( "iface %p, op %p stub!\n", iface, op );
return E_NOTIMPL;
}
static HRESULT WINAPI device_statics_FindAllAsyncDeviceClass( IDeviceInformationStatics *iface, DeviceClass class,
IAsyncOperation_DeviceInformationCollection **op )
{
FIXME( "iface %p, class %d, op %p stub!\n", iface, class, op );
return E_NOTIMPL;
}
static HRESULT WINAPI device_statics_FindAllAsyncAqsFilter( IDeviceInformationStatics *iface, HSTRING filter,
IAsyncOperation_DeviceInformationCollection **op )
{
FIXME( "iface %p, aqs %p, op %p stub!\n", iface, debugstr_hstring(filter), op );
return E_NOTIMPL;
}
static HRESULT WINAPI device_statics_FindAllAsyncAqsFilterAndAdditionalProperties( IDeviceInformationStatics *iface, HSTRING filter,
IIterable_HSTRING *additional_properties,
IAsyncOperation_DeviceInformationCollection **op )
{
FIXME( "iface %p, aqs %p, additional_properties %p, op %p stub!\n", iface, debugstr_hstring(filter), additional_properties, op );
return E_NOTIMPL;
}
static HRESULT WINAPI device_statics_CreateWatcher( IDeviceInformationStatics *iface, IDeviceWatcher **watcher )
{
FIXME( "iface %p, watcher %p stub!\n", iface, watcher );
return E_NOTIMPL;
}
static HRESULT WINAPI device_statics_CreateWatcherDeviceClass( IDeviceInformationStatics *iface, DeviceClass class, IDeviceWatcher **watcher )
{
FIXME( "iface %p, class %d, watcher %p stub!\n", iface, class, watcher );
return E_NOTIMPL;
}
static HRESULT WINAPI device_statics_CreateWatcherAqsFilter( IDeviceInformationStatics *iface, HSTRING filter, IDeviceWatcher **watcher )
{
FIXME( "iface %p, filter %s, watcher %p stub!\n", iface, debugstr_hstring(filter), watcher );
return E_NOTIMPL;
}
static HRESULT WINAPI device_statics_CreateWatcherAqsFilterAndAdditionalProperties( IDeviceInformationStatics *iface, HSTRING filter,
IIterable_HSTRING *additional_properties, IDeviceWatcher **watcher )
{
FIXME( "iface %p, aqs %p, additional_properties %p, watcher %p stub!\n", iface, debugstr_hstring(filter), additional_properties, watcher );
return E_NOTIMPL;
}
static const struct IDeviceInformationStaticsVtbl device_statics_vtbl =
{
device_statics_QueryInterface,
device_statics_AddRef,
device_statics_Release,
/* IInspectable methods */
device_statics_GetIids,
device_statics_GetRuntimeClassName,
device_statics_GetTrustLevel,
/* IDeviceInformationStatics methods */
device_statics_CreateFromIdAsync,
device_statics_CreateFromIdAsyncAdditionalProperties,
device_statics_FindAllAsync,
device_statics_FindAllAsyncDeviceClass,
device_statics_FindAllAsyncAqsFilter,
device_statics_FindAllAsyncAqsFilterAndAdditionalProperties,
device_statics_CreateWatcher,
device_statics_CreateWatcherDeviceClass,
device_statics_CreateWatcherAqsFilter,
device_statics_CreateWatcherAqsFilterAndAdditionalProperties,
};
DEFINE_IINSPECTABLE( device_statics2, IDeviceInformationStatics2, struct device_information_statics, IActivationFactory_iface ); DEFINE_IINSPECTABLE( device_statics2, IDeviceInformationStatics2, struct device_information_statics, IActivationFactory_iface );
static HRESULT WINAPI device_statics2_GetAqsFilterFromDeviceClass( IDeviceInformationStatics2 *iface, DeviceClass device_class, static HRESULT WINAPI device_statics2_GetAqsFilterFromDeviceClass( IDeviceInformationStatics2 *iface, DeviceClass device_class,
...@@ -374,6 +474,7 @@ static const struct IDeviceInformationStatics2Vtbl device_statics2_vtbl = ...@@ -374,6 +474,7 @@ static const struct IDeviceInformationStatics2Vtbl device_statics2_vtbl =
static struct device_information_statics device_information_statics = static struct device_information_statics device_information_statics =
{ {
{&activation_factory_vtbl}, {&activation_factory_vtbl},
{&device_statics_vtbl},
{&device_statics2_vtbl}, {&device_statics2_vtbl},
1 1
}; };
......
...@@ -144,6 +144,7 @@ static void test_DeviceInformation( void ) ...@@ -144,6 +144,7 @@ static void test_DeviceInformation( void )
IInspectable *inspectable, *inspectable2; IInspectable *inspectable, *inspectable2;
IActivationFactory *factory; IActivationFactory *factory;
IDeviceInformationStatics2 *device_info_statics2; IDeviceInformationStatics2 *device_info_statics2;
IDeviceInformationStatics *device_info_statics;
IDeviceWatcher *device_watcher; IDeviceWatcher *device_watcher;
DeviceWatcherStatus status = 0xdeadbeef; DeviceWatcherStatus status = 0xdeadbeef;
ULONG ref; ULONG ref;
...@@ -174,7 +175,7 @@ static void test_DeviceInformation( void ) ...@@ -174,7 +175,7 @@ static void test_DeviceInformation( void )
if (FAILED( hr )) if (FAILED( hr ))
{ {
win_skip( "IDeviceInformationStatics2 not supported.\n" ); win_skip( "IDeviceInformationStatics2 not supported.\n" );
goto skip_device_statics2; goto skip_device_statics;
} }
hr = IDeviceInformationStatics2_QueryInterface( device_info_statics2, &IID_IInspectable, (void **)&inspectable2 ); hr = IDeviceInformationStatics2_QueryInterface( device_info_statics2, &IID_IInspectable, (void **)&inspectable2 );
...@@ -223,7 +224,16 @@ static void test_DeviceInformation( void ) ...@@ -223,7 +224,16 @@ static void test_DeviceInformation( void )
IInspectable_Release( inspectable2 ); IInspectable_Release( inspectable2 );
IDeviceInformationStatics2_Release( device_info_statics2 ); IDeviceInformationStatics2_Release( device_info_statics2 );
skip_device_statics2: hr = IActivationFactory_QueryInterface( factory, &IID_IDeviceInformationStatics, (void **)&device_info_statics );
ok( hr == S_OK || broken( hr == E_NOINTERFACE ), "got hr %#lx\n", hr );
if (FAILED( hr ))
{
win_skip( "IDeviceInformationStatics not supported.\n" );
goto skip_device_statics;
}
IDeviceInformationStatics_Release( device_info_statics );
skip_device_statics:
IInspectable_Release( inspectable ); IInspectable_Release( inspectable );
ref = IActivationFactory_Release( factory ); ref = IActivationFactory_Release( factory );
ok( ref == 1, "got ref %lu\n", ref ); ok( ref == 1, "got ref %lu\n", ref );
......
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