Commit 658a5f45 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

dpnet: Store information when Initialize is called.

parent 9b683294
......@@ -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);
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment