Commit d721eee1 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gameux: Cleanup failure handling when processing main definition element, use better naming.

parent 52e4c5a8
......@@ -325,67 +325,58 @@ static HRESULT GAMEUX_ProcessGameDefinitionElement(
* GameData [O] structure where data loaded from
* XML element will be stored in
*/
static HRESULT GAMEUX_ParseGameDefinition(
IXMLDOMElement *gdElement,
struct GAMEUX_GAME_DATA *GameData)
static HRESULT GAMEUX_ParseGameDefinition(IXMLDOMElement *gamedef, struct GAMEUX_GAME_DATA *game_data)
{
static const WCHAR sGameId[] = {'g','a','m','e','I','D',0};
HRESULT hr = S_OK;
BSTR bstrAttribute;
VARIANT variant;
IXMLDOMNodeList *childrenList;
IXMLDOMNode *nextNode;
IXMLDOMElement *nextElement;
static const WCHAR gameidW[] = {'g','a','m','e','I','D',0};
IXMLDOMNodeList *props;
VARIANT var;
HRESULT hr;
BSTR attr;
TRACE("(%p, %p)\n", gdElement, GameData);
TRACE("(%p, %p)\n", gamedef, game_data);
bstrAttribute = SysAllocString(sGameId);
if(!bstrAttribute)
hr = E_OUTOFMEMORY;
attr = SysAllocString(gameidW);
if (!attr)
return E_OUTOFMEMORY;
hr = IXMLDOMElement_getAttribute(gdElement, bstrAttribute, &variant);
hr = IXMLDOMElement_getAttribute(gamedef, attr, &var);
SysFreeString(attr);
if(SUCCEEDED(hr))
if (SUCCEEDED(hr))
{
hr = ( GUIDFromStringW(V_BSTR(&variant), &GameData->guidApplicationId)==TRUE ? S_OK : E_FAIL);
SysFreeString(V_BSTR(&variant));
hr = CLSIDFromString(V_BSTR(&var), &game_data->guidApplicationId);
VariantClear(&var);
}
SysFreeString(bstrAttribute);
if (SUCCEEDED(hr))
hr = IXMLDOMElement_get_childNodes(gamedef, &props);
/* browse subnodes */
if(SUCCEEDED(hr))
hr = IXMLDOMElement_get_childNodes(gdElement, &childrenList);
if (FAILED(hr))
return hr;
if(SUCCEEDED(hr))
{
do
{
hr = IXMLDOMNodeList_nextNode(childrenList, &nextNode);
IXMLDOMNode *prop;
if(hr == S_OK)
hr = IXMLDOMNodeList_nextNode(props, &prop);
if (hr == S_OK)
{
hr = IXMLDOMNode_QueryInterface(nextNode, &IID_IXMLDOMElement,
(LPVOID*)&nextElement);
IXMLDOMElement *element;
if(SUCCEEDED(hr))
hr = IXMLDOMNode_QueryInterface(prop, &IID_IXMLDOMElement, (void**)&element);
if (hr == S_OK)
{
hr = GAMEUX_ProcessGameDefinitionElement(nextElement, GameData);
IXMLDOMElement_Release(nextElement);
hr = GAMEUX_ProcessGameDefinitionElement(element, game_data);
IXMLDOMElement_Release(element);
}
IXMLDOMNode_Release(nextNode);
}
IXMLDOMNode_Release(prop);
}
while(hr == S_OK);
hr = S_OK;
IXMLDOMNodeList_Release(childrenList);
}
while (hr == S_OK);
IXMLDOMNodeList_Release(props);
return hr;
return FAILED(hr) ? hr : S_OK;
}
struct parse_gdf_thread_param
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment