dplayx: Assimilate the rest of the inherited methods into IDirectPlay4.

This commit is contained in:
Michael Stefaniuc 2013-03-29 17:08:00 +01:00 committed by Alexandre Julliard
parent 73fa61d3b5
commit 52d1aec827
1 changed files with 68 additions and 82 deletions

View File

@ -852,14 +852,15 @@ static HRESULT WINAPI IDirectPlay4AImpl_CreateGroup( IDirectPlay4A *iface, DPID
TRUE ); TRUE );
} }
static HRESULT WINAPI DirectPlay2WImpl_CreateGroup static HRESULT WINAPI IDirectPlay4Impl_CreateGroup( IDirectPlay4 *iface, DPID *lpidGroup,
( LPDIRECTPLAY2 iface, LPDPID lpidGroup, LPDPNAME lpGroupName, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags )
LPVOID lpData, DWORD dwDataSize, DWORD dwFlags )
{ {
IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
*lpidGroup = DPID_UNKNOWN; *lpidGroup = DPID_UNKNOWN;
return DP_IF_CreateGroup( (IDirectPlay2AImpl*)iface, NULL, lpidGroup, return DP_IF_CreateGroup( This, NULL, lpidGroup, lpGroupName, lpData, dwDataSize, dwFlags,
lpGroupName, lpData, dwDataSize, dwFlags, FALSE ); FALSE );
} }
@ -1346,11 +1347,10 @@ static HRESULT WINAPI IDirectPlay4AImpl_CreatePlayer( IDirectPlay4A *iface, DPID
lpData, dwDataSize, dwFlags, TRUE ); lpData, dwDataSize, dwFlags, TRUE );
} }
static HRESULT WINAPI DirectPlay2WImpl_CreatePlayer static HRESULT WINAPI IDirectPlay4Impl_CreatePlayer( IDirectPlay4 *iface, DPID *lpidPlayer,
( LPDIRECTPLAY2 iface, LPDPID lpidPlayer, LPDPNAME lpPlayerName, DPNAME *lpPlayerName, HANDLE hEvent, void *lpData, DWORD dwDataSize, DWORD dwFlags )
HANDLE hEvent, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags )
{ {
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
if( lpidPlayer == NULL ) if( lpidPlayer == NULL )
{ {
@ -1526,10 +1526,9 @@ static HRESULT WINAPI IDirectPlay4AImpl_DestroyGroup( IDirectPlay4A *iface, DPID
return DP_IF_DestroyGroup( This, NULL, idGroup, TRUE ); return DP_IF_DestroyGroup( This, NULL, idGroup, TRUE );
} }
static HRESULT WINAPI DirectPlay2WImpl_DestroyGroup static HRESULT WINAPI IDirectPlay4Impl_DestroyGroup( IDirectPlay4 *iface, DPID idGroup )
( LPDIRECTPLAY2 iface, DPID idGroup )
{ {
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
return DP_IF_DestroyGroup( This, NULL, idGroup, FALSE ); return DP_IF_DestroyGroup( This, NULL, idGroup, FALSE );
} }
@ -1626,10 +1625,9 @@ static HRESULT WINAPI IDirectPlay4AImpl_DestroyPlayer( IDirectPlay4A *iface, DPI
return DP_IF_DestroyPlayer( This, NULL, idPlayer, TRUE ); return DP_IF_DestroyPlayer( This, NULL, idPlayer, TRUE );
} }
static HRESULT WINAPI DirectPlay2WImpl_DestroyPlayer static HRESULT WINAPI IDirectPlay4Impl_DestroyPlayer( IDirectPlay4 *iface, DPID idPlayer )
( LPDIRECTPLAY2 iface, DPID idPlayer )
{ {
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
return DP_IF_DestroyPlayer( This, NULL, idPlayer, FALSE ); return DP_IF_DestroyPlayer( This, NULL, idPlayer, FALSE );
} }
@ -2067,11 +2065,10 @@ static HRESULT WINAPI IDirectPlay4AImpl_GetGroupName( IDirectPlay4A *iface, DPID
return DP_IF_GetGroupName( This, idGroup, lpData, lpdwDataSize, TRUE ); return DP_IF_GetGroupName( This, idGroup, lpData, lpdwDataSize, TRUE );
} }
static HRESULT WINAPI DirectPlay2WImpl_GetGroupName static HRESULT WINAPI IDirectPlay4Impl_GetGroupName( IDirectPlay4 *iface, DPID idGroup,
( LPDIRECTPLAY2 iface, DPID idGroup, LPVOID lpData, void *lpData, DWORD *lpdwDataSize )
LPDWORD lpdwDataSize )
{ {
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
return DP_IF_GetGroupName( This, idGroup, lpData, lpdwDataSize, FALSE ); return DP_IF_GetGroupName( This, idGroup, lpData, lpdwDataSize, FALSE );
} }
@ -2250,11 +2247,10 @@ static HRESULT WINAPI IDirectPlay4AImpl_GetPlayerName( IDirectPlay4A *iface, DPI
return DP_IF_GetPlayerName( This, idPlayer, lpData, lpdwDataSize, TRUE ); return DP_IF_GetPlayerName( This, idPlayer, lpData, lpdwDataSize, TRUE );
} }
static HRESULT WINAPI DirectPlay2WImpl_GetPlayerName static HRESULT WINAPI IDirectPlay4Impl_GetPlayerName( IDirectPlay4 *iface, DPID idPlayer,
( LPDIRECTPLAY2 iface, DPID idPlayer, LPVOID lpData, void *lpData, DWORD *lpdwDataSize )
LPDWORD lpdwDataSize )
{ {
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
return DP_IF_GetPlayerName( This, idPlayer, lpData, lpdwDataSize, FALSE ); return DP_IF_GetPlayerName( This, idPlayer, lpData, lpdwDataSize, FALSE );
} }
@ -2299,10 +2295,10 @@ static HRESULT WINAPI IDirectPlay4AImpl_GetSessionDesc( IDirectPlay4A *iface, vo
return DP_GetSessionDesc( This, lpData, lpdwDataSize, TRUE ); return DP_GetSessionDesc( This, lpData, lpdwDataSize, TRUE );
} }
static HRESULT WINAPI DirectPlay2WImpl_GetSessionDesc static HRESULT WINAPI IDirectPlay4Impl_GetSessionDesc( IDirectPlay4 *iface, void *lpData,
( LPDIRECTPLAY2 iface, LPVOID lpData, LPDWORD lpdwDataSize ) DWORD *lpdwDataSize )
{ {
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
return DP_GetSessionDesc( This, lpData, lpdwDataSize, TRUE ); return DP_GetSessionDesc( This, lpData, lpdwDataSize, TRUE );
} }
@ -2511,13 +2507,11 @@ static HRESULT WINAPI IDirectPlay4AImpl_Receive( IDirectPlay4A *iface, DPID *lpi
return DP_IF_Receive( This, lpidFrom, lpidTo, dwFlags, lpData, lpdwDataSize, TRUE ); return DP_IF_Receive( This, lpidFrom, lpidTo, dwFlags, lpData, lpdwDataSize, TRUE );
} }
static HRESULT WINAPI DirectPlay2WImpl_Receive static HRESULT WINAPI IDirectPlay4Impl_Receive( IDirectPlay4 *iface, DPID *lpidFrom,
( LPDIRECTPLAY2 iface, LPDPID lpidFrom, LPDPID lpidTo, DPID *lpidTo, DWORD dwFlags, void *lpData, DWORD *lpdwDataSize )
DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize )
{ {
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
return DP_IF_Receive( This, lpidFrom, lpidTo, dwFlags, return DP_IF_Receive( This, lpidFrom, lpidTo, dwFlags, lpData, lpdwDataSize, FALSE );
lpData, lpdwDataSize, FALSE );
} }
static HRESULT WINAPI IDirectPlay4AImpl_Send( IDirectPlay4A *iface, DPID from, DPID to, static HRESULT WINAPI IDirectPlay4AImpl_Send( IDirectPlay4A *iface, DPID from, DPID to,
@ -2603,11 +2597,10 @@ static HRESULT WINAPI IDirectPlay4AImpl_SetGroupName( IDirectPlay4A *iface, DPID
return DP_IF_SetGroupName( This, idGroup, lpGroupName, dwFlags, TRUE ); return DP_IF_SetGroupName( This, idGroup, lpGroupName, dwFlags, TRUE );
} }
static HRESULT WINAPI DirectPlay2WImpl_SetGroupName static HRESULT WINAPI IDirectPlay4Impl_SetGroupName( IDirectPlay4 *iface, DPID idGroup,
( LPDIRECTPLAY2 iface, DPID idGroup, LPDPNAME lpGroupName, DPNAME *lpGroupName, DWORD dwFlags )
DWORD dwFlags )
{ {
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
return DP_IF_SetGroupName( This, idGroup, lpGroupName, dwFlags, FALSE ); return DP_IF_SetGroupName( This, idGroup, lpGroupName, dwFlags, FALSE );
} }
@ -2687,11 +2680,10 @@ static HRESULT WINAPI IDirectPlay4AImpl_SetPlayerName( IDirectPlay4A *iface, DPI
return DP_IF_SetPlayerName( This, idPlayer, lpPlayerName, dwFlags, TRUE ); return DP_IF_SetPlayerName( This, idPlayer, lpPlayerName, dwFlags, TRUE );
} }
static HRESULT WINAPI DirectPlay2WImpl_SetPlayerName static HRESULT WINAPI IDirectPlay4Impl_SetPlayerName( IDirectPlay4 *iface, DPID idPlayer,
( LPDIRECTPLAY2 iface, DPID idPlayer, LPDPNAME lpPlayerName, DPNAME *lpPlayerName, DWORD dwFlags )
DWORD dwFlags )
{ {
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
return DP_IF_SetPlayerName( This, idPlayer, lpPlayerName, dwFlags, FALSE ); return DP_IF_SetPlayerName( This, idPlayer, lpPlayerName, dwFlags, FALSE );
} }
@ -2760,10 +2752,10 @@ static HRESULT WINAPI IDirectPlay4AImpl_SetSessionDesc( IDirectPlay4A *iface,
return DP_SetSessionDesc( This, lpSessDesc, dwFlags, FALSE, TRUE ); return DP_SetSessionDesc( This, lpSessDesc, dwFlags, FALSE, TRUE );
} }
static HRESULT WINAPI DirectPlay2WImpl_SetSessionDesc static HRESULT WINAPI IDirectPlay4Impl_SetSessionDesc( IDirectPlay4 *iface,
( LPDIRECTPLAY2 iface, LPDPSESSIONDESC2 lpSessDesc, DWORD dwFlags ) DPSESSIONDESC2 *lpSessDesc, DWORD dwFlags )
{ {
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
return DP_SetSessionDesc( This, lpSessDesc, dwFlags, FALSE, TRUE ); return DP_SetSessionDesc( This, lpSessDesc, dwFlags, FALSE, TRUE );
} }
@ -3013,18 +3005,15 @@ static HRESULT WINAPI IDirectPlay4AImpl_CreateGroupInGroup( IDirectPlay4A *iface
dwDataSize, dwFlags, TRUE ); dwDataSize, dwFlags, TRUE );
} }
static HRESULT WINAPI DirectPlay3WImpl_CreateGroupInGroup static HRESULT WINAPI IDirectPlay4Impl_CreateGroupInGroup( IDirectPlay4 *iface, DPID idParentGroup,
( LPDIRECTPLAY3 iface, DPID idParentGroup, LPDPID lpidGroup, DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags )
LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize,
DWORD dwFlags )
{ {
IDirectPlay3Impl *This = (IDirectPlay3Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
*lpidGroup = DPID_UNKNOWN; *lpidGroup = DPID_UNKNOWN;
return DP_IF_CreateGroupInGroup( This, NULL, idParentGroup, lpidGroup, return DP_IF_CreateGroupInGroup( This, NULL, idParentGroup, lpidGroup, lpGroupName, lpData,
lpGroupName, lpData, dwDataSize, dwDataSize, dwFlags, FALSE );
dwFlags, FALSE );
} }
static HRESULT WINAPI IDirectPlay4AImpl_DeleteGroupFromGroup( IDirectPlay4A *iface, DPID parent, static HRESULT WINAPI IDirectPlay4AImpl_DeleteGroupFromGroup( IDirectPlay4A *iface, DPID parent,
@ -3721,11 +3710,11 @@ static HRESULT WINAPI IDirectPlay4AImpl_SecureOpen( IDirectPlay4A *iface,
return DP_SecureOpen( This, lpsd, dwFlags, lpSecurity, lpCredentials, TRUE ); return DP_SecureOpen( This, lpsd, dwFlags, lpSecurity, lpCredentials, TRUE );
} }
static HRESULT WINAPI DirectPlay3WImpl_SecureOpen static HRESULT WINAPI IDirectPlay4Impl_SecureOpen( IDirectPlay4 *iface,
( LPDIRECTPLAY3 iface, LPCDPSESSIONDESC2 lpsd, DWORD dwFlags, const DPSESSIONDESC2 *lpsd, DWORD dwFlags, const DPSECURITYDESC *lpSecurity,
LPCDPSECURITYDESC lpSecurity, LPCDPCREDENTIALS lpCredentials ) const DPCREDENTIALS *lpCredentials )
{ {
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; /* Yes a dp 2 interface */ IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
return DP_SecureOpen( This, lpsd, dwFlags, lpSecurity, lpCredentials, FALSE ); return DP_SecureOpen( This, lpsd, dwFlags, lpSecurity, lpCredentials, FALSE );
} }
@ -4084,8 +4073,6 @@ static HRESULT WINAPI IDirectPlay4Impl_CancelPriority( IDirectPlay4 *iface, DWOR
return dplay_cancelmsg( This, 0, DPCANCELSEND_PRIORITY, minprio, maxprio ); return dplay_cancelmsg( This, 0, DPCANCELSEND_PRIORITY, minprio, maxprio );
} }
/* Note: Hack so we can reuse the old functions without compiler warnings */
# define XCAST(fun) (void*)
static const IDirectPlay4Vtbl dp4_vt = static const IDirectPlay4Vtbl dp4_vt =
{ {
IDirectPlay4Impl_QueryInterface, IDirectPlay4Impl_QueryInterface,
@ -4093,41 +4080,41 @@ static const IDirectPlay4Vtbl dp4_vt =
IDirectPlay4Impl_Release, IDirectPlay4Impl_Release,
IDirectPlay4Impl_AddPlayerToGroup, IDirectPlay4Impl_AddPlayerToGroup,
IDirectPlay4Impl_Close, IDirectPlay4Impl_Close,
XCAST(CreateGroup)DirectPlay2WImpl_CreateGroup, IDirectPlay4Impl_CreateGroup,
XCAST(CreatePlayer)DirectPlay2WImpl_CreatePlayer, IDirectPlay4Impl_CreatePlayer,
IDirectPlay4Impl_DeletePlayerFromGroup, IDirectPlay4Impl_DeletePlayerFromGroup,
XCAST(DestroyGroup)DirectPlay2WImpl_DestroyGroup, IDirectPlay4Impl_DestroyGroup,
XCAST(DestroyPlayer)DirectPlay2WImpl_DestroyPlayer, IDirectPlay4Impl_DestroyPlayer,
IDirectPlay4Impl_EnumGroupPlayers, IDirectPlay4Impl_EnumGroupPlayers,
IDirectPlay4Impl_EnumGroups, IDirectPlay4Impl_EnumGroups,
IDirectPlay4Impl_EnumPlayers, IDirectPlay4Impl_EnumPlayers,
IDirectPlay4Impl_EnumSessions, IDirectPlay4Impl_EnumSessions,
IDirectPlay4Impl_GetCaps, IDirectPlay4Impl_GetCaps,
IDirectPlay4Impl_GetGroupData, IDirectPlay4Impl_GetGroupData,
XCAST(GetGroupName)DirectPlay2WImpl_GetGroupName, IDirectPlay4Impl_GetGroupName,
IDirectPlay4Impl_GetMessageCount, IDirectPlay4Impl_GetMessageCount,
IDirectPlay4Impl_GetPlayerAddress, IDirectPlay4Impl_GetPlayerAddress,
IDirectPlay4Impl_GetPlayerCaps, IDirectPlay4Impl_GetPlayerCaps,
IDirectPlay4Impl_GetPlayerData, IDirectPlay4Impl_GetPlayerData,
XCAST(GetPlayerName)DirectPlay2WImpl_GetPlayerName, IDirectPlay4Impl_GetPlayerName,
XCAST(GetSessionDesc)DirectPlay2WImpl_GetSessionDesc, IDirectPlay4Impl_GetSessionDesc,
IDirectPlay4Impl_Initialize, IDirectPlay4Impl_Initialize,
IDirectPlay4Impl_Open, IDirectPlay4Impl_Open,
XCAST(Receive)DirectPlay2WImpl_Receive, IDirectPlay4Impl_Receive,
IDirectPlay4Impl_Send, IDirectPlay4Impl_Send,
IDirectPlay4Impl_SetGroupData, IDirectPlay4Impl_SetGroupData,
XCAST(SetGroupName)DirectPlay2WImpl_SetGroupName, IDirectPlay4Impl_SetGroupName,
IDirectPlay4Impl_SetPlayerData, IDirectPlay4Impl_SetPlayerData,
XCAST(SetPlayerName)DirectPlay2WImpl_SetPlayerName, IDirectPlay4Impl_SetPlayerName,
XCAST(SetSessionDesc)DirectPlay2WImpl_SetSessionDesc, IDirectPlay4Impl_SetSessionDesc,
IDirectPlay4Impl_AddGroupToGroup, IDirectPlay4Impl_AddGroupToGroup,
XCAST(CreateGroupInGroup)DirectPlay3WImpl_CreateGroupInGroup, IDirectPlay4Impl_CreateGroupInGroup,
IDirectPlay4Impl_DeleteGroupFromGroup, IDirectPlay4Impl_DeleteGroupFromGroup,
IDirectPlay4Impl_EnumConnections, IDirectPlay4Impl_EnumConnections,
IDirectPlay4Impl_EnumGroupsInGroup, IDirectPlay4Impl_EnumGroupsInGroup,
IDirectPlay4Impl_GetGroupConnectionSettings, IDirectPlay4Impl_GetGroupConnectionSettings,
IDirectPlay4Impl_InitializeConnection, IDirectPlay4Impl_InitializeConnection,
XCAST(SecureOpen)DirectPlay3WImpl_SecureOpen, IDirectPlay4Impl_SecureOpen,
IDirectPlay4Impl_SendChatMessage, IDirectPlay4Impl_SendChatMessage,
IDirectPlay4Impl_SetGroupConnectionSettings, IDirectPlay4Impl_SetGroupConnectionSettings,
IDirectPlay4Impl_StartSession, IDirectPlay4Impl_StartSession,
@ -4142,7 +4129,6 @@ static const IDirectPlay4Vtbl dp4_vt =
IDirectPlay4Impl_CancelMessage, IDirectPlay4Impl_CancelMessage,
IDirectPlay4Impl_CancelPriority IDirectPlay4Impl_CancelPriority
}; };
#undef XCAST
static const IDirectPlay4Vtbl dp4A_vt = static const IDirectPlay4Vtbl dp4A_vt =
{ {