dpnet: Implement IDirectPlay8Client SetSPCaps.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5d66862e5a
commit
598b52ce38
|
@ -309,9 +309,17 @@ static HRESULT WINAPI IDirectPlay8ClientImpl_SetCaps(IDirectPlay8Client *iface,
|
||||||
static HRESULT WINAPI IDirectPlay8ClientImpl_SetSPCaps(IDirectPlay8Client *iface,
|
static HRESULT WINAPI IDirectPlay8ClientImpl_SetSPCaps(IDirectPlay8Client *iface,
|
||||||
const GUID * const pguidSP, const DPN_SP_CAPS * const pdpspCaps, const DWORD dwFlags)
|
const GUID * const pguidSP, const DPN_SP_CAPS * const pdpspCaps, const DWORD dwFlags)
|
||||||
{
|
{
|
||||||
IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
|
IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
|
||||||
FIXME("(%p):(%x): Stub\n", This, dwFlags);
|
|
||||||
return DPN_OK;
|
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,
|
static HRESULT WINAPI IDirectPlay8ClientImpl_GetSPCaps(IDirectPlay8Client *iface,
|
||||||
|
|
|
@ -140,6 +140,9 @@ static BOOL test_init_dp(void)
|
||||||
hr = IDirectPlay8Client_Initialize(client, NULL, NULL, 0);
|
hr = IDirectPlay8Client_Initialize(client, NULL, NULL, 0);
|
||||||
ok(hr == DPNERR_INVALIDPARAM, "got %x\n", hr);
|
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);
|
hr = IDirectPlay8Client_Initialize(client, NULL, DirectPlayMessageHandler, 0);
|
||||||
ok(hr == S_OK, "IDirectPlay8Client_Initialize failed with %x\n", hr);
|
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.dwBuffersPerThread == 1, "expected 1, got %d\n", caps.dwBuffersPerThread);
|
||||||
ok(caps.dwSystemBufferSize == 0x10000 || broken(caps.dwSystemBufferSize == 0x2000 /* before Win8 */),
|
ok(caps.dwSystemBufferSize == 0x10000 || broken(caps.dwSystemBufferSize == 0x2000 /* before Win8 */),
|
||||||
"expected 0x10000, got 0x%x\n", caps.dwSystemBufferSize);
|
"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)
|
static void test_lobbyclient(void)
|
||||||
|
|
Loading…
Reference in New Issue