From 187d176ae3977f9da2848e237a6422458a42ddfa Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Mariusz=20Pluci=C5=84ski?= Date: Mon, 7 Jun 2010 23:20:27 +0200 Subject: gameux: Add IGameExplorer2 implementation stub --- dlls/gameux/gameexplorer.c | 158 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 157 insertions(+), 1 deletions(-) diff --git a/dlls/gameux/gameexplorer.c b/dlls/gameux/gameexplorer.c index 16537c9..a738b35 100644 --- a/dlls/gameux/gameexplorer.c +++ b/dlls/gameux/gameexplorer.c @@ -1,5 +1,5 @@ /* - * gameux: IGameExplorer interfaces implementation + * gameux: IGameExplorer and IGameExplorer2 interfaces implementation * * Copyright (C) 2008 Alistair Leslie-Hughes * Copyright (C) 2010 Mariusz PluciƄski @@ -148,6 +148,144 @@ static const struct IGameExplorerVtbl GameExplorerImplVtbl = }; /* + * IGameExplorer2 implementation + */ +typedef struct _GameExplorer2Impl +{ + const struct IGameExplorer2Vtbl *lpVtbl; + LONG ref; +} GameExplorer2Impl; + +static inline GameExplorer2Impl *impl_from_IGameExplorer2( IGameExplorer2 *iface ) +{ + return (GameExplorer2Impl *)((char*)iface - FIELD_OFFSET(GameExplorer2Impl, lpVtbl)); +} + + +static HRESULT WINAPI GameExplorer2Impl_QueryInterface(IGameExplorer2 *iface, REFIID riid, void **ppvObject) +{ + GameExplorer2Impl *This = impl_from_IGameExplorer2( iface ); + + TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject ); + + *ppvObject = NULL; + + if ( IsEqualGUID( riid, &IID_IUnknown ) || + IsEqualGUID( riid, &IID_IGameExplorer2 ) ) + { + *ppvObject = iface; + } + else + { + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IGameExplorer2_AddRef( iface ); + + return S_OK; +} + +static ULONG WINAPI GameExplorer2Impl_AddRef(IGameExplorer2 *iface) +{ + GameExplorer2Impl *This = impl_from_IGameExplorer2( iface ); + TRACE("%p\n", This ); + return InterlockedIncrement( &This->ref ); +} + +static ULONG WINAPI GameExplorer2Impl_Release(IGameExplorer2 *iface) +{ + GameExplorer2Impl *This = impl_from_IGameExplorer2( iface ); + LONG ref; + + TRACE("%p\n", This ); + + ref = InterlockedDecrement( &This->ref ); + if ( ref == 0 ) + { + HeapFree( GetProcessHeap(), 0, iface ); + } + + return ref; +} + +static HRESULT WINAPI GameExplorer2Impl_AddGame(IGameExplorer2 *iface, + BSTR bstrGDFBinaryPath, + BSTR sGameInstallDirectory, + GAME_INSTALL_SCOPE installScope, + GUID *pInstanceID) +{ + TRACE("(%p, %s, %s, 0x%x, %p)\n", iface, debugstr_w(bstrGDFBinaryPath), debugstr_w(sGameInstallDirectory), installScope, pInstanceID); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI GameExplorer2Impl_RemoveGame(IGameExplorer2 *iface, + GUID instanceID) +{ + TRACE("(%p, %s)\n", iface, debugstr_guid(&instanceID)); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI GameExplorer2Impl_UpdateGame(IGameExplorer2 *iface, + GUID instanceID) +{ + TRACE("(%p, %s)\n", iface, debugstr_guid(&instanceID)); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI GameExplorer2Impl_VerifyAccess(IGameExplorer2 *iface, + BSTR sGDFBinaryPath, BOOL *pHasAccess) +{ + TRACE("(%p, %s, %p)\n", iface, debugstr_w(sGDFBinaryPath), pHasAccess); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameExplorer2Impl_CheckAccess(IGameExplorer2* iface, + LPCWSTR binaryGDFPath, + BOOL *pHasAccess) +{ + TRACE("(%p, %s, %p)\n", iface, debugstr_w(binaryGDFPath), pHasAccess); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameExplorer2Impl_InstallGame(IGameExplorer2* iface, + LPCWSTR binaryGDFPath, + LPCWSTR installDirectory, + GAME_INSTALL_SCOPE installScope) +{ + TRACE("(%p, %s, %s, 0x%x)\n", iface, debugstr_w(binaryGDFPath), debugstr_w(installDirectory), installScope); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE GameExplorer2Impl_UninstallGame(IGameExplorer2* iface, + LPCWSTR binaryGDFPath) +{ + TRACE("(%p, %s)\n", iface, debugstr_w(binaryGDFPath)); + FIXME("stub\n"); + return E_NOTIMPL; +} + +static const struct IGameExplorer2Vtbl GameExplorer2ImplVtbl = +{ + GameExplorer2Impl_QueryInterface, + GameExplorer2Impl_AddRef, + GameExplorer2Impl_Release, + GameExplorer2Impl_AddGame, + GameExplorer2Impl_RemoveGame, + GameExplorer2Impl_UpdateGame, + GameExplorer2Impl_VerifyAccess, + GameExplorer2Impl_InstallGame, + GameExplorer2Impl_UninstallGame, + GameExplorer2Impl_CheckAccess, +}; + +/* * Construction function */ HRESULT IGameExplorer_create(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppObj) @@ -172,6 +310,24 @@ HRESULT IGameExplorer_create(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppObj) FIXME("returning iface %p\n", *ppObj); return S_OK; } + else if( IsEqualIID( riid, &IID_IGameExplorer2 )) + { + GameExplorer2Impl *pGameExplorer; + + FIXME("%p\n", ppObj); + + pGameExplorer = HeapAlloc( GetProcessHeap(), 0, sizeof (*pGameExplorer) ); + if( !pGameExplorer ) + return E_OUTOFMEMORY; + + pGameExplorer->lpVtbl = &GameExplorer2ImplVtbl; + pGameExplorer->ref = 1; + + *ppObj = &pGameExplorer->lpVtbl; + + FIXME("returning iface %p\n", *ppObj); + return S_OK; + } return E_NOINTERFACE; } -- 1.6.2.5