Commit 41059e16 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dpnet: COM cleanup for the IDirectPlay8ThreadPool iface.

parent 2e01ea4b
......@@ -93,8 +93,7 @@ struct IDirectPlay8PeerImpl
*/
struct IDirectPlay8ThreadPoolImpl
{
/* IUnknown fields */
const IDirectPlay8ThreadPoolVtbl *lpVtbl;
IDirectPlay8ThreadPool IDirectPlay8ThreadPool_iface;
LONG ref;
};
......
......@@ -37,11 +37,16 @@
WINE_DEFAULT_DEBUG_CHANNEL(dpnet);
/* IUnknown interface follows */
static inline IDirectPlay8ThreadPoolImpl *impl_from_IDirectPlay8ThreadPool(IDirectPlay8ThreadPool *iface)
{
return CONTAINING_RECORD(iface, IDirectPlay8ThreadPoolImpl, IDirectPlay8ThreadPool_iface);
}
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_QueryInterface(PDIRECTPLAY8THREADPOOL iface, REFIID riid, LPVOID *ppobj)
/* IUnknown interface follows */
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_QueryInterface(IDirectPlay8ThreadPool *iface,
REFIID riid, void **ppobj)
{
IDirectPlay8ThreadPoolImpl *This = (IDirectPlay8ThreadPoolImpl*)iface;
IDirectPlay8ThreadPoolImpl *This = impl_from_IDirectPlay8ThreadPool(iface);
if(IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectPlay8ThreadPool))
......@@ -55,17 +60,17 @@ static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_QueryInterface(PDIRECTPLAY8THRE
return E_NOINTERFACE;
}
static ULONG WINAPI IDirectPlay8ThreadPoolImpl_AddRef(PDIRECTPLAY8THREADPOOL iface)
static ULONG WINAPI IDirectPlay8ThreadPoolImpl_AddRef(IDirectPlay8ThreadPool *iface)
{
IDirectPlay8ThreadPoolImpl* This = (IDirectPlay8ThreadPoolImpl*)iface;
IDirectPlay8ThreadPoolImpl* This = impl_from_IDirectPlay8ThreadPool(iface);
ULONG RefCount = InterlockedIncrement(&This->ref);
return RefCount;
}
static ULONG WINAPI IDirectPlay8ThreadPoolImpl_Release(PDIRECTPLAY8THREADPOOL iface)
static ULONG WINAPI IDirectPlay8ThreadPoolImpl_Release(IDirectPlay8ThreadPool *iface)
{
IDirectPlay8ThreadPoolImpl* This = (IDirectPlay8ThreadPoolImpl*)iface;
IDirectPlay8ThreadPoolImpl* This = impl_from_IDirectPlay8ThreadPool(iface);
ULONG RefCount = InterlockedDecrement(&This->ref);
if(!RefCount)
......@@ -75,31 +80,36 @@ static ULONG WINAPI IDirectPlay8ThreadPoolImpl_Release(PDIRECTPLAY8THREADPOOL if
}
/* IDirectPlay8ThreadPool interface follows */
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_Initialize(PDIRECTPLAY8THREADPOOL iface, PVOID CONST pvUserContext, CONST PFNDPNMESSAGEHANDLER pfn, CONST DWORD dwFlags)
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_Initialize(IDirectPlay8ThreadPool *iface,
void * const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags)
{
FIXME("(%p)->(%p,%p,%x): stub\n", iface, pvUserContext, pfn, dwFlags);
return DPN_OK;
}
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_Close(PDIRECTPLAY8THREADPOOL iface, CONST DWORD dwFlags)
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_Close(IDirectPlay8ThreadPool *iface,
const DWORD dwFlags)
{
return DPN_OK;
}
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_GetThreadCount(PDIRECTPLAY8THREADPOOL iface, CONST DWORD dwProcessorNum, DWORD* CONST pdwNumThreads, CONST DWORD dwFlags)
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_GetThreadCount(IDirectPlay8ThreadPool *iface,
const DWORD dwProcessorNum, DWORD * const pdwNumThreads, const DWORD dwFlags)
{
FIXME("(%p)->(%x,%p,%x): stub\n", iface, dwProcessorNum, pdwNumThreads, dwFlags);
*pdwNumThreads = 0;
return DPN_OK;
}
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_SetThreadCount(PDIRECTPLAY8THREADPOOL iface, CONST DWORD dwProcessorNum, CONST DWORD dwNumThreads, CONST DWORD dwFlags)
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_SetThreadCount(IDirectPlay8ThreadPool *iface,
const DWORD dwProcessorNum, const DWORD dwNumThreads, const DWORD dwFlags)
{
FIXME("(%p)->(%x,%x,%x): stub\n", iface, dwProcessorNum, dwNumThreads, dwFlags);
return DPN_OK;
}
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_DoWork(PDIRECTPLAY8THREADPOOL iface, CONST DWORD dwAllowedTimeSlice, CONST DWORD dwFlags)
static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_DoWork(IDirectPlay8ThreadPool *iface,
const DWORD dwAllowedTimeSlice, const DWORD dwFlags)
{
static BOOL Run = FALSE;
......@@ -136,8 +146,9 @@ HRESULT DPNET_CreateDirectPlay8ThreadPool(LPCLASSFACTORY iface, LPUNKNOWN punkOu
return E_OUTOFMEMORY;
}
Client->lpVtbl = &DirectPlay8ThreadPool_Vtbl;
Client->IDirectPlay8ThreadPool_iface.lpVtbl = &DirectPlay8ThreadPool_Vtbl;
Client->ref = 0;
return IDirectPlay8ThreadPoolImpl_QueryInterface((PDIRECTPLAY8THREADPOOL)Client, riid, ppobj);
return IDirectPlay8ThreadPoolImpl_QueryInterface(&Client->IDirectPlay8ThreadPool_iface, riid,
ppobj);
}
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