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
4ff6ba0a
Commit
4ff6ba0a
authored
Jul 31, 2008
by
Ismael Barros
Committed by
Alexandre Julliard
Aug 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dplayx: Tests for GetCaps.
parent
d142447c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
0 deletions
+125
-0
dplay.c
dlls/dplayx/dplay.c
+5
-0
dplayx.c
dlls/dplayx/tests/dplayx.c
+120
-0
No files found.
dlls/dplayx/dplay.c
View file @
4ff6ba0a
...
...
@@ -2380,6 +2380,11 @@ static HRESULT WINAPI DP_IF_GetPlayerCaps
TRACE
(
"(%p)->(0x%08x,%p,0x%08x)
\n
"
,
This
,
idPlayer
,
lpDPCaps
,
dwFlags
);
if
(
This
->
dp2
->
connectionInitialized
==
NO_PROVIDER
)
{
return
DPERR_UNINITIALIZED
;
}
/* Query the service provider */
data
.
idPlayer
=
idPlayer
;
data
.
dwFlags
=
dwFlags
;
...
...
dlls/dplayx/tests/dplayx.c
View file @
4ff6ba0a
...
...
@@ -529,6 +529,56 @@ static LPCSTR dwFlags2str(DWORD dwFlags, DWORD flagType)
return
flags
;
}
static
void
init_TCPIP_provider
(
LPDIRECTPLAY4
pDP
,
LPCSTR
strIPAddressString
,
WORD
port
)
{
DPCOMPOUNDADDRESSELEMENT
addressElements
[
3
];
LPVOID
pAddress
=
NULL
;
DWORD
dwAddressSize
=
0
;
LPDIRECTPLAYLOBBY3
pDPL
;
HRESULT
hr
;
CoCreateInstance
(
&
CLSID_DirectPlayLobby
,
NULL
,
CLSCTX_ALL
,
&
IID_IDirectPlayLobby3A
,
(
LPVOID
*
)
&
pDPL
);
/* Service provider */
addressElements
[
0
].
guidDataType
=
DPAID_ServiceProvider
;
addressElements
[
0
].
dwDataSize
=
sizeof
(
GUID
);
addressElements
[
0
].
lpData
=
(
LPVOID
)
&
DPSPGUID_TCPIP
;
/* IP address string */
addressElements
[
1
].
guidDataType
=
DPAID_INet
;
addressElements
[
1
].
dwDataSize
=
lstrlen
(
strIPAddressString
)
+
1
;
addressElements
[
1
].
lpData
=
(
LPVOID
)
strIPAddressString
;
/* Optional Port number */
if
(
port
>
0
)
{
addressElements
[
2
].
guidDataType
=
DPAID_INetPort
;
addressElements
[
2
].
dwDataSize
=
sizeof
(
WORD
);
addressElements
[
2
].
lpData
=
&
port
;
}
hr
=
IDirectPlayLobby_CreateCompoundAddress
(
pDPL
,
addressElements
,
2
,
NULL
,
&
dwAddressSize
);
checkHR
(
DPERR_BUFFERTOOSMALL
,
hr
);
if
(
hr
==
DPERR_BUFFERTOOSMALL
)
{
pAddress
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
dwAddressSize
);
hr
=
IDirectPlayLobby_CreateCompoundAddress
(
pDPL
,
addressElements
,
2
,
pAddress
,
&
dwAddressSize
);
checkHR
(
DP_OK
,
hr
);
}
hr
=
IDirectPlayX_InitializeConnection
(
pDP
,
pAddress
,
0
);
todo_wine
checkHR
(
DP_OK
,
hr
);
}
/* DirectPlayCreate */
...
...
@@ -753,6 +803,74 @@ static void test_InitializeConnection(void)
IDirectPlayX_Release
(
pDP
);
}
/* GetCaps */
static
void
test_GetCaps
(
void
)
{
LPDIRECTPLAY4
pDP
;
DPCAPS
dpcaps
;
DWORD
dwFlags
;
HRESULT
hr
;
CoCreateInstance
(
&
CLSID_DirectPlay
,
NULL
,
CLSCTX_ALL
,
&
IID_IDirectPlay4A
,
(
LPVOID
*
)
&
pDP
);
ZeroMemory
(
&
dpcaps
,
sizeof
(
DPCAPS
)
);
/* Service provider not ininitialized */
hr
=
IDirectPlayX_GetCaps
(
pDP
,
&
dpcaps
,
0
);
checkHR
(
DPERR_UNINITIALIZED
,
hr
);
init_TCPIP_provider
(
pDP
,
"127.0.0.1"
,
0
);
/* dpcaps not ininitialized */
hr
=
IDirectPlayX_GetCaps
(
pDP
,
&
dpcaps
,
0
);
todo_wine
checkHR
(
DPERR_INVALIDPARAMS
,
hr
);
dpcaps
.
dwSize
=
sizeof
(
DPCAPS
);
for
(
dwFlags
=
0
;
dwFlags
<=
DPGETCAPS_GUARANTEED
;
dwFlags
+=
DPGETCAPS_GUARANTEED
)
{
hr
=
IDirectPlayX_GetCaps
(
pDP
,
&
dpcaps
,
dwFlags
);
todo_wine
checkHR
(
DP_OK
,
hr
);
if
(
hr
==
DP_OK
)
{
check
(
sizeof
(
DPCAPS
),
dpcaps
.
dwSize
);
check
(
DPCAPS_ASYNCSUPPORTED
|
DPCAPS_GUARANTEEDOPTIMIZED
|
DPCAPS_GUARANTEEDSUPPORTED
,
dpcaps
.
dwFlags
);
check
(
0
,
dpcaps
.
dwMaxQueueSize
);
check
(
0
,
dpcaps
.
dwHundredBaud
);
check
(
500
,
dpcaps
.
dwLatency
);
check
(
65536
,
dpcaps
.
dwMaxLocalPlayers
);
check
(
20
,
dpcaps
.
dwHeaderLength
);
check
(
5000
,
dpcaps
.
dwTimeout
);
switch
(
dwFlags
)
{
case
0
:
check
(
65479
,
dpcaps
.
dwMaxBufferSize
);
check
(
65536
,
dpcaps
.
dwMaxPlayers
);
break
;
case
DPGETCAPS_GUARANTEED
:
check
(
1048547
,
dpcaps
.
dwMaxBufferSize
);
check
(
64
,
dpcaps
.
dwMaxPlayers
);
break
;
default:
break
;
}
}
}
IDirectPlayX_Release
(
pDP
);
}
START_TEST
(
dplayx
)
{
...
...
@@ -762,5 +880,7 @@ START_TEST(dplayx)
test_EnumConnections
();
test_InitializeConnection
();
test_GetCaps
();
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