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
0949e083
Commit
0949e083
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: Initial implementation of IGameExplorer::AddGame.
parent
b46183a2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
10 deletions
+73
-10
Makefile.in
dlls/gameux/Makefile.in
+1
-1
gameexplorer.c
dlls/gameux/gameexplorer.c
+0
-0
gameux_private.h
dlls/gameux/gameux_private.h
+63
-0
gameexplorer.c
dlls/gameux/tests/gameexplorer.c
+9
-9
No files found.
dlls/gameux/Makefile.in
View file @
0949e083
...
...
@@ -4,7 +4,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
gameux.dll
IMPORTS
=
uuid ole32 user32 advapi32
IMPORTS
=
uuid ole32 user32 advapi32
oleaut32
C_SRCS
=
\
factory.c
\
...
...
dlls/gameux/gameexplorer.c
View file @
0949e083
This diff is collapsed.
Click to expand it.
dlls/gameux/gameux_private.h
View file @
0949e083
...
...
@@ -20,3 +20,66 @@
extern
HRESULT
GameExplorer_create
(
IUnknown
*
pUnkOuter
,
IUnknown
**
ppObj
);
extern
HRESULT
GameStatistics_create
(
IUnknown
*
pUnkOuter
,
IUnknown
**
ppObj
);
/*******************************************************************************
* Helper functions and structures
*
* These are helper function and structures, which are used widely in gameux
* implementation. Details about usage and place of implementation is
* in description of each function/strucutre.
*/
/*******************************************************************************
* struct GAMEUX_GAME_DATA
*
* Structure which contains data about single game. It is used to transfer
* data inside of gameux module in various places.
*/
struct
GAMEUX_GAME_DATA
{
LPWSTR
sGDFBinaryPath
;
/* path to binary containing GDF */
LPWSTR
sGameInstallDirectory
;
/* directory passed to AddGame/InstallGame methods */
GAME_INSTALL_SCOPE
installScope
;
/* game's installation scope */
GUID
guidInstanceId
;
/* game installation instance identifier */
};
/*******************************************************************************
* GAMEUX_initGameData
*
* Initializes GAME_DATA structure fields with proper values. Should be
* called always before first usage of this structure. Implemented in gameexplorer.c
*
* Parameters:
* GameData [I/O] pointer to structure to initialize
*/
void
GAMEUX_initGameData
(
struct
GAMEUX_GAME_DATA
*
GameData
);
/*******************************************************************************
* GAMEUX_uninitGameData
*
* Properly frees all data stored or pointed by fields of GAME_DATA structure.
* Should be called before freeing this structure. Implemented in gameexplorer.c
*
* Parameters:
* GameData [I/O] pointer to structure to uninitialize
*/
void
GAMEUX_uninitGameData
(
struct
GAMEUX_GAME_DATA
*
GameData
);
/*******************************************************************************
* GAMEUX_RegisterGame
*
* Helper function. Registers game associated with given GDF binary in
* Game Explorer. Implemented in gameexplorer.c
*
* Parameters:
* sGDFBinaryPath [I] path to binary containing GDF file in
* resources
* sGameInstallDirectory [I] path to directory, where game installed
* it's files.
* installScope [I] scope of game installation
* pInstanceID [I/O] pointer to game instance identifier.
* If pointing to GUID_NULL, then new
* identifier will be generated automatically
* and returned via this parameter
*/
HRESULT
WINAPI
GAMEUX_RegisterGame
(
LPCWSTR
sGDFBinaryPath
,
LPCWSTR
sGameInstallDirectory
,
GAME_INSTALL_SCOPE
installScope
,
GUID
*
pInstanceID
);
dlls/gameux/tests/gameexplorer.c
View file @
0949e083
...
...
@@ -297,9 +297,9 @@ static void _validateGameRegistryValues(int line,
hr
=
_validateRegistryValue
(
hKey
,
keyPath
,
sApplicationId
,
RRF_RT_REG_SZ
,
sGameApplicationId
);
todo_wine
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"failed while checking registry value (error 0x%x)
\n
"
,
hr
);
hr
=
_validateRegistryValue
(
hKey
,
keyPath
,
sConfigApplicationPath
,
RRF_RT_REG_SZ
,
gameExePath
);
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
);
hr
=
_validateRegistryValue
(
hKey
,
keyPath
,
sConfigGDFBinaryPath
,
RRF_RT_REG_SZ
,
gameExeName
);
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
);
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
);
...
...
@@ -438,36 +438,36 @@ static void test_add_remove_game(void)
memcpy
(
&
guid
,
&
defaultGUID
,
sizeof
(
guid
));
hr
=
IGameExplorer_AddGame
(
ge
,
bstrExeName
,
bstrExePath
,
GIS_CURRENT_USER
,
&
guid
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"IGameExplorer::AddGame failed (error 0x%08x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"IGameExplorer::AddGame failed (error 0x%08x)
\n
"
,
hr
);
ok
(
memcmp
(
&
guid
,
&
defaultGUID
,
sizeof
(
guid
))
==
0
,
"AddGame unexpectedly modified GUID
\n
"
);
if
(
SUCCEEDED
(
hr
))
{
todo_wine
_validateGameRegistryKey
(
__LINE__
,
GIS_CURRENT_USER
,
&
guid
,
&
applicationId
,
sExePath
,
sExeName
,
TRUE
);
_validateGameRegistryKey
(
__LINE__
,
GIS_CURRENT_USER
,
&
guid
,
&
applicationId
,
sExePath
,
sExeName
,
TRUE
);
hr
=
IGameExplorer_RemoveGame
(
ge
,
guid
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"IGameExplorer::RemoveGame failed (error 0x%08x)
\n
"
,
hr
);
}
_validateGameRegistryKey
(
__LINE__
,
GIS_CURRENT_USER
,
&
guid
,
&
applicationId
,
sExePath
,
sExeName
,
FALSE
);
todo_wine
_validateGameRegistryKey
(
__LINE__
,
GIS_CURRENT_USER
,
&
guid
,
&
applicationId
,
sExePath
,
sExeName
,
FALSE
);
/* try to register game with empty guid */
memcpy
(
&
guid
,
&
GUID_NULL
,
sizeof
(
guid
));
hr
=
IGameExplorer_AddGame
(
ge
,
bstrExeName
,
bstrExePath
,
GIS_CURRENT_USER
,
&
guid
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"IGameExplorer::AddGame failed (error 0x%08x)
\n
"
,
hr
);
todo_wine
ok
(
memcmp
(
&
guid
,
&
GUID_NULL
,
sizeof
(
guid
))
!=
0
,
"AddGame did not modify GUID
\n
"
);
ok
(
SUCCEEDED
(
hr
),
"IGameExplorer::AddGame failed (error 0x%08x)
\n
"
,
hr
);
ok
(
memcmp
(
&
guid
,
&
GUID_NULL
,
sizeof
(
guid
))
!=
0
,
"AddGame did not modify GUID
\n
"
);
if
(
SUCCEEDED
(
hr
))
{
todo_wine
_validateGameRegistryKey
(
__LINE__
,
GIS_CURRENT_USER
,
&
guid
,
&
applicationId
,
sExePath
,
sExeName
,
TRUE
);
_validateGameRegistryKey
(
__LINE__
,
GIS_CURRENT_USER
,
&
guid
,
&
applicationId
,
sExePath
,
sExeName
,
TRUE
);
hr
=
IGameExplorer_RemoveGame
(
ge
,
guid
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"IGameExplorer::RemoveGame failed (error 0x%08x)
\n
"
,
hr
);
}
_validateGameRegistryKey
(
__LINE__
,
GIS_CURRENT_USER
,
&
guid
,
&
applicationId
,
sExePath
,
sExeName
,
FALSE
);
todo_wine
_validateGameRegistryKey
(
__LINE__
,
GIS_CURRENT_USER
,
&
guid
,
&
applicationId
,
sExePath
,
sExeName
,
FALSE
);
}
/* free allocated resources */
...
...
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