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
d4565f15
Commit
d4565f15
authored
Aug 24, 2021
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Aug 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Implement IDirectPlay8Server EnumServiceProviders.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ee2e5c02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
2 deletions
+98
-2
server.c
dlls/dpnet/server.c
+12
-2
server.c
dlls/dpnet/tests/server.c
+86
-0
No files found.
dlls/dpnet/server.c
View file @
d4565f15
...
...
@@ -126,9 +126,19 @@ static HRESULT WINAPI IDirectPlay8ServerImpl_EnumServiceProviders(IDirectPlay8Se
PDWORD
pcReturned
,
DWORD
dwFlags
)
{
IDirectPlay8ServerImpl
*
This
=
impl_from_IDirectPlay8Server
(
iface
);
FIXM
E
(
"(%p)->(%s %s %p %p %p %d)
\n
"
,
This
,
debugstr_guid
(
pguidServiceProvider
),
debugstr_guid
(
pguidApplication
),
TRAC
E
(
"(%p)->(%s %s %p %p %p %d)
\n
"
,
This
,
debugstr_guid
(
pguidServiceProvider
),
debugstr_guid
(
pguidApplication
),
pSPInfoBuffer
,
pcbEnumData
,
pcReturned
,
dwFlags
);
return
E_NOTIMPL
;
if
(
!
This
->
msghandler
)
return
DPNERR_UNINITIALIZED
;
if
(
dwFlags
)
FIXME
(
"Unhandled flags %x
\n
"
,
dwFlags
);
if
(
pguidApplication
)
FIXME
(
"Application guid %s is currently being ignored
\n
"
,
debugstr_guid
(
pguidApplication
));
return
enum_services_providers
(
pguidServiceProvider
,
pSPInfoBuffer
,
pcbEnumData
,
pcReturned
);
}
static
HRESULT
WINAPI
IDirectPlay8ServerImpl_CancelAsyncOperation
(
IDirectPlay8Server
*
iface
,
DPNHANDLE
hAsyncHandle
,
DWORD
dwFlags
)
...
...
dlls/dpnet/tests/server.c
View file @
d4565f15
...
...
@@ -184,6 +184,91 @@ static void test_server_info(void)
}
}
static
void
test_enum_service_providers
(
void
)
{
DPN_SERVICE_PROVIDER_INFO
*
serv_prov_info
=
NULL
;
IDirectPlay8Server
*
server
=
NULL
;
DWORD
items
,
size
;
DWORD
i
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_DirectPlay8Server
,
NULL
,
CLSCTX_ALL
,
&
IID_IDirectPlay8Server
,
(
LPVOID
*
)
&
server
);
ok
(
hr
==
S_OK
,
"Failed to create IDirectPlay8Server object
\n
"
);
if
(
FAILED
(
hr
))
return
;
size
=
0
;
items
=
0
;
hr
=
IDirectPlay8Server_EnumServiceProviders
(
server
,
NULL
,
NULL
,
serv_prov_info
,
&
size
,
&
items
,
0
);
ok
(
hr
==
DPNERR_UNINITIALIZED
,
"got %x
\n
"
,
hr
);
hr
=
IDirectPlay8Server_Initialize
(
server
,
NULL
,
DirectPlayMessageHandler
,
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
IDirectPlay8Server_Release
(
server
);
return
;
}
size
=
0
;
items
=
0
;
hr
=
IDirectPlay8Server_EnumServiceProviders
(
server
,
NULL
,
NULL
,
NULL
,
&
size
,
NULL
,
0
);
ok
(
hr
==
E_POINTER
,
"IDirectPlay8Server_EnumServiceProviders failed with %x
\n
"
,
hr
);
hr
=
IDirectPlay8Server_EnumServiceProviders
(
server
,
NULL
,
NULL
,
NULL
,
NULL
,
&
items
,
0
);
ok
(
hr
==
E_POINTER
,
"IDirectPlay8Server_EnumServiceProviders failed with %x
\n
"
,
hr
);
hr
=
IDirectPlay8Server_EnumServiceProviders
(
server
,
NULL
,
NULL
,
NULL
,
&
size
,
&
items
,
0
);
ok
(
hr
==
DPNERR_BUFFERTOOSMALL
,
"IDirectPlay8Server_EnumServiceProviders failed with %x
\n
"
,
hr
);
ok
(
size
!=
0
,
"size is unexpectedly 0
\n
"
);
serv_prov_info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
hr
=
IDirectPlay8Server_EnumServiceProviders
(
server
,
NULL
,
NULL
,
serv_prov_info
,
&
size
,
&
items
,
0
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Server_EnumServiceProviders failed with %x
\n
"
,
hr
);
ok
(
items
!=
0
,
"Found unexpectedly no service providers
\n
"
);
trace
(
"number of items found: %d
\n
"
,
items
);
for
(
i
=
0
;
i
<
items
;
i
++
)
{
trace
(
"Found Service Provider: %s
\n
"
,
wine_dbgstr_w
(
serv_prov_info
[
i
].
pwszName
));
trace
(
"Found guid: %s
\n
"
,
wine_dbgstr_guid
(
&
serv_prov_info
[
i
].
guid
));
}
ok
(
HeapFree
(
GetProcessHeap
(),
0
,
serv_prov_info
),
"Failed freeing server provider info
\n
"
);
size
=
0
;
items
=
0
;
hr
=
IDirectPlay8Server_EnumServiceProviders
(
server
,
&
CLSID_DP8SP_TCPIP
,
NULL
,
NULL
,
&
size
,
&
items
,
0
);
ok
(
hr
==
DPNERR_BUFFERTOOSMALL
,
"IDirectPlay8Server_EnumServiceProviders failed with %x
\n
"
,
hr
);
ok
(
size
!=
0
,
"size is unexpectedly 0
\n
"
);
serv_prov_info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
hr
=
IDirectPlay8Server_EnumServiceProviders
(
server
,
&
CLSID_DP8SP_TCPIP
,
NULL
,
serv_prov_info
,
&
size
,
&
items
,
0
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Server_EnumServiceProviders failed with %x
\n
"
,
hr
);
ok
(
items
!=
0
,
"Found unexpectedly no adapter
\n
"
);
for
(
i
=
0
;
i
<
items
;
i
++
)
{
trace
(
"Found adapter: %s
\n
"
,
wine_dbgstr_w
(
serv_prov_info
[
i
].
pwszName
));
trace
(
"Found adapter guid: %s
\n
"
,
wine_dbgstr_guid
(
&
serv_prov_info
[
i
].
guid
));
}
/* Invalid GUID */
items
=
88
;
hr
=
IDirectPlay8Server_EnumServiceProviders
(
server
,
&
appguid
,
NULL
,
serv_prov_info
,
&
size
,
&
items
,
0
);
ok
(
hr
==
DPNERR_DOESNOTEXIST
,
"IDirectPlay8Peer_EnumServiceProviders failed with %x
\n
"
,
hr
);
ok
(
items
==
88
,
"Found adapter %d
\n
"
,
items
);
HeapFree
(
GetProcessHeap
(),
0
,
serv_prov_info
);
IDirectPlay8Server_Release
(
server
);
}
BOOL
is_process_elevated
(
void
)
{
HANDLE
token
;
...
...
@@ -398,6 +483,7 @@ START_TEST(server)
create_server
();
test_server_info
();
test_enum_service_providers
();
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