mirror of
https://gitlab.winehq.org/wine/wine.git
synced 2024-11-19 17:06:04 -07:00
wintypes: Add stubs for IMapView<HSTRING, IInspectable *>.
Implement GetView() for Windows.Foundation.Collections.PropertySet using an instance of this stub.
This commit is contained in:
parent
7f2bb2cb46
commit
c62ecdd8ad
2 changed files with 141 additions and 3 deletions
|
@ -28,6 +28,132 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL( wintypes );
|
||||
|
||||
struct mapview_HSTRING_IInspectable
|
||||
{
|
||||
IMapView_HSTRING_IInspectable IMapView_HSTRING_IInspectable_iface;
|
||||
LONG ref;
|
||||
};
|
||||
|
||||
static inline struct mapview_HSTRING_IInspectable *
|
||||
impl_from_IMapView_HSTRING_IInspectable( IMapView_HSTRING_IInspectable *iface )
|
||||
{
|
||||
return CONTAINING_RECORD( iface, struct mapview_HSTRING_IInspectable,
|
||||
IMapView_HSTRING_IInspectable_iface );
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE mapview_HSTRING_IInspectable_QueryInterface(
|
||||
IMapView_HSTRING_IInspectable *iface, REFIID iid, void **out )
|
||||
{
|
||||
TRACE( "(%p, %s, %p)\n", iface, debugstr_guid( iid ), out );
|
||||
|
||||
*out = NULL;
|
||||
if (IsEqualGUID( iid, &IID_IUnknown ) ||
|
||||
IsEqualGUID( iid, &IID_IInspectable ) ||
|
||||
IsEqualGUID( iid, &IID_IMapView_HSTRING_IInspectable ))
|
||||
{
|
||||
*out = iface;
|
||||
IUnknown_AddRef( iface );
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
FIXME( "%s not implemented, returning E_NOTINTERFACE.\n", debugstr_guid( iid ) );
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
mapview_HSTRING_IInspectable_AddRef( IMapView_HSTRING_IInspectable *iface )
|
||||
{
|
||||
struct mapview_HSTRING_IInspectable *impl;
|
||||
|
||||
TRACE( "(%p)\n", iface );
|
||||
|
||||
impl = impl_from_IMapView_HSTRING_IInspectable( iface );
|
||||
return InterlockedIncrement( &impl->ref );
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
mapview_HSTRING_IInspectable_Release( IMapView_HSTRING_IInspectable *iface )
|
||||
{
|
||||
struct mapview_HSTRING_IInspectable *impl;
|
||||
ULONG ref;
|
||||
|
||||
TRACE( "(%p)\n", iface );
|
||||
|
||||
impl = impl_from_IMapView_HSTRING_IInspectable( iface );
|
||||
ref = InterlockedDecrement( &impl->ref );
|
||||
if (!ref)
|
||||
free( impl );
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE mapview_HSTRING_IInspectable_GetIids(
|
||||
IMapView_HSTRING_IInspectable *iface, ULONG *iid_count, IID **iids )
|
||||
{
|
||||
FIXME( "(%p, %p, %p) stub!\n", iface, iid_count, iids );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE mapview_HSTRING_IInspectable_GetRuntimeClassName(
|
||||
IMapView_HSTRING_IInspectable *iface, HSTRING *class_name )
|
||||
{
|
||||
FIXME( "(%p, %p) stub!\n", iface, class_name );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE mapview_HSTRING_IInspectable_GetTrustLevel(
|
||||
IMapView_HSTRING_IInspectable *iface, TrustLevel *trust_level )
|
||||
{
|
||||
FIXME( "(%p, %p) stub!\n", iface, trust_level );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
mapview_HSTRING_IInspectable_get_Size( IMapView_HSTRING_IInspectable *iface, UINT32 *size )
|
||||
{
|
||||
FIXME( "(%p, %p) stub!\n", iface, size );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE mapview_HSTRING_IInspectable_HaKey(
|
||||
IMapView_HSTRING_IInspectable *iface, HSTRING key, boolean *exists )
|
||||
{
|
||||
FIXME( "(%p, %s, %p) stub!\n", iface, debugstr_hstring( key ), exists );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE mapview_HSTRING_IInspectable_Lookup(
|
||||
IMapView_HSTRING_IInspectable *iface, HSTRING key, IInspectable **value )
|
||||
{
|
||||
FIXME( "(%p, %s, %p) stub!\n", iface, debugstr_hstring( key ), value );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE mapview_HSTRING_IInspectable_Split(
|
||||
IMapView_HSTRING_IInspectable *iface, IMapView_HSTRING_IInspectable **first,
|
||||
IMapView_HSTRING_IInspectable **second )
|
||||
{
|
||||
FIXME( "(%p, %p, %p) stub!\n", iface, first, second );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
const static IMapView_HSTRING_IInspectableVtbl mapview_HSTRING_IInspectable_vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
mapview_HSTRING_IInspectable_QueryInterface,
|
||||
mapview_HSTRING_IInspectable_AddRef,
|
||||
mapview_HSTRING_IInspectable_Release,
|
||||
/* IInspectable */
|
||||
mapview_HSTRING_IInspectable_GetIids,
|
||||
mapview_HSTRING_IInspectable_GetRuntimeClassName,
|
||||
mapview_HSTRING_IInspectable_GetTrustLevel,
|
||||
/* IMapView<HSTRING, IInspectable*> */
|
||||
mapview_HSTRING_IInspectable_Lookup,
|
||||
mapview_HSTRING_IInspectable_get_Size,
|
||||
mapview_HSTRING_IInspectable_HaKey,
|
||||
mapview_HSTRING_IInspectable_Split,
|
||||
};
|
||||
|
||||
struct propertyset
|
||||
{
|
||||
IPropertySet IPropertySet_iface;
|
||||
|
@ -201,8 +327,20 @@ static HRESULT STDMETHODCALLTYPE propertyset_HasKey( IMap_HSTRING_IInspectable *
|
|||
static HRESULT STDMETHODCALLTYPE propertyset_GetView(
|
||||
IMap_HSTRING_IInspectable *iface, IMapView_HSTRING_IInspectable **view )
|
||||
{
|
||||
FIXME( "(%p, %p) stub!\n", iface, view );
|
||||
return E_NOTIMPL;
|
||||
struct mapview_HSTRING_IInspectable *impl;
|
||||
|
||||
FIXME( "(%p, %p) semi-stub!\n", iface, view );
|
||||
*view = NULL;
|
||||
impl = calloc( 1, sizeof( *impl ) );
|
||||
if (!impl)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
impl->IMapView_HSTRING_IInspectable_iface.lpVtbl = &mapview_HSTRING_IInspectable_vtbl;
|
||||
|
||||
impl->ref = 1;
|
||||
*view = &impl->IMapView_HSTRING_IInspectable_iface;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE propertyset_Insert( IMap_HSTRING_IInspectable *iface,
|
||||
|
|
|
@ -104,7 +104,7 @@ static void test_IPropertySet(void)
|
|||
skip( "Could not obtain IIterable<IKeyValuePair<HSTRING, IInspectable *>> instance.\n");
|
||||
|
||||
hr = IMap_HSTRING_IInspectable_GetView( map, &map_view );
|
||||
todo_wine ok( SUCCEEDED( hr ), "GetView failed, got %#lx\n", hr );
|
||||
ok( SUCCEEDED( hr ), "GetView failed, got %#lx\n", hr );
|
||||
if (SUCCEEDED( hr ))
|
||||
{
|
||||
hr = IMapView_HSTRING_IInspectable_QueryInterface( map_view, &IID_IIterable_IKeyValuePair_HSTRING_IInspectable,
|
||||
|
|
Loading…
Reference in a new issue