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
April 2015
----- 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
451 discussions
Start a n
N
ew thread
Nikolay Sivov : shell32: Remove a couple of redundant lines.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: 1d3d0865608e16f5cdd651462677601e9f42222f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1d3d0865608e16f5cdd651462…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Apr 7 12:41:28 2015 +0300 shell32: Remove a couple of redundant lines. --- dlls/shell32/shellitem.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c index 9eb675a..d8cb6a8 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -1121,12 +1121,8 @@ static HRESULT WINAPI IShellItemArray_fnEnumItems(IShellItemArray *iface, IEnumShellItems **ppenumShellItems) { IShellItemArrayImpl *This = impl_from_IShellItemArray(iface); - HRESULT hr; TRACE("%p (%p)\n", This, ppenumShellItems); - - hr = IEnumShellItems_Constructor(iface, ppenumShellItems); - - return hr; + return IEnumShellItems_Constructor(iface, ppenumShellItems); } static const IShellItemArrayVtbl vt_IShellItemArray = {
1
0
0
0
Nikolay Sivov : shell32: Cleanup item array creation code.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: d19790840fac1b587f7528bd51c4e0950a8a715a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d19790840fac1b587f7528bd5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Apr 7 12:37:27 2015 +0300 shell32: Cleanup item array creation code. --- dlls/shell32/shellitem.c | 78 +++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 48 deletions(-) diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c index f8b083f..9eb675a 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -1142,29 +1142,31 @@ static const IShellItemArrayVtbl vt_IShellItemArray = { IShellItemArray_fnEnumItems }; -static HRESULT IShellItemArray_Constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv) +/* Caller is responsible to AddRef all items */ +static HRESULT create_shellitemarray(IShellItem **items, DWORD count, IShellItemArray **ret) { IShellItemArrayImpl *This; - HRESULT ret; - - TRACE("(%p, %s, %p)\n",pUnkOuter, debugstr_guid(riid), ppv); - if(pUnkOuter) - return CLASS_E_NOAGGREGATION; + TRACE("(%p, %d, %p)\n", items, count, ret); This = HeapAlloc(GetProcessHeap(), 0, sizeof(IShellItemArrayImpl)); if(!This) return E_OUTOFMEMORY; - This->ref = 1; This->IShellItemArray_iface.lpVtbl = &vt_IShellItemArray; - This->array = NULL; - This->item_count = 0; + This->ref = 1; - ret = IShellItemArray_QueryInterface(&This->IShellItemArray_iface, riid, ppv); - IShellItemArray_Release(&This->IShellItemArray_iface); + This->array = HeapAlloc(GetProcessHeap(), 0, count*sizeof(IShellItem*)); + if (!This->array) + { + HeapFree(GetProcessHeap(), 0, This); + return E_OUTOFMEMORY; + } + memcpy(This->array, items, count*sizeof(IShellItem*)); + This->item_count = count; - return ret; + *ret = &This->IShellItemArray_iface; + return S_OK; } HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, @@ -1173,13 +1175,14 @@ HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, PCUITEMID_CHILD_ARRAY ppidl, IShellItemArray **ppsiItemArray) { - IShellItemArrayImpl *This; IShellItem **array; HRESULT ret = E_FAIL; UINT i; TRACE("%p, %p, %d, %p, %p\n", pidlParent, psf, cidl, ppidl, ppsiItemArray); + *ppsiItemArray = NULL; + if(!pidlParent && !psf) return E_POINTER; @@ -1198,52 +1201,37 @@ HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, if(SUCCEEDED(ret)) { - ret = IShellItemArray_Constructor(NULL, &IID_IShellItemArray, (void**)&This); + ret = create_shellitemarray(array, cidl, ppsiItemArray); if(SUCCEEDED(ret)) - { - This->array = array; - This->item_count = cidl; - *ppsiItemArray = &This->IShellItemArray_iface; - return ret; - } } /* Something failed, clean up. */ for(i = 0; i < cidl; i++) if(array[i]) IShellItem_Release(array[i]); HeapFree(GetProcessHeap(), 0, array); - *ppsiItemArray = NULL; return ret; } -HRESULT WINAPI SHCreateShellItemArrayFromShellItem(IShellItem *psi, REFIID riid, void **ppv) +HRESULT WINAPI SHCreateShellItemArrayFromShellItem(IShellItem *item, REFIID riid, void **ppv) { - IShellItemArrayImpl *This; - IShellItem **array; + IShellItemArray *array; HRESULT ret; - TRACE("%p, %s, %p\n", psi, shdebugstr_guid(riid), ppv); + TRACE("%p, %s, %p\n", item, shdebugstr_guid(riid), ppv); - array = HeapAlloc(GetProcessHeap(), 0, sizeof(IShellItem*)); - if(!array) - return E_OUTOFMEMORY; + *ppv = NULL; - ret = IShellItemArray_Constructor(NULL, riid, (void**)&This); - if(SUCCEEDED(ret)) - { - array[0] = psi; - IShellItem_AddRef(psi); - This->array = array; - This->item_count = 1; - *ppv = This; - } - else + IShellItem_AddRef(item); + ret = create_shellitemarray(&item, 1, &array); + if(FAILED(ret)) { - HeapFree(GetProcessHeap(), 0, array); - *ppv = NULL; + IShellItem_Release(item); + return ret; } + ret = IShellItemArray_QueryInterface(array, riid, ppv); + IShellItemArray_Release(array); return ret; } @@ -1303,7 +1291,6 @@ HRESULT WINAPI SHCreateShellItemArrayFromIDLists(UINT cidl, PCIDLIST_ABSOLUTE_ARRAY pidl_array, IShellItemArray **psia) { - IShellItemArrayImpl *This; IShellItem **array; HRESULT ret; UINT i; @@ -1327,14 +1314,9 @@ HRESULT WINAPI SHCreateShellItemArrayFromIDLists(UINT cidl, if(SUCCEEDED(ret)) { - ret = IShellItemArray_Constructor(NULL, &IID_IShellItemArray, (void**)psia); + ret = create_shellitemarray(array, cidl, psia); if(SUCCEEDED(ret)) - { - This = impl_from_IShellItemArray(*psia); - This->array = array; - This->item_count = cidl; - return S_OK; - } + return ret; } for(i = 0; i < cidl; i++)
1
0
0
0
Nikolay Sivov : shell32: Fix allocation size (Valgrind).
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: 47f8dbcb3669de7a04420b80737682ec0e69cbd6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47f8dbcb3669de7a04420b807…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Apr 7 12:01:17 2015 +0300 shell32: Fix allocation size (Valgrind). --- dlls/shell32/shellitem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c index b1cae7e..f8b083f 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -1314,7 +1314,7 @@ HRESULT WINAPI SHCreateShellItemArrayFromIDLists(UINT cidl, if(cidl == 0) return E_INVALIDARG; - array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellItem*)); + array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cidl*sizeof(IShellItem*)); if(!array) return E_OUTOFMEMORY;
1
0
0
0
Marcus Meissner : d3drm: Avoid potential double free (Coverity).
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: 369cf7118bc074b7bff449c62eaea0b82fa3b715 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=369cf7118bc074b7bff449c62…
Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Tue Apr 7 07:31:34 2015 +0200 d3drm: Avoid potential double free (Coverity). --- dlls/d3drm/meshbuilder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/d3drm/meshbuilder.c b/dlls/d3drm/meshbuilder.c index b3c5dbf..e4d6d86 100644 --- a/dlls/d3drm/meshbuilder.c +++ b/dlls/d3drm/meshbuilder.c @@ -356,7 +356,9 @@ static void clean_mesh_builder_data(struct d3drm_mesh_builder *mesh_builder) } mesh_builder->nb_materials = 0; HeapFree(GetProcessHeap(), 0, mesh_builder->materials); + mesh_builder->materials = NULL; HeapFree(GetProcessHeap(), 0, mesh_builder->material_indices); + mesh_builder->material_indices = NULL; } static HRESULT WINAPI d3drm_mesh_builder2_QueryInterface(IDirect3DRMMeshBuilder2 *iface, REFIID riid, void **out)
1
0
0
0
Marcus Meissner : comctl32: Avoid integer overflow (Coverity).
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: b4ec41220306a3504a7bbcf815bf802c7f4a37b2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b4ec41220306a3504a7bbcf81…
Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Tue Apr 7 07:09:28 2015 +0200 comctl32: Avoid integer overflow (Coverity). --- dlls/comctl32/dsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/comctl32/dsa.c b/dlls/comctl32/dsa.c index 32f9926..a73a54a 100644 --- a/dlls/comctl32/dsa.c +++ b/dlls/comctl32/dsa.c @@ -488,5 +488,5 @@ ULONGLONG WINAPI DSA_GetSize(HDSA hdsa) if (!hdsa) return 0; - return sizeof(*hdsa) + hdsa->nMaxCount*hdsa->nItemSize; + return sizeof(*hdsa) + (ULONGLONG)hdsa->nMaxCount*hdsa->nItemSize; }
1
0
0
0
Sebastian Lackner : kernel32: Add stub for PowerClearRequest.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: 4ae0ef44d2c2634d9d580a526c2a64ddd41bd61d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4ae0ef44d2c2634d9d580a526…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Tue Apr 7 03:19:41 2015 +0200 kernel32: Add stub for PowerClearRequest. --- dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/powermgnt.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 6e28b90..bb72041 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1134,7 +1134,7 @@ @ stdcall PeekConsoleInputW(ptr ptr long ptr) @ stdcall PeekNamedPipe(long ptr long ptr ptr ptr) @ stdcall PostQueuedCompletionStatus(long long ptr ptr) -# @ stub PowerClearRequest +@ stdcall PowerClearRequest(long long) @ stdcall PowerCreateRequest(ptr) @ stdcall PowerSetRequest(long long) @ stdcall PrepareTape(ptr long long) diff --git a/dlls/kernel32/powermgnt.c b/dlls/kernel32/powermgnt.c index 43e086e..b5bd0d9 100644 --- a/dlls/kernel32/powermgnt.c +++ b/dlls/kernel32/powermgnt.c @@ -122,3 +122,14 @@ BOOL WINAPI PowerSetRequest(HANDLE request, POWER_REQUEST_TYPE type) SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } + +/*********************************************************************** + * PowerClearRequest (KERNEL32.@) + */ +BOOL WINAPI PowerClearRequest(HANDLE request, POWER_REQUEST_TYPE type) +{ + FIXME("(%p, %u): stub\n", request, type); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +}
1
0
0
0
Sebastian Lackner : kernel32: Add stub for PowerSetRequest.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: 25505995aff73a62cde60353269ec7aaa6c86c4f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=25505995aff73a62cde603532…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Tue Apr 7 03:18:58 2015 +0200 kernel32: Add stub for PowerSetRequest. --- dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/powermgnt.c | 11 +++++++++++ include/winbase.h | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 5258819..6e28b90 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1136,7 +1136,7 @@ @ stdcall PostQueuedCompletionStatus(long long ptr ptr) # @ stub PowerClearRequest @ stdcall PowerCreateRequest(ptr) -# @ stub PowerSetRequest +@ stdcall PowerSetRequest(long long) @ stdcall PrepareTape(ptr long long) @ stub PrivCopyFileExW @ stub PrivMoveFileIdentityW diff --git a/dlls/kernel32/powermgnt.c b/dlls/kernel32/powermgnt.c index 74ec397..43e086e 100644 --- a/dlls/kernel32/powermgnt.c +++ b/dlls/kernel32/powermgnt.c @@ -111,3 +111,14 @@ HANDLE WINAPI PowerCreateRequest(REASON_CONTEXT *context) SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return INVALID_HANDLE_VALUE; } + +/*********************************************************************** + * PowerSetRequest (KERNEL32.@) + */ +BOOL WINAPI PowerSetRequest(HANDLE request, POWER_REQUEST_TYPE type) +{ + FIXME("(%p, %u): stub\n", request, type); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} diff --git a/include/winbase.h b/include/winbase.h index 82220c2..f845082 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -865,6 +865,12 @@ typedef struct _SYSTEM_POWER_STATUS DWORD BatteryFullLifeTime; } SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS; +typedef enum _POWER_REQUEST_TYPE +{ + PowerRequestDisplayRequired, + PowerRequestSystemRequired, + PowerRequestAwayModeRequired +} POWER_REQUEST_TYPE, *PPOWER_REQUEST_TYPE; typedef struct _SYSTEM_INFO {
1
0
0
0
Sebastian Lackner : kernel32: Add stub for PowerCreateRequest.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: 966dd5074dd51cc56afb4859de471ab144ae6750 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=966dd5074dd51cc56afb4859d…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sun Mar 15 01:44:12 2015 +0100 kernel32: Add stub for PowerCreateRequest. --- dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/powermgnt.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 130affc..5258819 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1135,7 +1135,7 @@ @ stdcall PeekNamedPipe(long ptr long ptr ptr ptr) @ stdcall PostQueuedCompletionStatus(long long ptr ptr) # @ stub PowerClearRequest -# @ stub PowerCreateRequest +@ stdcall PowerCreateRequest(ptr) # @ stub PowerSetRequest @ stdcall PrepareTape(ptr long long) @ stub PrivCopyFileExW diff --git a/dlls/kernel32/powermgnt.c b/dlls/kernel32/powermgnt.c index 6d4336d..74ec397 100644 --- a/dlls/kernel32/powermgnt.c +++ b/dlls/kernel32/powermgnt.c @@ -100,3 +100,14 @@ EXECUTION_STATE WINAPI SetThreadExecutionState(EXECUTION_STATE flags) current = flags; return old; } + +/*********************************************************************** + * PowerCreateRequest (KERNEL32.@) + */ +HANDLE WINAPI PowerCreateRequest(REASON_CONTEXT *context) +{ + FIXME("(%p): stub\n", context); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return INVALID_HANDLE_VALUE; +}
1
0
0
0
Sebastian Lackner : user32: Invalidate key state cache globally after running LL hooks.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: d3be42ab96cf8925bb2abd5c26b8ffa67c8b910c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d3be42ab96cf8925bb2abd5c2…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Tue Apr 7 02:53:06 2015 +0200 user32: Invalidate key state cache globally after running LL hooks. --- dlls/user32/hook.c | 5 +---- dlls/user32/input.c | 9 ++++++++- dlls/user32/message.c | 7 ++++++- dlls/user32/user_private.h | 3 +++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/dlls/user32/hook.c b/dlls/user32/hook.c index f19949c..281b88e 100644 --- a/dlls/user32/hook.c +++ b/dlls/user32/hook.c @@ -437,10 +437,7 @@ static LRESULT call_hook( struct hook_info *info, INT code, WPARAM wparam, LPARA } if (info->id == WH_KEYBOARD_LL || info->id == WH_MOUSE_LL) - { - struct user_key_state_info *key_state_info = get_user_thread_info()->key_state; - if (key_state_info) key_state_info->time = 0; /* force refreshing the key state cache */ - } + interlocked_xchg_add( &global_key_state_counter, 1 ); /* force refreshing the key state cache */ return ret; } diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 6ea2c2f..57594a7 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -52,6 +52,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(win); WINE_DECLARE_DEBUG_CHANNEL(keyboard); +INT global_key_state_counter = 0; /*********************************************************************** * get_key_state @@ -369,6 +370,7 @@ static void check_for_events( UINT flags ) SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) { struct user_key_state_info *key_state_info = get_user_thread_info()->key_state; + INT counter = global_key_state_counter; SHORT ret; if (key < 0 || key >= 256) return 0; @@ -379,6 +381,7 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) { if (key_state_info && !(key_state_info->state[key] & 0xc0) && + key_state_info->counter == counter && GetTickCount() - key_state_info->time < 50) { /* use cached value */ @@ -401,7 +404,11 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) { if (reply->state & 0x40) ret |= 0x0001; if (reply->state & 0x80) ret |= 0x8000; - if (key_state_info) key_state_info->time = GetTickCount(); + if (key_state_info) + { + key_state_info->time = GetTickCount(); + key_state_info->counter = counter; + } } } SERVER_END_REQ; diff --git a/dlls/user32/message.c b/dlls/user32/message.c index fbc11da..2b544de 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -3293,6 +3293,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) struct user_key_state_info *key_state_info = get_user_thread_info()->key_state; struct send_message_info info; int prev_x, prev_y, new_x, new_y; + INT counter = global_key_state_counter; NTSTATUS ret; BOOL wait; @@ -3342,7 +3343,11 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) if (!ret) { - if (key_state_info) key_state_info->time = GetTickCount(); + if (key_state_info) + { + key_state_info->time = GetTickCount(); + key_state_info->counter = counter; + } if ((flags & SEND_HWMSG_INJECTED) && (prev_x != new_x || prev_y != new_y)) USER_Driver->pSetCursorPos( new_x, new_y ); } diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index 9e3a373..445fd40 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -192,9 +192,12 @@ struct user_thread_info C_ASSERT( sizeof(struct user_thread_info) <= sizeof(((TEB *)0)->Win32ClientInfo) ); +extern INT global_key_state_counter DECLSPEC_HIDDEN; + struct user_key_state_info { UINT time; /* Time of last key state refresh */ + INT counter; /* Counter to invalidate the key state */ BYTE state[256]; /* State for each key */ };
1
0
0
0
Sebastian Lackner : user32: Move key state cache into a separate struct.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: 325c061bbd6fcd7ebaa60e62a69e52b000b61cdd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=325c061bbd6fcd7ebaa60e62a…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Tue Apr 7 02:33:28 2015 +0200 user32: Move key state cache into a separate struct. --- dlls/user32/hook.c | 5 ++++- dlls/user32/input.c | 23 +++++++++++++++-------- dlls/user32/message.c | 7 ++++--- dlls/user32/user_private.h | 9 +++++++-- dlls/user32/winstation.c | 3 ++- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/dlls/user32/hook.c b/dlls/user32/hook.c index 2f6b42c..f19949c 100644 --- a/dlls/user32/hook.c +++ b/dlls/user32/hook.c @@ -437,7 +437,10 @@ static LRESULT call_hook( struct hook_info *info, INT code, WPARAM wparam, LPARA } if (info->id == WH_KEYBOARD_LL || info->id == WH_MOUSE_LL) - get_user_thread_info()->key_state_time = 0; /* force refreshing the key state cache */ + { + struct user_key_state_info *key_state_info = get_user_thread_info()->key_state; + if (key_state_info) key_state_info->time = 0; /* force refreshing the key state cache */ + } return ret; } diff --git a/dlls/user32/input.c b/dlls/user32/input.c index b6eecbe..6ea2c2f 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -368,7 +368,7 @@ static void check_for_events( UINT flags ) */ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) { - struct user_thread_info *thread_info = get_user_thread_info(); + struct user_key_state_info *key_state_info = get_user_thread_info()->key_state; SHORT ret; if (key < 0 || key >= 256) return 0; @@ -377,24 +377,31 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key ) if ((ret = USER_Driver->pGetAsyncKeyState( key )) == -1) { - if (thread_info->key_state && - !(thread_info->key_state[key] & 0xc0) && - GetTickCount() - thread_info->key_state_time < 50) + if (key_state_info && + !(key_state_info->state[key] & 0xc0) && + GetTickCount() - key_state_info->time < 50) + { + /* use cached value */ return 0; - - if (!thread_info->key_state) thread_info->key_state = HeapAlloc( GetProcessHeap(), 0, 256 ); + } + else if (!key_state_info) + { + key_state_info = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*key_state_info) ); + get_user_thread_info()->key_state = key_state_info; + } ret = 0; SERVER_START_REQ( get_key_state ) { req->tid = 0; req->key = key; - if (thread_info->key_state) wine_server_set_reply( req, thread_info->key_state, 256 ); + if (key_state_info) wine_server_set_reply( req, key_state_info->state, + sizeof(key_state_info->state) ); if (!wine_server_call( req )) { if (reply->state & 0x40) ret |= 0x0001; if (reply->state & 0x80) ret |= 0x8000; - thread_info->key_state_time = GetTickCount(); + if (key_state_info) key_state_info->time = GetTickCount(); } } SERVER_END_REQ; diff --git a/dlls/user32/message.c b/dlls/user32/message.c index eac4e4d..fbc11da 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -3290,7 +3290,7 @@ static BOOL send_message( struct send_message_info *info, DWORD_PTR *res_ptr, BO */ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) { - struct user_thread_info *thread_info = get_user_thread_info(); + struct user_key_state_info *key_state_info = get_user_thread_info()->key_state; struct send_message_info info; int prev_x, prev_y, new_x, new_y; NTSTATUS ret; @@ -3329,7 +3329,8 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) req->input.hw.lparam = MAKELONG( input->u.hi.wParamL, input->u.hi.wParamH ); break; } - if (thread_info->key_state) wine_server_set_reply( req, thread_info->key_state, 256 ); + if (key_state_info) wine_server_set_reply( req, key_state_info->state, + sizeof(key_state_info->state) ); ret = wine_server_call( req ); wait = reply->wait; prev_x = reply->prev_x; @@ -3341,7 +3342,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) if (!ret) { - if (thread_info->key_state) thread_info->key_state_time = GetTickCount(); + if (key_state_info) key_state_info->time = GetTickCount(); if ((flags & SEND_HWMSG_INJECTED) && (prev_x != new_x || prev_y != new_y)) USER_Driver->pSetCursorPos( new_x, new_y ); } diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index 919540d..9e3a373 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -184,8 +184,7 @@ struct user_thread_info DWORD GetMessagePosVal; /* Value for GetMessagePos */ ULONG_PTR GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */ UINT active_hooks; /* Bitmap of active hooks */ - UINT key_state_time; /* Time of last key state refresh */ - BYTE *key_state; /* Cache of global key state */ + struct user_key_state_info *key_state; /* Cache of global key state */ HWND top_window; /* Desktop window */ HWND msg_window; /* HWND_MESSAGE parent window */ RAWINPUT *rawinput; @@ -193,6 +192,12 @@ struct user_thread_info C_ASSERT( sizeof(struct user_thread_info) <= sizeof(((TEB *)0)->Win32ClientInfo) ); +struct user_key_state_info +{ + UINT time; /* Time of last key state refresh */ + BYTE state[256]; /* State for each key */ +}; + struct hook_extra_info { HHOOK handle; diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c index 12b9edc..d1353b4 100644 --- a/dlls/user32/winstation.c +++ b/dlls/user32/winstation.c @@ -399,9 +399,10 @@ BOOL WINAPI SetThreadDesktop( HDESK handle ) if (ret) /* reset the desktop windows */ { struct user_thread_info *thread_info = get_user_thread_info(); + struct user_key_state_info *key_state_info = thread_info->key_state; thread_info->top_window = 0; thread_info->msg_window = 0; - thread_info->key_state_time = 0; + if (key_state_info) key_state_info->time = 0; } return ret; }
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
46
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
Results per page:
10
25
50
100
200