From 9b7347b619c85c5028f193352f7bb6f2625c385e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20Pluci=C5=84ski?= Date: Tue, 7 Sep 2010 16:08:06 +0200 Subject: [PATCH] gameux: Add storing Description registry value. --- dlls/gameux/gameexplorer.c | 14 ++++++++++++++ dlls/gameux/gameux_private.h | 1 + dlls/gameux/tests/gameexplorer.c | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/gameux/gameexplorer.c b/dlls/gameux/gameexplorer.c index f79233353dd..deb6475452e 100644 --- a/dlls/gameux/gameexplorer.c +++ b/dlls/gameux/gameexplorer.c @@ -52,6 +52,7 @@ void GAMEUX_initGameData(struct GAMEUX_GAME_DATA *GameData) GameData->sGDFBinaryPath = NULL; GameData->sGameInstallDirectory = NULL; GameData->bstrName = NULL; + GameData->bstrDescription = NULL; } /******************************************************************************* * GAMEUX_uninitGameData @@ -63,6 +64,7 @@ void GAMEUX_uninitGameData(struct GAMEUX_GAME_DATA *GameData) HeapFree(GetProcessHeap(), 0, GameData->sGDFBinaryPath); HeapFree(GetProcessHeap(), 0, GameData->sGameInstallDirectory); SysFreeString(GameData->bstrName); + SysFreeString(GameData->bstrDescription); } /******************************************************************************* * GAMEUX_buildGameRegistryPath @@ -211,6 +213,8 @@ static HRESULT GAMEUX_WriteRegistryRecord(struct GAMEUX_GAME_DATA *GameData) {'C','o','n','f','i','g','G','D','F','B','i','n','a','r','y','P','a','t','h',0}; static const WCHAR sTitle[] = {'T','i','t','l','e',0}; + static const WCHAR sDescription[] = + {'D','e','s','c','r','i','p','t','i','o','n',0}; HRESULT hr, hr2; LPWSTR lpRegistryKey; @@ -251,6 +255,11 @@ static HRESULT GAMEUX_WriteRegistryRecord(struct GAMEUX_GAME_DATA *GameData) REG_SZ, (LPBYTE)(GameData->bstrName), (lstrlenW(GameData->bstrName)+1)*sizeof(WCHAR))); + if(SUCCEEDED(hr)) + hr = HRESULT_FROM_WIN32(RegSetValueExW(hKey, sDescription, 0, + REG_SZ, (LPBYTE)(GameData->bstrDescription ? GameData->bstrDescription : GameData->bstrName), + (lstrlenW(GameData->bstrDescription ? GameData->bstrDescription : GameData->bstrName)+1)*sizeof(WCHAR))); + RegCloseKey(hKey); if(FAILED(hr)) @@ -283,6 +292,8 @@ static HRESULT GAMEUX_ProcessGameDefinitionElement( { static const WCHAR sName[] = {'N','a','m','e',0}; + static const WCHAR sDescription[] = + {'D','e','s','c','r','i','p','t','i','o','n',0}; HRESULT hr; BSTR bstrElementName; @@ -296,6 +307,9 @@ static HRESULT GAMEUX_ProcessGameDefinitionElement( if(lstrcmpW(bstrElementName, sName) == 0) hr = IXMLDOMElement_get_text(element, &GameData->bstrName); + else if(lstrcmpW(bstrElementName, sDescription) == 0) + hr = IXMLDOMElement_get_text(element, &GameData->bstrDescription); + else FIXME("entry %s in Game Definition File not yet supported\n", debugstr_w(bstrElementName)); diff --git a/dlls/gameux/gameux_private.h b/dlls/gameux/gameux_private.h index 5b6e80da829..97826f09c24 100644 --- a/dlls/gameux/gameux_private.h +++ b/dlls/gameux/gameux_private.h @@ -43,6 +43,7 @@ struct GAMEUX_GAME_DATA GUID guidInstanceId; /* game installation instance identifier */ GUID guidApplicationId; /* game's application identifier */ BSTR bstrName; /* game's title */ + BSTR bstrDescription; /* game's description */ }; /******************************************************************************* * GAMEUX_initGameData diff --git a/dlls/gameux/tests/gameexplorer.c b/dlls/gameux/tests/gameexplorer.c index a538d35fe90..d01783d45e6 100644 --- a/dlls/gameux/tests/gameexplorer.c +++ b/dlls/gameux/tests/gameexplorer.c @@ -305,7 +305,7 @@ static void _validateGameRegistryValues(int line, /* this value exists up from Win7 */ hr = _validateRegistryValue(hKey, keyPath, sDescription, RRF_RT_REG_SZ, sGameDescription); - todo_wine ok_(__FILE__, line)(hr==S_OK || broken(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)), "failed while checking registry value (error 0x%x)\n", hr); + ok_(__FILE__, line)(hr==S_OK || broken(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)), "failed while checking registry value (error 0x%x)\n", hr); } /******************************************************************************* * _validateGameKey