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
August 2022
----- 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
1 participants
596 discussions
Start a n
N
ew thread
Angelo Haller : comctl32/listview: Send LVN_ODSTATECHANGED notification for LVS_OWNERDATA listview on selection changes.
by Alexandre Julliard
08 Aug '22
08 Aug '22
Module: wine Branch: master Commit: c73290154297e037d2f9181eba01759e1e13965f URL:
https://gitlab.winehq.org/wine/wine/-/commit/c73290154297e037d2f9181eba0175…
Author: Angelo Haller <angelo(a)szanni.org> Date: Tue Jun 28 16:16:10 2022 -0500 comctl32/listview: Send LVN_ODSTATECHANGED notification for LVS_OWNERDATA listview on selection changes. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52534
Signed-off-by: Angelo Haller <angelo(a)szanni.org> --- dlls/comctl32/listview.c | 16 ++++++++++++---- dlls/comctl32/tests/listview.c | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index bf22a90e987..e48b1fa2847 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -3610,6 +3610,7 @@ static BOOL LISTVIEW_AddGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) */ static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) { + INT nFirst = -1, nLast = -1; RANGES selection; DWORD old_mask; LVITEMW item; @@ -3661,21 +3662,28 @@ static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) iterator_destroy(&i); } - /* disable per item notifications on LVS_OWNERDATA style - FIXME: single LVN_ODSTATECHANGED should be used */ + /* Disable per item notifications on LVS_OWNERDATA style */ old_mask = infoPtr->notify_mask & NOTIFY_MASK_ITEM_CHANGE; if (infoPtr->dwStyle & LVS_OWNERDATA) infoPtr->notify_mask &= ~NOTIFY_MASK_ITEM_CHANGE; LISTVIEW_DeselectAllSkipItems(infoPtr, selection); - iterator_rangesitems(&i, selection); while(iterator_next(&i)) - LISTVIEW_SetItemState(infoPtr, i.nItem, &item); + { + /* Find the range for LVN_ODSTATECHANGED */ + if (nFirst == -1) + nFirst = i.nItem; + nLast = i.nItem; + LISTVIEW_SetItemState(infoPtr, i.nItem, &item); + } /* this will also destroy the selection */ iterator_destroy(&i); + if (infoPtr->dwStyle & LVS_OWNERDATA) + LISTVIEW_SetOwnerDataState(infoPtr, nFirst, nLast, &item); + infoPtr->notify_mask |= old_mask; LISTVIEW_SetItemFocus(infoPtr, nItem); } diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index ed5222a5ee8..fec1a83de4d 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -3577,7 +3577,7 @@ static void test_ownerdata_multiselect(void) ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX, ownerdata_multiselect_odstatechanged_seq, - "ownerdata select multiple notification", TRUE); + "ownerdata select multiple notification", FALSE); res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0); expect(0, res); @@ -3594,7 +3594,7 @@ static void test_ownerdata_multiselect(void) ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX, ownerdata_multiselect_odstatechanged_seq, - "ownerdata select multiple notification", TRUE); + "ownerdata select multiple notification", FALSE); res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0); expect(0, res);
1
0
0
0
Angelo Haller : comctl32/listview: Send LVN_ODSTATECHANGED only for LVS_OWNERDATA listviews.
by Alexandre Julliard
08 Aug '22
08 Aug '22
Module: wine Branch: master Commit: 6c814f81aa3ab1ffdc27837c6b0d7a2c9b445316 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6c814f81aa3ab1ffdc27837c6b0d7a…
Author: Angelo Haller <angelo(a)szanni.org> Date: Tue Jun 28 16:16:09 2022 -0500 comctl32/listview: Send LVN_ODSTATECHANGED only for LVS_OWNERDATA listviews. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53123
Signed-off-by: Angelo Haller <angelo(a)szanni.org> --- dlls/comctl32/listview.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index a12b19b8083..bf22a90e987 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -3587,7 +3587,8 @@ static BOOL LISTVIEW_AddGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) for (i = nFirst; i <= nLast; i++) LISTVIEW_SetItemState(infoPtr,i,&item); - LISTVIEW_SetOwnerDataState(infoPtr, nFirst, nLast, &item); + if (infoPtr->dwStyle & LVS_OWNERDATA) + LISTVIEW_SetOwnerDataState(infoPtr, nFirst, nLast, &item); if (!IsWindow(hwndSelf)) return FALSE;
1
0
0
0
Angelo Haller : comctl32/listview: Move sending LVN_ODSTATECHANGED notifications to a function.
by Alexandre Julliard
08 Aug '22
08 Aug '22
Module: wine Branch: master Commit: 425fd8f80e23e34667697f7032d002da8d10a352 URL:
https://gitlab.winehq.org/wine/wine/-/commit/425fd8f80e23e34667697f7032d002…
Author: Angelo Haller <angelo(a)szanni.org> Date: Tue Jun 28 16:16:08 2022 -0500 comctl32/listview: Move sending LVN_ODSTATECHANGED notifications to a function. Signed-off-by: Angelo Haller <angelo(a)szanni.org> --- dlls/comctl32/listview.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 3761a61286e..a12b19b8083 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -438,6 +438,7 @@ static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *, LPCWSTR, BOOL); static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *, INT, BOOL); static UINT LISTVIEW_GetItemState(const LISTVIEW_INFO *, INT, UINT); static BOOL LISTVIEW_SetItemState(LISTVIEW_INFO *, INT, const LVITEMW *); +static VOID LISTVIEW_SetOwnerDataState(LISTVIEW_INFO *, INT, INT, const LVITEMW *); static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *, INT, INT); static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *, INT, INT); static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *, INT, BOOL); @@ -3565,7 +3566,6 @@ static BOOL LISTVIEW_AddGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) INT nFirst = min(infoPtr->nSelectionMark, nItem); INT nLast = max(infoPtr->nSelectionMark, nItem); HWND hwndSelf = infoPtr->hwndSelf; - NMLVODSTATECHANGE nmlv; DWORD old_mask; LVITEMW item; INT i; @@ -3587,13 +3587,8 @@ static BOOL LISTVIEW_AddGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) for (i = nFirst; i <= nLast; i++) LISTVIEW_SetItemState(infoPtr,i,&item); - ZeroMemory(&nmlv, sizeof(nmlv)); - nmlv.iFrom = nFirst; - nmlv.iTo = nLast; - nmlv.uOldState = 0; - nmlv.uNewState = item.state; + LISTVIEW_SetOwnerDataState(infoPtr, nFirst, nLast, &item); - notify_hdr(infoPtr, LVN_ODSTATECHANGED, (LPNMHDR)&nmlv); if (!IsWindow(hwndSelf)) return FALSE; infoPtr->notify_mask |= old_mask; @@ -9023,6 +9018,22 @@ static BOOL LISTVIEW_SetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, const PO return LISTVIEW_MoveIconTo(infoPtr, nItem, &Pt, FALSE); } +/* Make sure to also disable per item notifications via the notification mask. */ +static VOID LISTVIEW_SetOwnerDataState(LISTVIEW_INFO *infoPtr, INT nFirst, INT nLast, const LVITEMW *item) +{ + NMLVODSTATECHANGE nmlv; + + if (!item) return; + + ZeroMemory(&nmlv, sizeof(nmlv)); + nmlv.iFrom = nFirst; + nmlv.iTo = nLast; + nmlv.uOldState = 0; + nmlv.uNewState = item->state; + + notify_hdr(infoPtr, LVN_ODSTATECHANGED, (LPNMHDR)&nmlv); +} + /*** * DESCRIPTION: * Sets the state of one or many items.
1
0
0
0
Angelo Haller : comctl32/listview: Send one deselect all items notification for LVS_OWNERDATA listviews.
by Alexandre Julliard
08 Aug '22
08 Aug '22
Module: wine Branch: master Commit: 8b392553b32677d25fd3e0fe14f70a5693f3b42c URL:
https://gitlab.winehq.org/wine/wine/-/commit/8b392553b32677d25fd3e0fe14f70a…
Author: Angelo Haller <angelo(a)szanni.org> Date: Tue Jun 28 16:16:07 2022 -0500 comctl32/listview: Send one deselect all items notification for LVS_OWNERDATA listviews. Send one deselect all items notification on selection change for LVS_OWNERDATA listviews instead of notifying about each individual item change. Signed-off-by: Angelo Haller <angelo(a)szanni.org> --- dlls/comctl32/listview.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index ab328b3e798..3761a61286e 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -3406,7 +3406,14 @@ static BOOL LISTVIEW_DeselectAllSkipItems(LISTVIEW_INFO *infoPtr, RANGES toSkip) lvItem.state = 0; lvItem.stateMask = LVIS_SELECTED; - + + /* Only send one deselect all (-1) notification for LVS_OWNERDATA style */ + if (infoPtr->dwStyle & LVS_OWNERDATA) + { + LISTVIEW_SetItemState(infoPtr, -1, &lvItem); + return TRUE; + } + /* need to clone the DPA because callbacks can change it */ if (!(clone = ranges_clone(infoPtr->selectionRanges))) return FALSE; iterator_rangesitems(&i, ranges_diff(clone, toSkip));
1
0
0
0
Brendan Shanks : wow64cpu: Use -norelay for BTCpuSimulate.
by Alexandre Julliard
08 Aug '22
08 Aug '22
Module: wine Branch: master Commit: 38cf242e7d33e4d13f3c703af8db8e9faabeb096 URL:
https://gitlab.winehq.org/wine/wine/-/commit/38cf242e7d33e4d13f3c703af8db8e…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Fri Aug 5 15:07:40 2022 -0700 wow64cpu: Use -norelay for BTCpuSimulate. Fixes exception handling stack unwinding under Wow64. --- dlls/wow64cpu/wow64cpu.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wow64cpu/wow64cpu.spec b/dlls/wow64cpu/wow64cpu.spec index 0a9e5b16dc8..6346cc54733 100644 --- a/dlls/wow64cpu/wow64cpu.spec +++ b/dlls/wow64cpu/wow64cpu.spec @@ -3,7 +3,7 @@ @ stdcall BTCpuProcessInit() @ stdcall BTCpuResetToConsistentState(ptr) @ stdcall BTCpuSetContext(long long ptr ptr) -@ stdcall BTCpuSimulate() +@ stdcall -norelay BTCpuSimulate() @ stdcall BTCpuTurboThunkControl(long) #@ stub TurboDispatchJumpAddressEnd #@ stub TurboDispatchJumpAddressStart
1
0
0
0
Nikolay Sivov : dwrite/fallback: Make sure all consecutively mapped characters belong to the same mapping.
by Alexandre Julliard
08 Aug '22
08 Aug '22
Module: wine Branch: master Commit: 1bff5e58590d54cf0ef40be26c9e6310ca07c910 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1bff5e58590d54cf0ef40be26c9e63…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Aug 5 23:14:59 2022 +0300 dwrite/fallback: Make sure all consecutively mapped characters belong to the same mapping. Picked fallback font often has wider character support than the ranges it's configured for. Desired behavior is to stop at the first character that doesn't belong to current mapping. For example, in texts like "abc<some CJK sequence>abc" we'd want the same for both "abc" sequences, as opposed to using fallback CJK font for trailing Latin range. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/dwrite/analyzer.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index 3f23c72dab4..f93d06a84d9 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -465,11 +465,24 @@ static void release_fallback_data(struct fallback_data *data) fallback_locale_list_destroy(&data->locales); } +static BOOL fallback_mapping_contains_character(const struct fallback_mapping *mapping, UINT32 ch) +{ + size_t i; + + for (i = 0; i < mapping->ranges_count; ++i) + { + const DWRITE_UNICODE_RANGE *range = &mapping->ranges[i]; + if (range->first <= ch && range->last >= ch) return TRUE; + } + + return FALSE; +} + static const struct fallback_mapping * find_fallback_mapping(const struct fallback_data *fallback, const struct fallback_locale *locale, UINT32 ch) { const struct fallback_mapping *mapping; - size_t i, j, r; + size_t i, j; for (i = 0; i < locale->ranges.count; i += 2) { @@ -477,11 +490,7 @@ static const struct fallback_mapping * find_fallback_mapping(const struct fallba for (j = start; j <= end; ++j) { mapping = &fallback->mappings[j]; - for (r = 0; r < mapping->ranges_count; ++r) - { - const DWRITE_UNICODE_RANGE *range = &mapping->ranges[r]; - if (range->first <= ch && range->last >= ch) return mapping; - } + if (fallback_mapping_contains_character(mapping, ch)) return mapping; } } @@ -2255,8 +2264,8 @@ static ULONG WINAPI fontfallback_Release(IDWriteFontFallback1 *iface) return IDWriteFactory7_Release(fallback->factory); } -static UINT32 fallback_font_get_supported_length(IDWriteFont3 *font, IDWriteTextAnalysisSource *source, UINT32 position, - UINT32 length) +static UINT32 fallback_font_get_supported_length(IDWriteFont3 *font, const struct fallback_mapping *mapping, + IDWriteTextAnalysisSource *source, UINT32 position, UINT32 length) { struct text_source_context context; UINT32 mapped = 0; @@ -2264,6 +2273,7 @@ static UINT32 fallback_font_get_supported_length(IDWriteFont3 *font, IDWriteText text_source_context_init(&context, source, position, length); while (!text_source_get_next_u32_char(&context)) { + if (mapping && !fallback_mapping_contains_character(mapping, context.ch)) break; if (!IDWriteFont3_HasCharacter(font, context.ch)) break; mapped += context.ch > 0xffff ? 2 : 1; } @@ -2321,7 +2331,7 @@ static HRESULT fallback_map_characters(const struct dwrite_fontfallback *fallbac if (SUCCEEDED(create_matching_font(mapping->collection ? mapping->collection : fallback->systemcollection, mapping->families[i], weight, style, stretch, &IID_IDWriteFont3, (void **)&font))) { - if (!(mapped = fallback_font_get_supported_length(font, source, position, length))) + if (!(mapped = fallback_font_get_supported_length(font, mapping, source, position, length))) { IDWriteFont3_Release(font); continue; @@ -2405,7 +2415,7 @@ static HRESULT WINAPI fontfallback_MapCharacters(IDWriteFontFallback1 *iface, ID if (SUCCEEDED(create_matching_font(basecollection, basefamily, weight, style, stretch, &IID_IDWriteFont, (void **)&font))) { - if ((*mapped_length = fallback_font_get_supported_length(font, source, position, length))) + if ((*mapped_length = fallback_font_get_supported_length(font, NULL, source, position, length))) { *ret_font = (IDWriteFont *)font; *scale = 1.0f;
1
0
0
0
Nikolay Sivov : dwrite/fallback: Consider character size for returned mapped length.
by Alexandre Julliard
08 Aug '22
08 Aug '22
Module: wine Branch: master Commit: e25ff734cf05775c5ac136573e97c2067f6049d8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e25ff734cf05775c5ac136573e97c2…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Aug 5 22:43:08 2022 +0300 dwrite/fallback: Consider character size for returned mapped length. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/dwrite/analyzer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index d23153a2d5e..3f23c72dab4 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -2265,7 +2265,7 @@ static UINT32 fallback_font_get_supported_length(IDWriteFont3 *font, IDWriteText while (!text_source_get_next_u32_char(&context)) { if (!IDWriteFont3_HasCharacter(font, context.ch)) break; - mapped++; + mapped += context.ch > 0xffff ? 2 : 1; } return mapped;
1
0
0
0
Rémi Bernon : win32u: Avoid invalid access when registered device alloc failed. (Coverity).
by Alexandre Julliard
08 Aug '22
08 Aug '22
Module: wine Branch: master Commit: a42b22e027e2be20f7f3a924eddeee92b7bbc99d URL:
https://gitlab.winehq.org/wine/wine/-/commit/a42b22e027e2be20f7f3a924eddeee…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Aug 6 10:16:58 2022 +0200 win32u: Avoid invalid access when registered device alloc failed. (Coverity). --- dlls/win32u/rawinput.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dlls/win32u/rawinput.c b/dlls/win32u/rawinput.c index 2dc03e7fe2d..cf150b60a8c 100644 --- a/dlls/win32u/rawinput.c +++ b/dlls/win32u/rawinput.c @@ -821,6 +821,7 @@ static void register_rawinput_device( const RAWINPUTDEVICE *device ) BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT device_count, UINT device_size ) { struct rawinput_device *server_devices; + RAWINPUTDEVICE *new_registered_devices; SIZE_T size; BOOL ret; UINT i; @@ -863,8 +864,15 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d } size = (SIZE_T)device_size * (registered_device_count + device_count); - registered_devices = realloc( registered_devices, size ); - if (registered_devices) for (i = 0; i < device_count; ++i) register_rawinput_device( devices + i ); + if (!(new_registered_devices = realloc( registered_devices, size ))) + { + pthread_mutex_unlock( &rawinput_mutex ); + SetLastError( ERROR_OUTOFMEMORY ); + return FALSE; + } + + registered_devices = new_registered_devices; + for (i = 0; i < device_count; ++i) register_rawinput_device( devices + i ); if (!(device_count = registered_device_count)) server_devices = NULL; else if (!(server_devices = malloc( device_count * sizeof(*server_devices) ))) @@ -893,12 +901,6 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d pthread_mutex_unlock( &rawinput_mutex ); - if (!registered_devices) - { - SetLastError( ERROR_OUTOFMEMORY ); - return FALSE; - } - return ret; }
1
0
0
0
Rémi Bernon : win32u: Send the total number of registered devices to the server.
by Alexandre Julliard
08 Aug '22
08 Aug '22
Module: wine Branch: master Commit: 17bdb5060a6fe30d6aada2e63745f930acdc4f50 URL:
https://gitlab.winehq.org/wine/wine/-/commit/17bdb5060a6fe30d6aada2e63745f9…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 5 11:25:49 2022 +0200 win32u: Send the total number of registered devices to the server. Instead of device_count which is the number of registration updates, and execute the request within the rawinput_mutex to ensure atomicity of the update and consistency between the client and the server state. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53468
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53487
--- dlls/win32u/rawinput.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/dlls/win32u/rawinput.c b/dlls/win32u/rawinput.c index 44951522442..2dc03e7fe2d 100644 --- a/dlls/win32u/rawinput.c +++ b/dlls/win32u/rawinput.c @@ -866,8 +866,15 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d registered_devices = realloc( registered_devices, size ); if (registered_devices) for (i = 0; i < device_count; ++i) register_rawinput_device( devices + i ); - server_devices = malloc( registered_device_count * sizeof(*server_devices) ); - if (server_devices) for (i = 0; i < registered_device_count; ++i) + if (!(device_count = registered_device_count)) server_devices = NULL; + else if (!(server_devices = malloc( device_count * sizeof(*server_devices) ))) + { + pthread_mutex_unlock( &rawinput_mutex ); + SetLastError( ERROR_OUTOFMEMORY ); + return FALSE; + } + + for (i = 0; i < device_count; ++i) { server_devices[i].usage_page = registered_devices[i].usUsagePage; server_devices[i].usage = registered_devices[i].usUsage; @@ -875,14 +882,6 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d server_devices[i].target = wine_server_user_handle( registered_devices[i].hwndTarget ); } - pthread_mutex_unlock( &rawinput_mutex ); - - if (!registered_devices || !server_devices) - { - SetLastError( ERROR_OUTOFMEMORY ); - return FALSE; - } - SERVER_START_REQ( update_rawinput_devices ) { wine_server_add_data( req, server_devices, device_count * sizeof(*server_devices) ); @@ -892,6 +891,14 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d free( server_devices ); + pthread_mutex_unlock( &rawinput_mutex ); + + if (!registered_devices) + { + SetLastError( ERROR_OUTOFMEMORY ); + return FALSE; + } + return ret; }
1
0
0
0
Rémi Bernon : win32u: Avoid reallocating rawinput device array with zero size.
by Alexandre Julliard
08 Aug '22
08 Aug '22
Module: wine Branch: master Commit: b5ed53899337660c3fad7bd4023b84eb84eb96f7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b5ed53899337660c3fad7bd4023b84…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 5 15:49:17 2022 +0200 win32u: Avoid reallocating rawinput device array with zero size. It actually frees the pointer. --- dlls/win32u/rawinput.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/win32u/rawinput.c b/dlls/win32u/rawinput.c index 8e3f3ace15a..44951522442 100644 --- a/dlls/win32u/rawinput.c +++ b/dlls/win32u/rawinput.c @@ -856,6 +856,12 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d pthread_mutex_lock( &rawinput_mutex ); + if (!registered_device_count && !device_count) + { + pthread_mutex_unlock( &rawinput_mutex ); + return TRUE; + } + size = (SIZE_T)device_size * (registered_device_count + device_count); registered_devices = realloc( registered_devices, size ); if (registered_devices) for (i = 0; i < device_count; ++i) register_rawinput_device( devices + i );
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
60
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
Results per page:
10
25
50
100
200