dpnet: Add stubbed DirectPlay8Peer interface (try2)

Alexandre Julliard julliard at winehq.org
Thu Aug 21 10:25:33 CDT 2008


Alexander Nicolaysen Sørnes <alex at 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 at winehq.org



More information about the wine-devel mailing list