Commit 73fa61d3 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dplayx: Cleanup the IDirectPlay_Cancel* methods.

parent da430fd1
...@@ -120,9 +120,6 @@ static HRESULT DP_SP_SendEx ...@@ -120,9 +120,6 @@ static HRESULT DP_SP_SendEx
( IDirectPlay2Impl* This, DWORD dwFlags, ( IDirectPlay2Impl* This, DWORD dwFlags,
LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout, LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout,
LPVOID lpContext, LPDWORD lpdwMsgID ); LPVOID lpContext, LPDWORD lpdwMsgID );
static HRESULT DP_IF_CancelMessage
( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags,
DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi );
static BOOL CALLBACK cbDPCreateEnumConnections( LPCGUID lpguidSP, static BOOL CALLBACK cbDPCreateEnumConnections( LPCGUID lpguidSP,
LPVOID lpConnection, DWORD dwConnectionSize, LPCDPNAME lpName, LPVOID lpConnection, DWORD dwConnectionSize, LPCDPNAME lpName,
DWORD dwFlags, LPVOID lpContext ); DWORD dwFlags, LPVOID lpContext );
...@@ -4018,16 +4015,14 @@ static HRESULT WINAPI IDirectPlay4Impl_GetMessageQueue( IDirectPlay4 *iface, DPI ...@@ -4018,16 +4015,14 @@ static HRESULT WINAPI IDirectPlay4Impl_GetMessageQueue( IDirectPlay4 *iface, DPI
return hr; return hr;
} }
static HRESULT DP_IF_CancelMessage static HRESULT dplay_cancelmsg ( IDirectPlayImpl* This, DWORD msgid, DWORD flags, DWORD minprio,
( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags, DWORD maxprio )
DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi )
{ {
HRESULT hr = DP_OK; HRESULT hr = DP_OK;
FIXME( "(%p)->(0x%08x,0x%08x,%u): semi stub\n", FIXME( "(%p)->(0x%08x,0x%08x): semi stub\n", This, msgid, flags );
This, dwMsgID, dwFlags, bAnsi );
if( This->dp2->spData.lpCB->Cancel ) if ( This->dp2->spData.lpCB->Cancel )
{ {
DPSP_CANCELDATA data; DPSP_CANCELDATA data;
...@@ -4036,86 +4031,57 @@ static HRESULT DP_IF_CancelMessage ...@@ -4036,86 +4031,57 @@ static HRESULT DP_IF_CancelMessage
/* FIXME: Undocumented callback */ /* FIXME: Undocumented callback */
data.lpISP = This->dp2->spData.lpISP; data.lpISP = This->dp2->spData.lpISP;
data.dwFlags = dwFlags; data.dwFlags = flags;
data.lprglpvSPMsgID = NULL; data.lprglpvSPMsgID = NULL;
data.cSPMsgID = dwMsgID; data.cSPMsgID = msgid;
data.dwMinPriority = dwMinPriority; data.dwMinPriority = minprio;
data.dwMaxPriority = dwMaxPriority; data.dwMaxPriority = maxprio;
hr = (*This->dp2->spData.lpCB->Cancel)( &data ); hr = (*This->dp2->spData.lpCB->Cancel)( &data );
} }
else else
{
FIXME( "SP doesn't implement Cancel\n" ); FIXME( "SP doesn't implement Cancel\n" );
}
return hr; return hr;
} }
static HRESULT WINAPI DirectPlay4AImpl_CancelMessage static HRESULT WINAPI IDirectPlay4AImpl_CancelMessage( IDirectPlay4A *iface, DWORD msgid,
( LPDIRECTPLAY4A iface, DWORD dwMsgID, DWORD dwFlags ) DWORD flags )
{ {
IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface );
return IDirectPlayX_CancelMessage( &This->IDirectPlay4_iface, msgid, flags );
if( dwFlags != 0 )
{
return DPERR_INVALIDFLAGS;
}
if( dwMsgID == 0 )
{
dwFlags |= DPCANCELSEND_ALL;
}
return DP_IF_CancelMessage( This, dwMsgID, dwFlags, 0, 0, TRUE );
} }
static HRESULT WINAPI DirectPlay4WImpl_CancelMessage static HRESULT WINAPI IDirectPlay4Impl_CancelMessage( IDirectPlay4 *iface, DWORD msgid,
( LPDIRECTPLAY4 iface, DWORD dwMsgID, DWORD dwFlags ) DWORD flags )
{ {
IDirectPlay4Impl *This = (IDirectPlay4Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
if( dwFlags != 0 ) if ( flags != 0 )
{
return DPERR_INVALIDFLAGS; return DPERR_INVALIDFLAGS;
}
if( dwMsgID == 0 ) if ( msgid == 0 )
{ flags |= DPCANCELSEND_ALL;
dwFlags |= DPCANCELSEND_ALL;
}
return DP_IF_CancelMessage( This, dwMsgID, dwFlags, 0, 0, FALSE ); return dplay_cancelmsg( This, msgid, flags, 0, 0 );
} }
static HRESULT WINAPI DirectPlay4AImpl_CancelPriority static HRESULT WINAPI IDirectPlay4AImpl_CancelPriority( IDirectPlay4A *iface, DWORD minprio,
( LPDIRECTPLAY4A iface, DWORD dwMinPriority, DWORD dwMaxPriority, DWORD maxprio, DWORD flags )
DWORD dwFlags )
{ {
IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface );
return IDirectPlayX_CancelPriority( &This->IDirectPlay4_iface, minprio, maxprio, flags );
if( dwFlags != 0 )
{
return DPERR_INVALIDFLAGS;
}
return DP_IF_CancelMessage( This, 0, DPCANCELSEND_PRIORITY, dwMinPriority,
dwMaxPriority, TRUE );
} }
static HRESULT WINAPI DirectPlay4WImpl_CancelPriority static HRESULT WINAPI IDirectPlay4Impl_CancelPriority( IDirectPlay4 *iface, DWORD minprio,
( LPDIRECTPLAY4 iface, DWORD dwMinPriority, DWORD dwMaxPriority, DWORD maxprio, DWORD flags )
DWORD dwFlags )
{ {
IDirectPlay4Impl *This = (IDirectPlay4Impl *)iface; IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
if( dwFlags != 0 ) if ( flags != 0 )
{
return DPERR_INVALIDFLAGS; return DPERR_INVALIDFLAGS;
}
return DP_IF_CancelMessage( This, 0, DPCANCELSEND_PRIORITY, dwMinPriority, return dplay_cancelmsg( This, 0, DPCANCELSEND_PRIORITY, minprio, maxprio );
dwMaxPriority, FALSE );
} }
/* Note: Hack so we can reuse the old functions without compiler warnings */ /* Note: Hack so we can reuse the old functions without compiler warnings */
...@@ -4173,8 +4139,8 @@ static const IDirectPlay4Vtbl dp4_vt = ...@@ -4173,8 +4139,8 @@ static const IDirectPlay4Vtbl dp4_vt =
IDirectPlay4Impl_SetGroupOwner, IDirectPlay4Impl_SetGroupOwner,
IDirectPlay4Impl_SendEx, IDirectPlay4Impl_SendEx,
IDirectPlay4Impl_GetMessageQueue, IDirectPlay4Impl_GetMessageQueue,
DirectPlay4WImpl_CancelMessage, IDirectPlay4Impl_CancelMessage,
DirectPlay4WImpl_CancelPriority IDirectPlay4Impl_CancelPriority
}; };
#undef XCAST #undef XCAST
...@@ -4232,8 +4198,8 @@ static const IDirectPlay4Vtbl dp4A_vt = ...@@ -4232,8 +4198,8 @@ static const IDirectPlay4Vtbl dp4A_vt =
DirectPlay4AImpl_SetGroupOwner, DirectPlay4AImpl_SetGroupOwner,
IDirectPlay4AImpl_SendEx, IDirectPlay4AImpl_SendEx,
IDirectPlay4AImpl_GetMessageQueue, IDirectPlay4AImpl_GetMessageQueue,
DirectPlay4AImpl_CancelMessage, IDirectPlay4AImpl_CancelMessage,
DirectPlay4AImpl_CancelPriority IDirectPlay4AImpl_CancelPriority
}; };
HRESULT dplay_create( REFIID riid, void **ppv ) HRESULT dplay_create( REFIID riid, void **ppv )
......
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