gameux: Add storing Description registry value.

This commit is contained in:
Mariusz Pluciński 2010-09-07 16:08:06 +02:00 committed by Alexandre Julliard
parent 3c68877bc5
commit 9b7347b619
3 changed files with 16 additions and 1 deletions

View File

@ -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));

View File

@ -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

View File

@ -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