Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/pin.c | 25 +++++++++++++++++++++++++ include/wine/strmbase.h | 2 ++ 2 files changed, 27 insertions(+)
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 2cc6ef5259d..d85d767bf52 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -157,6 +157,31 @@ HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, unsigned int ind return VFW_S_NO_MORE_ITEMS; }
+HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface) +{ + struct strmbase_pin *pin = impl_from_IPin(iface); + HRESULT hr; + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + *out = NULL; + + if (pin->pFuncsTable->pin_query_interface + && SUCCEEDED(hr = pin->pFuncsTable->pin_query_interface(filter, iid, out))) + return hr; + + if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IPin)) + *out = iface; + else + { + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + ULONG WINAPI BasePinImpl_AddRef(IPin *iface) { struct strmbase_pin *pin = impl_from_IPin(iface); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 65ba180caa7..5ee13c8892e 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -47,6 +47,7 @@ typedef struct BasePinFuncTable { HRESULT (*pin_query_accept)(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt); /* Required for EnumMediaTypes(). */ HRESULT (*pin_get_media_type)(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt); + HRESULT (*pin_query_interface)(struct strmbase_pin *pin, REFIID iid, void **out); } BasePinFuncTable;
struct strmbase_source @@ -97,6 +98,7 @@ typedef struct BaseInputPinFuncTable { /* Base Pin */ HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt); LONG WINAPI BasePinImpl_GetMediaTypeVersion(struct strmbase_pin *pin); +HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out); ULONG WINAPI BasePinImpl_AddRef(IPin *iface); ULONG WINAPI BasePinImpl_Release(IPin *iface); HRESULT WINAPI BasePinImpl_Disconnect(IPin * iface);