dpnet: Implement IDirectPlay8Server Initialize.

This commit is contained in:
Alistair Leslie-Hughes 2014-01-20 10:27:28 +11:00 committed by Alexandre Julliard
parent 658a5f450b
commit d34b75a887
2 changed files with 19 additions and 1 deletions

View File

@ -39,6 +39,10 @@ typedef struct IDirectPlay8ServerImpl
{
IDirectPlay8Server IDirectPlay8Server_iface;
LONG ref;
PFNDPNMESSAGEHANDLER msghandler;
DWORD flags;
void *usercontext;
} IDirectPlay8ServerImpl;
WINE_DEFAULT_DEBUG_CHANNEL(dpnet);
@ -98,7 +102,15 @@ static HRESULT WINAPI IDirectPlay8ServerImpl_Initialize(IDirectPlay8Server *ifac
PFNDPNMESSAGEHANDLER pfn, DWORD dwFlags)
{
IDirectPlay8ServerImpl *This = impl_from_IDirectPlay8Server(iface);
FIXME("(%p)->(%p %p %d)\n", This, pvUserContext, pfn, dwFlags);
TRACE("(%p)->(%p %p %d)\n", This, pvUserContext, pfn, dwFlags);
if(!pfn)
return DPNERR_INVALIDPARAM;
This->usercontext = pvUserContext;
This->msghandler = pfn;
This->flags = dwFlags;
return DPN_OK;
}
@ -391,6 +403,9 @@ HRESULT DPNET_CreateDirectPlay8Server(IClassFactory *iface, IUnknown *pUnkOuter,
server->IDirectPlay8Server_iface.lpVtbl = &DirectPlay8ServerVtbl;
server->ref = 1;
server->usercontext = NULL;
server->msghandler = NULL;
server->flags = 0;
hr = IDirectPlay8Server_QueryInterface(&server->IDirectPlay8Server_iface, riid, ppv);
IDirectPlay8Server_Release(&server->IDirectPlay8Server_iface);

View File

@ -39,6 +39,9 @@ static void create_server(void)
hr = IDirectPlay8Server_Close(server, 0);
todo_wine ok(hr == DPNERR_UNINITIALIZED, "got 0x%08x\n", hr);
hr = IDirectPlay8Server_Initialize(server, NULL, NULL, 0);
ok(hr == DPNERR_INVALIDPARAM, "got 0x%08x\n", hr);
hr = IDirectPlay8Server_Initialize(server, NULL, DirectPlayMessageHandler, 0);
ok(hr == S_OK, "got 0x%08x\n", hr);
if(hr == S_OK)