Commit 83cce966 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

dpnet: Handle unknown service GUID in enum_services_providers.

parent e3781c84
......@@ -147,10 +147,10 @@ HRESULT enum_services_providers(const GUID * const service, DPN_SERVICE_PROVIDER
if(!returned || !buf_size)
return E_POINTER;
*returned = 0;
if(!service)
{
*returned = 0;
res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, serviceproviders, 0, KEY_READ, &key);
if(res == ERROR_FILE_NOT_FOUND)
return DPNERR_DOESNOTEXIST;
......
......@@ -211,6 +211,12 @@ static void test_enum_service_providers(void)
}
ok(HeapFree(GetProcessHeap(), 0, serv_prov_info), "Failed freeing server provider info\n");
/* Invalid GUID */
items = 88;
hr = IDirectPlay8Client_EnumServiceProviders(client, &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);
}
static void test_enum_hosts(void)
......@@ -571,6 +577,12 @@ static void test_enum_service_providers_peer(void)
serv_prov_info -= items; /* set pointer back */
ok(HeapFree(GetProcessHeap(), 0, serv_prov_info), "Failed freeing server provider info\n");
/* Invalid GUID */
items = 88;
hr = IDirectPlay8Peer_EnumServiceProviders(peer, &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);
}
static void test_enum_hosts_peer(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment