From d34b75a88722d6c75efe20da212210a1227ac210 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 20 Jan 2014 10:27:28 +1100 Subject: [PATCH] dpnet: Implement IDirectPlay8Server Initialize. --- dlls/dpnet/server.c | 17 ++++++++++++++++- dlls/dpnet/tests/server.c | 3 +++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/dlls/dpnet/server.c b/dlls/dpnet/server.c index 09e0809c284..3e026fc7774 100644 --- a/dlls/dpnet/server.c +++ b/dlls/dpnet/server.c @@ -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); diff --git a/dlls/dpnet/tests/server.c b/dlls/dpnet/tests/server.c index ab3e360c7fc..f3b1da24880 100644 --- a/dlls/dpnet/tests/server.c +++ b/dlls/dpnet/tests/server.c @@ -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)