Commit 598b52ce authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

dpnet: Implement IDirectPlay8Client SetSPCaps.

parent 5d66862e
......@@ -309,9 +309,17 @@ static HRESULT WINAPI IDirectPlay8ClientImpl_SetCaps(IDirectPlay8Client *iface,
static HRESULT WINAPI IDirectPlay8ClientImpl_SetSPCaps(IDirectPlay8Client *iface,
const GUID * const pguidSP, const DPN_SP_CAPS * const pdpspCaps, const DWORD dwFlags)
{
IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
FIXME("(%p):(%x): Stub\n", This, dwFlags);
return DPN_OK;
IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
TRACE("(%p)->(%p,%p,%x): stub\n", iface, pguidSP, pdpspCaps, dwFlags);
if(!This->msghandler || pdpspCaps->dwSize != sizeof(DPN_SP_CAPS))
return DPNERR_INVALIDPARAM;
/* Only dwSystemBufferSize is set by this call. */
This->spcaps.dwSystemBufferSize = pdpspCaps->dwSystemBufferSize;
return DPN_OK;
}
static HRESULT WINAPI IDirectPlay8ClientImpl_GetSPCaps(IDirectPlay8Client *iface,
......
......@@ -140,6 +140,9 @@ static BOOL test_init_dp(void)
hr = IDirectPlay8Client_Initialize(client, NULL, NULL, 0);
ok(hr == DPNERR_INVALIDPARAM, "got %x\n", hr);
hr = IDirectPlay8Client_SetSPCaps(client, &CLSID_DP8SP_TCPIP, &caps, 0);
ok(hr == DPNERR_INVALIDPARAM, "SetSPCaps failed with %x\n", hr);
hr = IDirectPlay8Client_Initialize(client, NULL, DirectPlayMessageHandler, 0);
ok(hr == S_OK, "IDirectPlay8Client_Initialize failed with %x\n", hr);
......@@ -415,6 +418,33 @@ static void test_get_sp_caps(void)
ok(caps.dwBuffersPerThread == 1, "expected 1, got %d\n", caps.dwBuffersPerThread);
ok(caps.dwSystemBufferSize == 0x10000 || broken(caps.dwSystemBufferSize == 0x2000 /* before Win8 */),
"expected 0x10000, got 0x%x\n", caps.dwSystemBufferSize);
caps.dwNumThreads = 2;
caps.dwDefaultEnumCount = 3;
caps.dwDefaultEnumRetryInterval = 1400;
caps.dwDefaultEnumTimeout = 1400;
caps.dwMaxEnumPayloadSize = 900;
caps.dwBuffersPerThread = 2;
caps.dwSystemBufferSize = 0x0ffff;
hr = IDirectPlay8Client_SetSPCaps(client, &CLSID_DP8SP_TCPIP, &caps, 0);
ok(hr == DPN_OK, "SetSPCaps failed with %x\n", hr);
hr = IDirectPlay8Client_GetSPCaps(client, &CLSID_DP8SP_TCPIP, &caps, 0);
ok(hr == DPN_OK, "GetSPCaps failed with %x\n", hr);
ok(caps.dwSize == sizeof(DPN_SP_CAPS), "got %d\n", caps.dwSize);
ok(caps.dwNumThreads >= 3, "got %d\n", caps.dwNumThreads);
ok(caps.dwDefaultEnumCount == 5, "expected 5, got %d\n", caps.dwDefaultEnumCount);
ok(caps.dwDefaultEnumRetryInterval == 1500, "expected 1500, got %d\n", caps.dwDefaultEnumRetryInterval);
ok(caps.dwDefaultEnumTimeout == 1500, "expected 1500, got %d\n", caps.dwDefaultEnumTimeout);
ok(caps.dwMaxEnumPayloadSize == 983, "expected 983, got %d\n", caps.dwMaxEnumPayloadSize);
ok(caps.dwBuffersPerThread == 1, "expected 1, got %d\n", caps.dwBuffersPerThread);
ok(caps.dwSystemBufferSize == 0x0ffff, "expected 0x0ffff, got 0x%x\n", caps.dwSystemBufferSize);
/* Reset the System setting back to its default. */
caps.dwSystemBufferSize = 0x10000;
hr = IDirectPlay8Client_SetSPCaps(client, &CLSID_DP8SP_TCPIP, &caps, 0);
ok(hr == DPN_OK, "SetSPCaps failed with %x\n", hr);
}
static void test_lobbyclient(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