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 a7a8176303c..ec20a712ace 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 dc010d085f2..5b6a4b1c984 100644 --- a/dlls/windows.media.speech/vector.c +++ b/dlls/windows.media.speech/vector.c @@ -783,6 +783,7 @@ error: struct vector_view_inspectable { IVectorView_IInspectable IVectorView_IInspectable_iface; + IIterable_IInspectable IIterable_IInspectable_iface; struct vector_iids iids; LONG ref;
@@ -812,6 +813,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; @@ -935,6 +942,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*> @@ -944,6 +980,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;
@@ -972,6 +1009,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; @@ -1050,6 +1093,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;
@@ -1211,6 +1255,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; @@ -1219,6 +1291,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;