Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
724f0ea4
Commit
724f0ea4
authored
Aug 03, 2008
by
Ismael Barros
Committed by
Alexandre Julliard
Aug 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dplayx: Tests for CreatePlayer.
parent
bd22a57c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
179 additions
and
0 deletions
+179
-0
dplay.c
dlls/dplayx/dplay.c
+10
-0
dplayx.c
dlls/dplayx/tests/dplayx.c
+169
-0
No files found.
dlls/dplayx/dplay.c
View file @
724f0ea4
...
@@ -1611,6 +1611,11 @@ static HRESULT WINAPI DirectPlay2AImpl_CreatePlayer
...
@@ -1611,6 +1611,11 @@ static HRESULT WINAPI DirectPlay2AImpl_CreatePlayer
{
{
IDirectPlay2Impl
*
This
=
(
IDirectPlay2Impl
*
)
iface
;
IDirectPlay2Impl
*
This
=
(
IDirectPlay2Impl
*
)
iface
;
if
(
lpidPlayer
==
NULL
)
{
return
DPERR_INVALIDPARAMS
;
}
if
(
dwFlags
&
DPPLAYER_SERVERPLAYER
)
if
(
dwFlags
&
DPPLAYER_SERVERPLAYER
)
{
{
*
lpidPlayer
=
DPID_SERVERPLAYER
;
*
lpidPlayer
=
DPID_SERVERPLAYER
;
...
@@ -1630,6 +1635,11 @@ static HRESULT WINAPI DirectPlay2WImpl_CreatePlayer
...
@@ -1630,6 +1635,11 @@ static HRESULT WINAPI DirectPlay2WImpl_CreatePlayer
{
{
IDirectPlay2Impl
*
This
=
(
IDirectPlay2Impl
*
)
iface
;
IDirectPlay2Impl
*
This
=
(
IDirectPlay2Impl
*
)
iface
;
if
(
lpidPlayer
==
NULL
)
{
return
DPERR_INVALIDPARAMS
;
}
if
(
dwFlags
&
DPPLAYER_SERVERPLAYER
)
if
(
dwFlags
&
DPPLAYER_SERVERPLAYER
)
{
{
*
lpidPlayer
=
DPID_SERVERPLAYER
;
*
lpidPlayer
=
DPID_SERVERPLAYER
;
...
...
dlls/dplayx/tests/dplayx.c
View file @
724f0ea4
...
@@ -1759,6 +1759,173 @@ static void test_SessionDesc(void)
...
@@ -1759,6 +1759,173 @@ static void test_SessionDesc(void)
}
}
/* CreatePlayer */
static
void
test_CreatePlayer
(
void
)
{
LPDIRECTPLAY4
pDP
[
2
];
DPSESSIONDESC2
dpsd
;
DPNAME
name
;
DPID
dpid
;
HRESULT
hr
;
CoCreateInstance
(
&
CLSID_DirectPlay
,
NULL
,
CLSCTX_ALL
,
&
IID_IDirectPlay4A
,
(
LPVOID
*
)
&
pDP
[
0
]
);
CoCreateInstance
(
&
CLSID_DirectPlay
,
NULL
,
CLSCTX_ALL
,
&
IID_IDirectPlay4A
,
(
LPVOID
*
)
&
pDP
[
1
]
);
ZeroMemory
(
&
dpsd
,
sizeof
(
DPSESSIONDESC2
)
);
ZeroMemory
(
&
name
,
sizeof
(
DPNAME
)
);
/* Connection not initialized */
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
0
);
checkHR
(
DPERR_UNINITIALIZED
,
hr
);
init_TCPIP_provider
(
pDP
[
0
],
"127.0.0.1"
,
0
);
init_TCPIP_provider
(
pDP
[
1
],
"127.0.0.1"
,
0
);
/* Session not open */
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
0
);
todo_wine
checkHR
(
DPERR_INVALIDPARAMS
,
hr
);
if
(
hr
==
DPERR_UNINITIALIZED
)
{
skip
(
"CreatePlayer not implemented
\n
"
);
return
;
}
dpsd
.
dwSize
=
sizeof
(
DPSESSIONDESC2
);
dpsd
.
guidApplication
=
appGuid
;
IDirectPlayX_Open
(
pDP
[
0
],
&
dpsd
,
DPOPEN_CREATE
);
/* Player name */
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
0
);
checkHR
(
DP_OK
,
hr
);
name
.
dwSize
=
-
1
;
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
&
name
,
NULL
,
NULL
,
0
,
0
);
checkHR
(
DP_OK
,
hr
);
name
.
dwSize
=
sizeof
(
DPNAME
);
name
.
lpszShortNameA
=
(
LPSTR
)
"test"
;
name
.
lpszLongNameA
=
NULL
;
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
&
name
,
NULL
,
NULL
,
0
,
0
);
checkHR
(
DP_OK
,
hr
);
/* Null dpid */
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
);
checkHR
(
DPERR_INVALIDPARAMS
,
hr
);
/* There can only be one server player */
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
DPPLAYER_SERVERPLAYER
);
checkHR
(
DP_OK
,
hr
);
check
(
DPID_SERVERPLAYER
,
dpid
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
DPPLAYER_SERVERPLAYER
);
checkHR
(
DPERR_CANTCREATEPLAYER
,
hr
);
IDirectPlayX_DestroyPlayer
(
pDP
[
0
],
dpid
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
DPPLAYER_SERVERPLAYER
);
checkHR
(
DP_OK
,
hr
);
check
(
DPID_SERVERPLAYER
,
dpid
);
IDirectPlayX_DestroyPlayer
(
pDP
[
0
],
dpid
);
/* Flags */
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
0
);
checkHR
(
DP_OK
,
hr
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
DPPLAYER_SERVERPLAYER
);
checkHR
(
DP_OK
,
hr
);
check
(
DPID_SERVERPLAYER
,
dpid
);
IDirectPlayX_DestroyPlayer
(
pDP
[
0
],
dpid
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
DPPLAYER_SPECTATOR
);
checkHR
(
DP_OK
,
hr
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
(
DPPLAYER_SERVERPLAYER
|
DPPLAYER_SPECTATOR
)
);
checkHR
(
DP_OK
,
hr
);
check
(
DPID_SERVERPLAYER
,
dpid
);
IDirectPlayX_DestroyPlayer
(
pDP
[
0
],
dpid
);
/* Session with DPSESSION_NEWPLAYERSDISABLED */
IDirectPlayX_Close
(
pDP
[
0
]
);
dpsd
.
dwFlags
=
DPSESSION_NEWPLAYERSDISABLED
;
hr
=
IDirectPlayX_Open
(
pDP
[
0
],
&
dpsd
,
DPOPEN_CREATE
);
checkHR
(
DP_OK
,
hr
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
0
);
checkHR
(
DPERR_CANTCREATEPLAYER
,
hr
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
DPPLAYER_SERVERPLAYER
);
checkHR
(
DPERR_CANTCREATEPLAYER
,
hr
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
DPPLAYER_SPECTATOR
);
checkHR
(
DPERR_CANTCREATEPLAYER
,
hr
);
/* Creating players in a Client/Server session */
IDirectPlayX_Close
(
pDP
[
0
]
);
dpsd
.
dwFlags
=
DPSESSION_CLIENTSERVER
;
hr
=
IDirectPlayX_Open
(
pDP
[
0
],
&
dpsd
,
DPOPEN_CREATE
);
checkHR
(
DP_OK
,
hr
);
hr
=
IDirectPlayX_EnumSessions
(
pDP
[
1
],
&
dpsd
,
0
,
EnumSessions_cb_join
,
(
LPVOID
)
pDP
[
1
],
0
);
checkHR
(
DP_OK
,
hr
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
0
);
checkHR
(
DPERR_ACCESSDENIED
,
hr
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
DPPLAYER_SERVERPLAYER
);
checkHR
(
DP_OK
,
hr
);
check
(
DPID_SERVERPLAYER
,
dpid
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
1
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
DPPLAYER_SERVERPLAYER
);
checkHR
(
DPERR_INVALIDFLAGS
,
hr
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
1
],
&
dpid
,
NULL
,
NULL
,
NULL
,
0
,
0
);
checkHR
(
DP_OK
,
hr
);
IDirectPlayX_Release
(
pDP
[
0
]
);
IDirectPlayX_Release
(
pDP
[
1
]
);
}
START_TEST
(
dplayx
)
START_TEST
(
dplayx
)
{
{
...
@@ -1773,5 +1940,7 @@ START_TEST(dplayx)
...
@@ -1773,5 +1940,7 @@ START_TEST(dplayx)
test_EnumSessions
();
test_EnumSessions
();
test_SessionDesc
();
test_SessionDesc
();
test_CreatePlayer
();
CoUninitialize
();
CoUninitialize
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment