From: Alistair Leslie-Hughes Subject: dpnet: Implement IDirectPlay8Server Initialize Message-Id: <52DC91D8.9060908@hotmail.com> Date: Mon, 20 Jan 2014 14:02:48 +1100 Hi, Changelog: dpnet: Implement IDirectPlay8Server Initialize Best Regards Alistair Leslie-Hughes >From d5d3b2a49dadce312829f6e34336a76f6f2cefa9 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 20 Jan 2014 10:27:28 +1100 Subject: [PATCH] Implement IDirectPlay8Server Initialize To: wine-patches --- 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 09e0809..3e026fc 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 70cf16a..8f99fd3 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) -- 1.8.3.2