HRESULT DPNET_CreateDirectPlay8Client(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv) { IDirectPlay8ClientImpl* client; HRESULT hr; TRACE("(%p, %s, %p)\n", pUnkOuter, debugstr_guid(riid), ppv); *ppv = NULL; if(pUnkOuter) return CLASS_E_NOAGGREGATION; client = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8ClientImpl)); if (!client) return E_OUTOFMEMORY; client->IDirectPlay8Client_iface.lpVtbl = &DirectPlay8Client_Vtbl; client->ref = 1; init_dpn_sp_caps(&client->spcaps); hr = IDirectPlay8ClientImpl_QueryInterface(&client->IDirectPlay8Client_iface, riid, ppv); IDirectPlay8ClientImpl_Release(&client->IDirectPlay8Client_iface); return hr; }
HRESULT DPNET_CreateDirectPlay8Client(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) { IDirectPlay8ClientImpl* client; TRACE("(%p, %s, %p)\n", punkOuter, debugstr_guid(riid), ppobj); client = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8ClientImpl)); if (NULL == client) { *ppobj = NULL; return E_OUTOFMEMORY; } client->IDirectPlay8Client_iface.lpVtbl = &DirectPlay8Client_Vtbl; client->ref = 0; /* will be inited with QueryInterface */ return IDirectPlay8ClientImpl_QueryInterface(&client->IDirectPlay8Client_iface, riid, ppobj); }