Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
v2: should fix test failures on wine.
dlls/propsys/propvar.c | 9 ++++++++- dlls/propsys/tests/propsys.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c index c56a737ede..1b2cb157a4 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -807,6 +807,9 @@ static BOOL isemptyornull(const PROPVARIANT *propvar) } return i == propvar->u.parray->cDims; } + if (propvar->vt == VT_CLSID) + return !propvar->u.puuid; + /* FIXME: vectors, byrefs, errors? */ return FALSE; } @@ -893,8 +896,12 @@ INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2 else res = lstrcmpA(propvar1->u.pszVal, propvar2_converted->u.pszVal); break; + case VT_CLSID: + res = memcmp(propvar1->u.puuid, propvar2->u.puuid, sizeof(*propvar1->u.puuid)); + if (res) res = res > 0 ? 1 : -1; + break; default: - FIXME("vartype %d not handled\n", propvar1->vt); + FIXME("vartype %#x not handled\n", propvar1->vt); res = -1; break; } diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index c47729ea97..fab2d5e89e 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -660,6 +660,7 @@ static void test_PropVariantToStringAlloc(void) static void test_PropVariantCompare(void) { PROPVARIANT empty, null, emptyarray, i2_0, i2_2, i4_large, i4_largeneg, i4_2, str_2, str_02, str_b; + PROPVARIANT clsid_null, clsid, clsid2; INT res; static const WCHAR str_2W[] = {'2', 0}; static const WCHAR str_02W[] = {'0', '2', 0}; @@ -704,6 +705,12 @@ static void test_PropVariantCompare(void) str_02.u.bstrVal = SysAllocString(str_02W); str_b.vt = VT_BSTR; str_b.u.bstrVal = SysAllocString(str_bW); + clsid_null.vt = VT_CLSID; + clsid_null.u.puuid = NULL; + clsid.vt = VT_CLSID; + clsid.u.puuid = (GUID *)&dummy_guid; + clsid2.vt = VT_CLSID; + clsid2.u.puuid = (GUID *)&GUID_NULL;
res = PropVariantCompareEx(&empty, &empty, 0, 0); ok(res == 0, "res=%i\n", res); @@ -772,6 +779,34 @@ static void test_PropVariantCompare(void) res = PropVariantCompareEx(&i4_large, &str_b, 0, 0); todo_wine ok(res == -5 /* ??? */, "res=%i\n", res);
+ /* VT_CLSID */ + res = PropVariantCompareEx(&clsid_null, &clsid_null, 0, 0); + ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&clsid_null, &clsid_null, 0, PVCF_TREATEMPTYASGREATERTHAN); + ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&clsid, &clsid, 0, 0); + ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&clsid, &clsid2, 0, 0); + ok(res == 1, "res=%i\n", res); + + res = PropVariantCompareEx(&clsid2, &clsid, 0, 0); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&clsid_null, &clsid, 0, 0); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&clsid, &clsid_null, 0, 0); + ok(res == 1, "res=%i\n", res); + + res = PropVariantCompareEx(&clsid_null, &clsid, 0, PVCF_TREATEMPTYASGREATERTHAN); + ok(res == 1, "res=%i\n", res); + + res = PropVariantCompareEx(&clsid, &clsid_null, 0, PVCF_TREATEMPTYASGREATERTHAN); + ok(res == -1, "res=%i\n", res); + SysFreeString(str_2.u.bstrVal); SysFreeString(str_02.u.bstrVal); SysFreeString(str_b.u.bstrVal);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/propsys/propvar.c | 24 +++++++++++++++--------- dlls/propsys/tests/propsys.c | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 10 deletions(-)
diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c index 1b2cb157a4..5d6eecad77 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -846,7 +846,7 @@ INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2 else propvar2_converted = propvar2;
-#define CMP_INT_VALUE(var) do { \ +#define CMP_NUM_VALUE(var) do { \ if (propvar1->u.var > propvar2_converted->u.var) \ res = 1; \ else if (propvar1->u.var < propvar2_converted->u.var) \ @@ -858,28 +858,34 @@ INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2 switch (propvar1->vt) { case VT_I1: - CMP_INT_VALUE(cVal); + CMP_NUM_VALUE(cVal); break; case VT_UI1: - CMP_INT_VALUE(bVal); + CMP_NUM_VALUE(bVal); break; case VT_I2: - CMP_INT_VALUE(iVal); + CMP_NUM_VALUE(iVal); break; case VT_UI2: - CMP_INT_VALUE(uiVal); + CMP_NUM_VALUE(uiVal); break; case VT_I4: - CMP_INT_VALUE(lVal); + CMP_NUM_VALUE(lVal); break; case VT_UI4: - CMP_INT_VALUE(uiVal); + CMP_NUM_VALUE(uiVal); break; case VT_I8: - CMP_INT_VALUE(hVal.QuadPart); + CMP_NUM_VALUE(hVal.QuadPart); break; case VT_UI8: - CMP_INT_VALUE(uhVal.QuadPart); + CMP_NUM_VALUE(uhVal.QuadPart); + break; + case VT_R4: + CMP_NUM_VALUE(fltVal); + break; + case VT_R8: + CMP_NUM_VALUE(dblVal); break; case VT_BSTR: case VT_LPWSTR: diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index fab2d5e89e..1be88172bd 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -660,7 +660,7 @@ static void test_PropVariantToStringAlloc(void) static void test_PropVariantCompare(void) { PROPVARIANT empty, null, emptyarray, i2_0, i2_2, i4_large, i4_largeneg, i4_2, str_2, str_02, str_b; - PROPVARIANT clsid_null, clsid, clsid2; + PROPVARIANT clsid_null, clsid, clsid2, r4_0, r4_2, r8_0, r8_2; INT res; static const WCHAR str_2W[] = {'2', 0}; static const WCHAR str_02W[] = {'0', '2', 0}; @@ -711,6 +711,14 @@ static void test_PropVariantCompare(void) clsid.u.puuid = (GUID *)&dummy_guid; clsid2.vt = VT_CLSID; clsid2.u.puuid = (GUID *)&GUID_NULL; + r4_0.vt = VT_R4; + r4_0.u.fltVal = 0.0f; + r4_2.vt = VT_R4; + r4_2.u.fltVal = 2.0f; + r8_0.vt = VT_R8; + r8_0.u.dblVal = 0.0; + r8_2.vt = VT_R8; + r8_2.u.dblVal = 2.0;
res = PropVariantCompareEx(&empty, &empty, 0, 0); ok(res == 0, "res=%i\n", res); @@ -807,6 +815,29 @@ static void test_PropVariantCompare(void) res = PropVariantCompareEx(&clsid, &clsid_null, 0, PVCF_TREATEMPTYASGREATERTHAN); ok(res == -1, "res=%i\n", res);
+ /* VT_R4/VT_R8 */ + res = PropVariantCompareEx(&r4_0, &r8_0, 0, 0); +todo_wine + ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&r4_0, &r4_0, 0, 0); + ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&r4_0, &r4_2, 0, 0); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&r4_2, &r4_0, 0, 0); + ok(res == 1, "res=%i\n", res); + + res = PropVariantCompareEx(&r8_0, &r8_0, 0, 0); + ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&r8_0, &r8_2, 0, 0); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&r8_2, &r8_0, 0, 0); + ok(res == 1, "res=%i\n", res); + SysFreeString(str_2.u.bstrVal); SysFreeString(str_02.u.bstrVal); SysFreeString(str_b.u.bstrVal);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=49435
Your paranoid android.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 18 ++++++++++++++++++ include/mfidl.idl | 20 ++++++++++++++++++++ 2 files changed, 38 insertions(+)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 5a37ebab21..3f50d715c5 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -558,28 +558,46 @@ static const char *debugstr_attr(const GUID *guid) X(MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS), X(MF_MT_PIXEL_ASPECT_RATIO), X(MF_MT_AVG_BITRATE), + X(MF_PD_PMPHOST_CONTEXT), + X(MF_PD_APP_CONTEXT), + X(MF_PD_TOTAL_FILE_SIZE), + X(MF_PD_AUDIO_ENCODING_BITRATE), + X(MF_PD_VIDEO_ENCODING_BITRATE), + X(MF_PD_MIME_TYPE), + X(MF_PD_LAST_MODIFIED_TIME), + X(MF_PD_PLAYBACK_ELEMENT_ID), X(MF_MT_ALL_SAMPLES_INDEPENDENT), + X(MF_PD_PREFERRED_LANGUAGE), + X(MF_PD_PLAYBACK_BOUNDARY_TIME), X(MF_MT_FRAME_SIZE), X(MF_SINK_WRITER_ASYNC_CALLBACK), X(MF_MT_FRAME_RATE_RANGE_MAX), X(MF_MT_USER_DATA), X(MF_READWRITE_DISABLE_CONVERTERS), + X(MF_PD_SAMI_STYLELIST), + X(MF_SD_LANGUAGE), + X(MF_SD_PROTECTED), X(MF_READWRITE_MMCSS_PRIORITY_AUDIO), X(MF_BYTESTREAM_ORIGIN_NAME), X(MF_BYTESTREAM_CONTENT_TYPE), X(MF_BYTESTREAM_DURATION), + X(MF_SD_SAMI_LANGUAGE), X(MF_BYTESTREAM_LAST_MODIFIED_TIME), X(MF_MT_FRAME_RATE_RANGE_MIN), X(MF_BYTESTREAM_IFO_FILE_URI), X(MF_BYTESTREAM_DLNA_PROFILE_ID), X(MF_MT_MAJOR_TYPE), + X(MF_PD_ADAPTIVE_STREAMING), X(MF_MT_SUBTYPE), + X(MF_SD_MUTUALLY_EXCLUSIVE), + X(MF_SD_STREAM_NAME), X(MF_SINK_WRITER_D3D_MANAGER), X(MF_MT_INTERLACE_MODE), X(MF_READWRITE_MMCSS_PRIORITY), X(MF_SINK_WRITER_DISABLE_THROTTLING), X(MF_READWRITE_D3D_OPTIONAL), X(MF_READWRITE_MMCSS_CLASS_AUDIO), + X(MF_PD_AUDIO_ISVARIABLEBITRATE), X(MF_MT_FRAME_RATE), #undef X }; diff --git a/include/mfidl.idl b/include/mfidl.idl index 630dc6120d..6a958a9e6a 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -536,3 +536,23 @@ cpp_quote("{") cpp_quote(" return attributes->SetUINT64(key, ((UINT64)numerator << 32) | denominator);") cpp_quote("}") cpp_quote("#endif") + +cpp_quote("EXTERN_GUID(MF_SD_LANGUAGE, 0x00af2180, 0xbdc2, 0x423c, 0xab, 0xca, 0xf5, 0x03, 0x59, 0x3b, 0xc1, 0x21);") +cpp_quote("EXTERN_GUID(MF_SD_MUTUALLY_EXCLUSIVE, 0x023ef79c, 0x388d, 0x487f, 0xac, 0x17, 0x69, 0x6c, 0xd6, 0xe3, 0xc6, 0xf5);") +cpp_quote("EXTERN_GUID(MF_SD_PROTECTED, 0x00af2181, 0xbdc2, 0x423c, 0xab, 0xca, 0xf5, 0x03, 0x59, 0x3b, 0xc1, 0x21);") +cpp_quote("EXTERN_GUID(MF_SD_STREAM_NAME, 0x4f1b099d, 0xd314, 0x41e5, 0xa7, 0x81, 0x7f, 0xef, 0xaa, 0x4c, 0x50, 0x1f);") +cpp_quote("EXTERN_GUID(MF_SD_SAMI_LANGUAGE, 0x36fcb98a, 0x6cd0, 0x44cb, 0xac, 0xb9, 0xa8, 0xf5, 0x60, 0x0d, 0xd0, 0xbb);") + +cpp_quote("EXTERN_GUID(MF_PD_PMPHOST_CONTEXT, 0x6c990d31, 0xbb8e, 0x477a, 0x85, 0x98, 0x0d, 0x5d, 0x96, 0xfc, 0xd8, 0x8a);") +cpp_quote("EXTERN_GUID(MF_PD_APP_CONTEXT, 0x6c990d32, 0xbb8e, 0x477a, 0x85, 0x98, 0x0d, 0x5d, 0x96, 0xfc, 0xd8, 0x8a);") +cpp_quote("EXTERN_GUID(MF_PD_TOTAL_FILE_SIZE, 0x6c990d34, 0xbb8e, 0x477a, 0x85, 0x98, 0x0d, 0x5d, 0x96, 0xfc, 0xd8, 0x8a);") +cpp_quote("EXTERN_GUID(MF_PD_AUDIO_ENCODING_BITRATE, 0x6c990d35, 0xbb8e, 0x477a, 0x85, 0x98, 0x0d, 0x5d, 0x96, 0xfc, 0xd8, 0x8a);") +cpp_quote("EXTERN_GUID(MF_PD_VIDEO_ENCODING_BITRATE, 0x6c990d36, 0xbb8e, 0x477a, 0x85, 0x98, 0x0d, 0x5d, 0x96, 0xfc, 0xd8, 0x8a);") +cpp_quote("EXTERN_GUID(MF_PD_MIME_TYPE, 0x6c990d37, 0xbb8e, 0x477a, 0x85, 0x98, 0x0d, 0x5d, 0x96, 0xfc, 0xd8, 0x8a);") +cpp_quote("EXTERN_GUID(MF_PD_LAST_MODIFIED_TIME, 0x6c990d38, 0xbb8e, 0x477a, 0x85, 0x98, 0x0d, 0x5d, 0x96, 0xfc, 0xd8, 0x8a);") +cpp_quote("EXTERN_GUID(MF_PD_PLAYBACK_ELEMENT_ID, 0x6c990d39, 0xbb8e, 0x477a, 0x85, 0x98, 0x0d, 0x5d, 0x96, 0xfc, 0xd8, 0x8a);") +cpp_quote("EXTERN_GUID(MF_PD_PREFERRED_LANGUAGE, 0x6c990d3a, 0xbb8e, 0x477a, 0x85, 0x98, 0x0d, 0x5d, 0x96, 0xfc, 0xd8, 0x8a);") +cpp_quote("EXTERN_GUID(MF_PD_PLAYBACK_BOUNDARY_TIME, 0x6c990d3b, 0xbb8e, 0x477a, 0x85, 0x98, 0x0d, 0x5d, 0x96, 0xfc, 0xd8, 0x8a);") +cpp_quote("EXTERN_GUID(MF_PD_AUDIO_ISVARIABLEBITRATE, 0x33026ee0, 0xe387, 0x4582, 0xae, 0x0a, 0x34, 0xa2, 0xad, 0x3b, 0xaa, 0x18);") +cpp_quote("DEFINE_GUID(MF_PD_ADAPTIVE_STREAMING, 0xea0d5d97, 0x29f9, 0x488b, 0xae, 0x6b, 0x7d, 0x6b, 0x41, 0x36, 0x11, 0x2b);") +cpp_quote("EXTERN_GUID(MF_PD_SAMI_STYLELIST, 0xe0b73c7f, 0x486d, 0x484e, 0x98, 0x72, 0x4d, 0xe5, 0x19, 0x2a, 0x7b, 0xf8);")
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=49436
Your paranoid android.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 3f50d715c5..ea4387e9ae 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -1075,20 +1075,24 @@ static HRESULT WINAPI mfattributes_SetUnknown(IMFAttributes *iface, REFGUID key,
static HRESULT WINAPI mfattributes_LockStore(IMFAttributes *iface) { - mfattributes *This = impl_from_IMFAttributes(iface); + struct attributes *attributes = impl_from_IMFAttributes(iface);
- FIXME("%p\n", This); + TRACE("%p.\n", iface);
- return E_NOTIMPL; + EnterCriticalSection(&attributes->cs); + + return S_OK; }
static HRESULT WINAPI mfattributes_UnlockStore(IMFAttributes *iface) { - mfattributes *This = impl_from_IMFAttributes(iface); + struct attributes *attributes = impl_from_IMFAttributes(iface);
- FIXME("%p\n", This); + TRACE("%p.\n", iface);
- return E_NOTIMPL; + LeaveCriticalSection(&attributes->cs); + + return S_OK; }
static HRESULT WINAPI mfattributes_GetCount(IMFAttributes *iface, UINT32 *items)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=49437
Your paranoid android.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
=== debian9 (64 bit WoW report) ===
mfplat: mfplat.c:2039: Test failed: Unexpected refcount 1. Unhandled exception: page fault on read access to 0x00000010 in 64-bit code (0x00007fe4b3e6fd95).
Report errors: mfplat:mfplat crashed (c0000005)
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
From: Jactry Zeng jzeng@codeweavers.com
Signed-off-by: Jactry Zeng jzeng@codeweavers.com Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 25 ++++++++++++++++++++++--- dlls/mfplat/tests/mfplat.c | 17 +++++++++++++++-- 2 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index ea4387e9ae..7c3bad3e1f 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -1132,11 +1132,30 @@ static HRESULT WINAPI mfattributes_GetItemByIndex(IMFAttributes *iface, UINT32 i
static HRESULT WINAPI mfattributes_CopyAllItems(IMFAttributes *iface, IMFAttributes *dest) { - mfattributes *This = impl_from_IMFAttributes(iface); + struct attributes *attributes = impl_from_IMFAttributes(iface); + HRESULT hr = S_OK; + size_t i;
- FIXME("%p, %p\n", This, dest); + TRACE("%p, %p.\n", iface, dest);
- return E_NOTIMPL; + EnterCriticalSection(&attributes->cs); + + IMFAttributes_LockStore(dest); + + IMFAttributes_DeleteAllItems(dest); + + for (i = 0; i < attributes->count; ++i) + { + hr = IMFAttributes_SetItem(dest, &attributes->attributes[i].key, &attributes->attributes[i].value); + if (FAILED(hr)) + break; + } + + IMFAttributes_UnlockStore(dest); + + LeaveCriticalSection(&attributes->cs); + + return hr; }
static const IMFAttributesVtbl mfattributes_vtbl = diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index a999b9bbe9..613c2aa264 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -507,9 +507,9 @@ static void check_attr_count(IMFAttributes* obj, UINT32 expected, int line) static void test_MFCreateAttributes(void) { static const WCHAR stringW[] = {'W','i','n','e',0}; + IMFAttributes *attributes, *attributes1; PROPVARIANT propvar, ret_propvar; UINT32 value, string_length; - IMFAttributes *attributes; double double_value; IUnknown *unk_value; WCHAR bufferW[256]; @@ -714,11 +714,24 @@ static void test_MFCreateAttributes(void) hr = IMFAttributes_GetUnknown(attributes, &DUMMY_CLSID, &IID_IUnknown, (void **)&unk_value); ok(hr == MF_E_INVALIDTYPE, "Unexpected hr %#x.\n", hr);
- hr = IMFAttributes_DeleteAllItems(attributes); + /* CopyAllItems() */ + hr = MFCreateAttributes(&attributes1, 0); + ok(hr == S_OK, "Failed to create attributes object, hr %#x.\n", hr); + hr = IMFAttributes_CopyAllItems(attributes, attributes1); + ok(hr == S_OK, "Failed to copy items, hr %#x.\n", hr); + CHECK_ATTR_COUNT(attributes, 5); + CHECK_ATTR_COUNT(attributes1, 5); + + hr = IMFAttributes_DeleteAllItems(attributes1); ok(hr == S_OK, "Failed to delete items, hr %#x.\n", hr); + CHECK_ATTR_COUNT(attributes1, 0); + + hr = IMFAttributes_CopyAllItems(attributes1, attributes); + ok(hr == S_OK, "Failed to copy items, hr %#x.\n", hr); CHECK_ATTR_COUNT(attributes, 0);
IMFAttributes_Release(attributes); + IMFAttributes_Release(attributes1); }
static void test_MFCreateMFByteStreamOnStream(void)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=49438
Your paranoid android.
=== wxppro (32 bit report) ===
mfplat: 0b40:mfplat: unhandled exception c0000005 at 2F2E2E2F
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
From: Jactry Zeng jzeng@codeweavers.com
Signed-off-by: Jactry Zeng jzeng@codeweavers.com Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 22 ++++++++++++++++++---- dlls/mfplat/tests/mfplat.c | 14 ++++---------- 2 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 7c3bad3e1f..30bb808f6a 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -796,9 +796,19 @@ static HRESULT WINAPI mfattributes_GetDouble(IMFAttributes *iface, REFGUID key,
static HRESULT WINAPI mfattributes_GetGUID(IMFAttributes *iface, REFGUID key, GUID *value) { - FIXME("%p, %s, %p.\n", iface, debugstr_attr(key), value); + struct attributes *attributes = impl_from_IMFAttributes(iface); + PROPVARIANT attrval; + HRESULT hr;
- return E_NOTIMPL; + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + PropVariantInit(&attrval); + attrval.vt = VT_CLSID; + hr = attributes_get_item(attributes, key, &attrval); + if (SUCCEEDED(hr)) + hr = PropVariantToGUID(&attrval, value); + + return hr; }
static HRESULT WINAPI mfattributes_GetStringLength(IMFAttributes *iface, REFGUID key, UINT32 *length) @@ -1037,9 +1047,13 @@ static HRESULT WINAPI mfattributes_SetDouble(IMFAttributes *iface, REFGUID key,
static HRESULT WINAPI mfattributes_SetGUID(IMFAttributes *iface, REFGUID key, REFGUID value) { - FIXME("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_guid(value)); + struct attributes *attributes = impl_from_IMFAttributes(iface); + PROPVARIANT attrval;
- return E_NOTIMPL; + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_guid(value)); + + InitPropVariantFromCLSID(value, &attrval); + return attributes_set_item(attributes, key, &attrval); }
static HRESULT WINAPI mfattributes_SetString(IMFAttributes *iface, REFGUID key, const WCHAR *value) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 613c2aa264..73367b67ad 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -350,7 +350,6 @@ if(0) ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IMFMediaType_GetMajorType(mediatype, &guid); -todo_wine ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#x.\n", hr);
compressed = FALSE; @@ -376,13 +375,12 @@ todo_wine ok(!compressed, "Unexpected value %d.\n", compressed);
hr = IMFMediaType_SetGUID(mediatype, &MF_MT_MAJOR_TYPE, &MFMediaType_Video); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Failed to set GUID value, hr %#x.\n", hr);
hr = IMFMediaType_GetMajorType(mediatype, &guid); -todo_wine { ok(hr == S_OK, "Failed to get major type, hr %#x.\n", hr); ok(IsEqualGUID(&guid, &MFMediaType_Video), "Unexpected major type.\n"); -} + /* IsEqual() */ hr = MFCreateMediaType(&mediatype2); ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr); @@ -394,19 +392,16 @@ todo_wine {
/* Different major types. */ hr = IMFMediaType_SetGUID(mediatype2, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); -todo_wine ok(hr == S_OK, "Failed to set major type, hr %#x.\n", hr);
flags = 0; hr = IMFMediaType_IsEqual(mediatype, mediatype2, &flags); -todo_wine { ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); ok(flags == (MF_MEDIATYPE_EQUAL_FORMAT_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_USER_DATA), "Unexpected flags %#x.\n", flags); -} + /* Same major types, different subtypes. */ hr = IMFMediaType_SetGUID(mediatype2, &MF_MT_MAJOR_TYPE, &MFMediaType_Video); -todo_wine ok(hr == S_OK, "Failed to set major type, hr %#x.\n", hr);
flags = 0; @@ -417,13 +412,12 @@ todo_wine { | MF_MEDIATYPE_EQUAL_FORMAT_USER_DATA), "Unexpected flags %#x.\n", flags); } hr = IMFMediaType_SetGUID(mediatype, &MF_MT_SUBTYPE, &MFVideoFormat_RGB32); -todo_wine ok(hr == S_OK, "Failed to set subtype, hr %#x.\n", hr);
flags = 0; hr = IMFMediaType_IsEqual(mediatype, mediatype2, &flags); -todo_wine { ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); +todo_wine { ok(flags == (MF_MEDIATYPE_EQUAL_MAJOR_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_DATA | MF_MEDIATYPE_EQUAL_FORMAT_USER_DATA), "Unexpected flags %#x.\n", flags); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=49439
Your paranoid android.
=== wvistau64_zh_CN (32 bit report) ===
mfplat: 0bbc:mfplat: unhandled exception c0000005 at 2F2E2E2F
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
From: Jactry Zeng jzeng@codeweavers.com
Signed-off-by: Jactry Zeng jzeng@codeweavers.com Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 82 ++++++++++++++++++++++++++++++++++---- dlls/mfplat/tests/mfplat.c | 38 +++++++++++++++++- 2 files changed, 111 insertions(+), 9 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 30bb808f6a..2ef4077921 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -872,24 +872,84 @@ static HRESULT WINAPI mfattributes_GetAllocatedString(IMFAttributes *iface, REFG
static HRESULT WINAPI mfattributes_GetBlobSize(IMFAttributes *iface, REFGUID key, UINT32 *size) { - FIXME("%p, %s, %p.\n", iface, debugstr_attr(key), size); + struct attributes *attributes = impl_from_IMFAttributes(iface); + struct attribute *attribute; + HRESULT hr = S_OK;
- return E_NOTIMPL; + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), size); + + EnterCriticalSection(&attributes->cs); + + attribute = attributes_find_item(attributes, key, NULL); + if (attribute) + { + if (attribute->value.vt == MF_ATTRIBUTE_BLOB) + *size = attribute->value.u.caub.cElems; + else + hr = MF_E_INVALIDTYPE; + } + else + hr = MF_E_ATTRIBUTENOTFOUND; + + LeaveCriticalSection(&attributes->cs); + + return hr; }
static HRESULT WINAPI mfattributes_GetBlob(IMFAttributes *iface, REFGUID key, UINT8 *buf, UINT32 bufsize, UINT32 *blobsize) { - FIXME("%p, %s, %p, %d, %p.\n", iface, debugstr_attr(key), buf, bufsize, blobsize); + struct attributes *attributes = impl_from_IMFAttributes(iface); + struct attribute *attribute; + HRESULT hr;
- return E_NOTIMPL; + TRACE("%p, %s, %p, %d, %p.\n", iface, debugstr_attr(key), buf, bufsize, blobsize); + + EnterCriticalSection(&attributes->cs); + + attribute = attributes_find_item(attributes, key, NULL); + if (attribute) + { + if (attribute->value.vt == MF_ATTRIBUTE_BLOB) + { + UINT32 size = attribute->value.u.caub.cElems; + + if (bufsize >= size) + hr = PropVariantToBuffer(&attribute->value, buf, size); + else + hr = E_NOT_SUFFICIENT_BUFFER; + + if (blobsize) + *blobsize = size; + } + else + hr = MF_E_INVALIDTYPE; + } + else + hr = MF_E_ATTRIBUTENOTFOUND; + + LeaveCriticalSection(&attributes->cs); + + return hr; }
static HRESULT WINAPI mfattributes_GetAllocatedBlob(IMFAttributes *iface, REFGUID key, UINT8 **buf, UINT32 *size) { - FIXME("%p, %s, %p, %p.\n", iface, debugstr_attr(key), buf, size); + struct attributes *attributes = impl_from_IMFAttributes(iface); + PROPVARIANT attrval; + HRESULT hr;
- return E_NOTIMPL; + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), buf, size); + + attrval.vt = VT_VECTOR | VT_UI1; + hr = attributes_get_item(attributes, key, &attrval); + if (SUCCEEDED(hr)) + { + *buf = attrval.u.caub.pElems; + *size = attrval.u.caub.cElems; + } + + return hr; }
static HRESULT WINAPI mfattributes_GetUnknown(IMFAttributes *iface, REFGUID key, REFIID riid, void **ppv) @@ -1070,9 +1130,15 @@ static HRESULT WINAPI mfattributes_SetString(IMFAttributes *iface, REFGUID key,
static HRESULT WINAPI mfattributes_SetBlob(IMFAttributes *iface, REFGUID key, const UINT8 *buf, UINT32 size) { - FIXME("%p, %s, %p, %u.\n", iface, debugstr_attr(key), buf, size); + struct attributes *attributes = impl_from_IMFAttributes(iface); + PROPVARIANT attrval;
- return E_NOTIMPL; + TRACE("%p, %s, %p, %u.\n", iface, debugstr_attr(key), buf, size); + + attrval.vt = VT_VECTOR | VT_UI1; + attrval.u.caub.cElems = size; + attrval.u.caub.pElems = (UINT8 *)buf; + return attributes_set_item(attributes, key, &attrval); }
static HRESULT WINAPI mfattributes_SetUnknown(IMFAttributes *iface, REFGUID key, IUnknown *unknown) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 73367b67ad..edf3c6e694 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -501,9 +501,11 @@ static void check_attr_count(IMFAttributes* obj, UINT32 expected, int line) static void test_MFCreateAttributes(void) { static const WCHAR stringW[] = {'W','i','n','e',0}; + static const UINT8 blob[] = {0,1,2,3,4,5}; IMFAttributes *attributes, *attributes1; + UINT8 blob_value[256], *blob_buf = NULL; + UINT32 value, string_length, size; PROPVARIANT propvar, ret_propvar; - UINT32 value, string_length; double double_value; IUnknown *unk_value; WCHAR bufferW[256]; @@ -724,6 +726,40 @@ static void test_MFCreateAttributes(void) ok(hr == S_OK, "Failed to copy items, hr %#x.\n", hr); CHECK_ATTR_COUNT(attributes, 0);
+ /* Blob */ + hr = IMFAttributes_SetBlob(attributes, &DUMMY_GUID1, blob, sizeof(blob)); + ok(hr == S_OK, "Failed to set blob attribute, hr %#x.\n", hr); + CHECK_ATTR_COUNT(attributes, 1); + hr = IMFAttributes_GetBlobSize(attributes, &DUMMY_GUID1, &size); + ok(hr == S_OK, "Failed to get blob size, hr %#x.\n", hr); + ok(size == sizeof(blob), "Unexpected blob size %u.\n", size); + + hr = IMFAttributes_GetBlobSize(attributes, &DUMMY_GUID2, &size); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#x.\n", hr); + + size = 0; + hr = IMFAttributes_GetBlob(attributes, &DUMMY_GUID1, blob_value, sizeof(blob_value), &size); + ok(hr == S_OK, "Failed to get blob, hr %#x.\n", hr); + ok(size == sizeof(blob), "Unexpected blob size %u.\n", size); + ok(!memcmp(blob_value, blob, size), "Unexpected blob.\n"); + + hr = IMFAttributes_GetBlob(attributes, &DUMMY_GUID2, blob_value, sizeof(blob_value), &size); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#x.\n", hr); + + memset(blob_value, 0, sizeof(blob_value)); + size = 0; + hr = IMFAttributes_GetAllocatedBlob(attributes, &DUMMY_GUID1, &blob_buf, &size); + ok(hr == S_OK, "Failed to get allocated blob, hr %#x.\n", hr); + ok(size == sizeof(blob), "Unexpected blob size %u.\n", size); + ok(!memcmp(blob_buf, blob, size), "Unexpected blob.\n"); + CoTaskMemFree(blob_buf); + + hr = IMFAttributes_GetAllocatedBlob(attributes, &DUMMY_GUID2, &blob_buf, &size); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#x.\n", hr); + + hr = IMFAttributes_GetBlob(attributes, &DUMMY_GUID1, blob_value, sizeof(blob) - 1, NULL); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + IMFAttributes_Release(attributes); IMFAttributes_Release(attributes1); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=49440
Your paranoid android.
=== w7u (32 bit report) ===
mfplat: 0ccc:mfplat: unhandled exception c0000005 at 25FF9090
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
From: Jactry Zeng jzeng@codeweavers.com
Signed-off-by: Jactry Zeng jzeng@codeweavers.com Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 16 ++++++++++++++-- dlls/mfplat/tests/mfplat.c | 25 +++++++++++++++++++++---- 2 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 2ef4077921..88945f6724 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -731,9 +731,21 @@ static HRESULT WINAPI mfattributes_GetItemType(IMFAttributes *iface, REFGUID key
static HRESULT WINAPI mfattributes_CompareItem(IMFAttributes *iface, REFGUID key, REFPROPVARIANT value, BOOL *result) { - FIXME("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, result); + struct attributes *attributes = impl_from_IMFAttributes(iface); + struct attribute *attribute;
- return E_NOTIMPL; + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, result); + + *result = FALSE; + + EnterCriticalSection(&attributes->cs); + + if ((attribute = attributes_find_item(attributes, key, NULL))) + *result = !PropVariantCompareEx(&attribute->value, value, PVCU_DEFAULT, PVCF_DEFAULT); + + LeaveCriticalSection(&attributes->cs); + + return S_OK; }
static HRESULT WINAPI mfattributes_Compare(IMFAttributes *iface, IMFAttributes *theirs, MF_ATTRIBUTES_MATCH_TYPE type, diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index edf3c6e694..38151d9020 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -406,21 +406,19 @@ todo_wine
flags = 0; hr = IMFMediaType_IsEqual(mediatype, mediatype2, &flags); -todo_wine { ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(flags == (MF_MEDIATYPE_EQUAL_MAJOR_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_DATA | MF_MEDIATYPE_EQUAL_FORMAT_USER_DATA), "Unexpected flags %#x.\n", flags); -} + hr = IMFMediaType_SetGUID(mediatype, &MF_MT_SUBTYPE, &MFVideoFormat_RGB32); ok(hr == S_OK, "Failed to set subtype, hr %#x.\n", hr);
flags = 0; hr = IMFMediaType_IsEqual(mediatype, mediatype2, &flags); ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); -todo_wine { ok(flags == (MF_MEDIATYPE_EQUAL_MAJOR_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_DATA | MF_MEDIATYPE_EQUAL_FORMAT_USER_DATA), "Unexpected flags %#x.\n", flags); -} + IMFMediaType_Release(mediatype2); IMFMediaType_Release(mediatype); } @@ -511,6 +509,7 @@ static void test_MFCreateAttributes(void) WCHAR bufferW[256]; UINT64 value64; WCHAR *string; + BOOL result; HRESULT hr; GUID key;
@@ -650,6 +649,18 @@ static void test_MFCreateAttributes(void) ok(hr == S_OK, "Failed to get double value, hr %#x.\n", hr); ok(double_value == 22.0, "Unexpected value: %f, expected: 22.0.\n", double_value);
+ propvar.vt = MF_ATTRIBUTE_UINT64; + U(propvar).uhVal.QuadPart = 22; + hr = IMFAttributes_CompareItem(attributes, &GUID_NULL, &propvar, &result); + ok(hr == S_OK, "Failed to compare items, hr %#x.\n", hr); + ok(!result, "Unexpected result.\n"); + + propvar.vt = MF_ATTRIBUTE_DOUBLE; + U(propvar).dblVal = 22.0; + hr = IMFAttributes_CompareItem(attributes, &GUID_NULL, &propvar, &result); + ok(hr == S_OK, "Failed to compare items, hr %#x.\n", hr); + ok(result, "Unexpected result.\n"); + hr = IMFAttributes_SetString(attributes, &DUMMY_GUID1, stringW); ok(hr == S_OK, "Failed to set string attribute, hr %#x.\n", hr); CHECK_ATTR_COUNT(attributes, 3); @@ -722,6 +733,12 @@ static void test_MFCreateAttributes(void) ok(hr == S_OK, "Failed to delete items, hr %#x.\n", hr); CHECK_ATTR_COUNT(attributes1, 0);
+ propvar.vt = MF_ATTRIBUTE_UINT64; + U(propvar).uhVal.QuadPart = 22; + hr = IMFAttributes_CompareItem(attributes, &GUID_NULL, &propvar, &result); + ok(hr == S_OK, "Failed to compare items, hr %#x.\n", hr); + ok(!result, "Unexpected result.\n"); + hr = IMFAttributes_CopyAllItems(attributes1, attributes); ok(hr == S_OK, "Failed to copy items, hr %#x.\n", hr); CHECK_ATTR_COUNT(attributes, 0);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=49441
Your paranoid android.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=49434
Your paranoid android.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.
=== debian9 (build log) ===
Task errors: Unable to set the VM system time: the "nc -q0 '10.42.42.142' '4243'" command returned 1 (settime/connect). Maybe the TestAgentd process is missing the required privileges.