Commit 8952040a authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

dpwsockx: Implementation of GetCaps callback.

Based on patch by Ismael Barros. Signed-off-by: 's avatarAlistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: 's avatarBruno Jesus <bjesus@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 89b75296
......@@ -2891,9 +2891,15 @@ static HRESULT WINAPI IDirectPlay4Impl_GetPlayerCaps( IDirectPlay4 *iface, DPID
TRACE( "(%p)->(0x%08x,%p,0x%08x)\n", This, player, caps, flags);
if ( !caps )
return DPERR_INVALIDPARAMS;
if ( This->dp2->connectionInitialized == NO_PROVIDER )
return DPERR_UNINITIALIZED;
if( caps->dwSize != sizeof(DPCAPS) )
return DPERR_INVALIDPARAMS;
/* Query the service provider */
data.idPlayer = player;
data.dwFlags = flags;
......
......@@ -1088,7 +1088,7 @@ static void test_GetCaps(void)
/* dpcaps not ininitialized */
hr = IDirectPlayX_GetCaps( pDP, &dpcaps, 0 );
todo_wine checkHR( DPERR_INVALIDPARAMS, hr );
checkHR( DPERR_INVALIDPARAMS, hr );
dpcaps.dwSize = sizeof(DPCAPS);
......@@ -1098,11 +1098,7 @@ static void test_GetCaps(void)
{
hr = IDirectPlayX_GetCaps( pDP, &dpcaps, dwFlags );
todo_wine checkHR( DP_OK, hr );
if ( hr == DP_OK )
{
checkHR( DP_OK, hr );
check( sizeof(DPCAPS), dpcaps.dwSize );
check( DPCAPS_ASYNCSUPPORTED |
DPCAPS_GUARANTEEDOPTIMIZED |
......@@ -1128,7 +1124,6 @@ static void test_GetCaps(void)
default: break;
}
}
}
IDirectPlayX_Release( pDP );
}
......@@ -2189,7 +2184,6 @@ static void test_GetPlayerCaps(void)
hr = IDirectPlayX_GetPlayerCaps( pDP[0], dpid[0], &playerCaps, 0 );
checkHR( DPERR_INVALIDPARAMS, hr );
/* Invalid player */
playerCaps.dwSize = sizeof(DPCAPS);
......@@ -2202,6 +2196,8 @@ static void test_GetPlayerCaps(void)
hr = IDirectPlayX_GetPlayerCaps( pDP[0], dpid[0], &playerCaps, 0 );
checkHR( DP_OK, hr );
hr = IDirectPlayX_GetPlayerCaps( pDP[0], dpid[0], NULL, 0 );
checkHR( DPERR_INVALIDPARAMS, hr );
/* Regular parameters */
for (i=0; i<2; i++)
......
......@@ -25,6 +25,15 @@
#include "winnt.h"
#include "wine/dplaysp.h"
#define DPWS_MAXQUEUESIZE 0
#define DPWS_HUNDREDBAUD 0
#define DPWS_LATENCY 500
#define DPWS_MAXLOCALPLAYERS 65536
#define DPWS_TIMEOUT 5000
#define DPWS_MAXBUFFERSIZE 65479
#define DPWS_MAXPLAYERS 65536
#define DPWS_GUARANTEED_MAXBUFFERSIZE 1048547
#define DPWS_GUARANTEED_MAXPLAYERS 64
typedef struct tagDPWS_THREADDATA
{
......
......@@ -100,9 +100,32 @@ static HRESULT WINAPI DPWSCB_GetAddress( LPDPSP_GETADDRESSDATA data )
static HRESULT WINAPI DPWSCB_GetCaps( LPDPSP_GETCAPSDATA data )
{
FIXME( "(%d,%p,0x%08x,%p)\n",
TRACE( "(%d,%p,0x%08x,%p)\n",
data->idPlayer, data->lpCaps, data->dwFlags, data->lpISP );
return DPERR_UNSUPPORTED;
data->lpCaps->dwFlags = ( DPCAPS_ASYNCSUPPORTED |
DPCAPS_GUARANTEEDOPTIMIZED |
DPCAPS_GUARANTEEDSUPPORTED );
data->lpCaps->dwMaxQueueSize = DPWS_MAXQUEUESIZE;
data->lpCaps->dwHundredBaud = DPWS_HUNDREDBAUD;
data->lpCaps->dwLatency = DPWS_LATENCY;
data->lpCaps->dwMaxLocalPlayers = DPWS_MAXLOCALPLAYERS;
data->lpCaps->dwHeaderLength = sizeof(DPSP_MSG_HEADER);
data->lpCaps->dwTimeout = DPWS_TIMEOUT;
if ( data->dwFlags & DPGETCAPS_GUARANTEED )
{
data->lpCaps->dwMaxBufferSize = DPWS_GUARANTEED_MAXBUFFERSIZE;
data->lpCaps->dwMaxPlayers = DPWS_GUARANTEED_MAXPLAYERS;
}
else
{
data->lpCaps->dwMaxBufferSize = DPWS_MAXBUFFERSIZE;
data->lpCaps->dwMaxPlayers = DPWS_MAXPLAYERS;
}
return DP_OK;
}
static HRESULT WINAPI DPWSCB_Open( LPDPSP_OPENDATA data )
......
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