Zebediah Figura : strmbase: Introduce BasePinImpl_QueryInterface().

Alexandre Julliard julliard at winehq.org
Thu Sep 26 15:51:18 CDT 2019


Module: wine
Branch: master
Commit: fa280172e893f4146f725f6e7a4f6bb8cf3476eb
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=fa280172e893f4146f725f6e7a4f6bb8cf3476eb

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed Sep 25 22:36:22 2019 -0500

strmbase: Introduce BasePinImpl_QueryInterface().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 2cc6ef5259..d85d767bf5 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 65ba180caa..5ee13c8892 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);




More information about the wine-cvs mailing list