Module: wine Branch: master Commit: e852186ad3d324e3d8729e1e3e0140d2d6aef8ec URL: https://gitlab.winehq.org/wine/wine/-/commit/e852186ad3d324e3d8729e1e3e0140d...
Author: Zebediah Figura zfigura@codeweavers.com Date: Thu May 4 15:48:48 2023 -0500
qcap/audiorecord: Implement IKsPropertySet::Get(&ROPSETID_Pin, AMPROPERTY_PIN_CATEGORY).
Needed by the Microsoft Silverlight configuration tool.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36230
---
dlls/qcap/audiorecord.c | 30 +++++++++++++++++++++++++++--- dlls/qcap/tests/audiorecord.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-)
diff --git a/dlls/qcap/audiorecord.c b/dlls/qcap/audiorecord.c index e650c73916a..0a17eb08057 100644 --- a/dlls/qcap/audiorecord.c +++ b/dlls/qcap/audiorecord.c @@ -361,9 +361,33 @@ static HRESULT WINAPI property_set_Set(IKsPropertySet *iface, const GUID *set, D static HRESULT WINAPI property_set_Get(IKsPropertySet *iface, const GUID *set, DWORD id, void *instance, DWORD instance_size, void *data, DWORD size, DWORD *ret_size) { - FIXME("iface %p, set %s, id %lu, instance %p, instance_size %lu, data %p, size %lu, ret_size %p.\n", - iface, debugstr_guid(set), id, instance, instance_size, data, size, ret_size); - return E_NOTIMPL; + struct audio_record *filter = impl_from_IKsPropertySet(iface); + + TRACE("filter %p, set %s, id %lu, instance %p, instance_size %lu, data %p, size %lu, ret_size %p.\n", + filter, debugstr_guid(set), id, instance, instance_size, data, size, ret_size); + + if (!IsEqualGUID(set, &ROPSETID_Pin)) + { + FIXME("Unknown set %s, returning E_PROP_SET_UNSUPPORTED.\n", debugstr_guid(set)); + return E_PROP_SET_UNSUPPORTED; + } + + if (id != AMPROPERTY_PIN_CATEGORY) + { + FIXME("Unknown id %lu, returning E_PROP_ID_UNSUPPORTED.\n", id); + return E_PROP_ID_UNSUPPORTED; + } + + if (instance || instance_size) + FIXME("Unexpected instance data %p, size %lu.\n", instance, instance_size); + + *ret_size = sizeof(GUID); + + if (size < sizeof(GUID)) + return E_UNEXPECTED; + + *(GUID *)data = PIN_CATEGORY_CAPTURE; + return S_OK; }
static HRESULT WINAPI property_set_QuerySupported(IKsPropertySet *iface, diff --git a/dlls/qcap/tests/audiorecord.c b/dlls/qcap/tests/audiorecord.c index 77b63277460..3e2194436a9 100644 --- a/dlls/qcap/tests/audiorecord.c +++ b/dlls/qcap/tests/audiorecord.c @@ -951,6 +951,36 @@ static void test_connect_pin(IBaseFilter *filter) ok(!ref, "Got outstanding refcount %ld.\n", ref); }
+static void test_property_set(IBaseFilter *filter) +{ + IKsPropertySet *set; + GUID category; + IPin *source; + DWORD size; + HRESULT hr; + + IBaseFilter_FindPin(filter, L"Capture", &source); + IPin_QueryInterface(source, &IID_IKsPropertySet, (void **)&set); + + size = 0xdeadbeef; + memset(&category, 0xcc, sizeof(category)); + hr = IKsPropertySet_Get(set, &ROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, + NULL, 0, &category, sizeof(category) - 1, &size); + ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr); + ok(size == sizeof(GUID), "Got size %lu.\n", size); + + size = 0xdeadbeef; + memset(&category, 0xcc, sizeof(category)); + hr = IKsPropertySet_Get(set, &ROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, + NULL, 0, &category, sizeof(category) + 1, &size); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(IsEqualGUID(&category, &PIN_CATEGORY_CAPTURE), "Got category %s.\n", debugstr_guid(&category)); + ok(size == sizeof(GUID), "Got size %lu.\n", size); + + IKsPropertySet_Release(set); + IPin_Release(source); +} + static void test_stream_config(IBaseFilter *filter) { AUDIO_STREAM_CONFIG_CAPS caps; @@ -1116,6 +1146,7 @@ START_TEST(audiorecord) test_pin_info(filter); test_media_types(filter); test_connect_pin(filter); + test_property_set(filter); /* This calls SetFormat() and hence should be run last. */ test_stream_config(filter);