Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com
-- v2: dsdmo: Add IMediaParamInfo stub interface. dsdmo/tests: Add IMediaParamInfo tests.
From: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- include/Makefile.in | 1 + include/medparam.idl | 58 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 include/medparam.idl
diff --git a/include/Makefile.in b/include/Makefile.in index d5f389b506a..4ea66b37f33 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -414,6 +414,7 @@ SOURCES = \ mcx.h \ mediaerr.h \ mediaobj.idl \ + medparam.idl \ metahost.idl \ mfapi.h \ mfd3d12.idl \ diff --git a/include/medparam.idl b/include/medparam.idl new file mode 100644 index 00000000000..f3b7f2f463e --- /dev/null +++ b/include/medparam.idl @@ -0,0 +1,58 @@ +/* + * Copyright 2022 Zhiyi Zhang for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "unknwn.idl"; + +typedef float MP_DATA; +typedef DWORD MP_CAPS; +typedef DWORD MP_TIMEDATA; + +typedef enum _MP_Type +{ + MPT_INT, + MPT_FLOAT, + MPT_BOOL, + MPT_ENUM, + MPT_MAX, +} MP_TYPE; + +typedef struct _MP_PARAMINFO +{ + MP_TYPE mpType; + MP_CAPS mopCaps; + MP_DATA mpdMinValue; + MP_DATA mpdMaxValue; + MP_DATA mpdNeutralValue; + WCHAR szUnitText[32]; + WCHAR szLabel[32]; +} MP_PARAMINFO; + +[ +object, +uuid(6D6CBB60-A223-44AA-842F-A2F06750BE6D), +version(1.0) +] +interface IMediaParamInfo : IUnknown +{ + HRESULT GetParamCount([out] DWORD *count); + HRESULT GetParamInfo([in] DWORD index, [out] MP_PARAMINFO *info); + HRESULT GetParamText([in] DWORD index, [out] WCHAR **text); + HRESULT GetNumTimeFormats([out] DWORD *count); + HRESULT GetSupportedTimeFormat([in] DWORD index, [out] GUID *guid); + HRESULT GetCurrentTimeFormat([out] GUID *guid, [out] MP_TIMEDATA *time_data); +}
From: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/dsdmo/tests/dsdmo.c | 42 ++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-)
diff --git a/dlls/dsdmo/tests/dsdmo.c b/dlls/dsdmo/tests/dsdmo.c index 44e4f88af8f..4947b67c751 100644 --- a/dlls/dsdmo/tests/dsdmo.c +++ b/dlls/dsdmo/tests/dsdmo.c @@ -24,6 +24,7 @@ #include "mmsystem.h" #include "dmo.h" #include "initguid.h" +#include "medparam.h" #include "dsound.h" #include "uuids.h" #include "wine/test.h" @@ -131,28 +132,41 @@ static void test_aggregation(const GUID *clsid)
static void test_interfaces(const GUID *clsid, const GUID *iid) { + static const GUID *guids[] = + { + &IID_IMediaObject, + &IID_IMediaObjectInPlace, + &IID_IMediaParamInfo, + }; IUnknown *unk, *unk2, *unk3; + unsigned int i; HRESULT hr; ULONG ref;
hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, iid, (void **)&unk); ok(hr == S_OK, "Got hr %#lx.\n", hr);
- hr = IUnknown_QueryInterface(unk, &IID_IMediaObject, (void **)&unk2); - ok(hr == S_OK, "Got hr %#lx.\n", hr); - hr = IUnknown_QueryInterface(unk2, iid, (void **)&unk3); - ok(hr == S_OK, "Got hr %#lx.\n", hr); - ok(unk3 == unk, "Interface pointers didn't match.\n"); - IUnknown_Release(unk3); - IUnknown_Release(unk2); + for (i = 0; i < ARRAY_SIZE(guids); ++i) + { + winetest_push_context("GUID %s", debugstr_guid(guids[i]));
- hr = IUnknown_QueryInterface(unk, &IID_IMediaObjectInPlace, (void **)&unk2); - ok(hr == S_OK, "Got hr %#lx.\n", hr); - hr = IUnknown_QueryInterface(unk2, iid, (void **)&unk3); - ok(hr == S_OK, "Got hr %#lx.\n", hr); - ok(unk3 == unk, "Interface pointers didn't match.\n"); - IUnknown_Release(unk3); - IUnknown_Release(unk2); + hr = IUnknown_QueryInterface(unk, guids[i], (void **)&unk2); + todo_wine_if(guids[i] == &IID_IMediaParamInfo) + ok(hr == S_OK, "Got hr %#lx.\n", hr); + if (hr != S_OK) + { + winetest_pop_context(); + continue; + } + + hr = IUnknown_QueryInterface(unk2, iid, (void **)&unk3); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(unk3 == unk, "Interface pointers didn't match.\n"); + IUnknown_Release(unk3); + IUnknown_Release(unk2); + + winetest_pop_context(); + }
ref = IUnknown_Release(unk); ok(!ref, "Got outstanding refcount %ld.\n", ref);
From: Zhiyi Zhang zzhang@codeweavers.com
Fix Chuzzle Deluxe crash at start.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/dsdmo/main.c | 77 ++++++++++++++++++++++++++++++++++++++++ dlls/dsdmo/tests/dsdmo.c | 7 ---- 2 files changed, 77 insertions(+), 7 deletions(-)
diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c index fe7cf1115a7..720d37350fe 100644 --- a/dlls/dsdmo/main.c +++ b/dlls/dsdmo/main.c @@ -22,6 +22,7 @@ #include "mmsystem.h" #include "uuids.h" #include "initguid.h" +#include "medparam.h" #include "dsound.h" #include "rpcproxy.h"
@@ -33,6 +34,7 @@ struct effect { IMediaObject IMediaObject_iface; IMediaObjectInPlace IMediaObjectInPlace_iface; + IMediaParamInfo IMediaParamInfo_iface; IUnknown IUnknown_inner; IUnknown *outer_unk; LONG refcount; @@ -66,6 +68,8 @@ static HRESULT WINAPI effect_inner_QueryInterface(IUnknown *iface, REFIID iid, v *out = &effect->IMediaObject_iface; else if (IsEqualGUID(iid, &IID_IMediaObjectInPlace)) *out = &effect->IMediaObjectInPlace_iface; + else if (IsEqualGUID(iid, &IID_IMediaParamInfo)) + *out = &effect->IMediaParamInfo_iface; else if (!(*out = effect->ops->query_interface(effect, iid))) { WARN("%s not implemented; returning E_NOINTERFACE.\n", debugstr_guid(iid)); @@ -418,6 +422,78 @@ static const IMediaObjectInPlaceVtbl effect_inplace_vtbl = effect_inplace_GetLatency, };
+static struct effect *impl_from_IMediaParamInfo(IMediaParamInfo *iface) +{ + return CONTAINING_RECORD(iface, struct effect, IMediaParamInfo_iface); +} + +static HRESULT WINAPI effect_media_param_info_QueryInterface(IMediaParamInfo *iface, REFIID iid, void **out) +{ + struct effect *effect = impl_from_IMediaParamInfo(iface); + return IUnknown_QueryInterface(effect->outer_unk, iid, out); +} + +static ULONG WINAPI effect_media_param_info_AddRef(IMediaParamInfo *iface) +{ + struct effect *effect = impl_from_IMediaParamInfo(iface); + return IUnknown_AddRef(effect->outer_unk); +} + +static ULONG WINAPI effect_media_param_info_Release(IMediaParamInfo *iface) +{ + struct effect *effect = impl_from_IMediaParamInfo(iface); + return IUnknown_Release(effect->outer_unk); +} + +static HRESULT WINAPI effect_media_param_info_GetParamCount(IMediaParamInfo *iface, DWORD *count) +{ + FIXME("iface %p, count %p, stub!\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI effect_media_param_info_GetParamInfo(IMediaParamInfo *iface, DWORD index, MP_PARAMINFO *info) +{ + FIXME("iface %p, index %lu, info %p, stub!\n", iface, index, info); + return E_NOTIMPL; +} + +static HRESULT WINAPI effect_media_param_info_GetParamText(IMediaParamInfo *iface, DWORD index, WCHAR **text) +{ + FIXME("iface %p, index %lu, text %p, stub!\n", iface, index, text); + return E_NOTIMPL; +} + +static HRESULT WINAPI effect_media_param_info_GetNumTimeFormats(IMediaParamInfo *iface, DWORD *count) +{ + FIXME("iface %p, count %p, stub!\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI effect_media_param_info_GetSupportedTimeFormat(IMediaParamInfo *iface, DWORD index, GUID *guid) +{ + FIXME("iface %p, index %lu, guid %p, stub!\n", iface, index, guid); + return E_NOTIMPL; +} + +static HRESULT WINAPI effect_media_param_info_GetCurrentTimeFormat(IMediaParamInfo *iface, GUID *guid, MP_TIMEDATA *time_data) +{ + FIXME("iface %p, guid %p, time_data %p, stub!\n", iface, guid, time_data); + return E_NOTIMPL; +} + +static const IMediaParamInfoVtbl effect_media_param_info_vtbl = +{ + effect_media_param_info_QueryInterface, + effect_media_param_info_AddRef, + effect_media_param_info_Release, + effect_media_param_info_GetParamCount, + effect_media_param_info_GetParamInfo, + effect_media_param_info_GetParamText, + effect_media_param_info_GetNumTimeFormats, + effect_media_param_info_GetSupportedTimeFormat, + effect_media_param_info_GetCurrentTimeFormat, +}; + static void effect_init(struct effect *effect, IUnknown *outer, const struct effect_ops *ops) { effect->outer_unk = outer ? outer : &effect->IUnknown_inner; @@ -425,6 +501,7 @@ static void effect_init(struct effect *effect, IUnknown *outer, const struct eff effect->IUnknown_inner.lpVtbl = &effect_inner_vtbl; effect->IMediaObject_iface.lpVtbl = &effect_vtbl; effect->IMediaObjectInPlace_iface.lpVtbl = &effect_inplace_vtbl; + effect->IMediaParamInfo_iface.lpVtbl = &effect_media_param_info_vtbl;
InitializeCriticalSection(&effect->cs); effect->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": effect.cs"); diff --git a/dlls/dsdmo/tests/dsdmo.c b/dlls/dsdmo/tests/dsdmo.c index 4947b67c751..90b8e61f5e7 100644 --- a/dlls/dsdmo/tests/dsdmo.c +++ b/dlls/dsdmo/tests/dsdmo.c @@ -151,14 +151,7 @@ static void test_interfaces(const GUID *clsid, const GUID *iid) winetest_push_context("GUID %s", debugstr_guid(guids[i]));
hr = IUnknown_QueryInterface(unk, guids[i], (void **)&unk2); - todo_wine_if(guids[i] == &IID_IMediaParamInfo) ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr != S_OK) - { - winetest_pop_context(); - continue; - } - hr = IUnknown_QueryInterface(unk2, iid, (void **)&unk3); ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(unk3 == unk, "Interface pointers didn't match.\n");
This merge request was approved by Zebediah Figura.