[PATCH] dpwsockx: Implementation of GetCaps callback

Bruno Jesus 00cpxxx at gmail.com
Fri Feb 24 06:44:48 CST 2017


On Fri, Feb 24, 2017 at 3:45 AM, Alistair Leslie-Hughes
<leslie_alistair at hotmail.com> wrote:
> Based on patch by Ismael Barros
>
> Changes
> - Removed todo_wine from tests
> - Adjusted the DPWS_GUARANTEED_MAXBUFFERSIZE and DPWS_MAXBUFFERSIZE
>    to be the correct values
> - Remove unused defines.
> - Remove Adjustment of dwMaxBufferSize by sizeof(DPSP_MSG_HEADER)
> - Added check for structure size.

Thanks for your work on this, very minor stuff follows.

> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
> ---
>  dlls/dplayx/dplay.c           |  3 +++
>  dlls/dplayx/tests/dplayx.c    |  6 ++----
>  dlls/dpwsockx/dpwsockx_dll.h  | 10 ++++++++++
>  dlls/dpwsockx/dpwsockx_main.c | 27 +++++++++++++++++++++++++--
>  4 files changed, 40 insertions(+), 6 deletions(-)
>
> diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c
> index f4d934f..b8d2f15 100644
> --- a/dlls/dplayx/dplay.c
> +++ b/dlls/dplayx/dplay.c
> @@ -2894,6 +2894,9 @@ static HRESULT WINAPI IDirectPlay4Impl_GetPlayerCaps( IDirectPlay4 *iface, DPID
>      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;
> diff --git a/dlls/dplayx/tests/dplayx.c b/dlls/dplayx/tests/dplayx.c
> index de392aa..32e5e1f 100644
> --- a/dlls/dplayx/tests/dplayx.c
> +++ b/dlls/dplayx/tests/dplayx.c
> @@ -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,9 +1098,7 @@ static void test_GetCaps(void)
>      {
>
>          hr = IDirectPlayX_GetCaps( pDP, &dpcaps, dwFlags );
> -        todo_wine checkHR( DP_OK, hr );
> -
> -
> +        checkHR( DP_OK, hr );
>          if ( hr == DP_OK )
>          {

Since now the test must always pass in wine it could be useful to add
a win_skip to the else branch or invert the if and use continue. If
the if was added only for wine the whole if could be removed then.

>              check( sizeof(DPCAPS), dpcaps.dwSize );
> diff --git a/dlls/dpwsockx/dpwsockx_dll.h b/dlls/dpwsockx/dpwsockx_dll.h
> index 1a6ad6c..debcc11 100644
> --- a/dlls/dpwsockx/dpwsockx_dll.h
> +++ b/dlls/dpwsockx/dpwsockx_dll.h
> @@ -26,6 +26,16 @@
>  #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
> +

There is an extra new line before the defines.

>  typedef struct tagDPWS_THREADDATA
>  {
>      BOOL           is_running;
> diff --git a/dlls/dpwsockx/dpwsockx_main.c b/dlls/dpwsockx/dpwsockx_main.c
> index 548f37e..9606d73 100644
> --- a/dlls/dpwsockx/dpwsockx_main.c
> +++ b/dlls/dpwsockx/dpwsockx_main.c
> @@ -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;
> +

Is it worth to test a NULL data?



More information about the wine-devel mailing list