Commit 82b51258 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dplayx: Remove the duplicated IDirectPlayXImpl structs.

parent 0e7b1a46
...@@ -396,46 +396,26 @@ static BOOL DP_DestroyDirectPlay2( LPVOID lpDP ) ...@@ -396,46 +396,26 @@ static BOOL DP_DestroyDirectPlay2( LPVOID lpDP )
HRESULT DP_CreateInterface HRESULT DP_CreateInterface
( REFIID riid, LPVOID* ppvObj ) ( REFIID riid, LPVOID* ppvObj )
{ {
TRACE( " for %s\n", debugstr_guid( riid ) ); IDirectPlayImpl *This;
*ppvObj = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, TRACE( " for %s\n", debugstr_guid( riid ) );
sizeof( IDirectPlay2Impl ) );
if( *ppvObj == NULL ) This = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( IDirectPlayImpl ) );
{ if( !This )
return DPERR_OUTOFMEMORY; return DPERR_OUTOFMEMORY;
}
if( IsEqualGUID( &IID_IDirectPlay2, riid ) ) if( IsEqualGUID( &IID_IDirectPlay2, riid ) )
{
IDirectPlay2Impl *This = *ppvObj;
This->lpVtbl = &directPlay2WVT; This->lpVtbl = &directPlay2WVT;
}
else if( IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IDirectPlay2A, riid ) ) else if( IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IDirectPlay2A, riid ) )
{
IDirectPlay2AImpl *This = *ppvObj;
This->lpVtbl = &directPlay2AVT; This->lpVtbl = &directPlay2AVT;
}
else if( IsEqualGUID( &IID_IDirectPlay3, riid ) ) else if( IsEqualGUID( &IID_IDirectPlay3, riid ) )
{
IDirectPlay3Impl *This = *ppvObj;
This->lpVtbl = &directPlay3WVT; This->lpVtbl = &directPlay3WVT;
}
else if( IsEqualGUID( &IID_IDirectPlay3A, riid ) ) else if( IsEqualGUID( &IID_IDirectPlay3A, riid ) )
{
IDirectPlay3AImpl *This = *ppvObj;
This->lpVtbl = &directPlay3AVT; This->lpVtbl = &directPlay3AVT;
}
else if( IsEqualGUID( &IID_IDirectPlay4, riid ) ) else if( IsEqualGUID( &IID_IDirectPlay4, riid ) )
{
IDirectPlay4Impl *This = *ppvObj;
This->lpVtbl = &directPlay4WVT; This->lpVtbl = &directPlay4WVT;
}
else if( IsEqualGUID( &IID_IDirectPlay4A, riid ) ) else if( IsEqualGUID( &IID_IDirectPlay4A, riid ) )
{
IDirectPlay4AImpl *This = *ppvObj;
This->lpVtbl = &directPlay4AVT; This->lpVtbl = &directPlay4AVT;
}
else else
{ {
/* Unsupported interface */ /* Unsupported interface */
...@@ -446,6 +426,7 @@ HRESULT DP_CreateInterface ...@@ -446,6 +426,7 @@ HRESULT DP_CreateInterface
} }
/* Initialize it */ /* Initialize it */
*ppvObj = This;
if ( DP_CreateIUnknown( *ppvObj ) && DP_CreateDirectPlay2( *ppvObj ) ) if ( DP_CreateIUnknown( *ppvObj ) && DP_CreateDirectPlay2( *ppvObj ) )
{ {
IDirectPlayX_AddRef( (LPDIRECTPLAY2A)*ppvObj ); IDirectPlayX_AddRef( (LPDIRECTPLAY2A)*ppvObj );
......
...@@ -31,16 +31,6 @@ extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, ...@@ -31,16 +31,6 @@ extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
LPCVOID lpAddress, DWORD dwAddressSize, LPCVOID lpAddress, DWORD dwAddressSize,
LPVOID lpContext ) DECLSPEC_HIDDEN; LPVOID lpContext ) DECLSPEC_HIDDEN;
/*****************************************************************************
* Predeclare the interface implementation structures
*/
typedef struct IDirectPlay2Impl IDirectPlay2AImpl;
typedef struct IDirectPlay2Impl IDirectPlay2Impl;
typedef struct IDirectPlay3Impl IDirectPlay3AImpl;
typedef struct IDirectPlay3Impl IDirectPlay3Impl;
typedef struct IDirectPlay4Impl IDirectPlay4AImpl;
typedef struct IDirectPlay4Impl IDirectPlay4Impl;
typedef struct tagDirectPlayIUnknownData typedef struct tagDirectPlayIUnknownData
{ {
LONG ulObjRef; LONG ulObjRef;
...@@ -196,28 +186,20 @@ typedef struct tagDirectPlay2Data ...@@ -196,28 +186,20 @@ typedef struct tagDirectPlay2Data
DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST ) repliesExpected; DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST ) repliesExpected;
} DirectPlay2Data; } DirectPlay2Data;
#define DP_IMPL_FIELDS \ typedef struct IDirectPlayImpl
LONG ulInterfaceRef; \
DirectPlayIUnknownData* unk; \
DirectPlay2Data* dp2;
struct IDirectPlay2Impl
{
const IDirectPlay2Vtbl *lpVtbl;
DP_IMPL_FIELDS
};
struct IDirectPlay3Impl
{ {
const IDirectPlay3Vtbl *lpVtbl; const void *lpVtbl;
DP_IMPL_FIELDS LONG ulInterfaceRef;
}; DirectPlayIUnknownData *unk;
DirectPlay2Data *dp2;
struct IDirectPlay4Impl } IDirectPlayImpl;
{
const IDirectPlay4Vtbl *lpVtbl; typedef struct IDirectPlayImpl IDirectPlay2Impl;
DP_IMPL_FIELDS typedef struct IDirectPlayImpl IDirectPlay2AImpl;
}; typedef struct IDirectPlayImpl IDirectPlay3Impl;
typedef struct IDirectPlayImpl IDirectPlay3AImpl;
typedef struct IDirectPlayImpl IDirectPlay4Impl;
typedef struct IDirectPlayImpl IDirectPlay4AImpl;
HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpMessageBody, HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpMessageBody,
DWORD dwMessageBodySize, LPCVOID lpMessageHeader, DWORD dwMessageBodySize, LPCVOID lpMessageHeader,
......
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