From 6f370dff7f598a0ae9c0f1ca8f0a7b704243bf1e Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Fri, 29 Mar 2013 16:47:39 +0100 Subject: [PATCH] dplayx: Remove AddRef hacks for the parent DirectPlay object. --- dlls/dplayx/dplaysp.c | 23 ----------------------- dlls/dplayx/lobbysp.c | 16 ---------------- dlls/dplayx/tests/dplayx.c | 4 ++-- 3 files changed, 2 insertions(+), 41 deletions(-) diff --git a/dlls/dplayx/dplaysp.c b/dlls/dplayx/dplaysp.c index bd3e2c18dc5..9ce69104612 100644 --- a/dlls/dplayx/dplaysp.c +++ b/dlls/dplayx/dplaysp.c @@ -173,21 +173,6 @@ static BOOL DPSP_CreateDirectPlaySP( LPVOID lpSP, IDirectPlay2Impl* dp ) This->sp->dplay = dp; - /* Normally we should be keeping a reference, but since only the dplay - * interface that created us can destroy us, we do not keep a reference - * to it (ie we'd be stuck with always having one reference to the dplay - * object, and hence us, around). - * NOTE: The dp object does reference count us. - * - * FIXME: This is a kludge to get around a problem where a queryinterface - * is used to get a new interface and then is closed. We will then - * reference garbage. However, with this we will never deallocate - * the interface we store. The correct fix is to require all - * DP internal interfaces to use the This->dp2 interface which - * should be changed to This->dp - */ - IDirectPlayX_AddRef( (LPDIRECTPLAY2)dp ); - return TRUE; } @@ -195,14 +180,6 @@ static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP ) { IDirectPlaySPImpl *This = lpSP; - /* Normally we should be keeping a reference, but since only the dplay - * interface that created us can destroy us, we do not keep a reference - * to it (ie we'd be stuck with always having one reference to the dplay - * object, and hence us, around). - * NOTE: The dp object does reference count us. - */ - /*IDirectPlayX_Release( (LPDIRECTPLAY2)This->sp->dplay ); */ - HeapFree( GetProcessHeap(), 0, This->sp->lpSpRemoteData ); HeapFree( GetProcessHeap(), 0, This->sp->lpSpLocalData ); diff --git a/dlls/dplayx/lobbysp.c b/dlls/dplayx/lobbysp.c index 3f545c18a5d..737cb3f066f 100644 --- a/dlls/dplayx/lobbysp.c +++ b/dlls/dplayx/lobbysp.c @@ -148,22 +148,6 @@ static BOOL DPLSP_CreateDPLobbySP( LPVOID lpSP, IDirectPlay2Impl* dp ) This->sp->dplay = dp; - /* Normally we should be keeping a reference, but since only the dplay - * interface that created us can destroy us, we do not keep a reference - * to it (ie we'd be stuck with always having one reference to the dplay - * object, and hence us, around). - * NOTE: The dp object does reference count us. - * - * FIXME: This is a kludge to get around a problem where a queryinterface - * is used to get a new interface and then is closed. We will then - * reference garbage. However, with this we will never deallocate - * the interface we store. The correct fix is to require all - * DP internal interfaces to use the This->dp2 interface which - * should be changed to This->dp - */ - IDirectPlayX_AddRef( (LPDIRECTPLAY2)dp ); - - return TRUE; } diff --git a/dlls/dplayx/tests/dplayx.c b/dlls/dplayx/tests/dplayx.c index c8ec54d6df1..b7bbac3bb65 100644 --- a/dlls/dplayx/tests/dplayx.c +++ b/dlls/dplayx/tests/dplayx.c @@ -6394,7 +6394,7 @@ static void test_COM(void) (void**)&dp4); ok(hr == S_OK, "DirectPlay create failed: %08x, expected S_OK\n", hr); refcount = IDirectPlayX_AddRef(dp4); - todo_wine ok(refcount == 2, "refcount == %u, expected 2\n", refcount); + ok(refcount == 2, "refcount == %u, expected 2\n", refcount); hr = IDirectPlayX_QueryInterface(dp4, &IID_IDirectPlay2A, (void**)&dp2A); ok(hr == S_OK, "QueryInterface for IID_IDirectPlay2A failed: %08x\n", hr); @@ -6441,7 +6441,7 @@ static void test_COM(void) IDirectPlay2_Release(dp2A); IDirectPlayX_Release(dp4); refcount = IDirectPlayX_Release(dp4); - todo_wine ok(refcount == 0, "refcount == %u, expected 0\n", refcount); + ok(refcount == 0, "refcount == %u, expected 0\n", refcount); }