From e9c2a8606acc120058e0a375030539c0747f7228 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Mariusz=20Pluci=C5=84ski?= Date: Mon, 7 Jun 2010 23:04:53 +0200 Subject: gameux: Add IGameStatistics implementaiton stub --- dlls/gameux/gamestatistics.c | 188 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 187 insertions(+), 1 deletions(-) diff --git a/dlls/gameux/gamestatistics.c b/dlls/gameux/gamestatistics.c index 6230d0e..2e13bef 100644 --- a/dlls/gameux/gamestatistics.c +++ b/dlls/gameux/gamestatistics.c @@ -1,5 +1,5 @@ /* - * gameux: IGameStatisticsMgr implementation + * gameux: IGameStatistics and IGameStatisticsMgr implementation * * Copyright (C) 2010 Mariusz PluciƄski * @@ -35,6 +35,192 @@ WINE_DEFAULT_DEBUG_CHANNEL(gameux); /* + * IGameStatistics + */ + +typedef struct _GameStatisticsImpl +{ + const struct IGameStatisticsVtbl *lpVtbl; + LONG ref; +} GameStatisticsImpl; + +static inline GameStatisticsImpl *impl_from_IGameStatistics( IGameStatistics *iface ) +{ + return (GameStatisticsImpl *)((char*)iface - FIELD_OFFSET(GameStatisticsImpl, lpVtbl)); +} + + +static HRESULT WINAPI GameStatisticsImpl_QueryInterface(IGameStatistics *iface, REFIID riid, void **ppvObject) +{ + GameStatisticsImpl *This = impl_from_IGameStatistics( iface ); + + TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject ); + + *ppvObject = NULL; + + if ( IsEqualGUID( riid, &IID_IUnknown ) || + IsEqualGUID( riid, &IID_IGameStatistics ) ) + { + *ppvObject = iface; + } + else + { + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IGameStatistics_AddRef( iface ); + + return S_OK; +} + +static ULONG WINAPI GameStatisticsImpl_AddRef(IGameStatistics *iface) +{ + GameStatisticsImpl *This = impl_from_IGameStatistics( iface ); + TRACE("%p\n", This ); + return InterlockedIncrement( &This->ref ); +} + +static ULONG WINAPI GameStatisticsImpl_Release(IGameStatistics *iface) +{ + GameStatisticsImpl *This = impl_from_IGameStatistics( iface ); + LONG ref; + + TRACE("%p\n", This ); + + ref = InterlockedDecrement( &This->ref ); + if ( ref == 0 ) + { + HeapFree( GetProcessHeap(), 0, iface ); + } + + return ref; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_GetCategoryTitle( + IGameStatistics* iface, + WORD categoryIndex, + LPWSTR *pTitle) { + TRACE("(%p, %d, %p)\n", iface, categoryIndex, pTitle); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_GetLastPlayedCategory( + IGameStatistics* iface, + UINT *pCategoryIndex) { + TRACE("(%p, %p)\n", iface, pCategoryIndex); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_GetMaxCategories( + IGameStatistics* iface, + WORD *pMax) { + TRACE("(%p, %p)\n", iface, pMax); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_GetMaxCategoryLength( + IGameStatistics* iface, + UINT *cch) { + TRACE("(%p, %p)\n", iface, cch); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_GetMaxNameLength( + IGameStatistics* iface, + UINT *cch) { + TRACE("(%p, %p)\n", iface, cch); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_GetMaxStatsPerCategory( + IGameStatistics* iface, + WORD *pMax) { + TRACE("(%p, %p)\n", iface, pMax); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_GetMaxValueLength( + IGameStatistics* iface, + UINT *cch) { + TRACE("(%p, %p)\n", iface, cch); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_GetStatistic( + IGameStatistics* iface, + WORD categoryIndex, + WORD statIndex, + LPWSTR *pName, + LPWSTR *pValue) { + TRACE("(%p, %d, %d, %p, %p)\n", iface, categoryIndex, statIndex, pName, pValue); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_Save( + IGameStatistics* iface, + BOOL trackChanges) { + TRACE("(%p, %d)\n", iface, trackChanges); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_SetCategoryTitle( + IGameStatistics* iface, + WORD categoryIndex, + LPCWSTR title) { + TRACE("(%p, %d, %s)\n", iface, categoryIndex, debugstr_w(title)); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_SetLastPlayedCategory( + IGameStatistics* iface, + UINT categoryIndex) { + TRACE("(%p, %d)\n", iface, categoryIndex); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameStatisticsImpl_SetStatistic( + IGameStatistics* iface, + WORD categoryIndex, + WORD statIndex, + LPCWSTR name, + LPCWSTR value) { + TRACE("(%p, %d, %d, %s, %s)\n", iface, categoryIndex, statIndex, debugstr_w(name), debugstr_w(value)); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static const struct IGameStatisticsVtbl GameStatisticsImplVtbl = +{ + GameStatisticsImpl_QueryInterface, + GameStatisticsImpl_AddRef, + GameStatisticsImpl_Release, + GameStatisticsImpl_GetMaxCategoryLength, + GameStatisticsImpl_GetMaxNameLength, + GameStatisticsImpl_GetMaxValueLength, + GameStatisticsImpl_GetMaxCategories, + GameStatisticsImpl_GetMaxStatsPerCategory, + GameStatisticsImpl_SetCategoryTitle, + GameStatisticsImpl_GetCategoryTitle, + GameStatisticsImpl_GetStatistic, + GameStatisticsImpl_SetStatistic, + GameStatisticsImpl_Save, + GameStatisticsImpl_SetLastPlayedCategory, + GameStatisticsImpl_GetLastPlayedCategory, +}; + +/* * IGameStatisticsMgr */ -- 1.6.2.5