Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/session.c | 19 +++++++++++++++---- dlls/mf/tests/mf.c | 4 ++-- 2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index fe87b3e6584..c8ec1b5c33f 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -1637,23 +1637,34 @@ static HRESULT WINAPI mfsession_QueryInterface(IMFMediaSession *iface, REFIID ri
TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out);
+ *out = NULL; + if (IsEqualIID(riid, &IID_IMFMediaSession) || IsEqualIID(riid, &IID_IMFMediaEventGenerator) || IsEqualIID(riid, &IID_IUnknown)) { *out = &session->IMFMediaSession_iface; - IMFMediaSession_AddRef(iface); - return S_OK; } else if (IsEqualIID(riid, &IID_IMFGetService)) { *out = &session->IMFGetService_iface; + } + else if (IsEqualIID(riid, &IID_IMFRateSupport)) + { + *out = &session->IMFRateSupport_iface; + } + else if (IsEqualIID(riid, &IID_IMFRateControl)) + { + *out = &session->IMFRateControl_iface; + } + + if (*out) + { IMFMediaSession_AddRef(iface); return S_OK; }
- WARN("Unsupported %s.\n", debugstr_guid(riid)); - *out = NULL; + WARN("Unsupported interface %s.\n", debugstr_guid(riid)); return E_NOINTERFACE; }
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 623781a6ba2..eb681a8b9a7 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -1181,8 +1181,8 @@ static void test_media_session(void) ok(hr == S_OK, "Failed to create media session, hr %#x.\n", hr);
check_interface(session, &IID_IMFGetService, TRUE); - todo_wine check_interface(session, &IID_IMFRateSupport, TRUE); - todo_wine check_interface(session, &IID_IMFRateControl, TRUE); + check_interface(session, &IID_IMFRateSupport, TRUE); + check_interface(session, &IID_IMFRateControl, TRUE); check_interface(session, &IID_IMFAttributes, FALSE); check_interface(session, &IID_IMFTopologyNodeAttributeEditor, FALSE); check_interface(session, &IID_IMFLocalMFTRegistration, FALSE);