dpnet: Add pointer tests and checks in EnumServiceProvider.

This commit is contained in:
Alistair Leslie-Hughes 2014-02-19 15:08:55 +11:00 committed by Alexandre Julliard
parent 964c7d7305
commit bf681bff2e
2 changed files with 9 additions and 0 deletions

View File

@ -130,6 +130,9 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_EnumServiceProviders(IDirectPlay8Peer
TRACE("(%p)->(%p,%p,%p,%p,%p,%x): stub\n", iface, pguidServiceProvider, pguidApplication, pSPInfoBuffer,
pcbEnumData, pcReturned, dwFlags);
if(!pcReturned || !pcbEnumData)
return E_POINTER;
if(!pguidServiceProvider)
{
req_size = sizeof(DPN_SERVICE_PROVIDER_INFO) + sizeof(dp_providerW);

View File

@ -59,6 +59,12 @@ static void test_enum_service_providers(void)
size = 0;
items = 0;
hr = IDirectPlay8Peer_EnumServiceProviders(peer, NULL, NULL, NULL, &size, NULL, 0);
ok(hr == E_POINTER, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
hr = IDirectPlay8Peer_EnumServiceProviders(peer, NULL, NULL, NULL, NULL, &items, 0);
ok(hr == E_POINTER, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
hr = IDirectPlay8Peer_EnumServiceProviders(peer, NULL, NULL, NULL, &size, &items, 0);
ok(hr == DPNERR_BUFFERTOOSMALL, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
ok(size != 0, "size is unexpectedly 0\n");