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

dpnet: Implement IDirectPlay8Thread Initialize.

In order to get the tests to pass, msghandler needed to be reset in Close. Signed-off-by: 's avatarAlistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 960b48f4
......@@ -120,8 +120,12 @@ struct IDirectPlay8LobbiedApplicationImpl
*/
struct IDirectPlay8ThreadPoolImpl
{
IDirectPlay8ThreadPool IDirectPlay8ThreadPool_iface;
LONG ref;
IDirectPlay8ThreadPool IDirectPlay8ThreadPool_iface;
LONG ref;
PFNDPNMESSAGEHANDLER msghandler;
DWORD flags;
void *usercontext;
};
/**
......
......@@ -64,7 +64,7 @@ static void create_threadpool(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDirectPlay8ThreadPool_Initialize(pool1, NULL, NULL, 0);
todo_wine ok(hr == DPNERR_INVALIDPARAM, "got 0x%08x\n", hr);
ok(hr == DPNERR_INVALIDPARAM, "got 0x%08x\n", hr);
hr = IDirectPlay8ThreadPool_Initialize(pool1, NULL, &DirectPlayThreadHandler, 0);
ok(hr == S_OK, "got 0x%08x\n", hr);
......@@ -133,6 +133,9 @@ static void test_enum_hosts(void)
hr = IDirectPlay8ThreadPool_Initialize(pool1, NULL, &DirectPlayThreadHandler, 0);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDirectPlay8ThreadPool_Initialize(pool1, NULL, &DirectPlayThreadHandler, 0);
ok(hr == DPNERR_ALREADYINITIALIZED, "got 0x%08x\n", hr);
hr = IDirectPlay8ThreadPool_GetThreadCount(pool1, -1, &threadcnt, 0);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(threadcnt == 0, "got %d\n", threadcnt);
......
......@@ -82,13 +82,32 @@ static ULONG WINAPI IDirectPlay8ThreadPoolImpl_Release(IDirectPlay8ThreadPool *i
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_Initialize(IDirectPlay8ThreadPool *iface,
void * const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags)
{
FIXME("(%p)->(%p,%p,%x): stub\n", iface, pvUserContext, pfn, dwFlags);
IDirectPlay8ThreadPoolImpl *This = impl_from_IDirectPlay8ThreadPool(iface);
TRACE("(%p)->(%p,%p,%x)\n", This, pvUserContext, pfn, dwFlags);
if(!pfn)
return DPNERR_INVALIDPARAM;
if(This->msghandler)
return DPNERR_ALREADYINITIALIZED;
This->msghandler = pfn;
This->flags = dwFlags;
This->usercontext = pvUserContext;
return DPN_OK;
}
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_Close(IDirectPlay8ThreadPool *iface,
const DWORD dwFlags)
{
IDirectPlay8ThreadPoolImpl *This = impl_from_IDirectPlay8ThreadPool(iface);
FIXME("(%p)->(%x)\n", This, dwFlags);
This->msghandler = NULL;
return DPN_OK;
}
......
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