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