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
960b48f4
Commit
960b48f4
authored
Feb 15, 2017
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Feb 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Add basic validation in IDirectPlay8Peer EnumHosts.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6eb0015d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
peer.c
dlls/dpnet/peer.c
+13
-2
client.c
dlls/dpnet/tests/client.c
+4
-4
No files found.
dlls/dpnet/peer.c
View file @
960b48f4
...
...
@@ -457,11 +457,22 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_EnumHosts(IDirectPlay8Peer *iface,
const
DWORD
dwUserEnumDataSize
,
const
DWORD
dwEnumCount
,
const
DWORD
dwRetryInterval
,
const
DWORD
dwTimeOut
,
void
*
const
pvUserContext
,
DPNHANDLE
*
const
pAsyncHandle
,
const
DWORD
dwFlags
)
{
IDirectPlay8PeerImpl
*
This
=
impl_from_IDirectPlay8Peer
(
iface
);
FIXME
(
"(%p)->(%p,%p,%p,%p,%x,%x,%x,%x,%p,%p,%x): stub
\n
"
,
iface
,
pApplicationDesc
,
pAddrHost
,
pDeviceInfo
,
pUserEnumData
,
dwUserEnumDataSize
,
dwEnumCount
,
This
,
pApplicationDesc
,
pAddrHost
,
pDeviceInfo
,
pUserEnumData
,
dwUserEnumDataSize
,
dwEnumCount
,
dwRetryInterval
,
dwTimeOut
,
pvUserContext
,
pAsyncHandle
,
dwFlags
);
return
DPNERR_GENERIC
;
if
(
!
This
->
msghandler
)
return
DPNERR_UNINITIALIZED
;
if
((
dwFlags
&
DPNENUMHOSTS_SYNC
)
&&
pAsyncHandle
)
return
DPNERR_INVALIDPARAM
;
if
(
dwUserEnumDataSize
>
This
->
spcaps
.
dwMaxEnumPayloadSize
)
return
DPNERR_ENUMQUERYTOOLARGE
;
return
(
dwFlags
&
DPNENUMHOSTS_SYNC
)
?
DPN_OK
:
DPNSUCCESS_PENDING
;
}
static
HRESULT
WINAPI
IDirectPlay8PeerImpl_DestroyPeer
(
IDirectPlay8Peer
*
iface
,
const
DPNID
dpnidClient
,
...
...
dlls/dpnet/tests/client.c
View file @
960b48f4
...
...
@@ -609,7 +609,7 @@ static void test_enum_hosts_peer(void)
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
);
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
);
...
...
@@ -617,15 +617,15 @@ static void test_enum_hosts_peer(void)
/* No Initialize has been called on peer2. */
hr
=
IDirectPlay8Peer_EnumHosts
(
peer2
,
&
appdesc
,
host
,
local
,
NULL
,
0
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async
,
0
);
todo_wine
ok
(
hr
==
DPNERR_UNINITIALIZED
,
"IDirectPlay8Peer_EnumHosts failed with 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNERR_UNINITIALIZED
,
"IDirectPlay8Peer_EnumHosts failed with 0x%08x
\n
"
,
hr
);
/* Since we are running asynchronously, EnumHosts returns DPNSUCCESS_PENDING. */
hr
=
IDirectPlay8Peer_EnumHosts
(
peer
,
&
appdesc
,
host
,
local
,
NULL
,
0
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async
,
0
);
todo_wine
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Peer_EnumHosts failed with 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Peer_EnumHosts failed with 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
async
,
"No Handle returned
\n
"
);
hr
=
IDirectPlay8Peer_EnumHosts
(
peer
,
&
appdesc
,
host
,
local
,
NULL
,
0
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async2
,
0
);
todo_wine
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Peer_EnumHosts failed with 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Peer_EnumHosts failed with 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
async2
,
"No Handle returned
\n
"
);
todo_wine
ok
(
async2
!=
async
,
"Same handle returned.
\n
"
);
...
...
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