Commit 4a4678ca authored by Louis Lenders's avatar Louis Lenders Committed by Alexandre Julliard

dpnet: Return a TCP/IP provider in IDirectPlay8PeerImpl_EnumServiceProviders.

parent 7029559e
......@@ -95,8 +95,53 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_EnumServiceProviders(IDirectPlay8Peer
DPN_SERVICE_PROVIDER_INFO * const pSPInfoBuffer, DWORD * const pcbEnumData,
DWORD * const pcReturned, const DWORD dwFlags)
{
FIXME("(%p)->(%p,%p,%p,%p,%p,%x): stub\n", iface, pguidServiceProvider, pguidApplication, pSPInfoBuffer, pcbEnumData, pcReturned, dwFlags);
return DPNERR_GENERIC;
static const WCHAR dp_providerW[] = {'D','i','r','e','c','t','P','l','a','y','8',' ','T','C','P','/','I','P',' ',
'S','e','r','v','i','c','e',' ','P','r','o','v','i','d','e','r','\0'};
static const WCHAR dp_adapterW[] = {'L','o','c','a','l',' ','A','r','e','a',' ','C','o','n','n','e','c','t','i','o','n',
' ','-',' ','I','P','v','4','\0'};
static const GUID adapter_guid = {0x4ce725f6, 0xd3c0, 0xdade, {0xba, 0x6f, 0x11, 0xf9, 0x65, 0xbc, 0x42, 0x99}};
DWORD req_size;
TRACE("(%p)->(%p,%p,%p,%p,%p,%x): stub\n", iface, pguidServiceProvider, pguidApplication, pSPInfoBuffer,
pcbEnumData, pcReturned, dwFlags);
if(!pguidServiceProvider)
{
req_size = sizeof(DPN_SERVICE_PROVIDER_INFO) + sizeof(dp_providerW);
}
else if(IsEqualGUID(pguidServiceProvider, &CLSID_DP8SP_TCPIP))
{
req_size = sizeof(DPN_SERVICE_PROVIDER_INFO) + sizeof(dp_adapterW);
}
else
{
FIXME("Application requested a provider we don't handle (yet)\n");
*pcReturned = 0;
return DPNERR_DOESNOTEXIST;
}
if(*pcbEnumData < req_size)
{
*pcbEnumData = req_size;
return DPNERR_BUFFERTOOSMALL;
}
pSPInfoBuffer->pwszName = (LPWSTR)(pSPInfoBuffer + sizeof(DPN_SERVICE_PROVIDER_INFO));
if(!pguidServiceProvider)
{
lstrcpyW(pSPInfoBuffer->pwszName, dp_providerW);
pSPInfoBuffer->guid = CLSID_DP8SP_TCPIP;
}
else
{
lstrcpyW(pSPInfoBuffer->pwszName, dp_adapterW);
pSPInfoBuffer->guid = adapter_guid;
}
*pcReturned = 1;
return DPN_OK;
}
static HRESULT WINAPI IDirectPlay8PeerImpl_CancelAsyncOperation(IDirectPlay8Peer *iface,
......
......@@ -67,14 +67,14 @@ static void test_enum_service_providers(void)
items = 0;
hr = IDirectPlay8Peer_EnumServiceProviders(peer, NULL, NULL, NULL, &size, &items, 0);
todo_wine ok(hr == DPNERR_BUFFERTOOSMALL, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
todo_wine ok(size != 0, "size is unexpectedly 0\n");
ok(hr == DPNERR_BUFFERTOOSMALL, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
ok(size != 0, "size is unexpectedly 0\n");
serv_prov_info = (DPN_SERVICE_PROVIDER_INFO*) HeapAlloc(GetProcessHeap(), 0, size);
hr = IDirectPlay8Peer_EnumServiceProviders(peer, NULL, NULL, serv_prov_info, &size, &items, 0);
todo_wine ok(hr == S_OK, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
todo_wine ok(items != 0, "Found unexpectedly no service providers\n");
ok(hr == S_OK, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
ok(items != 0, "Found unexpectedly no service providers\n");
trace("number of items found: %d\n", items);
......@@ -93,14 +93,15 @@ static void test_enum_service_providers(void)
items = 0;
hr = IDirectPlay8Peer_EnumServiceProviders(peer, &CLSID_DP8SP_TCPIP, NULL, NULL, &size, &items, 0);
todo_wine ok(hr == DPNERR_BUFFERTOOSMALL, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
todo_wine ok(size != 0, "size is unexpectedly 0\n");
ok(hr == DPNERR_BUFFERTOOSMALL, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
ok(size != 0, "size is unexpectedly 0\n");
serv_prov_info = (DPN_SERVICE_PROVIDER_INFO*) HeapAlloc(GetProcessHeap(), 0, size);
hr = IDirectPlay8Peer_EnumServiceProviders(peer, &CLSID_DP8SP_TCPIP, NULL, serv_prov_info, &size, &items, 0);
todo_wine ok(hr == S_OK, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
todo_wine ok(items != 0, "Found unexpectedly no adapter\n");
ok(hr == S_OK, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
ok(items != 0, "Found unexpectedly no adapter\n");
for (i=0;i<items;i++)
{
......
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