Commit d1331e62 authored by Alessandro Pignotti's avatar Alessandro Pignotti Committed by Alexandre Julliard

dplay: Directplay should initialize session Guid, with conformance tests.

parent 5c9edfd4
......@@ -213,6 +213,9 @@ dlls/dnsapi/tests/testlist.c
dlls/dplay/libdplay.def
dlls/dplay/version.res
dlls/dplayx/libdplayx.def
dlls/dplayx/tests/*.ok
dlls/dplayx/tests/dplayx_crosstest.exe
dlls/dplayx/tests/testlist.c
dlls/dplayx/version.res
dlls/dpnet/libdpnet.def
dlls/dpnet/version.res
......@@ -803,6 +806,7 @@ programs/winetest/d3d9_test.exe
programs/winetest/ddraw_test.exe
programs/winetest/dinput_test.exe
programs/winetest/dnsapi_test.exe
programs/winetest/dplayx_test.exe
programs/winetest/dsound_test.exe
programs/winetest/gdi32_test.exe
programs/winetest/hlink_test.exe
......
......@@ -216,6 +216,7 @@ ALL_MAKEFILES = \
dlls/dnsapi/tests/Makefile \
dlls/dplay/Makefile \
dlls/dplayx/Makefile \
dlls/dplayx/tests/Makefile \
dlls/dpnet/Makefile \
dlls/dpnhpast/Makefile \
dlls/dsound/Makefile \
......@@ -549,6 +550,7 @@ dlls/dnsapi/Makefile: dlls/dnsapi/Makefile.in dlls/Makedll.rules
dlls/dnsapi/tests/Makefile: dlls/dnsapi/tests/Makefile.in dlls/Maketest.rules
dlls/dplay/Makefile: dlls/dplay/Makefile.in dlls/Makedll.rules
dlls/dplayx/Makefile: dlls/dplayx/Makefile.in dlls/Makedll.rules
dlls/dplayx/tests/Makefile: dlls/dplayx/tests/Makefile.in dlls/Maketest.rules
dlls/dpnet/Makefile: dlls/dpnet/Makefile.in dlls/Makedll.rules
dlls/dpnhpast/Makefile: dlls/dpnhpast/Makefile.in dlls/Makedll.rules
dlls/dsound/Makefile: dlls/dsound/Makefile.in dlls/Makedll.rules
......
......@@ -20563,6 +20563,8 @@ ac_config_files="$ac_config_files dlls/dplay/Makefile"
ac_config_files="$ac_config_files dlls/dplayx/Makefile"
ac_config_files="$ac_config_files dlls/dplayx/tests/Makefile"
ac_config_files="$ac_config_files dlls/dpnet/Makefile"
ac_config_files="$ac_config_files dlls/dpnhpast/Makefile"
......@@ -21709,6 +21711,7 @@ do
"dlls/dnsapi/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dnsapi/tests/Makefile" ;;
"dlls/dplay/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dplay/Makefile" ;;
"dlls/dplayx/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dplayx/Makefile" ;;
"dlls/dplayx/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dplayx/tests/Makefile" ;;
"dlls/dpnet/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dpnet/Makefile" ;;
"dlls/dpnhpast/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dpnhpast/Makefile" ;;
"dlls/dsound/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dsound/Makefile" ;;
......
......@@ -1586,6 +1586,7 @@ AC_CONFIG_FILES([dlls/dnsapi/Makefile])
AC_CONFIG_FILES([dlls/dnsapi/tests/Makefile])
AC_CONFIG_FILES([dlls/dplay/Makefile])
AC_CONFIG_FILES([dlls/dplayx/Makefile])
AC_CONFIG_FILES([dlls/dplayx/tests/Makefile])
AC_CONFIG_FILES([dlls/dpnet/Makefile])
AC_CONFIG_FILES([dlls/dpnhpast/Makefile])
AC_CONFIG_FILES([dlls/dsound/Makefile])
......
......@@ -233,6 +233,7 @@ TESTSUBDIRS = \
ddraw/tests \
dinput/tests \
dnsapi/tests \
dplayx/tests \
dsound/tests \
gdi32/tests \
hlink/tests \
......
......@@ -3244,7 +3244,11 @@ static HRESULT WINAPI DP_SetSessionDesc
HeapFree( GetProcessHeap(), 0, This->dp2->lpSessionDesc );
This->dp2->lpSessionDesc = lpTempSessDesc;
if( bInitial )
{
/*Initializing session GUID*/
CoCreateGuid( &(This->dp2->lpSessionDesc->guidInstance) );
}
/* Set the new */
DP_CopySessionDesc( This->dp2->lpSessionDesc, lpSessDesc, bAnsi );
......
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = dplayx.dll
IMPORTS = ole32 kernel32
EXTRALIBS = -ldxguid
CTESTS = \
dplayx.c
@MAKE_TEST_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend
/* DirectPlay Conformance Tests
*
* Copyright 2007 - Alessandro Pignotti
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wine/test.h"
#include <dplay.h>
static BOOL validSP = FALSE; /*This global variable is needed until wine has a working service provider
implementation*/
static BOOL CALLBACK EnumConnectionsCallback(LPCGUID lpguidSP, LPVOID lpConnection,
DWORD dwConnectionSize, LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext)
{
HRESULT hr;
if(IsEqualGUID(lpguidSP,&DPSPGUID_TCPIP))
{
/*I'm forcing TCP/IP Sevice provider*/
hr = IDirectPlayX_InitializeConnection((LPDIRECTPLAY4) lpContext, lpConnection, 0);
todo_wine ok( SUCCEEDED( hr ), "It's not possible to initialize TCP/IP service provider\n");
if( SUCCEEDED( hr ))
validSP = TRUE;
return FALSE;
}
return TRUE;
}
static void test_session_guid(LPDIRECTPLAY4 pDP)
{
GUID appGuid;
GUID zeroGuid;
DPSESSIONDESC2 sessionDesc;
LPDPSESSIONDESC2 newSession;
DWORD sessionSize;
static char name[] = "DPlay conformance test";
CoCreateGuid( &appGuid );
IDirectPlayX_EnumConnections(pDP, &appGuid, EnumConnectionsCallback, pDP, 0);
if( validSP )
{
memset(&sessionDesc, 0, sizeof( DPSESSIONDESC2 ));
memset(&zeroGuid, 0, 16);
sessionDesc.dwSize = sizeof( DPSESSIONDESC2 );
memcpy(&sessionDesc.guidApplication, &appGuid, 16);
sessionDesc.dwFlags = DPSESSION_CLIENTSERVER;
sessionDesc.lpszSessionNameA = name;
sessionDesc.dwMaxPlayers = 10;
sessionDesc.dwCurrentPlayers = 0;
IDirectPlayX_Open(pDP, &sessionDesc, DPOPEN_CREATE);
/* I read the sessiondesc from directplay in a fresh memory location,
because directplay does not touch the original struct, but saves
internally a version with the session guid set*/
IDirectPlayX_GetSessionDesc(pDP, NULL, &sessionSize);
newSession=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sessionSize);
IDirectPlayX_GetSessionDesc(pDP, newSession, &sessionSize);
todo_wine ok( !IsEqualGUID(&newSession->guidInstance, &zeroGuid), "Session guid not initialized");
HeapFree(GetProcessHeap(), 0, newSession);
}
}
START_TEST(dplayx)
{
LPDIRECTPLAY4 pDP;
CoInitialize( NULL );
CoCreateInstance(&CLSID_DirectPlay, NULL, CLSCTX_ALL, &IID_IDirectPlay4A, (VOID**)&pDP);
test_session_guid( pDP );
IDirectPlayX_Release( pDP );
CoUninitialize();
}
......@@ -36,6 +36,7 @@ TESTBINS = \
ddraw_test.exe \
dinput_test.exe \
dnsapi_test.exe \
dplayx_test.exe \
dsound_test.exe \
gdi32_test.exe \
hlink_test.exe \
......@@ -109,6 +110,8 @@ dinput_test.exe: $(DLLDIR)/dinput/tests/dinput_test.exe$(DLLEXT)
cp $(DLLDIR)/dinput/tests/dinput_test.exe$(DLLEXT) $@ && $(STRIP) $@
dnsapi_test.exe: $(DLLDIR)/dnsapi/tests/dnsapi_test.exe$(DLLEXT)
cp $(DLLDIR)/dnsapi/tests/dnsapi_test.exe$(DLLEXT) $@ && $(STRIP) $@
dplayx_test.exe: $(DLLDIR)/dplayx/tests/dplayx_test.exe$(DLLEXT)
cp $(DLLDIR)/dplayx/tests/dplayx_test.exe$(DLLEXT) $@ && $(STRIP) $@
dsound_test.exe: $(DLLDIR)/dsound/tests/dsound_test.exe$(DLLEXT)
cp $(DLLDIR)/dsound/tests/dsound_test.exe$(DLLEXT) $@ && $(STRIP) $@
gdi32_test.exe: $(DLLDIR)/gdi32/tests/gdi32_test.exe$(DLLEXT)
......
......@@ -159,6 +159,7 @@ d3d9_test.exe TESTRES "d3d9_test.exe"
ddraw_test.exe TESTRES "ddraw_test.exe"
dinput_test.exe TESTRES "dinput_test.exe"
dnsapi_test.exe TESTRES "dnsapi_test.exe"
dplayx_test.exe TESTRES "dplayx_test.exe"
dsound_test.exe TESTRES "dsound_test.exe"
gdi32_test.exe TESTRES "gdi32_test.exe"
hlink_test.exe TESTRES "hlink_test.exe"
......
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