To both IVector<IInspectable*> and IVectorView<IInspectable*>.
Signed-off-by: Bernhard Kölbl besentv@gmail.com --- dlls/windows.media.speech/private.h | 1 + dlls/windows.media.speech/recognizer.c | 1 + dlls/windows.media.speech/vector.c | 73 ++++++++++++++++++++++++++ 3 files changed, 75 insertions(+)
diff --git a/dlls/windows.media.speech/private.h b/dlls/windows.media.speech/private.h index f7ca87ab393..ba790c361aa 100644 --- a/dlls/windows.media.speech/private.h +++ b/dlls/windows.media.speech/private.h @@ -63,6 +63,7 @@ extern IActivationFactory *synthesizer_factory;
struct vector_iids { + const GUID *iterable; const GUID *vector; const GUID *view; }; diff --git a/dlls/windows.media.speech/recognizer.c b/dlls/windows.media.speech/recognizer.c index cbfe4b71c13..cca3e25d0d6 100644 --- a/dlls/windows.media.speech/recognizer.c +++ b/dlls/windows.media.speech/recognizer.c @@ -641,6 +641,7 @@ static HRESULT WINAPI recognizer_factory_Create( ISpeechRecognizerFactory *iface struct session *session; struct vector_iids constraints_iids = { + .iterable = &IID_IIterable_ISpeechRecognitionConstraint, .vector = &IID_IVector_ISpeechRecognitionConstraint, .view = &IID_IVectorView_ISpeechRecognitionConstraint, }; diff --git a/dlls/windows.media.speech/vector.c b/dlls/windows.media.speech/vector.c index 90627fa1c37..bad977fe429 100644 --- a/dlls/windows.media.speech/vector.c +++ b/dlls/windows.media.speech/vector.c @@ -781,6 +781,7 @@ error: struct vector_view_inspectable { IVectorView_IInspectable IVectorView_IInspectable_iface; + IIterable_IInspectable IIterable_IInspectable_iface; struct vector_iids iids; LONG ref;
@@ -808,6 +809,12 @@ static HRESULT WINAPI vector_view_inspectable_QueryInterface( IVectorView_IInspe return S_OK; }
+ if (IsEqualGUID(iid, impl->iids.iterable)) + { + IInspectable_AddRef((*out = &impl->IIterable_IInspectable_iface)); + return S_OK; + } + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); *out = NULL; return E_NOINTERFACE; @@ -931,6 +938,35 @@ static const struct IVectorView_IInspectableVtbl vector_view_inspectable_vtbl = vector_view_inspectable_GetMany };
+/* + * + * IIterable<Inspectable*> + * + */ + +DEFINE_IINSPECTABLE_(iterable_view_inspectable, IIterable_IInspectable, struct vector_view_inspectable, + view_impl_from_IIterable_IInspectable, IIterable_IInspectable_iface, &impl->IVectorView_IInspectable_iface) + +static HRESULT WINAPI iterable_view_inspectable_First( IIterable_IInspectable *iface, IIterator_IInspectable **value ) +{ + FIXME("iface %p, value %p stub!\n", iface, value); + return E_NOTIMPL; +} + +static const struct IIterable_IInspectableVtbl iterable_view_inspectable_vtbl = +{ + /* IUnknown methods */ + iterable_view_inspectable_QueryInterface, + iterable_view_inspectable_AddRef, + iterable_view_inspectable_Release, + /* IInspectable methods */ + iterable_view_inspectable_GetIids, + iterable_view_inspectable_GetRuntimeClassName, + iterable_view_inspectable_GetTrustLevel, + /* IIterable<IInspectable*> methods */ + iterable_view_inspectable_First +}; + /* * * IVector<Inspectable*> @@ -940,6 +976,7 @@ static const struct IVectorView_IInspectableVtbl vector_view_inspectable_vtbl = struct vector_inspectable { IVector_IInspectable IVector_IInspectable_iface; + IIterable_IInspectable IIterable_IInspectable_iface; struct vector_iids iids; LONG ref;
@@ -968,6 +1005,12 @@ static HRESULT WINAPI vector_inspectable_QueryInterface( IVector_IInspectable *i return S_OK; }
+ if (IsEqualGUID(iid, impl->iids.iterable)) + { + IInspectable_AddRef((*out = &impl->IIterable_IInspectable_iface)); + return S_OK; + } + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); *out = NULL; return E_NOINTERFACE; @@ -1046,6 +1089,7 @@ static HRESULT WINAPI vector_inspectable_GetView( IVector_IInspectable *iface, I
if (!(view = calloc(1, offsetof(struct vector_view_inspectable, elements[impl->size])))) return E_OUTOFMEMORY; view->IVectorView_IInspectable_iface.lpVtbl = &vector_view_inspectable_vtbl; + view->IIterable_IInspectable_iface.lpVtbl = &iterable_view_inspectable_vtbl; view->iids = impl->iids; view->ref = 1;
@@ -1207,6 +1251,34 @@ static const struct IVector_IInspectableVtbl vector_inspectable_vtbl = vector_inspectable_ReplaceAll };
+/* + * + * IIterable<Inspectable*> + * + */ + +DEFINE_IINSPECTABLE(iterable_inspectable, IIterable_IInspectable, struct vector_inspectable, IVector_IInspectable_iface) + +static HRESULT WINAPI iterable_inspectable_First( IIterable_IInspectable *iface, IIterator_IInspectable **value ) +{ + FIXME("iface %p, value %p stub!\n", iface, value); + return E_NOTIMPL; +} + +static const struct IIterable_IInspectableVtbl iterable_inspectable_vtbl = +{ + /* IUnknown methods */ + iterable_inspectable_QueryInterface, + iterable_inspectable_AddRef, + iterable_inspectable_Release, + /* IInspectable methods */ + iterable_inspectable_GetIids, + iterable_inspectable_GetRuntimeClassName, + iterable_inspectable_GetTrustLevel, + /* IIterable<IInspectable*> methods */ + iterable_inspectable_First +}; + HRESULT vector_inspectable_create( const struct vector_iids *iids, IVector_IInspectable **out ) { struct vector_inspectable *impl; @@ -1215,6 +1287,7 @@ HRESULT vector_inspectable_create( const struct vector_iids *iids, IVector_IInsp
if (!(impl = calloc(1, sizeof(*impl)))) return E_OUTOFMEMORY; impl->IVector_IInspectable_iface.lpVtbl = &vector_inspectable_vtbl; + impl->IIterable_IInspectable_iface.lpVtbl = &iterable_inspectable_vtbl; impl->iids = *iids; impl->ref = 1;