From 95a9bc043e842a003234b8342fff11e91b555ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20Pluci=C5=84ski?= Date: Thu, 16 Sep 2010 13:55:34 +0200 Subject: [PATCH] gameux: Add UninstallGame implementation. --- dlls/gameux/gameexplorer.c | 18 ++++++++++++++++-- dlls/gameux/tests/gameexplorer.c | 4 ++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/dlls/gameux/gameexplorer.c b/dlls/gameux/gameexplorer.c index 66173f2959d..1816ebdfd01 100644 --- a/dlls/gameux/gameexplorer.c +++ b/dlls/gameux/gameexplorer.c @@ -991,9 +991,23 @@ static HRESULT WINAPI GameExplorer2Impl_UninstallGame( IGameExplorer2 *iface, LPCWSTR binaryGDFPath) { + HRESULT hr; + GUID instanceId; GameExplorerImpl *This = impl_from_IGameExplorer2(iface); - FIXME("stub (%p, %s)\n", This, debugstr_w(binaryGDFPath)); - return E_NOTIMPL; + TRACE("(%p, %s)\n", This, debugstr_w(binaryGDFPath)); + + if(!binaryGDFPath) + return E_INVALIDARG; + + hr = GAMEUX_FindGameInstanceId(binaryGDFPath, GIS_CURRENT_USER, &instanceId); + + if(hr == S_FALSE) + hr = GAMEUX_FindGameInstanceId(binaryGDFPath, GIS_ALL_USERS, &instanceId); + + if(hr == S_OK) + hr = GAMEUX_RemoveRegistryRecord(&instanceId); + + return hr; } static const struct IGameExplorer2Vtbl GameExplorer2ImplVtbl = diff --git a/dlls/gameux/tests/gameexplorer.c b/dlls/gameux/tests/gameexplorer.c index 4fc432b1685..9ce0e391fbd 100644 --- a/dlls/gameux/tests/gameexplorer.c +++ b/dlls/gameux/tests/gameexplorer.c @@ -646,10 +646,10 @@ void test_install_uninstall_game(void) _validateGameRegistryKey(__LINE__, GIS_CURRENT_USER, &guid, &applicationId, sExePath, sExeName, TRUE); hr = IGameExplorer2_UninstallGame(ge2, sExeName); - todo_wine ok(SUCCEEDED(hr), "IGameExplorer2::UninstallGame failed (error 0x%08x)\n", hr); + ok(SUCCEEDED(hr), "IGameExplorer2::UninstallGame failed (error 0x%08x)\n", hr); } - todo_wine _validateGameRegistryKey(__LINE__, GIS_CURRENT_USER, &guid, &applicationId, sExePath, sExeName, FALSE); + _validateGameRegistryKey(__LINE__, GIS_CURRENT_USER, &guid, &applicationId, sExePath, sExeName, FALSE); IGameExplorer2_Release(ge2); }