Commit 3b7f969a authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dplayx: IDirectPlay and IUnknown share a refcount.

parent de65abb2
......@@ -643,7 +643,7 @@ static HRESULT WINAPI IDirectPlay4Impl_QueryInterface( IDirectPlay4 *iface, REFI
if ( IsEqualGUID( &IID_IUnknown, riid ) )
{
TRACE( "(%p)->(IID_IUnknown %p)\n", This, ppv );
*ppv = &This->IDirectPlay4A_iface;
*ppv = &This->IDirectPlay_iface;
}
else if ( IsEqualGUID( &IID_IDirectPlay, riid ) )
{
......
......@@ -6367,6 +6367,7 @@ static void test_host_migration(void)
static void test_COM(void)
{
IDirectPlay *dp;
IDirectPlay2A *dp2A;
IDirectPlay2 *dp2;
IDirectPlay3A *dp3A;
......@@ -6426,14 +6427,22 @@ static void test_COM(void)
ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
IDirectPlayX_Release(dp4A);
/* IDirectPlay and IUnknown share a refcount */
hr = IDirectPlayX_QueryInterface(dp4, &IID_IDirectPlay, (void**)&dp);
ok(hr == S_OK, "QueryInterface for IID_IDirectPlay failed: %08x\n", hr);
refcount = IDirectPlayX_AddRef(dp);
ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
IDirectPlay_Release(dp);
hr = IDirectPlayX_QueryInterface(dp4, &IID_IUnknown, (void**)&unk);
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
refcount = IUnknown_AddRef(unk);
todo_wine ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
ok(refcount == 3, "refcount == %u, expected 3\n", refcount);
refcount = IUnknown_Release(unk);
todo_wine ok(refcount == 1, "refcount == %u, expected 1\n", refcount);
ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
IUnknown_Release(unk);
IDirectPlay_Release(dp);
IDirectPlayX_Release(dp4A);
IDirectPlay3_Release(dp3);
IDirectPlay3_Release(dp3A);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment