Re: dpnet: Add stubbed DirectPlay8Peer interface (try2)
Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> writes:
HRESULT DPNET_CreateDirectPlay8Peer(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) { - WARN("(%p, %s, %p): stub.\n", punkOuter, debugstr_guid(riid), ppobj); - return CLASS_E_CLASSNOTAVAILABLE; + IDirectPlay8PeerImpl* Client; + + Client = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8PeerImpl)); + + if(Client == NULL) + { + *ppobj = NULL; + WARN("Not enough memory\n"); + return E_OUTOFMEMORY; + } + + Client->lpVtbl = &DirectPlay8Peer_Vtbl; + return IDirectPlay8PeerImpl_QueryInterface((PDIRECTPLAY8PEER)Client, riid, ppobj);
You are leaking the object on error. -- Alexandre Julliard julliard(a)winehq.org
participants (1)
-
Alexandre Julliard