Module: wine Branch: master Commit: 31f5f9da801c7c04dfff67e832f9eea5d1051a38 URL: https://source.winehq.org/git/wine.git/?a=commit;h=31f5f9da801c7c04dfff67e83...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Fri Jan 24 12:21:30 2020 +0300
ole32: Fix comparison data for antimoniker.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ole32/antimoniker.c | 15 +++++++-------- dlls/ole32/tests/moniker.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/dlls/ole32/antimoniker.c b/dlls/ole32/antimoniker.c index 9b02129021..ff2e287070 100644 --- a/dlls/ole32/antimoniker.c +++ b/dlls/ole32/antimoniker.c @@ -540,19 +540,18 @@ static ULONG WINAPI AntiMonikerROTDataImpl_Release(IROTData* iface) * AntiMonikerIROTData_GetComparisonData ******************************************************************************/ static HRESULT WINAPI -AntiMonikerROTDataImpl_GetComparisonData(IROTData* iface, BYTE* pbData, - ULONG cbMax, ULONG* pcbData) +AntiMonikerROTDataImpl_GetComparisonData(IROTData *iface, BYTE *data, ULONG data_len, ULONG *data_req) { - DWORD constant = 1; + AntiMonikerImpl *moniker = impl_from_IROTData(iface);
- TRACE("(%p, %u, %p)\n", pbData, cbMax, pcbData); + TRACE("%p, %p, %u, %p.\n", iface, data, data_len, data_req);
- *pcbData = sizeof(CLSID) + sizeof(DWORD); - if (cbMax < *pcbData) + *data_req = sizeof(CLSID) + sizeof(DWORD); + if (data_len < *data_req) return E_OUTOFMEMORY;
- memcpy(pbData, &CLSID_AntiMoniker, sizeof(CLSID)); - memcpy(pbData+sizeof(CLSID), &constant, sizeof(DWORD)); + memcpy(data, &CLSID_AntiMoniker, sizeof(CLSID)); + memcpy(data + sizeof(CLSID), &moniker->count, sizeof(moniker->count));
return S_OK; } diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index 65cd279b1a..5fff7041ef 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -1412,11 +1412,27 @@ static const BYTE expected_anti_moniker_marshal_data[] = 0x01,0x00,0x00,0x00, };
+static const BYTE expected_anti_moniker_marshal_data2[] = +{ + 0x4d,0x45,0x4f,0x57,0x04,0x00,0x00,0x00, + 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46, + 0x05,0x03,0x00,0x00,0x00,0x00,0x00,0x00, + 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46, + 0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00, + 0x02,0x00,0x00,0x00, +}; + static const BYTE expected_anti_moniker_saved_data[] = { 0x01,0x00,0x00,0x00, };
+static const BYTE expected_anti_moniker_saved_data2[] = +{ + 0x02,0x00,0x00,0x00, +}; + static const BYTE expected_anti_moniker_comparison_data[] = { 0x05,0x03,0x00,0x00,0x00,0x00,0x00,0x00, @@ -1424,6 +1440,13 @@ static const BYTE expected_anti_moniker_comparison_data[] = 0x01,0x00,0x00,0x00, };
+static const BYTE expected_anti_moniker_comparison_data2[] = +{ + 0x05,0x03,0x00,0x00,0x00,0x00,0x00,0x00, + 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46, + 0x02,0x00,0x00,0x00, +}; + static const BYTE expected_gc_moniker_marshal_data[] = { 0x4d,0x45,0x4f,0x57,0x04,0x00,0x00,0x00, @@ -2330,6 +2353,12 @@ todo_wine hr = IMoniker_Load(moniker, stream); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ test_moniker("anti moniker 2", moniker, + expected_anti_moniker_marshal_data2, sizeof(expected_anti_moniker_marshal_data2), + expected_anti_moniker_saved_data2, sizeof(expected_anti_moniker_saved_data2), + expected_anti_moniker_comparison_data2, sizeof(expected_anti_moniker_comparison_data2), + 20, L"\..\.."); + hr = IMoniker_IsEqual(moniker, moniker2); ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);