Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
d3b14079
Commit
d3b14079
authored
11 years ago
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dpnet/tests: Add IDirectPlay8Peer_EnumHosts tests.
parent
1500a8a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/dpnet/tests/peer.c
+46
-13
46 additions, 13 deletions
dlls/dpnet/tests/peer.c
with
46 additions
and
13 deletions
dlls/dpnet/tests/peer.c
+
46
−
13
View file @
d3b14079
...
...
@@ -23,21 +23,12 @@
#include
<dplay8.h>
#include
"wine/test.h"
static
char
*
show_guid
(
const
GUID
*
guid
,
char
*
buf
)
{
sprintf
(
buf
,
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]);
return
buf
;
}
static
IDirectPlay8Peer
*
peer
=
NULL
;
static
HRESULT
WINAPI
DirectPlayMessageHandler
(
PVOID
context
,
DWORD
message_id
,
PVOID
buffer
)
{
trace
(
"DirectPlayMessageHandler: 0x%08x
\n
"
,
message_id
);
return
S_OK
;
}
...
...
@@ -64,7 +55,6 @@ static void test_enum_service_providers(void)
DWORD
items
,
size
;
DWORD
i
;
HRESULT
hr
;
char
guid
[
39
]
;
size
=
0
;
items
=
0
;
...
...
@@ -84,7 +74,7 @@ static void test_enum_service_providers(void)
for
(
i
=
0
;
i
<
items
;
i
++
)
{
trace
(
"Found Service Provider: %s
\n
"
,
wine_dbgstr_w
(
serv_prov_info
->
pwszName
));
trace
(
"Found guid: %s
\n
"
,
show
_guid
(
&
serv_prov_info
->
guid
,
guid
));
trace
(
"Found guid: %s
\n
"
,
wine_dbgstr
_guid
(
&
serv_prov_info
->
guid
));
serv_prov_info
++
;
}
...
...
@@ -109,7 +99,7 @@ static void test_enum_service_providers(void)
for
(
i
=
0
;
i
<
items
;
i
++
)
{
trace
(
"Found adapter: %s
\n
"
,
wine_dbgstr_w
(
serv_prov_info
->
pwszName
));
trace
(
"Found adapter guid: %s
\n
"
,
show
_guid
(
&
serv_prov_info
->
guid
,
guid
));
trace
(
"Found adapter guid: %s
\n
"
,
wine_dbgstr
_guid
(
&
serv_prov_info
->
guid
));
serv_prov_info
++
;
}
...
...
@@ -118,6 +108,48 @@ static void test_enum_service_providers(void)
ok
(
HeapFree
(
GetProcessHeap
(),
0
,
serv_prov_info
),
"Failed freeing server provider info
\n
"
);
}
static
const
GUID
appguid
=
{
0xcd0c3d4b
,
0xe15e
,
0x4cf2
,
{
0x9e
,
0xa8
,
0x6e
,
0x1d
,
0x65
,
0x48
,
0xc5
,
0xa5
}
};
static
void
test_enum_hosts
(
void
)
{
HRESULT
hr
;
IDirectPlay8Address
*
host
=
NULL
;
IDirectPlay8Address
*
local
=
NULL
;
DPN_APPLICATION_DESC
appdesc
;
DPNHANDLE
async
=
0
;
static
const
WCHAR
localhost
[]
=
{
'1'
,
'2'
,
'7'
,
'.'
,
'0'
,
'.'
,
'0'
,
'.'
,
'1'
,
0
};
memset
(
&
appdesc
,
0
,
sizeof
(
DPN_APPLICATION_DESC
)
);
appdesc
.
dwSize
=
sizeof
(
DPN_APPLICATION_DESC
);
appdesc
.
guidApplication
=
appguid
;
hr
=
CoCreateInstance
(
&
CLSID_DirectPlay8Address
,
NULL
,
CLSCTX_ALL
,
&
IID_IDirectPlay8Address
,
(
LPVOID
*
)
&
local
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Address failed with 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_SetSP
(
local
,
&
CLSID_DP8SP_TCPIP
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Address_SetSP failed with 0x%08x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_DirectPlay8Address
,
NULL
,
CLSCTX_ALL
,
&
IID_IDirectPlay8Address
,
(
LPVOID
*
)
&
host
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Address failed with 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_SetSP
(
host
,
&
CLSID_DP8SP_TCPIP
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Address_SetSP failed with 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Address_AddComponent
(
host
,
DPNA_KEY_HOSTNAME
,
localhost
,
sizeof
(
localhost
),
DPNA_DATATYPE_STRING
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Address failed with 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Peer_EnumHosts
(
peer
,
&
appdesc
,
host
,
local
,
NULL
,
0
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async
,
0
);
todo_wine
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Peer_EnumServiceProviders failed with 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
async
,
"No Handle returned
\n
"
);
hr
=
IDirectPlay8Peer_CancelAsyncOperation
(
peer
,
async
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"IDirectPlay8Peer_CancelAsyncOperation failed with 0x%08x
\n
"
,
hr
);
IDirectPlay8Address_Release
(
local
);
IDirectPlay8Address_Release
(
host
);
}
static
void
test_get_sp_caps
(
void
)
{
DPN_SP_CAPS
caps
;
...
...
@@ -164,6 +196,7 @@ START_TEST(peer)
{
test_init_dp
();
test_enum_service_providers
();
test_enum_hosts
();
test_get_sp_caps
();
test_cleanup_dp
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment