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
35692e40
Commit
35692e40
authored
Sep 26, 2010
by
Mariusz Pluciński
Committed by
Alexandre Julliard
Sep 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gameux: Add implementation of IGameStatistics::SetCategoryTitle.
parent
6fa52cd3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
9 deletions
+52
-9
gamestatistics.c
dlls/gameux/gamestatistics.c
+45
-2
gamestatistics.c
dlls/gameux/tests/gamestatistics.c
+7
-7
No files found.
dlls/gameux/gamestatistics.c
View file @
35692e40
...
...
@@ -40,12 +40,36 @@ WINE_DEFAULT_DEBUG_CHANNEL(gameux);
#define MAX_CATEGORIES 10
#define MAX_STATS_PER_CATEGORY 10
/*******************************************************************************
* Game statistics helper components
*/
/*******************************************************************************
* struct GAMEUX_STATS
*
* set of structures for containing game's data
*/
struct
GAMEUX_STATS_STAT
{
WCHAR
sName
[
MAX_NAME_LENGTH
+
1
];
WCHAR
sValue
[
MAX_VALUE_LENGTH
+
1
];
};
struct
GAMEUX_STATS_CATEGORY
{
WCHAR
sName
[
MAX_CATEGORY_LENGTH
+
1
];
struct
GAMEUX_STATS_STAT
stats
[
MAX_STATS_PER_CATEGORY
];
};
struct
GAMEUX_STATS
{
WCHAR
sStatsFile
[
MAX_PATH
];
struct
GAMEUX_STATS_CATEGORY
categories
[
MAX_CATEGORIES
];
};
/*******************************************************************************
* IGameStatistics implementation
*/
typedef
struct
_GameStatisticsImpl
{
const
struct
IGameStatisticsVtbl
*
lpVtbl
;
LONG
ref
;
struct
GAMEUX_STATS
stats
;
}
GameStatisticsImpl
;
static
inline
GameStatisticsImpl
*
impl_from_IGameStatistics
(
IGameStatistics
*
iface
)
...
...
@@ -177,8 +201,27 @@ static HRESULT WINAPI GameStatisticsImpl_SetCategoryTitle(
WORD
categoryIndex
,
LPCWSTR
title
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
HRESULT
hr
=
S_OK
;
DWORD
dwLength
;
GameStatisticsImpl
*
This
=
impl_from_IGameStatistics
(
iface
);
TRACE
(
"(%p, %d, %s)
\n
"
,
This
,
categoryIndex
,
debugstr_w
(
title
));
if
(
!
title
||
categoryIndex
>=
MAX_CATEGORIES
)
return
E_INVALIDARG
;
dwLength
=
lstrlenW
(
title
);
if
(
dwLength
>
MAX_CATEGORY_LENGTH
)
{
hr
=
S_FALSE
;
dwLength
=
MAX_CATEGORY_LENGTH
;
}
lstrcpynW
(
This
->
stats
.
categories
[
categoryIndex
].
sName
,
title
,
dwLength
+
1
);
return
hr
;
}
static
HRESULT
WINAPI
GameStatisticsImpl_GetCategoryTitle
(
...
...
dlls/gameux/tests/gamestatistics.c
View file @
35692e40
...
...
@@ -271,10 +271,10 @@ static void test_gamestatisticsmgr( void )
/* write sample statistics */
hr
=
IGameStatistics_SetCategoryTitle
(
gs
,
wMaxCategories
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"setting category title invalid value: 0x%x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"setting category title invalid value: 0x%x
\n
"
,
hr
);
hr
=
IGameStatistics_SetCategoryTitle
(
gs
,
wMaxCategories
,
sCategory0
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"setting category title invalid value: 0x%x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"setting category title invalid value: 0x%x
\n
"
,
hr
);
/* check what happen if string is too long */
sTooLongString
=
CoTaskMemAlloc
(
sizeof
(
WCHAR
)
*
(
uMaxCategoryLength
+
2
));
...
...
@@ -283,12 +283,12 @@ static void test_gamestatisticsmgr( void )
/* when string is too long, Windows returns S_FALSE, but saves string (stripped to expected number of characters) */
hr
=
IGameStatistics_SetCategoryTitle
(
gs
,
0
,
sTooLongString
);
todo_wine
ok
(
hr
==
S_FALSE
,
"setting category title invalid result: 0x%x
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"setting category title invalid result: 0x%x
\n
"
,
hr
);
CoTaskMemFree
(
sTooLongString
);
todo_wine
ok
(
IGameStatistics_SetCategoryTitle
(
gs
,
0
,
sCategory0
)
==
S_OK
,
"setting category title failed: %s
\n
"
,
wine_dbgstr_w
(
sCategory0
));
todo_wine
ok
(
IGameStatistics_SetCategoryTitle
(
gs
,
1
,
sCategory1
)
==
S_OK
,
"setting category title failed: %s
\n
"
,
wine_dbgstr_w
(
sCategory1
));
todo_wine
ok
(
IGameStatistics_SetCategoryTitle
(
gs
,
2
,
sCategory2
)
==
S_OK
,
"setting category title failed: %s
\n
"
,
wine_dbgstr_w
(
sCategory1
));
ok
(
IGameStatistics_SetCategoryTitle
(
gs
,
0
,
sCategory0
)
==
S_OK
,
"setting category title failed: %s
\n
"
,
wine_dbgstr_w
(
sCategory0
));
ok
(
IGameStatistics_SetCategoryTitle
(
gs
,
1
,
sCategory1
)
==
S_OK
,
"setting category title failed: %s
\n
"
,
wine_dbgstr_w
(
sCategory1
));
ok
(
IGameStatistics_SetCategoryTitle
(
gs
,
2
,
sCategory2
)
==
S_OK
,
"setting category title failed: %s
\n
"
,
wine_dbgstr_w
(
sCategory1
));
/* check what happen if any string is NULL */
hr
=
IGameStatistics_SetStatistic
(
gs
,
0
,
0
,
NULL
,
sValue00
);
...
...
@@ -333,7 +333,7 @@ static void test_gamestatisticsmgr( void )
todo_wine
ok
(
_isFileExists
(
lpStatisticsFile
)
==
TRUE
,
"statistics file %s does not exists
\n
"
,
wine_dbgstr_w
(
lpStatisticsFile
));
/* this value should not be stored in storage, we need it only to test is it not saved */
todo_wine
ok
(
IGameStatistics_SetCategoryTitle
(
gs
,
0
,
sCategory0a
)
==
S_OK
,
"setting category title failed: %s
\n
"
,
wine_dbgstr_w
(
sCategory0a
));
ok
(
IGameStatistics_SetCategoryTitle
(
gs
,
0
,
sCategory0a
)
==
S_OK
,
"setting category title failed: %s
\n
"
,
wine_dbgstr_w
(
sCategory0a
));
hr
=
IGameStatistics_Release
(
gs
);
ok
(
SUCCEEDED
(
hr
),
"releasing IGameStatistics returned error: 0x%08x
\n
"
,
hr
);
...
...
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