dpnet: Implement IDirectPlay8Thread Initialize.

In order to get the tests to pass, msghandler needed
to be reset in Close.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2017-02-15 04:36:26 +00:00 committed by Alexandre Julliard
parent 960b48f4e7
commit da5e8d0887
3 changed files with 30 additions and 4 deletions

View File

@ -120,8 +120,12 @@ struct IDirectPlay8LobbiedApplicationImpl
*/
struct IDirectPlay8ThreadPoolImpl
{
IDirectPlay8ThreadPool IDirectPlay8ThreadPool_iface;
LONG ref;
IDirectPlay8ThreadPool IDirectPlay8ThreadPool_iface;
LONG ref;
PFNDPNMESSAGEHANDLER msghandler;
DWORD flags;
void *usercontext;
};
/**

View File

@ -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);

View File

@ -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;
}