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
23efe792
Commit
23efe792
authored
Sep 23, 2010
by
Mariusz Pluciński
Committed by
Alexandre Julliard
Sep 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gameux: Add partial implementation of IGameStatisticsMgr::GetGameStatistics.
parent
7c798a4a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
103 additions
and
37 deletions
+103
-37
gameexplorer.c
dlls/gameux/gameexplorer.c
+4
-35
gamestatistics.c
dlls/gameux/gamestatistics.c
+50
-2
gameux_private.h
dlls/gameux/gameux_private.h
+49
-0
No files found.
dlls/gameux/gameexplorer.c
View file @
23efe792
...
...
@@ -69,29 +69,9 @@ void GAMEUX_uninitGameData(struct GAMEUX_GAME_DATA *GameData)
/*******************************************************************************
* GAMEUX_buildGameRegistryPath
*
* Helper function, builds registry path to key, where game's data are stored
*
* Parameters:
* installScope [I] the scope which was used in AddGame/InstallGame call
* gameInstanceId [I] game instance GUID. If NULL, then only
* path to scope will be returned
* lpRegistryPath [O] pointer which will receive address to string
* containing expected registry path. Path
* is relative to HKLM registry key. It
* must be freed by calling HeapFree(GetProcessHeap(), 0, ...)
*
* Name of game's registry key always follows patterns below:
* When game is installed for current user only (installScope is GIS_CURRENT_USER):
* HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
* GameUX\[user's security ID]\[game instance ID]
*
* When game is installed for all users (installScope is GIS_ALL_USERS):
* HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
* GameUX\Games\[game instance ID]
*
*
* Internal helper function. Description available in gameux_private.h file
*/
static
HRESULT
GAMEUX_buildGameRegistryPath
(
GAME_INSTALL_SCOPE
installScope
,
HRESULT
GAMEUX_buildGameRegistryPath
(
GAME_INSTALL_SCOPE
installScope
,
LPCGUID
gameInstanceId
,
LPWSTR
*
lpRegistryPath
)
{
...
...
@@ -697,20 +677,9 @@ static HRESULT GAMEUX_UpdateGame(LPGUID InstanceID) {
/*******************************************************************************
* GAMEUX_FindGameInstanceId
*
* Helper funtion. Searches for instance identifier of given game in given
* installation scope.
*
* Parameters:
* sGDFBinaryPath [I] path to binary containing GDF
* installScope [I] game install scope to search in
* pInstanceId [O] instance identifier of given game
*
* Returns:
* S_OK id was returned properly
* S_FALSE id was not found in the registry
* E_OUTOFMEMORY problem while memory allocation
* Internal helper function. Description available in gameux_private.h file
*/
static
HRESULT
GAMEUX_FindGameInstanceId
(
HRESULT
GAMEUX_FindGameInstanceId
(
LPCWSTR
sGDFBinaryPath
,
GAME_INSTALL_SCOPE
installScope
,
GUID
*
pInstanceId
)
...
...
dlls/gameux/gamestatistics.c
View file @
23efe792
...
...
@@ -22,6 +22,7 @@
#include "config.h"
#include "ole2.h"
#include "winreg.h"
#include "gameux.h"
#include "gameux_private.h"
...
...
@@ -107,8 +108,55 @@ static HRESULT STDMETHODCALLTYPE GameStatisticsMgrImpl_GetGameStatistics(
GAMESTATS_OPEN_RESULT
*
pOpenResult
,
IGameStatistics
**
ppiStats
)
{
FIXME
(
"stub (%p, %s, 0x%x, %p, %p)
\n
"
,
iface
,
debugstr_w
(
GDFBinaryPath
),
openType
,
pOpenResult
,
ppiStats
);
return
E_NOTIMPL
;
static
const
WCHAR
sApplicationId
[]
=
{
'A'
,
'p'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'I'
,
'd'
,
0
};
HRESULT
hr
;
GUID
instanceId
;
LPWSTR
lpRegistryPath
=
NULL
;
WCHAR
lpApplicationId
[
49
];
DWORD
dwLength
=
sizeof
(
lpApplicationId
);
GAME_INSTALL_SCOPE
installScope
;
TRACE
(
"(%p, %s, 0x%x, %p, %p)
\n
"
,
iface
,
debugstr_w
(
GDFBinaryPath
),
openType
,
pOpenResult
,
ppiStats
);
if
(
!
GDFBinaryPath
)
return
E_INVALIDARG
;
installScope
=
GIS_CURRENT_USER
;
hr
=
GAMEUX_FindGameInstanceId
(
GDFBinaryPath
,
installScope
,
&
instanceId
);
if
(
hr
==
S_FALSE
)
{
installScope
=
GIS_ALL_USERS
;
hr
=
GAMEUX_FindGameInstanceId
(
GDFBinaryPath
,
installScope
,
&
instanceId
);
}
if
(
hr
==
S_FALSE
)
/* game not registered, so statistics cannot be used */
hr
=
E_FAIL
;
if
(
SUCCEEDED
(
hr
))
/* game is registered, let's read it's application id from registry */
hr
=
GAMEUX_buildGameRegistryPath
(
installScope
,
&
instanceId
,
&
lpRegistryPath
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
HRESULT_FROM_WIN32
(
RegGetValueW
(
HKEY_LOCAL_MACHINE
,
lpRegistryPath
,
sApplicationId
,
RRF_RT_REG_SZ
,
NULL
,
lpApplicationId
,
&
dwLength
));
}
if
(
SUCCEEDED
(
hr
))
{
TRACE
(
"found app id: %s
\n
"
,
debugstr_w
(
lpApplicationId
));
FIXME
(
"creating instance of IGameStatistics not yet implemented
\n
"
);
hr
=
E_NOTIMPL
;
}
HeapFree
(
GetProcessHeap
(),
0
,
lpRegistryPath
);
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
GameStatisticsMgrImpl_RemoveGameStatistics
(
...
...
dlls/gameux/gameux_private.h
View file @
23efe792
...
...
@@ -86,3 +86,52 @@ HRESULT WINAPI GAMEUX_RegisterGame(LPCWSTR sGDFBinaryPath,
LPCWSTR
sGameInstallDirectory
,
GAME_INSTALL_SCOPE
installScope
,
GUID
*
pInstanceID
);
/*******************************************************************************
* GAMEUX_FindGameInstanceId
*
* Helper funtion. Searches for instance identifier of given game in given
* installation scope. Implemented in gameexplorer.c
*
* Parameters:
* sGDFBinaryPath [I] path to binary containing GDF
* installScope [I] game install scope to search in
* pInstanceId [O] instance identifier of given game
*
* Returns:
* S_OK id was returned properly
* S_FALSE id was not found in the registry
* E_OUTOFMEMORY problem while memory allocation
*/
HRESULT
GAMEUX_FindGameInstanceId
(
LPCWSTR
sGDFBinaryPath
,
GAME_INSTALL_SCOPE
installScope
,
GUID
*
pInstanceId
);
/*******************************************************************************
* GAMEUX_buildGameRegistryPath
*
* Helper function, builds registry path to key, where game's data are stored.
* Implemented in gameexplorer.c
*
* Parameters:
* installScope [I] the scope which was used in AddGame/InstallGame call
* gameInstanceId [I] game instance GUID. If NULL, then only
* path to scope will be returned
* lpRegistryPath [O] pointer which will receive address to string
* containing expected registry path. Path
* is relative to HKLM registry key. It
* must be freed by calling HeapFree(GetProcessHeap(), 0, ...)
*
* Name of game's registry key always follows patterns below:
* When game is installed for current user only (installScope is GIS_CURRENT_USER):
* HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
* GameUX\[user's security ID]\[game instance ID]
*
* When game is installed for all users (installScope is GIS_ALL_USERS):
* HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
* GameUX\Games\[game instance ID]
*
*
*/
HRESULT
GAMEUX_buildGameRegistryPath
(
GAME_INSTALL_SCOPE
installScope
,
LPCGUID
gameInstanceId
,
LPWSTR
*
lpRegistryPath
);
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