Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- dlls/comsvcs/property.c | 16 ++++++++++++++-- dlls/comsvcs/tests/property.c | 25 ++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/dlls/comsvcs/property.c b/dlls/comsvcs/property.c index 81b13a2cc8..2a10a32285 100644 --- a/dlls/comsvcs/property.c +++ b/dlls/comsvcs/property.c @@ -399,8 +399,20 @@ 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; + + property_group = find_propery_group(manager, name); + 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 1008b04c53..555fb8553c 100644 --- a/dlls/comsvcs/tests/property.c +++ b/dlls/comsvcs/tests/property.c @@ -163,7 +163,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; @@ -271,6 +271,29 @@ 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: %d.\n", refcount); + refcount = get_refcount(manager); + ok(refcount == expected_refcount, "Got refcount: %d, expected %d.\n", refcount, expected_refcount); + ISharedPropertyGroup_Release(group2); + SysFreeString(name); + expected_refcount = get_refcount(manager); ISharedPropertyGroup_Release(group1); refcount = get_refcount(manager);
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=77314
Your paranoid android.
=== debiant (32 bit report) ===
comsvcs: property.c:127: Test failed: Got hr 0x80040154. property.c:131: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b37).
Report validation errors: comsvcs:property crashed (c0000005)
=== debiant (32 bit French report) ===
comsvcs: property.c:127: Test failed: Got hr 0x80040154. property.c:131: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b37).
Report validation errors: comsvcs:property crashed (c0000005)
=== debiant (32 bit Japanese:Japan report) ===
comsvcs: property.c:127: Test failed: Got hr 0x80040154. property.c:131: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b37).
Report validation errors: comsvcs:property crashed (c0000005)
=== debiant (32 bit Chinese:China report) ===
comsvcs: property.c:127: Test failed: Got hr 0x80040154. property.c:131: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b37).
Report validation errors: comsvcs:property crashed (c0000005)
=== debiant (32 bit WoW report) ===
comsvcs: property.c:127: Test failed: Got hr 0x80040154. property.c:131: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b37).
Report validation errors: comsvcs:property crashed (c0000005)
=== debiant (64 bit WoW report) ===
comsvcs: property.c:127: Test failed: Got hr 0x80040154. property.c:131: Test failed: Got hr 0x80040154. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00403b37).
Report validation errors: comsvcs:property crashed (c0000005)