Mariusz Pluciński : gameux: Add storing Description registry value.
Alexandre Julliard
julliard at winehq.org
Thu Sep 9 13:56:52 CDT 2010
Module: wine
Branch: master
Commit: 9b7347b619c85c5028f193352f7bb6f2625c385e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9b7347b619c85c5028f193352f7bb6f2625c385e
Author: Mariusz Pluciński <vshader at gmail.com>
Date: Tue Sep 7 16:08:06 2010 +0200
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 deletions(-)
diff --git a/dlls/gameux/gameexplorer.c b/dlls/gameux/gameexplorer.c
index f792333..deb6475 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 5b6e80d..97826f0 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 a538d35..d01783d 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
More information about the wine-cvs
mailing list