winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2010
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
852 discussions
Start a n
N
ew thread
Vincent Povirk : ktmw32: Add stub dll.
by Alexandre Julliard
27 Sep '10
27 Sep '10
Module: wine Branch: master Commit: 8f87459baa2fd7d67723b9b0cd6e65576a0fe797 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8f87459baa2fd7d67723b9b0c…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Sun Sep 26 16:38:44 2010 -0500 ktmw32: Add stub dll. --- configure | 1 + configure.ac | 1 + dlls/ktmw32/Makefile.in | 6 ++++++ dlls/ktmw32/ktmw32.spec | 44 ++++++++++++++++++++++++++++++++++++++++++++ dlls/ktmw32/ktmw32_main.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 95 insertions(+), 0 deletions(-) diff --git a/configure b/configure index f1f9435..436bbae 100755 --- a/configure +++ b/configure @@ -14685,6 +14685,7 @@ wine_fn_config_dll kernel32 enable_kernel32 kernel32 wine_fn_config_test dlls/kernel32/tests kernel32_test wine_fn_config_dll keyboard.drv16 enable_win16 wine_fn_config_dll krnl386.exe16 enable_win16 kernel +wine_fn_config_dll ktmw32 enable_ktmw32 wine_fn_config_dll loadperf enable_loadperf loadperf wine_fn_config_dll localspl enable_localspl wine_fn_config_test dlls/localspl/tests localspl_test diff --git a/configure.ac b/configure.ac index 341ba18..fb85cac 100644 --- a/configure.ac +++ b/configure.ac @@ -2463,6 +2463,7 @@ WINE_CONFIG_DLL(kernel32,,[kernel32]) WINE_CONFIG_TEST(dlls/kernel32/tests) WINE_CONFIG_DLL(keyboard.drv16,enable_win16) WINE_CONFIG_DLL(krnl386.exe16,enable_win16,[kernel]) +WINE_CONFIG_DLL(ktmw32) WINE_CONFIG_DLL(loadperf,,[loadperf]) WINE_CONFIG_DLL(localspl) WINE_CONFIG_TEST(dlls/localspl/tests) diff --git a/dlls/ktmw32/Makefile.in b/dlls/ktmw32/Makefile.in new file mode 100644 index 0000000..62c41d8 --- /dev/null +++ b/dlls/ktmw32/Makefile.in @@ -0,0 +1,6 @@ +MODULE = ktmw32.dll + +C_SRCS = \ + ktmw32_main.c + +@MAKE_DLL_RULES@ diff --git a/dlls/ktmw32/ktmw32.spec b/dlls/ktmw32/ktmw32.spec new file mode 100644 index 0000000..062f1f2 --- /dev/null +++ b/dlls/ktmw32/ktmw32.spec @@ -0,0 +1,44 @@ +@ stub CommitComplete +@ stub CommitEnlistment +@ stub CommitTransaction +@ stub CommitTransactionAsync +@ stub CreateEnlistment +@ stub CreateResourceManager +@ stub CreateTransaction +@ stub CreateTransactionManager +@ stub GetCurrentClockTransactionManager +@ stub GetEnlistmentId +@ stub GetEnlistmentRecoveryInformation +@ stub GetNotificationResourceManager +@ stub GetNotificationResourceManagerAsync +@ stub GetTransactionId +@ stub GetTransactionInformation +@ stub GetTransactionManagerId +@ stub OpenEnlistment +@ stub OpenResourceManager +@ stub OpenTransaction +@ stub OpenTransactionManager +@ stub OpenTransactionManagerById +@ stub PrePrepareComplete +@ stub PrePrepareEnlistment +@ stub PrepareComplete +@ stub PrepareEnlistment +@ stub PrivCreateTransaction +@ stub PrivIsLogWritableTransactionManager +@ stub PrivPropagationComplete +@ stub PrivPropagationFailed +@ stub PrivRegisterProtocolAddressInformation +@ stub ReadOnlyEnlistment +@ stub RecoverEnlistment +@ stub RecoverResourceManager +@ stub RecoverTransactionManager +@ stub RenameTransactionManager +@ stub RollbackComplete +@ stub RollbackEnlistment +@ stub RollbackTransaction +@ stub RollbackTransactionAsync +@ stub RollforwardTransactionManager +@ stub SetEnlistmentRecoveryInformation +@ stub SetResourceManagerCompletionPort +@ stub SetTransactionInformation +@ stub SinglePhaseReject diff --git a/dlls/ktmw32/ktmw32_main.c b/dlls/ktmw32/ktmw32_main.c new file mode 100644 index 0000000..960def2 --- /dev/null +++ b/dlls/ktmw32/ktmw32_main.c @@ -0,0 +1,43 @@ +/* + * Copyright 2010 Vincent Povirk for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#include "config.h" + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ktm); + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + break; + case DLL_PROCESS_DETACH: + break; + } + + return TRUE; +}
1
0
0
0
Mariusz Pluciński : gameux: Finished implementation of saving game statistics.
by Alexandre Julliard
27 Sep '10
27 Sep '10
Module: wine Branch: master Commit: d87a7613449fc4172fc2db792ad984527dcf2722 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d87a7613449fc4172fc2db792…
Author: Mariusz Pluciński <vshader(a)gmail.com> Date: Sun Sep 26 15:04:58 2010 +0200 gameux: Finished implementation of saving game statistics. --- dlls/gameux/gamestatistics.c | 168 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 163 insertions(+), 5 deletions(-) diff --git a/dlls/gameux/gamestatistics.c b/dlls/gameux/gamestatistics.c index a82f03a..0cce059 100644 --- a/dlls/gameux/gamestatistics.c +++ b/dlls/gameux/gamestatistics.c @@ -104,12 +104,20 @@ static HRESULT GAMEUX_createStatsDirectory(LPCWSTR lpFilePath) static HRESULT GAMEUX_updateStatisticsFile(struct GAMEUX_STATS *stats) { static const WCHAR sStatistics[] = {'S','t','a','t','i','s','t','i','c','s',0}; + static const WCHAR sCategory[] = {'C','a','t','e','g','o','r','y',0}; + static const WCHAR sIndex[] = {'I','n','d','e','x',0}; + static const WCHAR sStatistic[] = {'S','t','a','t','i','s','t','i','c',0}; + static const WCHAR sName[] = {'N','a','m','e',0}; + static const WCHAR sValue[] = {'V','a','l','u','e',0}; HRESULT hr = S_OK; IXMLDOMDocument *document; - IXMLDOMElement *root; - VARIANT vStatsFilePath; - BSTR bstrStatistics = NULL; + IXMLDOMElement *root, *categoryElement, *statisticsElement; + IXMLDOMNode *categoryNode, *statisticsNode; + VARIANT vStatsFilePath, vValue; + BSTR bstrStatistics = NULL, bstrCategory = NULL, bstrIndex = NULL, + bstrStatistic = NULL, bstrName = NULL, bstrValue = NULL; + int i, j; TRACE("(%p)\n", stats); @@ -132,7 +140,150 @@ static HRESULT GAMEUX_updateStatisticsFile(struct GAMEUX_STATS *stats) if(SUCCEEDED(hr)) hr = IXMLDOMDocument_createElement(document, bstrStatistics, &root); - FIXME("writing statistics not fully implemented\n"); + if(SUCCEEDED(hr)) + { + bstrCategory = SysAllocString(sCategory); + if(!bstrCategory) + hr = E_OUTOFMEMORY; + } + + if(SUCCEEDED(hr)) + { + bstrIndex = SysAllocString(sIndex); + if(!bstrIndex) + hr = E_OUTOFMEMORY; + } + + if(SUCCEEDED(hr)) + { + bstrStatistic = SysAllocString(sStatistic); + if(!bstrStatistic) + hr = E_OUTOFMEMORY; + } + + if(SUCCEEDED(hr)) + { + bstrName = SysAllocString(sName); + if(!bstrName) + hr = E_OUTOFMEMORY; + } + + if(SUCCEEDED(hr)) + { + bstrValue = SysAllocString(sValue); + if(!bstrValue) + hr = E_OUTOFMEMORY; + } + + if(SUCCEEDED(hr)) + + if(SUCCEEDED(hr)) + for(i=0; i<MAX_CATEGORIES; ++i) + { + if(lstrlenW(stats->categories[i].sName)==0) + continue; + + V_VT(&vValue) = VT_INT; + V_INT(&vValue) = NODE_ELEMENT; + + hr = IXMLDOMDocument_createNode(document, vValue, bstrCategory, NULL, &categoryNode); + + if(SUCCEEDED(hr)) + hr = IXMLDOMNode_QueryInterface(categoryNode, &IID_IXMLDOMElement, (LPVOID*)&categoryElement); + + V_INT(&vValue) = i; + if(SUCCEEDED(hr)) + hr = IXMLDOMElement_setAttribute(categoryElement, bstrIndex, vValue); + + if(SUCCEEDED(hr)) + { + V_VT(&vValue) = VT_BSTR; + V_BSTR(&vValue) = SysAllocString(stats->categories[i].sName); + if(!V_BSTR(&vValue)) + hr = E_OUTOFMEMORY; + } + + if(SUCCEEDED(hr)) + { + TRACE("storing category %d: %s\n", i, debugstr_w(V_BSTR(&vValue))); + hr = IXMLDOMElement_setAttribute(categoryElement, bstrName, vValue); + } + + SysFreeString(V_BSTR(&vValue)); + + if(SUCCEEDED(hr)) + { + for(j=0; j<MAX_STATS_PER_CATEGORY; ++j) + { + if(lstrlenW(stats->categories[i].stats[j].sName)==0) + continue; + + V_VT(&vValue) = VT_INT; + V_INT(&vValue) = NODE_ELEMENT; + + hr = IXMLDOMDocument_createNode(document, vValue, bstrStatistic, NULL, &statisticsNode); + + if(SUCCEEDED(hr)) + hr = IXMLDOMNode_QueryInterface(statisticsNode, &IID_IXMLDOMElement, (LPVOID*)&statisticsElement); + + V_INT(&vValue) = j; + if(SUCCEEDED(hr)) + hr = IXMLDOMElement_setAttribute(statisticsElement, bstrIndex, vValue); + + if(SUCCEEDED(hr)) + { + V_VT(&vValue) = VT_BSTR; + V_BSTR(&vValue) = SysAllocString(stats->categories[i].stats[j].sName); + if(!V_BSTR(&vValue)) + hr = E_OUTOFMEMORY; + } + + if(SUCCEEDED(hr)) + { + TRACE(" storing statistic %d: name: %s\n", j, debugstr_w(V_BSTR(&vValue))); + hr = IXMLDOMElement_setAttribute(statisticsElement, bstrName, vValue); + } + + SysFreeString(V_BSTR(&vValue)); + + if(SUCCEEDED(hr)) + { + V_VT(&vValue) = VT_BSTR; + V_BSTR(&vValue) = SysAllocString(stats->categories[i].stats[j].sValue); + if(!V_BSTR(&vValue)) + hr = E_OUTOFMEMORY; + } + + if(SUCCEEDED(hr)) + { + TRACE(" storing statistic %d: name: %s\n", j, debugstr_w(V_BSTR(&vValue))); + hr = IXMLDOMElement_setAttribute(statisticsElement, bstrValue, vValue); + } + + SysFreeString(V_BSTR(&vValue)); + + if(SUCCEEDED(hr)) + hr = IXMLDOMElement_appendChild(categoryNode, statisticsNode, &statisticsNode); + + IXMLDOMElement_Release(statisticsElement); + IXMLDOMNode_Release(statisticsNode); + } + } + + if(SUCCEEDED(hr)) + hr = IXMLDOMElement_appendChild(root, categoryNode, &categoryNode); + + IXMLDOMElement_Release(categoryElement); + IXMLDOMNode_Release(categoryNode); + + if(FAILED(hr)) + break; + } + + if(SUCCEEDED(hr)) + hr = IXMLDOMDocument_putref_documentElement(document, root); + + IXMLDOMElement_Release(root); TRACE("saving game statistics in %s file\n", debugstr_w(stats->sStatsFile)); if(SUCCEEDED(hr)) @@ -141,8 +292,15 @@ static HRESULT GAMEUX_updateStatisticsFile(struct GAMEUX_STATS *stats) if(SUCCEEDED(hr)) hr = IXMLDOMDocument_save(document, vStatsFilePath); - SysFreeString(V_BSTR(&vStatsFilePath)); + IXMLDOMDocument_Release(document); + + SysFreeString(bstrValue); + SysFreeString(bstrName); + SysFreeString(bstrStatistic); + SysFreeString(bstrIndex); + SysFreeString(bstrCategory); SysFreeString(bstrStatistics); + SysFreeString(V_BSTR(&vStatsFilePath)); TRACE("ret=0x%x\n", hr); return hr; }
1
0
0
0
Mariusz Pluciński : gameux: Add implementation of IGameStatisticsMgr::RemoveGameStatistics.
by Alexandre Julliard
27 Sep '10
27 Sep '10
Module: wine Branch: master Commit: 5cac9d2cb2c020802a56a5b1b28348316f1087ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5cac9d2cb2c020802a56a5b1b…
Author: Mariusz Pluciński <vshader(a)gmail.com> Date: Sun Sep 26 15:04:04 2010 +0200 gameux: Add implementation of IGameStatisticsMgr::RemoveGameStatistics. --- dlls/gameux/gamestatistics.c | 114 +++++++++++++++++++++++------------- dlls/gameux/tests/gamestatistics.c | 4 +- 2 files changed, 76 insertions(+), 42 deletions(-) diff --git a/dlls/gameux/gamestatistics.c b/dlls/gameux/gamestatistics.c index 83ee5cd..a82f03a 100644 --- a/dlls/gameux/gamestatistics.c +++ b/dlls/gameux/gamestatistics.c @@ -183,6 +183,64 @@ static HRESULT GAMEUX_buildStatisticsFilePath( return hr; } +/******************************************************************************* + * GAMEUX_getAppIdFromGDFPath + * + * Loads application identifier associated with given GDF binary. + * Routine reads identifier from registry, so will fail if game + * is not registered. + * + * Parameters: + * GDFBinaryPath [I] path to gdf binary + * lpApplicationId [O] place to store application id. + * must be at least 49 characters + * to store guid and termination 0 + */ +static HRESULT GAMEUX_getAppIdFromGDFPath( + LPCWSTR GDFBinaryPath, + LPWSTR lpApplicationId) +{ + static const WCHAR sApplicationId[] = + {'A','p','p','l','i','c','a','t','i','o','n','I','d',0}; + + HRESULT hr; + GAME_INSTALL_SCOPE installScope; + GUID instanceId; + LPWSTR lpRegistryPath; + DWORD dwLength = 49*sizeof(WCHAR);/* place for GUID */ + + TRACE("(%s, %p)\n", debugstr_w(GDFBinaryPath), lpApplicationId); + + 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)); + + HeapFree(GetProcessHeap(), 0, lpRegistryPath); + + TRACE("found app id: %s, return: %#x\n", debugstr_w(lpApplicationId), hr); + return hr; +} /******************************************************************* * IGameStatistics implementation */ @@ -560,51 +618,16 @@ static HRESULT STDMETHODCALLTYPE GameStatisticsMgrImpl_GetGameStatistics( GAMESTATS_OPEN_RESULT *pOpenResult, IGameStatistics **ppiStats) { - 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; GameStatisticsImpl *statisticsImpl; 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; + hr = GAMEUX_getAppIdFromGDFPath(GDFBinaryPath, lpApplicationId); 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)); hr = create_IGameStatistics(&statisticsImpl); - } if(SUCCEEDED(hr)) { @@ -618,8 +641,6 @@ static HRESULT STDMETHODCALLTYPE GameStatisticsMgrImpl_GetGameStatistics( hr = E_NOTIMPL; } - HeapFree(GetProcessHeap(), 0, lpRegistryPath); - return hr; } @@ -627,8 +648,21 @@ static HRESULT STDMETHODCALLTYPE GameStatisticsMgrImpl_RemoveGameStatistics( IGameStatisticsMgr* iface, LPCWSTR GDFBinaryPath) { - FIXME("stub (%p, %s)\n", iface, debugstr_w(GDFBinaryPath)); - return E_NOTIMPL; + HRESULT hr; + WCHAR lpApplicationId[49]; + WCHAR sStatsFile[MAX_PATH]; + + TRACE("(%p, %s)\n", iface, debugstr_w(GDFBinaryPath)); + + hr = GAMEUX_getAppIdFromGDFPath(GDFBinaryPath, lpApplicationId); + + if(SUCCEEDED(hr)) + hr = GAMEUX_buildStatisticsFilePath(lpApplicationId, sStatsFile); + + if(SUCCEEDED(hr)) + hr = (DeleteFileW(sStatsFile)==TRUE ? S_OK : HRESULT_FROM_WIN32(GetLastError())); + + return hr; } static const struct IGameStatisticsMgrVtbl GameStatisticsMgrImplVtbl = diff --git a/dlls/gameux/tests/gamestatistics.c b/dlls/gameux/tests/gamestatistics.c index 759f6d5..29bfcf3 100644 --- a/dlls/gameux/tests/gamestatistics.c +++ b/dlls/gameux/tests/gamestatistics.c @@ -414,8 +414,8 @@ static void test_gamestatisticsmgr( void ) /* test of removing game statistics from underlying storage */ ok(_isFileExists(lpStatisticsFile) == TRUE, "statistics file %s does not exists\n", wine_dbgstr_w(lpStatisticsFile)); hr = IGameStatisticsMgr_RemoveGameStatistics(gsm, sExeName); - todo_wine ok(SUCCEEDED(hr), "cannot remove game statistics, error: 0x%x\n", hr); - todo_wine ok(_isFileExists(lpStatisticsFile) == FALSE, "statistics file %s still exists\n", wine_dbgstr_w(lpStatisticsFile)); + ok(SUCCEEDED(hr), "cannot remove game statistics, error: 0x%x\n", hr); + ok(_isFileExists(lpStatisticsFile) == FALSE, "statistics file %s still exists\n", wine_dbgstr_w(lpStatisticsFile)); } hr = IGameStatisticsMgr_Release(gsm);
1
0
0
0
Mariusz Pluciński : gameux: IGameStatistics:: Save initial implementation.
by Alexandre Julliard
27 Sep '10
27 Sep '10
Module: wine Branch: master Commit: ef3a1ab53a1b772d1efffd0ee6a40c057469f24d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ef3a1ab53a1b772d1efffd0ee…
Author: Mariusz Pluciński <vshader(a)gmail.com> Date: Sun Sep 26 15:02:43 2010 +0200 gameux: IGameStatistics::Save initial implementation. --- dlls/gameux/gamestatistics.c | 139 +++++++++++++++++++++++++++++++++++- dlls/gameux/tests/gamestatistics.c | 8 +- 2 files changed, 141 insertions(+), 6 deletions(-) diff --git a/dlls/gameux/gamestatistics.c b/dlls/gameux/gamestatistics.c index a4c88a4..83ee5cd 100644 --- a/dlls/gameux/gamestatistics.c +++ b/dlls/gameux/gamestatistics.c @@ -23,6 +23,9 @@ #include "ole2.h" #include "winreg.h" +#include "msxml2.h" +#include "shlwapi.h" +#include "shlobj.h" #include "gameux.h" #include "gameux_private.h" @@ -63,6 +66,124 @@ struct GAMEUX_STATS struct GAMEUX_STATS_CATEGORY categories[MAX_CATEGORIES]; }; /******************************************************************************* + * GAMEUX_createStatsDirectory + * + * Helper function, creates directory to store game statistics + * + * Parameters + * path [I] path to game statistics file. + * base directory of this file will + * be created if it doesn't exists + */ +static HRESULT GAMEUX_createStatsDirectory(LPCWSTR lpFilePath) +{ + HRESULT hr; + WCHAR lpDirectoryPath[MAX_PATH]; + LPCWSTR lpEnd; + + lpEnd = StrRChrW(lpFilePath, NULL, '\\'); + lstrcpynW(lpDirectoryPath, lpFilePath, lpEnd-lpFilePath+1); + + hr = HRESULT_FROM_WIN32(SHCreateDirectoryExW(NULL, lpDirectoryPath, NULL)); + + if(hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS) || + hr == HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)) + hr = S_FALSE; + + return hr; +} +/******************************************************************* + * GAMEUX_updateStatisticsFile + * + * Helper function updating data stored in statistics file + * + * Parameters: + * data [I] pointer to struct containing + * statistics data + */ +static HRESULT GAMEUX_updateStatisticsFile(struct GAMEUX_STATS *stats) +{ + static const WCHAR sStatistics[] = {'S','t','a','t','i','s','t','i','c','s',0}; + + HRESULT hr = S_OK; + IXMLDOMDocument *document; + IXMLDOMElement *root; + VARIANT vStatsFilePath; + BSTR bstrStatistics = NULL; + + TRACE("(%p)\n", stats); + + V_VT(&vStatsFilePath) = VT_BSTR; + V_BSTR(&vStatsFilePath) = SysAllocString(stats->sStatsFile); + if(!V_BSTR(&vStatsFilePath)) + hr = E_OUTOFMEMORY; + + if(SUCCEEDED(hr)) + hr = CoCreateInstance(&CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, + &IID_IXMLDOMDocument, (void**)&document); + + if(SUCCEEDED(hr)) + { + bstrStatistics = SysAllocString(sStatistics); + if(!bstrStatistics) + hr = E_OUTOFMEMORY; + } + + if(SUCCEEDED(hr)) + hr = IXMLDOMDocument_createElement(document, bstrStatistics, &root); + + FIXME("writing statistics not fully implemented\n"); + + TRACE("saving game statistics in %s file\n", debugstr_w(stats->sStatsFile)); + if(SUCCEEDED(hr)) + hr = GAMEUX_createStatsDirectory(stats->sStatsFile); + + if(SUCCEEDED(hr)) + hr = IXMLDOMDocument_save(document, vStatsFilePath); + + SysFreeString(V_BSTR(&vStatsFilePath)); + SysFreeString(bstrStatistics); + TRACE("ret=0x%x\n", hr); + return hr; +} +/******************************************************************************* + * GAMEUX_buildStatisticsFilePath + * Creates path to file contaning statistics of game with given id. + * + * Parameters: + * lpApplicationId [I] application id of game, + * as string + * lpStatisticsFile [O] array where path will be + * stored. It's size must be + * at least MAX_PATH + */ +static HRESULT GAMEUX_buildStatisticsFilePath( + LPCWSTR lpApplicationId, + LPWSTR lpStatisticsFile) +{ + static const WCHAR sBackslash[] = {'\\',0}; + static const WCHAR sStatisticsDir[] = {'\\','M','i','c','r','o','s','o','f','t', + '\\','W','i','n','d','o','w','s','\\','G','a','m','e','E','x','p', + 'l','o','r','e','r','\\','G','a','m','e','S','t','a','t','i','s', + 't','i','c','s',0}; + static const WCHAR sDotGamestats[] = {'.','g','a','m','e','s','t','a','t','s',0}; + + HRESULT hr; + + hr = SHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, lpStatisticsFile); + + if(SUCCEEDED(hr)) + { + lstrcatW(lpStatisticsFile, sStatisticsDir); + lstrcatW(lpStatisticsFile, lpApplicationId); + lstrcatW(lpStatisticsFile, sBackslash); + lstrcatW(lpStatisticsFile, lpApplicationId); + lstrcatW(lpStatisticsFile, sDotGamestats); + } + + return hr; +} +/******************************************************************* * IGameStatistics implementation */ typedef struct _GameStatisticsImpl @@ -299,8 +420,17 @@ static HRESULT WINAPI GameStatisticsImpl_Save( IGameStatistics *iface, BOOL trackChanges) { - FIXME("stub\n"); - return E_NOTIMPL; + GameStatisticsImpl *This = impl_from_IGameStatistics(iface); + HRESULT hr = S_OK; + + TRACE("(%p, %d)\n", This, trackChanges); + + if(trackChanges == TRUE) + FIXME("tracking changes not yet implemented\n"); + + hr = GAMEUX_updateStatisticsFile(&This->stats); + + return hr; } static HRESULT WINAPI GameStatisticsImpl_SetLastPlayedCategory( @@ -479,6 +609,11 @@ static HRESULT STDMETHODCALLTYPE GameStatisticsMgrImpl_GetGameStatistics( if(SUCCEEDED(hr)) { *ppiStats = IGameStatistics_from_impl(statisticsImpl); + hr = GAMEUX_buildStatisticsFilePath(lpApplicationId, statisticsImpl->stats.sStatsFile); + } + + if(SUCCEEDED(hr)) + { FIXME("loading game statistics not yet implemented\n"); hr = E_NOTIMPL; } diff --git a/dlls/gameux/tests/gamestatistics.c b/dlls/gameux/tests/gamestatistics.c index 491aecb..759f6d5 100644 --- a/dlls/gameux/tests/gamestatistics.c +++ b/dlls/gameux/tests/gamestatistics.c @@ -328,9 +328,9 @@ static void test_gamestatisticsmgr( void ) ok(_isFileExists(lpStatisticsFile) == FALSE, "statistics file %s already exists\n", wine_dbgstr_w(lpStatisticsFile)); - todo_wine ok(IGameStatistics_Save(gs, FALSE)==S_OK, "statistic saving failed\n"); + ok(IGameStatistics_Save(gs, FALSE)==S_OK, "statistic saving failed\n"); - todo_wine ok(_isFileExists(lpStatisticsFile) == TRUE, "statistics file %s does not exists\n", wine_dbgstr_w(lpStatisticsFile)); + 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 */ ok(IGameStatistics_SetCategoryTitle(gs, 0, sCategory0a)==S_OK, "setting category title failed: %s\n", wine_dbgstr_w(sCategory0a)); @@ -412,10 +412,10 @@ static void test_gamestatisticsmgr( void ) ok(SUCCEEDED(hr), "releasing IGameStatistics returned error: 0x%x\n", hr); /* test of removing game statistics from underlying storage */ - todo_wine ok(_isFileExists(lpStatisticsFile) == TRUE, "statistics file %s does not exists\n", wine_dbgstr_w(lpStatisticsFile)); + ok(_isFileExists(lpStatisticsFile) == TRUE, "statistics file %s does not exists\n", wine_dbgstr_w(lpStatisticsFile)); hr = IGameStatisticsMgr_RemoveGameStatistics(gsm, sExeName); todo_wine ok(SUCCEEDED(hr), "cannot remove game statistics, error: 0x%x\n", hr); - ok(_isFileExists(lpStatisticsFile) == FALSE, "statistics file %s still exists\n", wine_dbgstr_w(lpStatisticsFile)); + todo_wine ok(_isFileExists(lpStatisticsFile) == FALSE, "statistics file %s still exists\n", wine_dbgstr_w(lpStatisticsFile)); } hr = IGameStatisticsMgr_Release(gsm);
1
0
0
0
Mariusz Pluciński : gameux: Add implementation of IGameStatistics::SetStatistic.
by Alexandre Julliard
27 Sep '10
27 Sep '10
Module: wine Branch: master Commit: ce28a5f2621e7954241fa5df42d7c77ae47a2c39 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ce28a5f2621e7954241fa5df4…
Author: Mariusz Pluciński <vshader(a)gmail.com> Date: Sun Sep 26 15:00:40 2010 +0200 gameux: Add implementation of IGameStatistics::SetStatistic. --- dlls/gameux/gamestatistics.c | 44 ++++++++++++++++++++++++++++++++++- dlls/gameux/tests/gamestatistics.c | 26 ++++++++++---------- 2 files changed, 55 insertions(+), 15 deletions(-) diff --git a/dlls/gameux/gamestatistics.c b/dlls/gameux/gamestatistics.c index 67bfc08..a4c88a4 100644 --- a/dlls/gameux/gamestatistics.c +++ b/dlls/gameux/gamestatistics.c @@ -251,8 +251,48 @@ static HRESULT WINAPI GameStatisticsImpl_SetStatistic( LPCWSTR name, LPCWSTR value) { - FIXME("stub\n"); - return E_NOTIMPL; + HRESULT hr = S_OK; + DWORD dwNameLen, dwValueLen; + GameStatisticsImpl *This = impl_from_IGameStatistics(iface); + + TRACE("(%p, %d, %d, %s, %s)\n", This, categoryIndex, statIndex, + debugstr_w(name), debugstr_w(value)); + + if(!name) + return S_FALSE; + + if(categoryIndex >= MAX_CATEGORIES || statIndex >= MAX_STATS_PER_CATEGORY) + return E_INVALIDARG; + + dwNameLen = lstrlenW(name); + + if(dwNameLen > MAX_NAME_LENGTH) + { + hr = S_FALSE; + dwNameLen = MAX_NAME_LENGTH; + } + + lstrcpynW(This->stats.categories[categoryIndex].stats[statIndex].sName, + name, dwNameLen+1); + + if(value) + { + dwValueLen = lstrlenW(value); + + if(dwValueLen > MAX_VALUE_LENGTH) + { + hr = S_FALSE; + dwValueLen = MAX_VALUE_LENGTH; + } + + lstrcpynW(This->stats.categories[categoryIndex].stats[statIndex].sValue, + value, dwValueLen+1); + } + else + /* Windows allows to pass NULL as value */ + This->stats.categories[categoryIndex].stats[statIndex].sValue[0] = 0; + + return hr; } static HRESULT WINAPI GameStatisticsImpl_Save( diff --git a/dlls/gameux/tests/gamestatistics.c b/dlls/gameux/tests/gamestatistics.c index e62368a..491aecb 100644 --- a/dlls/gameux/tests/gamestatistics.c +++ b/dlls/gameux/tests/gamestatistics.c @@ -292,39 +292,39 @@ static void test_gamestatisticsmgr( void ) /* check what happen if any string is NULL */ hr = IGameStatistics_SetStatistic(gs, 0, 0, NULL, sValue00); - todo_wine ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%x)\n", hr); + ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%x)\n", hr); hr = IGameStatistics_SetStatistic(gs, 0, 0, sStatistic00, NULL); - todo_wine ok(hr == S_OK, "setting statistic returned unexpected value: 0x%x)\n", hr); + ok(hr == S_OK, "setting statistic returned unexpected value: 0x%x)\n", hr); /* check what happen if any string is too long */ sTooLongString = CoTaskMemAlloc(sizeof(WCHAR)*(uMaxNameLength+2)); memset(sTooLongString, 'a', sizeof(WCHAR)*(uMaxNameLength+1)); sTooLongString[uMaxNameLength+1]=0; hr = IGameStatistics_SetStatistic(gs, 0, 0, sTooLongString, sValue00); - todo_wine ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%x)\n", hr); + ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%x)\n", hr); CoTaskMemFree(sTooLongString); sTooLongString = CoTaskMemAlloc(sizeof(WCHAR)*(uMaxValueLength+2)); memset(sTooLongString, 'a', sizeof(WCHAR)*(uMaxValueLength+1)); sTooLongString[uMaxValueLength+1]=0; hr = IGameStatistics_SetStatistic(gs, 0, 0, sStatistic00, sTooLongString); - todo_wine ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%x)\n", hr); + ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%x)\n", hr); CoTaskMemFree(sTooLongString); /* check what happen on too big index of category or statistic */ hr = IGameStatistics_SetStatistic(gs, wMaxCategories, 0, sStatistic00, sValue00); - todo_wine ok(hr == E_INVALIDARG, "setting statistic returned unexpected value: 0x%x)\n", hr); + ok(hr == E_INVALIDARG, "setting statistic returned unexpected value: 0x%x)\n", hr); hr = IGameStatistics_SetStatistic(gs, 0, wMaxStatsPerCategory, sStatistic00, sValue00); - todo_wine ok(hr == E_INVALIDARG, "setting statistic returned unexpected value: 0x%x)\n", hr); - - todo_wine ok(IGameStatistics_SetStatistic(gs, 0, 0, sStatistic00, sValue00)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic00), wine_dbgstr_w(sValue00)); - todo_wine ok(IGameStatistics_SetStatistic(gs, 0, 1, sStatistic01, sValue01)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic01), wine_dbgstr_w(sValue01)); - todo_wine ok(IGameStatistics_SetStatistic(gs, 1, 0, sStatistic10, sValue10)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic10), wine_dbgstr_w(sValue10)); - todo_wine ok(IGameStatistics_SetStatistic(gs, 1, 1, sStatistic11, sValue11)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic11), wine_dbgstr_w(sValue11)); - todo_wine ok(IGameStatistics_SetStatistic(gs, 2, 0, sStatistic20, sValue20)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic20), wine_dbgstr_w(sValue20)); - todo_wine ok(IGameStatistics_SetStatistic(gs, 2, 1, sStatistic21, sValue21)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic21), wine_dbgstr_w(sValue21)); + ok(hr == E_INVALIDARG, "setting statistic returned unexpected value: 0x%x)\n", hr); + + ok(IGameStatistics_SetStatistic(gs, 0, 0, sStatistic00, sValue00)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic00), wine_dbgstr_w(sValue00)); + ok(IGameStatistics_SetStatistic(gs, 0, 1, sStatistic01, sValue01)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic01), wine_dbgstr_w(sValue01)); + ok(IGameStatistics_SetStatistic(gs, 1, 0, sStatistic10, sValue10)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic10), wine_dbgstr_w(sValue10)); + ok(IGameStatistics_SetStatistic(gs, 1, 1, sStatistic11, sValue11)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic11), wine_dbgstr_w(sValue11)); + ok(IGameStatistics_SetStatistic(gs, 2, 0, sStatistic20, sValue20)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic20), wine_dbgstr_w(sValue20)); + ok(IGameStatistics_SetStatistic(gs, 2, 1, sStatistic21, sValue21)==S_OK, "setting statistic failed: name=%s, value=%s\n", wine_dbgstr_w(sStatistic21), wine_dbgstr_w(sValue21)); ok(_isFileExists(lpStatisticsFile) == FALSE, "statistics file %s already exists\n", wine_dbgstr_w(lpStatisticsFile));
1
0
0
0
Mariusz Pluciński : gameux: Add implementation of IGameStatistics::SetCategoryTitle.
by Alexandre Julliard
27 Sep '10
27 Sep '10
Module: wine Branch: master Commit: 35692e40b113c950a8969ec1a438889332045d08 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=35692e40b113c950a8969ec1a…
Author: Mariusz Pluciński <vshader(a)gmail.com> Date: Sun Sep 26 15:17:41 2010 +0200 gameux: Add implementation of IGameStatistics::SetCategoryTitle. --- dlls/gameux/gamestatistics.c | 47 ++++++++++++++++++++++++++++++++++- dlls/gameux/tests/gamestatistics.c | 14 +++++----- 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/dlls/gameux/gamestatistics.c b/dlls/gameux/gamestatistics.c index 44cc04e..67bfc08 100644 --- a/dlls/gameux/gamestatistics.c +++ b/dlls/gameux/gamestatistics.c @@ -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( diff --git a/dlls/gameux/tests/gamestatistics.c b/dlls/gameux/tests/gamestatistics.c index 30e1fcd..e62368a 100644 --- a/dlls/gameux/tests/gamestatistics.c +++ b/dlls/gameux/tests/gamestatistics.c @@ -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);
1
0
0
0
Vincent Pelletier : msvcp90: Direct basic_string::operator=(char const *) to existing implementation.
by Alexandre Julliard
27 Sep '10
27 Sep '10
Module: wine Branch: master Commit: 6fa52cd37da936aff9b873bfd95b986f2fa6b0f4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6fa52cd37da936aff9b873bfd…
Author: Vincent Pelletier <plr.vincent(a)gmail.com> Date: Sat Sep 25 12:16:20 2010 +0200 msvcp90: Direct basic_string::operator=(char const *) to existing implementation. --- dlls/msvcp80/msvcp80.spec | 4 ++-- dlls/msvcp90/msvcp90.spec | 4 ++-- dlls/msvcp90/string.c | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/msvcp80/msvcp80.spec b/dlls/msvcp80/msvcp80.spec index eda3b7c..f05b53d 100644 --- a/dlls/msvcp80/msvcp80.spec +++ b/dlls/msvcp80/msvcp80.spec @@ -1382,8 +1382,8 @@ @ stub -arch=win64 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@AEBV01@@Z @ stub -arch=win32 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z @ stub -arch=win64 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@D@Z -@ stub -arch=win32 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z -@ stub -arch=win64 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z +@ thiscall -arch=win32 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z(ptr ptr) msvcp90.??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z +@ cdecl -arch=win64 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z(ptr ptr) msvcp90.??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z @ stub -arch=win32 ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV01@ABV01@@Z @ stub -arch=win64 ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV01@AEBV01@@Z @ stub -arch=win32 ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV01@G@Z diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec index d7f368a..9ed37ec 100644 --- a/dlls/msvcp90/msvcp90.spec +++ b/dlls/msvcp90/msvcp90.spec @@ -1384,8 +1384,8 @@ @ cdecl -arch=win64 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCP_basic_string_char_assign @ stub -arch=win32 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z @ stub -arch=win64 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@D@Z -@ stub -arch=win32 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z -@ stub -arch=win64 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z +@ thiscall -arch=win32 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z(ptr ptr) MSVCP_basic_string_char_assign_cstr +@ cdecl -arch=win64 ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z(ptr ptr) MSVCP_basic_string_char_assign_cstr @ stub -arch=win32 ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV01@ABV01@@Z @ stub -arch=win64 ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV01@AEBV01@@Z @ stub -arch=win32 ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV01@G@Z diff --git a/dlls/msvcp90/string.c b/dlls/msvcp90/string.c index fad3346..cc4ff1b 100644 --- a/dlls/msvcp90/string.c +++ b/dlls/msvcp90/string.c @@ -679,6 +679,8 @@ basic_string_char* __thiscall MSVCP_basic_string_char_assign_cstr_len( /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z */ /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD@Z */ +/* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z */ +/* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z */ DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_assign_cstr, 8) basic_string_char* __thiscall MSVCP_basic_string_char_assign_cstr( basic_string_char *this, const char *str)
1
0
0
0
Vitaly Perov : comdlg32: Add basic implementation of PrintDlgExA.
by Alexandre Julliard
27 Sep '10
27 Sep '10
Module: wine Branch: master Commit: dcef05b6f1efc9d43825e8f1de6c0e9ad06c8537 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dcef05b6f1efc9d43825e8f1d…
Author: Vitaly Perov <vitperov(a)etersoft.ru> Date: Thu Sep 23 15:53:21 2010 +0300 comdlg32: Add basic implementation of PrintDlgExA. --- dlls/comdlg32/printdlg.c | 89 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 85 insertions(+), 4 deletions(-) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index 0bb3a7b..05d9401 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -5,6 +5,7 @@ * Copyright 1996 Albrecht Kleine * Copyright 1999 Klaas van Gend * Copyright 2000 Huw D M Davies + * Copyright 2010 Vitaly Perov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -3752,14 +3753,94 @@ BOOL WINAPI PageSetupDlgW(LPPAGESETUPDLGW setupdlg) */ HRESULT WINAPI PrintDlgExA(LPPRINTDLGEXA lppd) { + DWORD ret = E_FAIL; + LPVOID ptr; - FIXME("(%p) stub\n", lppd); - if ((lppd == NULL) || (lppd->lStructSize != sizeof(PRINTDLGEXA))) { + FIXME("(%p) not fully implemented\n", lppd); + if ((lppd == NULL) || (lppd->lStructSize != sizeof(PRINTDLGEXA))) return E_INVALIDARG; - } - if (!IsWindow(lppd->hwndOwner)) { + if (!IsWindow(lppd->hwndOwner)) return E_HANDLE; + + if (lppd->Flags & PD_RETURNDEFAULT) + { + PRINTER_INFO_2A *pbuf; + DRIVER_INFO_2A *dbuf; + HANDLE hprn; + DWORD needed = 1024; + BOOL bRet; + + if (lppd->hDevMode || lppd->hDevNames) + { + WARN("hDevMode or hDevNames non-zero for PD_RETURNDEFAULT\n"); + COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); + return E_INVALIDARG; + } + if (!PRINTDLG_OpenDefaultPrinter(&hprn)) + { + WARN("Can't find default printer\n"); + COMDLG32_SetCommDlgExtendedError(PDERR_NODEFAULTPRN); + return E_FAIL; + } + + pbuf = HeapAlloc(GetProcessHeap(), 0, needed); + bRet = GetPrinterA(hprn, 2, (LPBYTE)pbuf, needed, &needed); + if (!bRet && (GetLastError() == ERROR_INSUFFICIENT_BUFFER)) + { + HeapFree(GetProcessHeap(), 0, pbuf); + pbuf = HeapAlloc(GetProcessHeap(), 0, needed); + bRet = GetPrinterA(hprn, 2, (LPBYTE)pbuf, needed, &needed); + } + if (!bRet) + { + HeapFree(GetProcessHeap(), 0, pbuf); + ClosePrinter(hprn); + return E_FAIL; + } + + needed = 1024; + dbuf = HeapAlloc(GetProcessHeap(), 0, needed); + bRet = GetPrinterDriverA(hprn, NULL, 3, (LPBYTE)dbuf, needed, &needed); + if (!bRet && (GetLastError() == ERROR_INSUFFICIENT_BUFFER)) + { + HeapFree(GetProcessHeap(), 0, dbuf); + dbuf = HeapAlloc(GetProcessHeap(), 0, needed); + bRet = GetPrinterDriverA(hprn, NULL, 3, (LPBYTE)dbuf, needed, &needed); + } + if (!bRet) + { + ERR("GetPrinterDriverА failed, last error %d, fix your config for printer %s!\n", + GetLastError(), pbuf->pPrinterName); + HeapFree(GetProcessHeap(), 0, dbuf); + HeapFree(GetProcessHeap(), 0, pbuf); + COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); + ClosePrinter(hprn); + return E_FAIL; + } + ClosePrinter(hprn); + + PRINTDLG_CreateDevNames(&(lppd->hDevNames), + dbuf->pDriverPath, + pbuf->pPrinterName, + pbuf->pPortName); + lppd->hDevMode = GlobalAlloc(GMEM_MOVEABLE, pbuf->pDevMode->dmSize + + pbuf->pDevMode->dmDriverExtra); + if (lppd->hDevMode) + { + ptr = GlobalLock(lppd->hDevMode); + if (ptr) + { + memcpy(ptr, pbuf->pDevMode, pbuf->pDevMode->dmSize + + pbuf->pDevMode->dmDriverExtra); + GlobalUnlock(lppd->hDevMode); + ret = S_OK; + } + } + HeapFree(GetProcessHeap(), 0, pbuf); + HeapFree(GetProcessHeap(), 0, dbuf); + + return ret; } return E_NOTIMPL;
1
0
0
0
Alexandre Julliard : kernel32/nls: Define the neutral and reading layout locale values.
by Alexandre Julliard
27 Sep '10
27 Sep '10
Module: wine Branch: master Commit: 5df625ff09d12c143e6657b22ead552a0642ab39 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5df625ff09d12c143e6657b22…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 27 14:09:41 2010 +0200 kernel32/nls: Define the neutral and reading layout locale values. --- dlls/kernel32/nls/afk.nls | 2 ++ dlls/kernel32/nls/ara.nls | 2 ++ dlls/kernel32/nls/arb.nls | 2 ++ dlls/kernel32/nls/are.nls | 2 ++ dlls/kernel32/nls/arg.nls | 2 ++ dlls/kernel32/nls/arh.nls | 2 ++ dlls/kernel32/nls/ari.nls | 2 ++ dlls/kernel32/nls/arj.nls | 2 ++ dlls/kernel32/nls/ark.nls | 2 ++ dlls/kernel32/nls/arl.nls | 2 ++ dlls/kernel32/nls/arm.nls | 2 ++ dlls/kernel32/nls/aro.nls | 2 ++ dlls/kernel32/nls/arq.nls | 2 ++ dlls/kernel32/nls/ars.nls | 2 ++ dlls/kernel32/nls/art.nls | 2 ++ dlls/kernel32/nls/aru.nls | 2 ++ dlls/kernel32/nls/ary.nls | 2 ++ dlls/kernel32/nls/aze.nls | 2 ++ dlls/kernel32/nls/azl.nls | 2 ++ dlls/kernel32/nls/bel.nls | 2 ++ dlls/kernel32/nls/bgr.nls | 2 ++ dlls/kernel32/nls/brf.nls | 2 ++ dlls/kernel32/nls/cat.nls | 2 ++ dlls/kernel32/nls/chs.nls | 2 ++ dlls/kernel32/nls/cht.nls | 2 ++ dlls/kernel32/nls/cor.nls | 2 ++ dlls/kernel32/nls/csy.nls | 2 ++ dlls/kernel32/nls/cym.nls | 2 ++ dlls/kernel32/nls/dan.nls | 2 ++ dlls/kernel32/nls/dea.nls | 2 ++ dlls/kernel32/nls/dec.nls | 2 ++ dlls/kernel32/nls/del.nls | 2 ++ dlls/kernel32/nls/des.nls | 2 ++ dlls/kernel32/nls/deu.nls | 2 ++ dlls/kernel32/nls/div.nls | 2 ++ dlls/kernel32/nls/ell.nls | 2 ++ dlls/kernel32/nls/ena.nls | 2 ++ dlls/kernel32/nls/enb.nls | 2 ++ dlls/kernel32/nls/enc.nls | 2 ++ dlls/kernel32/nls/eng.nls | 2 ++ dlls/kernel32/nls/eni.nls | 2 ++ dlls/kernel32/nls/enj.nls | 2 ++ dlls/kernel32/nls/enl.nls | 2 ++ dlls/kernel32/nls/enp.nls | 2 ++ dlls/kernel32/nls/ens.nls | 2 ++ dlls/kernel32/nls/ent.nls | 2 ++ dlls/kernel32/nls/enu.nls | 2 ++ dlls/kernel32/nls/enw.nls | 2 ++ dlls/kernel32/nls/enz.nls | 2 ++ dlls/kernel32/nls/eox.nls | 2 ++ dlls/kernel32/nls/esa.nls | 2 ++ dlls/kernel32/nls/esb.nls | 2 ++ dlls/kernel32/nls/esc.nls | 2 ++ dlls/kernel32/nls/esd.nls | 2 ++ dlls/kernel32/nls/ese.nls | 2 ++ dlls/kernel32/nls/esf.nls | 2 ++ dlls/kernel32/nls/esg.nls | 2 ++ dlls/kernel32/nls/esh.nls | 2 ++ dlls/kernel32/nls/esi.nls | 2 ++ dlls/kernel32/nls/esl.nls | 2 ++ dlls/kernel32/nls/esm.nls | 2 ++ dlls/kernel32/nls/esn.nls | 2 ++ dlls/kernel32/nls/eso.nls | 2 ++ dlls/kernel32/nls/esp.nls | 2 ++ dlls/kernel32/nls/esr.nls | 2 ++ dlls/kernel32/nls/ess.nls | 2 ++ dlls/kernel32/nls/esu.nls | 2 ++ dlls/kernel32/nls/esv.nls | 2 ++ dlls/kernel32/nls/esy.nls | 2 ++ dlls/kernel32/nls/esz.nls | 2 ++ dlls/kernel32/nls/eti.nls | 2 ++ dlls/kernel32/nls/euq.nls | 2 ++ dlls/kernel32/nls/far.nls | 2 ++ dlls/kernel32/nls/fin.nls | 2 ++ dlls/kernel32/nls/fos.nls | 2 ++ dlls/kernel32/nls/fra.nls | 2 ++ dlls/kernel32/nls/frb.nls | 2 ++ dlls/kernel32/nls/frc.nls | 2 ++ dlls/kernel32/nls/frl.nls | 2 ++ dlls/kernel32/nls/frm.nls | 2 ++ dlls/kernel32/nls/frs.nls | 2 ++ dlls/kernel32/nls/gae.nls | 2 ++ dlls/kernel32/nls/gdh.nls | 2 ++ dlls/kernel32/nls/gdv.nls | 2 ++ dlls/kernel32/nls/glc.nls | 2 ++ dlls/kernel32/nls/guj.nls | 2 ++ dlls/kernel32/nls/heb.nls | 2 ++ dlls/kernel32/nls/hin.nls | 2 ++ dlls/kernel32/nls/hrv.nls | 2 ++ dlls/kernel32/nls/hun.nls | 2 ++ dlls/kernel32/nls/hye.nls | 2 ++ dlls/kernel32/nls/ind.nls | 2 ++ dlls/kernel32/nls/isl.nls | 2 ++ dlls/kernel32/nls/ita.nls | 2 ++ dlls/kernel32/nls/its.nls | 2 ++ dlls/kernel32/nls/jpn.nls | 2 ++ dlls/kernel32/nls/kan.nls | 2 ++ dlls/kernel32/nls/kat.nls | 2 ++ dlls/kernel32/nls/kkz.nls | 2 ++ dlls/kernel32/nls/knk.nls | 2 ++ dlls/kernel32/nls/kor.nls | 2 ++ dlls/kernel32/nls/kyr.nls | 2 ++ dlls/kernel32/nls/lth.nls | 2 ++ dlls/kernel32/nls/lvi.nls | 2 ++ dlls/kernel32/nls/mar.nls | 2 ++ dlls/kernel32/nls/mki.nls | 2 ++ dlls/kernel32/nls/mon.nls | 2 ++ dlls/kernel32/nls/msb.nls | 2 ++ dlls/kernel32/nls/msl.nls | 2 ++ dlls/kernel32/nls/nlb.nls | 2 ++ dlls/kernel32/nls/nld.nls | 2 ++ dlls/kernel32/nls/nls.nls | 2 ++ dlls/kernel32/nls/non.nls | 2 ++ dlls/kernel32/nls/nor.nls | 2 ++ dlls/kernel32/nls/pan.nls | 2 ++ dlls/kernel32/nls/plk.nls | 2 ++ dlls/kernel32/nls/ptb.nls | 2 ++ dlls/kernel32/nls/ptg.nls | 2 ++ dlls/kernel32/nls/rmc.nls | 2 ++ dlls/kernel32/nls/rom.nls | 2 ++ dlls/kernel32/nls/rus.nls | 2 ++ dlls/kernel32/nls/san.nls | 2 ++ dlls/kernel32/nls/sky.nls | 2 ++ dlls/kernel32/nls/slv.nls | 2 ++ dlls/kernel32/nls/sqi.nls | 2 ++ dlls/kernel32/nls/srb.nls | 2 ++ dlls/kernel32/nls/srl.nls | 2 ++ dlls/kernel32/nls/sve.nls | 2 ++ dlls/kernel32/nls/svf.nls | 2 ++ dlls/kernel32/nls/swk.nls | 2 ++ dlls/kernel32/nls/syr.nls | 2 ++ dlls/kernel32/nls/tam.nls | 2 ++ dlls/kernel32/nls/tel.nls | 2 ++ dlls/kernel32/nls/tha.nls | 2 ++ dlls/kernel32/nls/trk.nls | 2 ++ dlls/kernel32/nls/ttt.nls | 2 ++ dlls/kernel32/nls/ukr.nls | 2 ++ dlls/kernel32/nls/urd.nls | 2 ++ dlls/kernel32/nls/uzb.nls | 2 ++ dlls/kernel32/nls/uzl.nls | 2 ++ dlls/kernel32/nls/vit.nls | 2 ++ dlls/kernel32/nls/wal.nls | 2 ++ dlls/kernel32/nls/zhh.nls | 2 ++ dlls/kernel32/nls/zhi.nls | 2 ++ dlls/kernel32/nls/zhm.nls | 2 ++ 145 files changed, 290 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5df625ff09d12c143e665…
1
0
0
0
Alexandre Julliard : kernel32: Implemented EnumSystemLocalesEx.
by Alexandre Julliard
27 Sep '10
27 Sep '10
Module: wine Branch: master Commit: 9f792ab3d56acdf38eaba06734667df001c976b7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9f792ab3d56acdf38eaba0673…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 27 14:03:12 2010 +0200 kernel32: Implemented EnumSystemLocalesEx. --- dlls/kernel32/kernel32.spec | 1 + dlls/kernel32/locale.c | 49 ++++++++++++++++++++++++++++++++++++++++++ dlls/kernel32/tests/locale.c | 49 +++++++++++++++++++++++++++-------------- include/winnls.h | 19 ++++++++++++++++ 4 files changed, 101 insertions(+), 17 deletions(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 43e339b..e4ce77e 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -324,6 +324,7 @@ @ stdcall EnumSystemLanguageGroupsA(ptr long ptr) @ stdcall EnumSystemLanguageGroupsW(ptr long ptr) @ stdcall EnumSystemLocalesA(ptr long) +@ stdcall EnumSystemLocalesEx(ptr long long ptr) @ stdcall EnumSystemLocalesW(ptr long) @ stdcall EnumTimeFormatsA(ptr long long) @ stdcall EnumTimeFormatsW(ptr long long) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 168bb19..927d058 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -2222,6 +2222,55 @@ BOOL WINAPI EnumSystemLocalesW( LOCALE_ENUMPROCW lpfnLocaleEnum, DWORD dwFlags ) } +struct enum_locale_ex_data +{ + LOCALE_ENUMPROCEX proc; + DWORD flags; + LPARAM lparam; +}; + +static BOOL CALLBACK enum_locale_ex_proc( HMODULE module, LPCWSTR type, + LPCWSTR name, WORD lang, LONG_PTR lparam ) +{ + struct enum_locale_ex_data *data = (struct enum_locale_ex_data *)lparam; + WCHAR buffer[256]; + DWORD neutral; + unsigned int flags; + + GetLocaleInfoW( MAKELCID( lang, SORT_DEFAULT ), LOCALE_SNAME | LOCALE_NOUSEROVERRIDE, + buffer, sizeof(buffer) / sizeof(WCHAR) ); + if (!GetLocaleInfoW( MAKELCID( lang, SORT_DEFAULT ), + LOCALE_INEUTRAL | LOCALE_NOUSEROVERRIDE | LOCALE_RETURN_NUMBER, + (LPWSTR)&neutral, sizeof(neutral) / sizeof(WCHAR) )) + neutral = 0; + flags = LOCALE_WINDOWS; + flags |= neutral ? LOCALE_NEUTRALDATA : LOCALE_SPECIFICDATA; + if (data->flags && ~(data->flags & flags)) return TRUE; + return data->proc( buffer, flags, data->lparam ); +} + +/****************************************************************************** + * EnumSystemLocalesEx (KERNEL32.@) + */ +BOOL WINAPI EnumSystemLocalesEx( LOCALE_ENUMPROCEX proc, DWORD flags, LPARAM lparam, LPVOID reserved ) +{ + struct enum_locale_ex_data data; + + if (reserved) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + data.proc = proc; + data.flags = flags; + data.lparam = lparam; + EnumResourceLanguagesW( kernel32_handle, (LPCWSTR)RT_STRING, + (LPCWSTR)MAKEINTRESOURCE((LOCALE_SNAME >> 4) + 1), + enum_locale_ex_proc, (LONG_PTR)&data ); + return TRUE; +} + + /*********************************************************************** * VerLanguageNameA (KERNEL32.@) * diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 9d6f7e4..34b5f00 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -67,23 +67,13 @@ static inline int isdigitW( WCHAR wc ) static HMODULE hKernel32; static WORD enumCount; -typedef BOOL (WINAPI *EnumSystemLanguageGroupsAFn)(LANGUAGEGROUP_ENUMPROC, - DWORD, LONG_PTR); -static EnumSystemLanguageGroupsAFn pEnumSystemLanguageGroupsA; -typedef BOOL (WINAPI *EnumLanguageGroupLocalesAFn)(LANGGROUPLOCALE_ENUMPROC, - LGRPID, DWORD, LONG_PTR); -static EnumLanguageGroupLocalesAFn pEnumLanguageGroupLocalesA; -typedef BOOL (WINAPI *EnumUILanguagesAFn)(UILANGUAGE_ENUMPROC, - DWORD, LONG_PTR); -static EnumUILanguagesAFn pEnumUILanguagesA; - -typedef INT (WINAPI *FoldStringAFn)(DWORD, LPCSTR, INT, LPSTR, INT); -static FoldStringAFn pFoldStringA; -typedef INT (WINAPI *FoldStringWFn)(DWORD, LPCWSTR, INT, LPWSTR, INT); -static FoldStringWFn pFoldStringW; - -typedef BOOL (WINAPI *IsValidLanguageGroupFn)(LGRPID, DWORD); -static IsValidLanguageGroupFn pIsValidLanguageGroup; +static BOOL (WINAPI *pEnumSystemLanguageGroupsA)(LANGUAGEGROUP_ENUMPROC, DWORD, LONG_PTR); +static BOOL (WINAPI *pEnumLanguageGroupLocalesA)(LANGGROUPLOCALE_ENUMPROC, LGRPID, DWORD, LONG_PTR); +static BOOL (WINAPI *pEnumUILanguagesA)(UILANGUAGE_ENUMPROC, DWORD, LONG_PTR); +static BOOL (WINAPI *pEnumSystemLocalesEx)(LOCALE_ENUMPROCEX, DWORD, LPARAM, LPVOID); +static INT (WINAPI *pFoldStringA)(DWORD, LPCSTR, INT, LPSTR, INT); +static INT (WINAPI *pFoldStringW)(DWORD, LPCWSTR, INT, LPWSTR, INT); +static BOOL (WINAPI *pIsValidLanguageGroup)(LGRPID, DWORD); static void InitFunctionPointers(void) { @@ -94,6 +84,7 @@ static void InitFunctionPointers(void) pFoldStringW = (void*)GetProcAddress(hKernel32, "FoldStringW"); pIsValidLanguageGroup = (void*)GetProcAddress(hKernel32, "IsValidLanguageGroup"); pEnumUILanguagesA = (void*)GetProcAddress(hKernel32, "EnumUILanguagesA"); + pEnumSystemLocalesEx = (void*)GetProcAddress(hKernel32, "EnumSystemLocalesEx"); } #define eq(received, expected, label, type) \ @@ -2346,6 +2337,29 @@ static void test_EnumSystemLanguageGroupsA(void) pEnumSystemLanguageGroupsA(langgrp_procA, LGRPID_SUPPORTED, 0); } +static BOOL CALLBACK enum_func( LPWSTR name, DWORD flags, LPARAM lparam ) +{ + trace( "%s %x\n", wine_dbgstr_w(name), flags ); + return TRUE; +} + +static void test_EnumSystemLocalesEx(void) +{ + BOOL ret; + + if (!pEnumSystemLocalesEx) + { + win_skip( "EnumSystemLocalesEx not available\n" ); + return; + } + SetLastError( 0xdeadbeef ); + ret = pEnumSystemLocalesEx( enum_func, LOCALE_ALL, 0, (void *)1 ); + ok( !ret, "should have failed\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pEnumSystemLocalesEx( enum_func, 0, 0, NULL ); + ok( ret, "failed err %u\n", GetLastError() ); +} static BOOL CALLBACK lgrplocale_procA(LGRPID lgrpid, LCID lcid, LPSTR lpszNum, LONG_PTR lParam) @@ -2801,6 +2815,7 @@ START_TEST(locale) test_FoldStringW(); test_ConvertDefaultLocale(); test_EnumSystemLanguageGroupsA(); + test_EnumSystemLocalesEx(); test_EnumLanguageGroupLocalesA(); test_SetLocaleInfoA(); test_EnumUILanguageA(); diff --git a/include/winnls.h b/include/winnls.h index b75e24a..279c944 100644 --- a/include/winnls.h +++ b/include/winnls.h @@ -150,6 +150,14 @@ extern "C" { #define LCID_SUPPORTED 0x2 #define LCID_ALTERNATE_SORTS 0x4 +#define LOCALE_ALL 0x00 +#define LOCALE_WINDOWS 0x01 +#define LOCALE_SUPPLEMENTAL 0x02 +#define LOCALE_ALTERNATE_SORTS 0x04 +#define LOCALE_REPLACEMENT 0x08 +#define LOCALE_NEUTRALDATA 0x10 +#define LOCALE_SPECIFICDATA 0x20 + /* Locale flags */ #define LOCALE_NOUSEROVERRIDE 0x80000000 #define LOCALE_USE_CP_ACP 0x40000000 @@ -279,6 +287,16 @@ extern "C" { #define LOCALE_SPARENT 0x006D #define LOCALE_SCONSOLEFALLBACKNAME 0x006E #define LOCALE_SLANGDISPLAYNAME 0x006F +#define LOCALE_IREADINGLAYOUT 0x0070 +#define LOCALE_INEUTRAL 0x0071 +#define LOCALE_INEGATIVEPERCENT 0x0074 +#define LOCALE_IPOSITIVEPERCENT 0x0075 +#define LOCALE_SPERCENT 0x0076 +#define LOCALE_SPERMILLE 0x0077 +#define LOCALE_SMONTHDAY 0x0078 +#define LOCALE_SSHORTTIME 0x0079 +#define LOCALE_SOPENTYPELANGUAGETAG 0X007A +#define LOCALE_SSORTLOCALE 0x007B #define LOCALE_IDEFAULTEBCDICCODEPAGE 0x1012 #define LOCALE_IPAPERSIZE 0x100A @@ -624,6 +642,7 @@ typedef BOOL (CALLBACK *LANGUAGEGROUP_ENUMPROCA)(LGRPID,LPSTR,LPSTR,DWORD,LON typedef BOOL (CALLBACK *LANGUAGEGROUP_ENUMPROCW)(LGRPID,LPWSTR,LPWSTR,DWORD,LONG_PTR); typedef BOOL (CALLBACK *LOCALE_ENUMPROCA)(LPSTR); typedef BOOL (CALLBACK *LOCALE_ENUMPROCW)(LPWSTR); +typedef BOOL (CALLBACK *LOCALE_ENUMPROCEX)(LPWSTR, DWORD, LPARAM); typedef BOOL (CALLBACK *TIMEFMT_ENUMPROCA)(LPSTR); typedef BOOL (CALLBACK *TIMEFMT_ENUMPROCW)(LPWSTR); typedef BOOL (CALLBACK *UILANGUAGE_ENUMPROCA)(LPSTR,LONG_PTR);
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
18
...
86
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Results per page:
10
25
50
100
200