dpnet: Add stubbed interface IDirectPlay8Server
Michael Stefaniuc
mstefani at redhat.com
Wed Jan 8 06:15:57 CST 2014
Hello Alistair,
On 01/08/2014 06:26 AM, Alistair Leslie-Hughes wrote:
> Changelog:
> dpnet: Add stubbed interface IDirectPlay8Server
> diff --git a/dlls/dpnet/dpnet_private.h b/dlls/dpnet/dpnet_private.h
> index 72012cd..5195d51 100644
> --- a/dlls/dpnet/dpnet_private.h
> +++ b/dlls/dpnet/dpnet_private.h
> @@ -37,6 +37,7 @@ typedef struct IDirectPlay8AddressImpl IDirectPlay8AddressImpl;
> typedef struct IDirectPlay8LobbiedApplicationImpl IDirectPlay8LobbiedApplicationImpl;
> typedef struct IDirectPlay8PeerImpl IDirectPlay8PeerImpl;
> typedef struct IDirectPlay8ThreadPoolImpl IDirectPlay8ThreadPoolImpl;
> +typedef struct IDirectPlay8ServerImpl IDirectPlay8ServerImpl;
please add the struct directly to server.c as it is used only there.
> +static ULONG WINAPI IDirectPlay8ServerImpl_AddRef(IDirectPlay8Server *iface)
> +{
> + IDirectPlay8ServerImpl *This = impl_from_IDirectPlay8Server(iface);
> + ULONG refCount = InterlockedIncrement(&This->ref);
> +
> + TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
The standard to which Wine moves is to print the current refcount. See
http://wiki.winehq.org/COMGuideline under "COM aggregation" for sample
AddRef / Release functions.
> +HRESULT DPNET_CreateDirectPlay8Server(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj)
IClassFactory* and IUnknown* are much nicer.
> +{
> + IDirectPlay8ServerImpl *server;
> +
> + TRACE("(%p, %s, %p)\n", punkOuter, debugstr_guid(riid), ppobj);
> +
> + server = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8ServerImpl));
> + if (!server)
> + {
> + *ppobj = NULL;
> + return E_OUTOFMEMORY;
> + }
> + server->IDirectPlay8Server_iface.lpVtbl = &DirectPlay8ServerVtbl;
> + server->ref = 1;
> +
> + *ppobj = (LPVOID*)&server->IDirectPlay8Server_iface;
This will fail to fail for an unsupported riid. I have added the correct
way to the COMGuideline wiki page.
thanks
bye
michael
More information about the wine-devel
mailing list