gameux: Add implementation of IGameStatistics::GetCategoryTitle.
This commit is contained in:
parent
2d6875b035
commit
ff9e31a2b5
|
@ -807,8 +807,29 @@ static HRESULT WINAPI GameStatisticsImpl_GetCategoryTitle(
|
||||||
WORD categoryIndex,
|
WORD categoryIndex,
|
||||||
LPWSTR *pTitle)
|
LPWSTR *pTitle)
|
||||||
{
|
{
|
||||||
FIXME("stub\n");
|
HRESULT hr = S_OK;
|
||||||
return E_NOTIMPL;
|
LONG nLength;
|
||||||
|
GameStatisticsImpl *This = impl_from_IGameStatistics(iface);
|
||||||
|
|
||||||
|
TRACE("%p, %d, %p\n", This, categoryIndex, pTitle);
|
||||||
|
|
||||||
|
*pTitle = NULL;
|
||||||
|
|
||||||
|
if(!pTitle || categoryIndex >= MAX_CATEGORIES)
|
||||||
|
hr = E_INVALIDARG;
|
||||||
|
|
||||||
|
|
||||||
|
if(SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
nLength = lstrlenW(This->stats.categories[categoryIndex].sName);
|
||||||
|
if(nLength != 0)
|
||||||
|
{
|
||||||
|
*pTitle = CoTaskMemAlloc(sizeof(WCHAR)*(nLength+1));
|
||||||
|
lstrcpyW(*pTitle, This->stats.categories[categoryIndex].sName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI GameStatisticsImpl_GetStatistic(
|
static HRESULT WINAPI GameStatisticsImpl_GetStatistic(
|
||||||
|
|
|
@ -346,23 +346,23 @@ static void test_gamestatisticsmgr( void )
|
||||||
|
|
||||||
/* verify values with these which we stored before*/
|
/* verify values with these which we stored before*/
|
||||||
hr = IGameStatistics_GetCategoryTitle(gs, 0, &lpName);
|
hr = IGameStatistics_GetCategoryTitle(gs, 0, &lpName);
|
||||||
todo_wine ok(hr == S_OK, "getting category title failed\n");
|
ok(hr == S_OK, "getting category title failed\n");
|
||||||
todo_wine ok(lstrcmpW(lpName, sCategory0)==0, "getting category title returned invalid string (%s)\n", wine_dbgstr_w(lpName));
|
ok(lstrcmpW(lpName, sCategory0)==0, "getting category title returned invalid string (%s)\n", wine_dbgstr_w(lpName));
|
||||||
CoTaskMemFree(lpName);
|
CoTaskMemFree(lpName);
|
||||||
|
|
||||||
hr = IGameStatistics_GetCategoryTitle(gs, 1, &lpName);
|
hr = IGameStatistics_GetCategoryTitle(gs, 1, &lpName);
|
||||||
todo_wine ok(hr == S_OK, "getting category title failed\n");
|
ok(hr == S_OK, "getting category title failed\n");
|
||||||
todo_wine ok(lstrcmpW(lpName, sCategory1)==0, "getting category title returned invalid string (%s)\n", wine_dbgstr_w(lpName));
|
ok(lstrcmpW(lpName, sCategory1)==0, "getting category title returned invalid string (%s)\n", wine_dbgstr_w(lpName));
|
||||||
CoTaskMemFree(lpName);
|
CoTaskMemFree(lpName);
|
||||||
|
|
||||||
hr = IGameStatistics_GetCategoryTitle(gs, 2, &lpName);
|
hr = IGameStatistics_GetCategoryTitle(gs, 2, &lpName);
|
||||||
todo_wine ok(hr == S_OK, "getting category title failed\n");
|
ok(hr == S_OK, "getting category title failed\n");
|
||||||
todo_wine ok(lstrcmpW(lpName, sCategory2)==0, "getting category title returned invalid string (%s)\n", wine_dbgstr_w(lpName));
|
ok(lstrcmpW(lpName, sCategory2)==0, "getting category title returned invalid string (%s)\n", wine_dbgstr_w(lpName));
|
||||||
CoTaskMemFree(lpName);
|
CoTaskMemFree(lpName);
|
||||||
|
|
||||||
/* check result if category doesn't exists */
|
/* check result if category doesn't exists */
|
||||||
hr = IGameStatistics_GetCategoryTitle(gs, 3, &lpName);
|
hr = IGameStatistics_GetCategoryTitle(gs, 3, &lpName);
|
||||||
todo_wine ok(hr == S_OK, "getting category title failed\n");
|
ok(hr == S_OK, "getting category title failed\n");
|
||||||
ok(lpName == NULL, "getting category title failed\n");
|
ok(lpName == NULL, "getting category title failed\n");
|
||||||
CoTaskMemFree(lpName);
|
CoTaskMemFree(lpName);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue