dplayx: Remove the unused lock from IDirectPlaySPImpl.

This commit is contained in:
Michael Stefaniuc 2013-09-04 23:57:16 +02:00 committed by Alexandre Julliard
parent 07e5975797
commit 95fcb49503
1 changed files with 1 additions and 42 deletions

View File

@ -34,19 +34,12 @@
WINE_DEFAULT_DEBUG_CHANNEL(dplay); WINE_DEFAULT_DEBUG_CHANNEL(dplay);
/* Prototypes */ /* Prototypes */
static BOOL DPSP_CreateIUnknown( LPVOID lpSP );
static BOOL DPSP_DestroyIUnknown( LPVOID lpSP );
static BOOL DPSP_CreateDirectPlaySP( void *lpSP, IDirectPlayImpl *dp ); static BOOL DPSP_CreateDirectPlaySP( void *lpSP, IDirectPlayImpl *dp );
static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP ); static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP );
/* Predefine the interface */ /* Predefine the interface */
typedef struct IDirectPlaySPImpl IDirectPlaySPImpl; typedef struct IDirectPlaySPImpl IDirectPlaySPImpl;
typedef struct tagDirectPlaySPIUnknownData
{
CRITICAL_SECTION DPSP_lock;
} DirectPlaySPIUnknownData;
typedef struct tagDirectPlaySPData typedef struct tagDirectPlaySPData
{ {
LPVOID lpSpRemoteData; LPVOID lpSpRemoteData;
@ -60,7 +53,6 @@ typedef struct tagDirectPlaySPData
} DirectPlaySPData; } DirectPlaySPData;
#define DPSP_IMPL_FIELDS \ #define DPSP_IMPL_FIELDS \
DirectPlaySPIUnknownData* unk; \
DirectPlaySPData* sp; DirectPlaySPData* sp;
struct IDirectPlaySPImpl struct IDirectPlaySPImpl
@ -111,9 +103,7 @@ HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp )
} }
/* Initialize it */ /* Initialize it */
if( DPSP_CreateIUnknown( *ppvObj ) && if( DPSP_CreateDirectPlaySP( *ppvObj, dp ) )
DPSP_CreateDirectPlaySP( *ppvObj, dp )
)
{ {
IDirectPlaySP_AddRef( (LPDIRECTPLAYSP)*ppvObj ); IDirectPlaySP_AddRef( (LPDIRECTPLAYSP)*ppvObj );
return S_OK; return S_OK;
@ -121,7 +111,6 @@ HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp )
/* Initialize failed, destroy it */ /* Initialize failed, destroy it */
DPSP_DestroyDirectPlaySP( *ppvObj ); DPSP_DestroyDirectPlaySP( *ppvObj );
DPSP_DestroyIUnknown( *ppvObj );
HeapFree( GetProcessHeap(), 0, *ppvObj ); HeapFree( GetProcessHeap(), 0, *ppvObj );
*ppvObj = NULL; *ppvObj = NULL;
@ -129,35 +118,6 @@ HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp )
return DPERR_NOMEMORY; return DPERR_NOMEMORY;
} }
static BOOL DPSP_CreateIUnknown( LPVOID lpSP )
{
IDirectPlaySPImpl *This = lpSP;
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
if ( This->unk == NULL )
{
return FALSE;
}
InitializeCriticalSection( &This->unk->DPSP_lock );
This->unk->DPSP_lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectPlaySPImpl*->DirectPlaySPIUnknownData*->DPSP_lock");
return TRUE;
}
static BOOL DPSP_DestroyIUnknown( LPVOID lpSP )
{
IDirectPlaySPImpl *This = lpSP;
This->unk->DPSP_lock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &This->unk->DPSP_lock );
HeapFree( GetProcessHeap(), 0, This->unk );
return TRUE;
}
static BOOL DPSP_CreateDirectPlaySP( void *lpSP, IDirectPlayImpl *dp ) static BOOL DPSP_CreateDirectPlaySP( void *lpSP, IDirectPlayImpl *dp )
{ {
IDirectPlaySPImpl *This = lpSP; IDirectPlaySPImpl *This = lpSP;
@ -229,7 +189,6 @@ static ULONG WINAPI IDirectPlaySPImpl_Release( IDirectPlaySP *iface )
if( !ref ) if( !ref )
{ {
DPSP_DestroyDirectPlaySP( This ); DPSP_DestroyDirectPlaySP( This );
DPSP_DestroyIUnknown( This );
HeapFree( GetProcessHeap(), 0, This ); HeapFree( GetProcessHeap(), 0, This );
} }