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
6eb0015d
Commit
6eb0015d
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 IDirectPlay8Client EnumHosts.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
db1d1940
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
11 deletions
+23
-11
client.c
dlls/dpnet/client.c
+14
-2
client.c
dlls/dpnet/tests/client.c
+7
-7
thread.c
dlls/dpnet/tests/thread.c
+2
-2
No files found.
dlls/dpnet/client.c
View file @
6eb0015d
...
...
@@ -145,8 +145,20 @@ static HRESULT WINAPI IDirectPlay8ClientImpl_EnumHosts(IDirectPlay8Client *iface
const
DWORD
dwFlags
)
{
IDirectPlay8ClientImpl
*
This
=
impl_from_IDirectPlay8Client
(
iface
);
FIXME
(
"(%p):(%p,%p,%x): Stub
\n
"
,
This
,
pvUserContext
,
pAsyncHandle
,
dwFlags
);
return
DPN_OK
;
FIXME
(
"(%p):(%p,%p,%p,%p,%u,%u,%u,%u,%p,%p,%x)
\n
"
,
This
,
pApplicationDesc
,
pAddrHost
,
pDeviceInfo
,
pUserEnumData
,
dwUserEnumDataSize
,
dwEnumCount
,
dwRetryInterval
,
dwTimeOut
,
pvUserContext
,
pAsyncHandle
,
dwFlags
);
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
IDirectPlay8ClientImpl_CancelAsyncOperation
(
IDirectPlay8Client
*
iface
,
...
...
dlls/dpnet/tests/client.c
View file @
6eb0015d
...
...
@@ -254,22 +254,22 @@ static void test_enum_hosts(void)
data
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
caps
.
dwMaxEnumPayloadSize
+
1
);
hr
=
IDirectPlay8Client_EnumHosts
(
client
,
&
appdesc
,
host
,
local
,
NULL
,
0
,
2
,
1000
,
1000
,
NULL
,
&
async
,
DPNENUMHOSTS_SYNC
);
todo_wine
ok
(
hr
==
DPNERR_INVALIDPARAM
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNERR_INVALIDPARAM
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Client_EnumHosts
(
client
,
&
appdesc
,
host
,
local
,
data
,
caps
.
dwMaxEnumPayloadSize
+
1
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async
,
DPNENUMHOSTS_SYNC
);
todo_wine
ok
(
hr
==
DPNERR_INVALIDPARAM
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNERR_INVALIDPARAM
,
"got 0x%08x
\n
"
,
hr
);
async
=
0
;
hr
=
IDirectPlay8Client_EnumHosts
(
client
,
&
appdesc
,
host
,
local
,
data
,
caps
.
dwMaxEnumPayloadSize
+
1
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async
,
0
);
todo_wine
ok
(
hr
==
DPNERR_ENUMQUERYTOOLARGE
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNERR_ENUMQUERYTOOLARGE
,
"got 0x%08x
\n
"
,
hr
);
ok
(
!
async
,
"Handle returned
\n
"
);
async
=
0
;
hr
=
IDirectPlay8Client_EnumHosts
(
client
,
&
appdesc
,
host
,
local
,
data
,
caps
.
dwMaxEnumPayloadSize
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async
,
0
);
todo_wine
ok
(
hr
==
DPNSUCCESS_PENDING
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNSUCCESS_PENDING
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
async
,
"No Handle returned
\n
"
);
/* This CancelAsyncOperation doesn't generate a DPN_MSGID_ASYNC_OP_COMPLETE */
...
...
@@ -279,15 +279,15 @@ static void test_enum_hosts(void)
/* No Initialize has been called on client2. */
hr
=
IDirectPlay8Client_EnumHosts
(
client2
,
&
appdesc
,
host
,
local
,
NULL
,
0
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async
,
0
);
todo_wine
ok
(
hr
==
DPNERR_UNINITIALIZED
,
"IDirectPlay8Client_EnumHosts failed with 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNERR_UNINITIALIZED
,
"IDirectPlay8Client_EnumHosts failed with 0x%08x
\n
"
,
hr
);
/* Since we are running asynchronously, EnumHosts returns DPNSUCCESS_PENDING. */
hr
=
IDirectPlay8Client_EnumHosts
(
client
,
&
appdesc
,
host
,
local
,
NULL
,
0
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async
,
0
);
todo_wine
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Client_EnumHosts failed with 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Client_EnumHosts failed with 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
async
,
"No Handle returned
\n
"
);
hr
=
IDirectPlay8Client_EnumHosts
(
client
,
&
appdesc
,
host
,
local
,
NULL
,
0
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async2
,
0
);
todo_wine
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Client_EnumHosts failed with 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Client_EnumHosts failed with 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
async2
,
"No Handle returned
\n
"
);
todo_wine
ok
(
async2
!=
async
,
"Same handle returned.
\n
"
);
...
...
dlls/dpnet/tests/thread.c
View file @
6eb0015d
...
...
@@ -164,7 +164,7 @@ static void test_enum_hosts(void)
ok
(
hr
==
S_OK
,
"IDirectPlay8Address failed with 0x%08x
\n
"
,
hr
);
hr
=
IDirectPlay8Client_EnumHosts
(
client
,
&
appdesc
,
host
,
local
,
NULL
,
0
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async
,
0
);
todo_wine
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Client_EnumHosts failed with 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Client_EnumHosts failed with 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
async
,
"No Handle returned
\n
"
);
hr
=
IDirectPlay8ThreadPool_GetThreadCount
(
pool1
,
-
1
,
&
threadcnt
,
0
);
...
...
@@ -172,7 +172,7 @@ static void test_enum_hosts(void)
todo_wine
ok
(
threadcnt
==
6
,
"got %d
\n
"
,
threadcnt
);
hr
=
IDirectPlay8Client_EnumHosts
(
client
,
&
appdesc
,
host
,
local
,
NULL
,
0
,
INFINITE
,
0
,
INFINITE
,
NULL
,
&
async2
,
0
);
todo_wine
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Client_EnumHosts failed with 0x%08x
\n
"
,
hr
);
ok
(
hr
==
DPNSUCCESS_PENDING
,
"IDirectPlay8Client_EnumHosts failed with 0x%08x
\n
"
,
hr
);
WaitForSingleObject
(
enumevent
,
1000
);
...
...
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