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>
This commit is contained in:
parent
6eb0015d08
commit
960b48f4e7
|
@ -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,
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
Loading…
Reference in New Issue