[PATCH v3 4/5] comsvcs: Implement ISharedPropertyGroupManager_get_Group().
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> --- v3: - Add more tests. v2: No changes. --- dlls/comsvcs/property.c | 19 +++++++++++++++++-- dlls/comsvcs/tests/property.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/dlls/comsvcs/property.c b/dlls/comsvcs/property.c index 045415e246..a73964d288 100644 --- a/dlls/comsvcs/property.c +++ b/dlls/comsvcs/property.c @@ -378,8 +378,23 @@ static HRESULT WINAPI group_manager_CreatePropertyGroup(ISharedPropertyGroupMana static HRESULT WINAPI group_manager_get_Group(ISharedPropertyGroupManager *iface, BSTR name, ISharedPropertyGroup **group) { - FIXME("iface %p, name %s, group %p: stub.\n", iface, debugstr_w(name), group); - return E_NOTIMPL; + struct group_manager *manager = impl_from_ISharedPropertyGroupManager(iface); + struct property_group *property_group; + + TRACE("iface %p, name %s, group %p.\n", iface, debugstr_w(name), group); + + if (!name || !group) + return E_POINTER; + + EnterCriticalSection(&manager->cs); + property_group = find_propery_group(manager, name); + LeaveCriticalSection(&manager->cs); + + if (!property_group) + return E_INVALIDARG; + + return ISharedPropertyGroup_QueryInterface(&property_group->ISharedPropertyGroup_iface, + &IID_ISharedPropertyGroup, (void **)group); } static HRESULT WINAPI group_manager_get__NewEnum(ISharedPropertyGroupManager *iface, IUnknown **retval) diff --git a/dlls/comsvcs/tests/property.c b/dlls/comsvcs/tests/property.c index 8ac5e522f5..7321bbcfe6 100644 --- a/dlls/comsvcs/tests/property.c +++ b/dlls/comsvcs/tests/property.c @@ -166,7 +166,7 @@ static void test_interfaces(void) static void test_property_group(void) { - ISharedPropertyGroup *group, *group1; + ISharedPropertyGroup *group, *group1, *group2; ISharedPropertyGroupManager *manager; ULONG refcount, expected_refcount; LONG isolation, release; @@ -284,6 +284,34 @@ static void test_property_group(void) TEST_TYPEINFO(dispatch, test_name_ids, ARRAY_SIZE(test_name_ids), &IID_ISharedPropertyGroup); IDispatch_Release(dispatch); + hr = ISharedPropertyGroupManager_get_Group(manager, NULL, &group2); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + name = SysAllocString(L"nonexistgroup"); + hr = ISharedPropertyGroupManager_get_Group(manager, name, &group2); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + SysFreeString(name); + + name = SysAllocString(L"testgroupname"); + hr = ISharedPropertyGroupManager_get_Group(manager, name, NULL); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + expected_refcount = get_refcount(manager); + hr = ISharedPropertyGroupManager_get_Group(manager, name, &group2); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(group2 == group, "Got unexpected pointer %p.\n", group2); + refcount = get_refcount(group); + ok(refcount == 2, "Got unexpected refcount: %u.\n", refcount); + refcount = get_refcount(manager); + ok(refcount == expected_refcount, "Got refcount: %u, expected %u.\n", refcount, expected_refcount); + ISharedPropertyGroup_Release(group2); + SysFreeString(name); + + name = SysAllocString(L"Testgroupname"); + hr = ISharedPropertyGroupManager_get_Group(manager, name, &group2); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + SysFreeString(name); + expected_refcount = get_refcount(manager) - 1; ISharedPropertyGroup_Release(group); refcount = get_refcount(manager); -- 2.28.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=77762 Your paranoid android. === debiant (32 bit report) === comsvcs: property.c:130: Test failed: Got hr 0x80040154. property.c:134: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b4d). Report validation errors: comsvcs:property crashed (c0000005) === debiant (32 bit French report) === comsvcs: property.c:130: Test failed: Got hr 0x80040154. property.c:134: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b4d). Report validation errors: comsvcs:property crashed (c0000005) === debiant (32 bit Japanese:Japan report) === comsvcs: property.c:130: Test failed: Got hr 0x80040154. property.c:134: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b4d). Report validation errors: comsvcs:property crashed (c0000005) === debiant (32 bit Chinese:China report) === comsvcs: property.c:130: Test failed: Got hr 0x80040154. property.c:134: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b4d). Report validation errors: comsvcs:property crashed (c0000005) === debiant (32 bit WoW report) === comsvcs: property.c:130: Test failed: Got hr 0x80040154. property.c:134: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b4d). Report validation errors: comsvcs:property crashed (c0000005) === debiant (64 bit WoW report) === comsvcs: property.c:130: Test failed: Got hr 0x80040154. property.c:134: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b4d). Report validation errors: comsvcs:property crashed (c0000005)
participants (2)
-
Jactry Zeng -
Marvin