Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3c68877b
Commit
3c68877b
authored
Sep 07, 2010
by
Mariusz Pluciński
Committed by
Alexandre Julliard
Sep 09, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gameux: Add storing Title registry value.
parent
180ac750
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
1 deletion
+82
-1
gameexplorer.c
dlls/gameux/gameexplorer.c
+80
-0
gameux_private.h
dlls/gameux/gameux_private.h
+1
-0
gameexplorer.c
dlls/gameux/tests/gameexplorer.c
+1
-1
No files found.
dlls/gameux/gameexplorer.c
View file @
3c68877b
...
@@ -51,6 +51,7 @@ void GAMEUX_initGameData(struct GAMEUX_GAME_DATA *GameData)
...
@@ -51,6 +51,7 @@ void GAMEUX_initGameData(struct GAMEUX_GAME_DATA *GameData)
{
{
GameData
->
sGDFBinaryPath
=
NULL
;
GameData
->
sGDFBinaryPath
=
NULL
;
GameData
->
sGameInstallDirectory
=
NULL
;
GameData
->
sGameInstallDirectory
=
NULL
;
GameData
->
bstrName
=
NULL
;
}
}
/*******************************************************************************
/*******************************************************************************
* GAMEUX_uninitGameData
* GAMEUX_uninitGameData
...
@@ -61,6 +62,7 @@ void GAMEUX_uninitGameData(struct GAMEUX_GAME_DATA *GameData)
...
@@ -61,6 +62,7 @@ void GAMEUX_uninitGameData(struct GAMEUX_GAME_DATA *GameData)
{
{
HeapFree
(
GetProcessHeap
(),
0
,
GameData
->
sGDFBinaryPath
);
HeapFree
(
GetProcessHeap
(),
0
,
GameData
->
sGDFBinaryPath
);
HeapFree
(
GetProcessHeap
(),
0
,
GameData
->
sGameInstallDirectory
);
HeapFree
(
GetProcessHeap
(),
0
,
GameData
->
sGameInstallDirectory
);
SysFreeString
(
GameData
->
bstrName
);
}
}
/*******************************************************************************
/*******************************************************************************
* GAMEUX_buildGameRegistryPath
* GAMEUX_buildGameRegistryPath
...
@@ -196,6 +198,7 @@ static HRESULT GAMEUX_buildGameRegistryPath(GAME_INSTALL_SCOPE installScope,
...
@@ -196,6 +198,7 @@ static HRESULT GAMEUX_buildGameRegistryPath(GAME_INSTALL_SCOPE installScope,
* ApplicationId guidApplicationId
* ApplicationId guidApplicationId
* ConfigApplicationPath sGameInstallDirectory
* ConfigApplicationPath sGameInstallDirectory
* ConfigGDFBinaryPath sGDFBinaryPath
* ConfigGDFBinaryPath sGDFBinaryPath
* Title bstrName
*
*
*/
*/
static
HRESULT
GAMEUX_WriteRegistryRecord
(
struct
GAMEUX_GAME_DATA
*
GameData
)
static
HRESULT
GAMEUX_WriteRegistryRecord
(
struct
GAMEUX_GAME_DATA
*
GameData
)
...
@@ -206,6 +209,8 @@ static HRESULT GAMEUX_WriteRegistryRecord(struct GAMEUX_GAME_DATA *GameData)
...
@@ -206,6 +209,8 @@ static HRESULT GAMEUX_WriteRegistryRecord(struct GAMEUX_GAME_DATA *GameData)
{
'C'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
'A'
,
'p'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'P'
,
'a'
,
't'
,
'h'
,
0
};
{
'C'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
'A'
,
'p'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'P'
,
'a'
,
't'
,
'h'
,
0
};
static
const
WCHAR
sConfigGDFBinaryPath
[]
=
static
const
WCHAR
sConfigGDFBinaryPath
[]
=
{
'C'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
'G'
,
'D'
,
'F'
,
'B'
,
'i'
,
'n'
,
'a'
,
'r'
,
'y'
,
'P'
,
'a'
,
't'
,
'h'
,
0
};
{
'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
};
HRESULT
hr
,
hr2
;
HRESULT
hr
,
hr2
;
LPWSTR
lpRegistryKey
;
LPWSTR
lpRegistryKey
;
...
@@ -241,6 +246,11 @@ static HRESULT GAMEUX_WriteRegistryRecord(struct GAMEUX_GAME_DATA *GameData)
...
@@ -241,6 +246,11 @@ static HRESULT GAMEUX_WriteRegistryRecord(struct GAMEUX_GAME_DATA *GameData)
REG_SZ
,
(
LPBYTE
)(
sGameApplicationId
),
REG_SZ
,
(
LPBYTE
)(
sGameApplicationId
),
(
lstrlenW
(
sGameApplicationId
)
+
1
)
*
sizeof
(
WCHAR
)));
(
lstrlenW
(
sGameApplicationId
)
+
1
)
*
sizeof
(
WCHAR
)));
if
(
SUCCEEDED
(
hr
))
hr
=
HRESULT_FROM_WIN32
(
RegSetValueExW
(
hKey
,
sTitle
,
0
,
REG_SZ
,
(
LPBYTE
)(
GameData
->
bstrName
),
(
lstrlenW
(
GameData
->
bstrName
)
+
1
)
*
sizeof
(
WCHAR
)));
RegCloseKey
(
hKey
);
RegCloseKey
(
hKey
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
...
@@ -258,6 +268,43 @@ static HRESULT GAMEUX_WriteRegistryRecord(struct GAMEUX_GAME_DATA *GameData)
...
@@ -258,6 +268,43 @@ static HRESULT GAMEUX_WriteRegistryRecord(struct GAMEUX_GAME_DATA *GameData)
return
hr
;
return
hr
;
}
}
/*******************************************************************************
/*******************************************************************************
* GAMEUX_ProcessGameDefinitionElement
*
* Helper function, parses single element from Game Definition
*
* Parameters:
* lpXMLElement [I] game definition element
* GameData [O] structure, where parsed
* data will be stored
*/
static
HRESULT
GAMEUX_ProcessGameDefinitionElement
(
IXMLDOMElement
*
element
,
struct
GAMEUX_GAME_DATA
*
GameData
)
{
static
const
WCHAR
sName
[]
=
{
'N'
,
'a'
,
'm'
,
'e'
,
0
};
HRESULT
hr
;
BSTR
bstrElementName
;
TRACE
(
"(%p, %p)
\n
"
,
element
,
GameData
);
hr
=
IXMLDOMElement_get_nodeName
(
element
,
&
bstrElementName
);
if
(
SUCCEEDED
(
hr
))
{
/* check element name */
if
(
lstrcmpW
(
bstrElementName
,
sName
)
==
0
)
hr
=
IXMLDOMElement_get_text
(
element
,
&
GameData
->
bstrName
);
else
FIXME
(
"entry %s in Game Definition File not yet supported
\n
"
,
debugstr_w
(
bstrElementName
));
SysFreeString
(
bstrElementName
);
}
return
hr
;
}
/*******************************************************************************
* GAMEUX_ParseGameDefinition
* GAMEUX_ParseGameDefinition
*
*
* Helper function, loads data from given XML element into fields of GAME_DATA
* Helper function, loads data from given XML element into fields of GAME_DATA
...
@@ -277,6 +324,9 @@ static HRESULT GAMEUX_ParseGameDefinition(
...
@@ -277,6 +324,9 @@ static HRESULT GAMEUX_ParseGameDefinition(
HRESULT
hr
=
S_OK
;
HRESULT
hr
=
S_OK
;
BSTR
bstrAttribute
;
BSTR
bstrAttribute
;
VARIANT
variant
;
VARIANT
variant
;
IXMLDOMNodeList
*
childrenList
;
IXMLDOMNode
*
nextNode
;
IXMLDOMElement
*
nextElement
;
TRACE
(
"(%p, %p)
\n
"
,
gdElement
,
GameData
);
TRACE
(
"(%p, %p)
\n
"
,
gdElement
,
GameData
);
...
@@ -295,6 +345,36 @@ static HRESULT GAMEUX_ParseGameDefinition(
...
@@ -295,6 +345,36 @@ static HRESULT GAMEUX_ParseGameDefinition(
SysFreeString
(
bstrAttribute
);
SysFreeString
(
bstrAttribute
);
/* browse subnodes */
if
(
SUCCEEDED
(
hr
))
hr
=
IXMLDOMElement_get_childNodes
(
gdElement
,
&
childrenList
);
if
(
SUCCEEDED
(
hr
))
{
do
{
hr
=
IXMLDOMNodeList_nextNode
(
childrenList
,
&
nextNode
);
if
(
hr
==
S_OK
)
{
hr
=
IXMLDOMNode_QueryInterface
(
nextNode
,
&
IID_IXMLDOMElement
,
(
LPVOID
*
)
&
nextElement
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
GAMEUX_ProcessGameDefinitionElement
(
nextElement
,
GameData
);
IXMLDOMElement_Release
(
nextElement
);
}
IXMLDOMElement_Release
(
nextNode
);
}
}
while
(
hr
==
S_OK
);
hr
=
S_OK
;
IXMLDOMNodeList_Release
(
childrenList
);
}
return
hr
;
return
hr
;
}
}
/*******************************************************************************
/*******************************************************************************
...
...
dlls/gameux/gameux_private.h
View file @
3c68877b
...
@@ -42,6 +42,7 @@ struct GAMEUX_GAME_DATA
...
@@ -42,6 +42,7 @@ struct GAMEUX_GAME_DATA
GAME_INSTALL_SCOPE
installScope
;
/* game's installation scope */
GAME_INSTALL_SCOPE
installScope
;
/* game's installation scope */
GUID
guidInstanceId
;
/* game installation instance identifier */
GUID
guidInstanceId
;
/* game installation instance identifier */
GUID
guidApplicationId
;
/* game's application identifier */
GUID
guidApplicationId
;
/* game's application identifier */
BSTR
bstrName
;
/* game's title */
};
};
/*******************************************************************************
/*******************************************************************************
* GAMEUX_initGameData
* GAMEUX_initGameData
...
...
dlls/gameux/tests/gameexplorer.c
View file @
3c68877b
...
@@ -301,7 +301,7 @@ static void _validateGameRegistryValues(int line,
...
@@ -301,7 +301,7 @@ static void _validateGameRegistryValues(int line,
hr
=
_validateRegistryValue
(
hKey
,
keyPath
,
sConfigGDFBinaryPath
,
RRF_RT_REG_SZ
,
gameExeName
);
hr
=
_validateRegistryValue
(
hKey
,
keyPath
,
sConfigGDFBinaryPath
,
RRF_RT_REG_SZ
,
gameExeName
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"failed while checking registry value (error 0x%x)
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"failed while checking registry value (error 0x%x)
\n
"
,
hr
);
hr
=
_validateRegistryValue
(
hKey
,
keyPath
,
sTitle
,
RRF_RT_REG_SZ
,
sExampleGame
);
hr
=
_validateRegistryValue
(
hKey
,
keyPath
,
sTitle
,
RRF_RT_REG_SZ
,
sExampleGame
);
todo_wine
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"failed while checking registry value (error 0x%x)
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"failed while checking registry value (error 0x%x)
\n
"
,
hr
);
/* this value exists up from Win7 */
/* this value exists up from Win7 */
hr
=
_validateRegistryValue
(
hKey
,
keyPath
,
sDescription
,
RRF_RT_REG_SZ
,
sGameDescription
);
hr
=
_validateRegistryValue
(
hKey
,
keyPath
,
sDescription
,
RRF_RT_REG_SZ
,
sGameDescription
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment