From: Alistair Leslie-Hughes Subject: dpnet: Implement IDirectPlay8Peer Initialize Message-Id: <52DC91A6.4040203@hotmail.com> Date: Mon, 20 Jan 2014 14:01:58 +1100 Hi, Changelog: dpnet: Implement IDirectPlay8Peer Initialize Best Regards Alistair Leslie-Hughes >From 4d74abf5c5b9f569e84b989f18995ff5fc60e0fd Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 20 Jan 2014 09:59:41 +1100 Subject: [PATCH] Store information when Initialize is called To: wine-patches --- dlls/dpnet/peer.c | 16 ++++++++++++++++ dlls/dpnet/tests/peer.c | 3 +++ 2 files changed, 19 insertions(+) diff --git a/dlls/dpnet/peer.c b/dlls/dpnet/peer.c index 1b287dd..7b962a4 100644 --- a/dlls/dpnet/peer.c +++ b/dlls/dpnet/peer.c @@ -43,6 +43,10 @@ typedef struct IDirectPlay8PeerImpl { IDirectPlay8Peer IDirectPlay8Peer_iface; LONG ref; + + PFNDPNMESSAGEHANDLER msghandler; + DWORD flags; + void *usercontext; } IDirectPlay8PeerImpl; static inline IDirectPlay8PeerImpl *impl_from_IDirectPlay8Peer(IDirectPlay8Peer *iface) @@ -96,8 +100,17 @@ static ULONG WINAPI IDirectPlay8PeerImpl_Release(IDirectPlay8Peer *iface) static HRESULT WINAPI IDirectPlay8PeerImpl_Initialize(IDirectPlay8Peer *iface, void * const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) { + IDirectPlay8PeerImpl* This = impl_from_IDirectPlay8Peer(iface); + TRACE("(%p)->(%p,%p,%x): stub\n", iface, pvUserContext, pfn, dwFlags); + if(!pfn) + return DPNERR_INVALIDPARAM; + + This->usercontext = pvUserContext; + This->msghandler = pfn; + This->flags = dwFlags; + return DPN_OK; } @@ -502,6 +515,9 @@ HRESULT DPNET_CreateDirectPlay8Peer(IClassFactory *iface, IUnknown *pUnkOuter, R Client->IDirectPlay8Peer_iface.lpVtbl = &DirectPlay8Peer_Vtbl; Client->ref = 1; + Client->usercontext = NULL; + Client->msghandler = NULL; + Client->flags = 0; ret = IDirectPlay8Peer_QueryInterface(&Client->IDirectPlay8Peer_iface, riid, ppobj); IDirectPlay8Peer_Release(&Client->IDirectPlay8Peer_iface); diff --git a/dlls/dpnet/tests/peer.c b/dlls/dpnet/tests/peer.c index a9ab01d..8ae0afe 100644 --- a/dlls/dpnet/tests/peer.c +++ b/dlls/dpnet/tests/peer.c @@ -51,6 +51,9 @@ static void test_init_dp(void) hr = CoCreateInstance(&CLSID_DirectPlay8Peer, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlay8Peer, (void **)&peer); ok(hr == S_OK, "CoCreateInstance failed with 0x%x\n", hr); + hr = IDirectPlay8Peer_Initialize(peer, NULL, NULL, 0); + ok(hr == DPNERR_INVALIDPARAM, "got %x\n", hr); + hr = IDirectPlay8Peer_Initialize(peer, NULL, DirectPlayMessageHandler, 0); ok(hr == S_OK, "IDirectPlay8Peer_Initialize failed with %x\n", hr); } -- 1.8.3.2