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
May 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
2 participants
907 discussions
Start a n
N
ew thread
Jacek Caban : win32u: Handle sys color brushes in fill_rect.
by Alexandre Julliard
16 May '22
16 May '22
Module: wine Branch: master Commit: 781b9544244bce97a44c5eb5916da23437653991 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=781b9544244bce97a44c5eb5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 16 13:57:38 2022 +0200 win32u: Handle sys color brushes in fill_rect. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53004
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/defwnd.c | 2 ++ dlls/win32u/sysparams.c | 2 +- dlls/win32u/win32u_private.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 67472246960..27120a96d98 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -35,6 +35,8 @@ void fill_rect( HDC dc, const RECT *rect, HBRUSH hbrush ) { HBRUSH prev_brush; + if (hbrush <= (HBRUSH)(COLOR_MENUBAR + 1)) hbrush = get_sys_color_brush( HandleToULong(hbrush) - 1 ); + prev_brush = NtGdiSelectBrush( dc, hbrush ); NtGdiPatBlt( dc, rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top, PATCOPY ); if (prev_brush) NtGdiSelectBrush( dc, prev_brush ); diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 114016954aa..5fec4ade0f8 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -4506,7 +4506,7 @@ static HBRUSH get_55aa_brush(void) return brush_55aa; } -static HBRUSH get_sys_color_brush( unsigned int index ) +HBRUSH get_sys_color_brush( unsigned int index ) { if (index == COLOR_55AA_BRUSH) return get_55aa_brush(); if (index >= ARRAY_SIZE( system_colors )) return 0; diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index e459e6df6bd..d02871a6ad1 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -404,6 +404,7 @@ extern UINT get_monitor_dpi( HMONITOR monitor ) DECLSPEC_HIDDEN; extern BOOL get_monitor_info( HMONITOR handle, MONITORINFO *info ) DECLSPEC_HIDDEN; extern UINT get_win_monitor_dpi( HWND hwnd ) DECLSPEC_HIDDEN; extern RECT get_primary_monitor_rect( UINT dpi ) DECLSPEC_HIDDEN; +extern HBRUSH get_sys_color_brush( unsigned int index ) DECLSPEC_HIDDEN; extern UINT get_system_dpi(void) DECLSPEC_HIDDEN; extern int get_system_metrics( int index ) DECLSPEC_HIDDEN; extern UINT get_thread_dpi(void) DECLSPEC_HIDDEN;
1
0
0
0
Zebediah Figura : shlwapi/tests: Fix a test failure with the UTF-8 code page.
by Alexandre Julliard
16 May '22
16 May '22
Module: wine Branch: master Commit: 588bd3e7f24a66ea0c267260b20cc8c04fa75d8a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=588bd3e7f24a66ea0c267260…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Sat May 14 17:05:11 2022 -0500 shlwapi/tests: Fix a test failure with the UTF-8 code page. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52870
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shlwapi/tests/url.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 6957e244213..6870de4ee5f 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -674,10 +674,10 @@ static void test_UrlGetPart(void) /* All characters, other than those with special meaning, are allowed. */ {"
http://foo:bar@google.*.com:21/internal.php?query=x&return=y
", URL_PART_HOSTNAME, 0, S_OK, "
google.*.com
"}, - {"http:// !\"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff:pass@host", URL_PART_USERNAME, 0, S_OK, " !\"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff"}, - {"
http://user
: !\"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff@host", URL_PART_PASSWORD, 0, S_OK, " !\"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff"}, - {"http:// !\"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff", URL_PART_HOSTNAME, 0, S_OK, " !\"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff"}, - {"
http://host
: !\"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff", URL_PART_PORT, 0, S_OK, " !\"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff"}, + {"http:// !\"$%&'()*+,-.;<=>[]^_`{|~}:pass@host", URL_PART_USERNAME, 0, S_OK, " !\"$%&'()*+,-.;<=>[]^_`{|~}"}, + {"
http://user
: !\"$%&'()*+,-.;<=>[]^_`{|~}@host", URL_PART_PASSWORD, 0, S_OK, " !\"$%&'()*+,-.;<=>[]^_`{|~}"}, + {"http:// !\"$%&'()*+,-.;<=>[]^_`{|~}", URL_PART_HOSTNAME, 0, S_OK, " !\"$%&'()*+,-.;<=>[]^_`{|~}"}, + {"
http://host
: !\"$%&'()*+,-.;<=>[]^_`{|~}", URL_PART_PORT, 0, S_OK, " !\"$%&'()*+,-.;<=>[]^_`{|~}"}, {"http:///index.html", URL_PART_HOSTNAME, 0, S_FALSE, ""}, {"http:///index.html", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:"}, @@ -855,6 +855,15 @@ static void test_UrlGetPart(void) winetest_pop_context(); } + + /* Test non-ASCII characters. */ + + size = ARRAY_SIZE(bufferW); + wcscpy(bufferW, L"x"); + hr = UrlGetPartW(L"http://\x01\x7f\x80\xff:pass@host", bufferW, &size, URL_PART_USERNAME, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(size == wcslen(bufferW), "Got size %lu.\n", size); + ok(!wcscmp(bufferW, L"\x01\x7f\x80\xff"), "Got result %s.\n", debugstr_w(bufferW)); } /* ########################### */
1
0
0
0
Francois Gouget : mstask/tests: Fix the compare_trigger_state() failure lines.
by Alexandre Julliard
16 May '22
16 May '22
Module: wine Branch: master Commit: 7618c6c6b7be52eb4fc4bb6571e0b2bda8e6f94e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7618c6c6b7be52eb4fc4bb65…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri May 13 20:00:34 2022 +0200 mstask/tests: Fix the compare_trigger_state() failure lines. compare_trigger_state() is called from multiple places and any failure should be accounted for the calling place's line. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/tests/task_trigger.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/dlls/mstask/tests/task_trigger.c b/dlls/mstask/tests/task_trigger.c index e0c1b549ab7..24b873770d2 100644 --- a/dlls/mstask/tests/task_trigger.c +++ b/dlls/mstask/tests/task_trigger.c @@ -35,74 +35,75 @@ static DWORD obj_refcount(void *obj_to_check) return IUnknown_Release(obj); } -static void compare_trigger_state(TASK_TRIGGER found_state, - TASK_TRIGGER expected_state) +#define compare_trigger_state(found,expected) compare_trigger_state_(__LINE__,found,expected) +static void compare_trigger_state_(int line, TASK_TRIGGER found_state, + TASK_TRIGGER expected_state) { - ok(found_state.cbTriggerSize == expected_state.cbTriggerSize, + ok_(__FILE__, line)(found_state.cbTriggerSize == expected_state.cbTriggerSize, "cbTriggerSize: Found %d but expected %d\n", found_state.cbTriggerSize, expected_state.cbTriggerSize); - ok(found_state.Reserved1 == expected_state.Reserved1, + ok_(__FILE__, line)(found_state.Reserved1 == expected_state.Reserved1, "Reserved1: Found %d but expected %d\n", found_state.Reserved1, expected_state.Reserved1); - ok(found_state.wBeginYear == expected_state.wBeginYear, + ok_(__FILE__, line)(found_state.wBeginYear == expected_state.wBeginYear, "wBeginYear: Found %d but expected %d\n", found_state.wBeginYear, expected_state.wBeginYear); - ok(found_state.wBeginMonth == expected_state.wBeginMonth, + ok_(__FILE__, line)(found_state.wBeginMonth == expected_state.wBeginMonth, "wBeginMonth: Found %d but expected %d\n", found_state.wBeginMonth, expected_state.wBeginMonth); - ok(found_state.wBeginDay == expected_state.wBeginDay, + ok_(__FILE__, line)(found_state.wBeginDay == expected_state.wBeginDay, "wBeginDay: Found %d but expected %d\n", found_state.wBeginDay, expected_state.wBeginDay); - ok(found_state.wEndYear == expected_state.wEndYear, + ok_(__FILE__, line)(found_state.wEndYear == expected_state.wEndYear, "wEndYear: Found %d but expected %d\n", found_state.wEndYear, expected_state.wEndYear); - ok(found_state.wEndMonth == expected_state.wEndMonth, + ok_(__FILE__, line)(found_state.wEndMonth == expected_state.wEndMonth, "wEndMonth: Found %d but expected %d\n", found_state.wEndMonth, expected_state.wEndMonth); - ok(found_state.wEndDay == expected_state.wEndDay, + ok_(__FILE__, line)(found_state.wEndDay == expected_state.wEndDay, "wEndDay: Found %d but expected %d\n", found_state.wEndDay, expected_state.wEndDay); - ok(found_state.wStartHour == expected_state.wStartHour, + ok_(__FILE__, line)(found_state.wStartHour == expected_state.wStartHour, "wStartHour: Found %d but expected %d\n", found_state.wStartHour, expected_state.wStartHour); - ok(found_state.wStartMinute == expected_state.wStartMinute, + ok_(__FILE__, line)(found_state.wStartMinute == expected_state.wStartMinute, "wStartMinute: Found %d but expected %d\n", found_state.wStartMinute, expected_state.wStartMinute); - ok(found_state.MinutesDuration == expected_state.MinutesDuration, + ok_(__FILE__, line)(found_state.MinutesDuration == expected_state.MinutesDuration, "MinutesDuration: Found %ld but expected %ld\n", found_state.MinutesDuration, expected_state.MinutesDuration); - ok(found_state.MinutesInterval == expected_state.MinutesInterval, + ok_(__FILE__, line)(found_state.MinutesInterval == expected_state.MinutesInterval, "MinutesInterval: Found %ld but expected %ld\n", found_state.MinutesInterval, expected_state.MinutesInterval); - ok(found_state.rgFlags == expected_state.rgFlags, + ok_(__FILE__, line)(found_state.rgFlags == expected_state.rgFlags, "rgFlags: Found %ld but expected %ld\n", found_state.rgFlags, expected_state.rgFlags); - ok(found_state.TriggerType == expected_state.TriggerType, + ok_(__FILE__, line)(found_state.TriggerType == expected_state.TriggerType, "TriggerType: Found %d but expected %d\n", found_state.TriggerType, expected_state.TriggerType); - ok(found_state.Type.Daily.DaysInterval == expected_state.Type.Daily.DaysInterval, + ok_(__FILE__, line)(found_state.Type.Daily.DaysInterval == expected_state.Type.Daily.DaysInterval, "Type.Daily.DaysInterval: Found %d but expected %d\n", found_state.Type.Daily.DaysInterval, expected_state.Type.Daily.DaysInterval); - ok(found_state.Reserved2 == expected_state.Reserved2, + ok_(__FILE__, line)(found_state.Reserved2 == expected_state.Reserved2, "Reserved2: Found %d but expected %d\n", found_state.Reserved2, expected_state.Reserved2); - ok(found_state.wRandomMinutesInterval == expected_state.wRandomMinutesInterval, + ok_(__FILE__, line)(found_state.wRandomMinutesInterval == expected_state.wRandomMinutesInterval, "wRandomMinutesInterval: Found %d but expected %d\n", found_state.wRandomMinutesInterval, expected_state.wRandomMinutesInterval); }
1
0
0
0
Francois Gouget : mstask/tests: Ignore the compare_trigger_state() return value.
by Alexandre Julliard
16 May '22
16 May '22
Module: wine Branch: master Commit: 1017c188f70de56426adb2d5df2db9fcefd264f1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1017c188f70de56426adb2d5…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri May 13 19:59:18 2022 +0200 mstask/tests: Ignore the compare_trigger_state() return value. What counts is the ok() calls that compare_trigger_state() makes. Its return value is meaningless. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/tests/task_trigger.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dlls/mstask/tests/task_trigger.c b/dlls/mstask/tests/task_trigger.c index d0f659ef246..e0c1b549ab7 100644 --- a/dlls/mstask/tests/task_trigger.c +++ b/dlls/mstask/tests/task_trigger.c @@ -35,7 +35,7 @@ static DWORD obj_refcount(void *obj_to_check) return IUnknown_Release(obj); } -static BOOL compare_trigger_state(TASK_TRIGGER found_state, +static void compare_trigger_state(TASK_TRIGGER found_state, TASK_TRIGGER expected_state) { ok(found_state.cbTriggerSize == expected_state.cbTriggerSize, @@ -105,8 +105,6 @@ static BOOL compare_trigger_state(TASK_TRIGGER found_state, ok(found_state.wRandomMinutesInterval == expected_state.wRandomMinutesInterval, "wRandomMinutesInterval: Found %d but expected %d\n", found_state.wRandomMinutesInterval, expected_state.wRandomMinutesInterval); - - return TRUE; } static void test_SetTrigger_GetTrigger(void) @@ -342,14 +340,12 @@ static void test_SetTrigger_GetTrigger(void) trigger_state.cbTriggerSize = sizeof(trigger_state) - 1; hres = ITaskTrigger_GetTrigger(test_trigger, &trigger_state); ok(hres == S_OK, "Failed to GetTrigger\n"); - ok(compare_trigger_state(trigger_state, normal_trigger_state), - "Invalid state\n"); + compare_trigger_state(trigger_state, normal_trigger_state); memset(&trigger_state, 0xcf, sizeof(trigger_state)); trigger_state.cbTriggerSize = 0; hres = ITaskTrigger_GetTrigger(test_trigger, &trigger_state); ok(hres == S_OK, "Failed to GetTrigger\n"); - ok(compare_trigger_state(trigger_state, normal_trigger_state), - "Invalid state\n"); + compare_trigger_state(trigger_state, normal_trigger_state); ITaskTrigger_Release(test_trigger); ITask_Release(test_task);
1
0
0
0
Francois Gouget : comctl32/tests: Use winetest_push_context() in tooltip:test_customdraw().
by Alexandre Julliard
16 May '22
16 May '22
Module: wine Branch: master Commit: 3a3f40602828c704071e1ed5857016b7a89b8a9f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3a3f40602828c704071e1ed5…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri May 13 19:57:43 2022 +0200 comctl32/tests: Use winetest_push_context() in tooltip:test_customdraw(). Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/tooltips.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c index 3bde35250cc..b6f3ace7285 100644 --- a/dlls/comctl32/tests/tooltips.c +++ b/dlls/comctl32/tests/tooltips.c @@ -188,6 +188,7 @@ static void test_customdraw(void) { HWND parent, hwndTip; RECT rect; TTTOOLINFOA toolInfo = { 0 }; + winetest_push_context("%ld", iterationNumber); /* Create a main window */ parent = CreateWindowExA(0, "CustomDrawClass", NULL, @@ -196,7 +197,7 @@ static void test_customdraw(void) { 50, 50, 300, 300, NULL, NULL, NULL, 0); - ok(parent != NULL, "%ld: Creation of main window failed\n", iterationNumber); + ok(parent != NULL, "Creation of main window failed\n"); /* Make it show */ ShowWindow(parent, SW_SHOWNORMAL); @@ -208,7 +209,7 @@ static void test_customdraw(void) { CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, parent, NULL, GetModuleHandleA(NULL), 0); - ok(hwndTip != NULL, "%ld: Creation of tooltip window failed\n", iterationNumber); + ok(hwndTip != NULL, "Creation of tooltip window failed\n"); /* Set up parms for the wndproc to handle */ CD_Stages = 0; @@ -229,7 +230,7 @@ static void test_customdraw(void) { toolInfo.lParam = 0xdeadbeef; GetClientRect (parent, &toolInfo.rect); ret = SendMessageA(hwndTip, TTM_ADDTOOLA, 0, (LPARAM)&toolInfo); - ok(ret, "%ld: Failed to add the tool.\n", iterationNumber); + ok(ret, "Failed to add the tool.\n"); /* Make tooltip appear quickly */ SendMessageA(hwndTip, TTM_SETDELAYTIME, TTDT_INITIAL, MAKELPARAM(1,0)); @@ -243,27 +244,28 @@ static void test_customdraw(void) { { /* Check CustomDraw results */ ok(CD_Stages == expectedResults[iterationNumber].ExpectedCalls, - "%ld: CustomDraw stages %x, expected %x\n", iterationNumber, CD_Stages, + "CustomDraw stages %x, expected %x\n", CD_Stages, expectedResults[iterationNumber].ExpectedCalls); } ret = SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, 0); - ok(ret, "%ld: Failed to get current tool %#Ix.\n", iterationNumber, ret); + ok(ret, "Failed to get current tool %#Ix.\n", ret); memset(&toolInfo, 0xcc, sizeof(toolInfo)); toolInfo.cbSize = sizeof(toolInfo); toolInfo.lpszText = NULL; toolInfo.lpReserved = (void *)0xdeadbeef; SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, (LPARAM)&toolInfo); - ok(toolInfo.hwnd == parent, "%ld: Unexpected hwnd %p.\n", iterationNumber, toolInfo.hwnd); - ok(toolInfo.hinst == GetModuleHandleA(NULL), "%ld: Unexpected hinst %p.\n", iterationNumber, toolInfo.hinst); - ok(toolInfo.uId == 0x1234abcd, "%ld: Unexpected uId %Ix.\n", iterationNumber, toolInfo.uId); - ok(toolInfo.lParam == 0, "%ld: Unexpected lParam %Ix.\n", iterationNumber, toolInfo.lParam); - ok(toolInfo.lpReserved == (void *)0xdeadbeef, "%ld: Unexpected lpReserved %p.\n", iterationNumber, toolInfo.lpReserved); + ok(toolInfo.hwnd == parent, "Unexpected hwnd %p.\n", toolInfo.hwnd); + ok(toolInfo.hinst == GetModuleHandleA(NULL), "Unexpected hinst %p.\n", toolInfo.hinst); + ok(toolInfo.uId == 0x1234abcd, "Unexpected uId %Ix.\n", toolInfo.uId); + ok(toolInfo.lParam == 0, "Unexpected lParam %Ix.\n", toolInfo.lParam); + ok(toolInfo.lpReserved == (void *)0xdeadbeef, "Unexpected lpReserved %p.\n", toolInfo.lpReserved); /* Clean up */ DestroyWindow(hwndTip); DestroyWindow(parent); + winetest_pop_context(); } SetCursorPos(orig_pos.x, orig_pos.y);
1
0
0
0
Francois Gouget : shell32: Shelllink: Make the create_lnk() failure messages unique.
by Alexandre Julliard
16 May '22
16 May '22
Module: wine Branch: master Commit: 43363df399d5385c389f63612c5b68d267394726 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=43363df399d5385c389f6361…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri May 13 19:57:03 2022 +0200 shell32: Shelllink: Make the create_lnk() failure messages unique. create_lnk() reports all failures from the perspective of the caller. That means the failure messages must be unique so one can figure out which one of its ok() calls actually failed. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/tests/shelllink.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index 8cbc46696ab..c8a0308a9cb 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -452,41 +452,45 @@ void create_lnk_(int line, const WCHAR* path, lnk_desc_t* desc) init_dirty = IPersistFile_IsDirty(pf); /* empty links start off as clean */ r = IPersistFile_Save(pf, NULL, FALSE); - lok(r == S_OK || r == E_INVALIDARG /* before Windows 7 */, "save failed (0x%08lx)\n", r); + lok(r == S_OK || r == E_INVALIDARG /* before Windows 7 */, + "save(NULL, FALSE) failed (0x%08lx)\n", r); + r = IPersistFile_IsDirty(pf); - lok(r == init_dirty, "dirty (0x%08lx)\n", r); + lok(r == init_dirty, "dirty(NULL, FALSE) (0x%08lx)\n", r); r = IPersistFile_Save(pf, NULL, TRUE); - lok(r == S_OK || r == E_INVALIDARG /* before Windows 7 */, "save failed (0x%08lx)\n", r); + lok(r == S_OK || r == E_INVALIDARG /* before Windows 7 */, + "save(NULL, TRUE) failed (0x%08lx)\n", r); + r = IPersistFile_IsDirty(pf); - lok(r == init_dirty, "dirty (0x%08lx)\n", r); + lok(r == init_dirty, "dirty(NULL, TRUE) (0x%08lx)\n", r); /* test GetCurFile before ::Save */ str = (LPWSTR)0xdeadbeef; r = IPersistFile_GetCurFile(pf, &str); - lok(r == S_FALSE, "got 0x%08lx\n", r); - lok(str == NULL, "got %p\n", str); + lok(r == S_FALSE, "GetCurFile:before got 0x%08lx\n", r); + lok(str == NULL, "GetCurFile:before got %p\n", str); r = IPersistFile_Save(pf, path, TRUE); - lok(r == S_OK, "save failed (0x%08lx)\n", r); + lok(r == S_OK, "save(path, TRUE) failed (0x%08lx)\n", r); r = IPersistFile_IsDirty(pf); - lok(r == S_FALSE, "dirty (0x%08lx)\n", r); + lok(r == S_FALSE, "dirty(path, TRUE) (0x%08lx)\n", r); /* test GetCurFile after ::Save */ r = IPersistFile_GetCurFile(pf, &str); - lok(r == S_OK, "got 0x%08lx\n", r); - lok(str != NULL, "Didn't expect NULL\n"); - lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str)); + lok(r == S_OK, "GetCurFile(path, TRUE) got 0x%08lx\n", r); + lok(str != NULL, "GetCurFile(path, TRUE) Didn't expect NULL\n"); + lok(!wcscmp(path, str), "GetCurFile(path, TRUE) Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str)); CoTaskMemFree(str); r = IPersistFile_Save(pf, NULL, TRUE); - lok(r == S_OK, "save failed (0x%08lx)\n", r); + lok(r == S_OK, "save(NULL, TRUE) failed (0x%08lx)\n", r); /* test GetCurFile after ::Save */ r = IPersistFile_GetCurFile(pf, &str); - lok(r == S_OK, "got 0x%08lx\n", r); - lok(str != NULL, "Didn't expect NULL\n"); - lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str)); + lok(r == S_OK, "GetCurFile(NULL, TRUE) got 0x%08lx\n", r); + lok(str != NULL, "GetCurFile(NULL, TRUE) Didn't expect NULL\n"); + lok(!wcscmp(path, str), "GetCurFile(NULL, TRUE) Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str)); CoTaskMemFree(str); IPersistFile_Release(pf);
1
0
0
0
Nikolay Sivov : mfreadwrite/reader: Allocate output samples on read requests.
by Alexandre Julliard
16 May '22
16 May '22
Module: wine Branch: master Commit: 68fa3f673633c138596b86ad2ed1befcd0cc63c5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=68fa3f673633c138596b86ad…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri May 13 19:34:13 2022 +0300 mfreadwrite/reader: Allocate output samples on read requests. Instead of tracking when free notifications, simply propagate allocation error to the caller. Behavior spotted by Giovanni. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfreadwrite/reader.c | 138 +++++++++------------------------------------- 1 file changed, 25 insertions(+), 113 deletions(-) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index e7b7b555e68..741ef93f367 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -52,7 +52,6 @@ struct stream_response DWORD stream_flags; LONGLONG timestamp; IMFSample *sample; - unsigned int sa_pending : 1; }; enum media_stream_state @@ -87,7 +86,6 @@ struct media_stream IMFMediaType *current; struct stream_transform decoder; IMFVideoSampleAllocatorEx *allocator; - IMFVideoSampleAllocatorNotify notify_cb; DWORD id; unsigned int index; enum media_stream_state state; @@ -103,7 +101,6 @@ enum source_reader_async_op SOURCE_READER_ASYNC_SEEK, SOURCE_READER_ASYNC_FLUSH, SOURCE_READER_ASYNC_SAMPLE_READY, - SOURCE_READER_ASYNC_SA_READY, }; struct source_reader_async_command @@ -201,11 +198,6 @@ static struct source_reader_async_command *impl_from_async_command_IUnknown(IUnk return CONTAINING_RECORD(iface, struct source_reader_async_command, IUnknown_iface); } -static struct media_stream *impl_stream_from_IMFVideoSampleAllocatorNotify(IMFVideoSampleAllocatorNotify *iface) -{ - return CONTAINING_RECORD(iface, struct media_stream, notify_cb); -} - static void source_reader_release_responses(struct source_reader *reader, struct media_stream *stream); static ULONG source_reader_addref(struct source_reader *reader) @@ -394,7 +386,7 @@ static void source_reader_response_ready(struct source_reader *reader, struct st struct media_stream *stream = &reader->streams[response->stream_index]; HRESULT hr; - if (!stream->requests || response->sa_pending) + if (!stream->requests) return; if (reader->async_callback) @@ -446,20 +438,6 @@ static void source_reader_copy_sample_buffer(IMFSample *src, IMFSample *dst) } } -static void source_reader_set_sa_response(struct source_reader *reader, struct stream_response *response) -{ - struct media_stream *stream = &reader->streams[response->stream_index]; - IMFSample *sample; - - if (SUCCEEDED(IMFVideoSampleAllocatorEx_AllocateSample(stream->allocator, &sample))) - { - source_reader_copy_sample_buffer(response->sample, sample); - response->sa_pending = 0; - IMFSample_Release(response->sample); - response->sample = sample; - } -} - static HRESULT source_reader_queue_response(struct source_reader *reader, struct media_stream *stream, HRESULT status, DWORD stream_flags, LONGLONG timestamp, IMFSample *sample) { @@ -476,12 +454,6 @@ static HRESULT source_reader_queue_response(struct source_reader *reader, struct if (response->sample) IMFSample_AddRef(response->sample); - if (response->sample && stream->allocator) - { - response->sa_pending = 1; - source_reader_set_sa_response(reader, response); - } - list_add_tail(&reader->responses, &response->entry); stream->responses++; @@ -975,26 +947,37 @@ static struct stream_response * media_stream_detach_response(struct source_reade static struct stream_response *media_stream_pop_response(struct source_reader *reader, struct media_stream *stream) { struct stream_response *response; + IMFSample *sample; + HRESULT hr; LIST_FOR_EACH_ENTRY(response, &reader->responses, struct stream_response, entry) { - if ((stream && response->stream_index != stream->index) || response->sa_pending) + if (stream && response->stream_index != stream->index) continue; - return media_stream_detach_response(reader, response); - } + if (!stream) stream = &reader->streams[response->stream_index]; - return NULL; -} + if (stream->allocator) + { + /* Return allocation error to the caller, while keeping original response sample in for later. */ + if (SUCCEEDED(hr = IMFVideoSampleAllocatorEx_AllocateSample(stream->allocator, &sample))) + { + source_reader_copy_sample_buffer(response->sample, sample); + IMFSample_Release(response->sample); + response->sample = sample; + } + else + { + if (!(response = calloc(1, sizeof(*response)))) + return NULL; -static struct stream_response *media_stream_pick_pending_response(struct source_reader *reader, unsigned int stream) -{ - struct stream_response *response; + response->status = hr; + response->stream_flags = MF_SOURCE_READERF_ERROR; + return response; + } + } - LIST_FOR_EACH_ENTRY(response, &reader->responses, struct stream_response, entry) - { - if (response->stream_index == stream && response->sa_pending) - return response; + return media_stream_detach_response(reader, response); } return NULL; @@ -1070,7 +1053,7 @@ static BOOL source_reader_got_response_for_stream(struct source_reader *reader, LIST_FOR_EACH_ENTRY(response, &reader->responses, struct stream_response, entry) { - if (response->stream_index == stream->index && !response->sa_pending) + if (response->stream_index == stream->index) return TRUE; } @@ -1308,18 +1291,6 @@ static HRESULT WINAPI source_reader_async_commands_callback_Invoke(IMFAsyncCallb break; - case SOURCE_READER_ASYNC_SA_READY: - - EnterCriticalSection(&reader->cs); - if ((response = media_stream_pick_pending_response(reader, command->u.sa.stream_index))) - { - source_reader_set_sa_response(reader, response); - source_reader_response_ready(reader, response); - } - LeaveCriticalSection(&reader->cs); - - break; - case SOURCE_READER_ASYNC_SAMPLE_READY: EnterCriticalSection(&reader->cs); @@ -1683,7 +1654,6 @@ static HRESULT source_reader_set_compatible_media_type(struct source_reader *rea static HRESULT source_reader_setup_sample_allocator(struct source_reader *reader, unsigned int index) { struct media_stream *stream = &reader->streams[index]; - IMFVideoSampleAllocatorCallback *callback; GUID major = { 0 }; HRESULT hr; @@ -1713,13 +1683,6 @@ static HRESULT source_reader_setup_sample_allocator(struct source_reader *reader if (FAILED(hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(stream->allocator, 2, 8, NULL, stream->current))) WARN("Failed to initialize sample allocator, hr %#lx.\n", hr); - if (SUCCEEDED(IMFVideoSampleAllocatorEx_QueryInterface(stream->allocator, &IID_IMFVideoSampleAllocatorCallback, (void **)&callback))) - { - if (FAILED(hr = IMFVideoSampleAllocatorCallback_SetCallback(callback, &stream->notify_cb))) - WARN("Failed to set allocator callback, hr %#lx.\n", hr); - IMFVideoSampleAllocatorCallback_Release(callback); - } - return hr; } @@ -2283,56 +2246,6 @@ static DWORD reader_get_first_stream_index(IMFPresentationDescriptor *descriptor return MF_SOURCE_READER_INVALID_STREAM_INDEX; } -static HRESULT WINAPI stream_sample_allocator_cb_QueryInterface(IMFVideoSampleAllocatorNotify *iface, - REFIID riid, void **obj) -{ - if (IsEqualIID(riid, &IID_IMFVideoSampleAllocatorNotify) || - IsEqualIID(riid, &IID_IUnknown)) - { - *obj = iface; - IMFVideoSampleAllocatorNotify_AddRef(iface); - return S_OK; - } - - *obj = NULL; - return E_NOINTERFACE; -} - -static ULONG WINAPI stream_sample_allocator_cb_AddRef(IMFVideoSampleAllocatorNotify *iface) -{ - struct media_stream *stream = impl_stream_from_IMFVideoSampleAllocatorNotify(iface); - return source_reader_addref(stream->reader); -} - -static ULONG WINAPI stream_sample_allocator_cb_Release(IMFVideoSampleAllocatorNotify *iface) -{ - struct media_stream *stream = impl_stream_from_IMFVideoSampleAllocatorNotify(iface); - return source_reader_release(stream->reader); -} - -static HRESULT WINAPI stream_sample_allocator_cb_NotifyRelease(IMFVideoSampleAllocatorNotify *iface) -{ - struct media_stream *stream = impl_stream_from_IMFVideoSampleAllocatorNotify(iface); - struct source_reader_async_command *command; - - if (SUCCEEDED(source_reader_create_async_op(SOURCE_READER_ASYNC_SA_READY, &command))) - { - command->u.sa.stream_index = stream->index; - MFPutWorkItem(stream->reader->queue, &stream->reader->async_commands_callback, &command->IUnknown_iface); - IUnknown_Release(&command->IUnknown_iface); - } - - return S_OK; -} - -static const IMFVideoSampleAllocatorNotifyVtbl stream_sample_allocator_cb_vtbl = -{ - stream_sample_allocator_cb_QueryInterface, - stream_sample_allocator_cb_AddRef, - stream_sample_allocator_cb_Release, - stream_sample_allocator_cb_NotifyRelease, -}; - static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttributes *attributes, BOOL shutdown_on_release, REFIID riid, void **out) { @@ -2404,7 +2317,6 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri if (FAILED(hr)) break; - object->streams[i].notify_cb.lpVtbl = &stream_sample_allocator_cb_vtbl; object->streams[i].reader = object; object->streams[i].index = i; }
1
0
0
0
Alexandre Julliard : kernelbase: Cache the sortid for each locale.
by Alexandre Julliard
16 May '22
16 May '22
Module: wine Branch: master Commit: 610db32153d408742ceb612a91e35a3af4ba1d84 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=610db32153d408742ceb612a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon May 16 18:23:30 2022 +0200 kernelbase: Cache the sortid for each locale. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/locale.c | 107 ++++++++++++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 42 deletions(-) diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 5986e3537ee..1648e3fb2e5 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -324,11 +324,11 @@ static struct norm_table *norm_info; struct sortguid { GUID id; /* sort GUID */ - DWORD flags; /* flags */ - DWORD compr; /* offset to compression table */ - DWORD except; /* exception table offset in sortkey table */ - DWORD ling_except; /* exception table offset for linguistic casing */ - DWORD casemap; /* linguistic casemap table offset */ + UINT flags; /* flags */ + UINT compr; /* offset to compression table */ + UINT except; /* exception table offset in sortkey table */ + UINT ling_except; /* exception table offset for linguistic casing */ + UINT casemap; /* linguistic casemap table offset */ }; #define FLAG_HAS_3_BYTE_WEIGHTS 0x01 @@ -336,19 +336,19 @@ struct sortguid #define FLAG_DOUBLECOMPRESSION 0x20 #define FLAG_INVERSECASING 0x40 -static const struct sortguid *current_locale_sort; -static const GUID default_sort_guid = { 0x00000001, 0x57ee, 0x1e5c, { 0x00, 0xb4, 0xd0, 0x00, 0x0b, 0xb1, 0xe1, 0x1e }}; +static const struct sortguid **locale_sorts; +static const struct sortguid *current_locale_sort; static struct { - DWORD *keys; /* sortkey table, indexed by char */ - USHORT *casemap; /* casemap table, in l_intl.nls format */ - WORD *ctypes; /* CT_CTYPE1,2,3 values */ - BYTE *ctype_idx; /* index to map char to ctypes array entry */ - DWORD version; /* NLS version */ - DWORD guid_count; /* number of sort GUIDs */ - struct sortguid *guids; /* table of sort GUIDs */ + UINT version; /* NLS version */ + UINT guid_count; /* number of sort GUIDs */ + const UINT *keys; /* sortkey table, indexed by char */ + const USHORT *casemap; /* casemap table, in l_intl.nls format */ + const WORD *ctypes; /* CT_CTYPE1,2,3 values */ + const BYTE *ctype_idx; /* index to map char to ctypes array entry */ + const struct sortguid *guids; /* table of sort GUIDs */ } sort; static CRITICAL_SECTION locale_section; @@ -403,22 +403,36 @@ static void load_locale_nls(void) } -static void init_sortkeys( DWORD *ptr ) +static void load_sortdefault_nls(void) { - WORD *ctype; - DWORD *table; + const struct + { + UINT sortkeys; + UINT casemaps; + UINT ctypes; + UINT sortids; + } *header; - sort.keys = (DWORD *)((char *)ptr + ptr[0]); - sort.casemap = (USHORT *)((char *)ptr + ptr[1]); + const WORD *ctype; + const UINT *table; + SIZE_T size; + + NtGetNlsSectionPtr( 9, 0, NULL, (void **)&header, &size ); + + sort.keys = (UINT *)((char *)header + header->sortkeys); + sort.casemap = (USHORT *)((char *)header + header->casemaps); - ctype = (WORD *)((char *)ptr + ptr[2]); + ctype = (WORD *)((char *)header + header->ctypes); sort.ctypes = ctype + 2; sort.ctype_idx = (BYTE *)ctype + ctype[1] + 2; - table = (DWORD *)((char *)ptr + ptr[3]); + table = (UINT *)((char *)header + header->sortids); sort.version = table[0]; sort.guid_count = table[1]; sort.guids = (struct sortguid *)(table + 2); + + locale_sorts = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, + locale_table->nb_lcnames * sizeof(*locale_sorts) ); } @@ -550,28 +564,36 @@ static const NLS_LOCALE_DATA *get_locale_by_name( const WCHAR *name, LCID *lcid } -static const struct sortguid *get_language_sort( const WCHAR *locale ) +static const struct sortguid *get_language_sort( const WCHAR *name ) { - WCHAR *p, *end, buffer[LOCALE_NAME_MAX_LENGTH], guidstr[39]; + const NLS_LOCALE_LCNAME_INDEX *entry; + const NLS_LOCALE_DATA *locale; + WCHAR guidstr[39]; const struct sortguid *ret; UNICODE_STRING str; + LCID lcid; GUID guid; HKEY key = 0; DWORD size, type; - if (locale == LOCALE_NAME_USER_DEFAULT) + if (name == LOCALE_NAME_USER_DEFAULT) { if (current_locale_sort) return current_locale_sort; - GetUserDefaultLocaleName( buffer, ARRAY_SIZE( buffer )); + name = locale_strings + user_locale->sname + 1; } - else lstrcpynW( buffer, locale, LOCALE_NAME_MAX_LENGTH ); - if (buffer[0] && !RegOpenKeyExW( nls_key, L"Sorting\\Ids", 0, KEY_READ, &key )) + if (!(entry = find_lcname_entry( name ))) return NULL; + if ((ret = locale_sorts[entry - lcnames_index])) return ret; + + lcid = entry->id; + name = locale_strings + entry->name + 1; + locale = get_locale_data( entry->idx ); + if (!RegOpenKeyExW( nls_key, L"Sorting\\Ids", 0, KEY_READ, &key )) { for (;;) { size = sizeof(guidstr); - if (!RegQueryValueExW( key, buffer, NULL, &type, (BYTE *)guidstr, &size ) && type == REG_SZ) + if (!RegQueryValueExW( key, name, NULL, &type, (BYTE *)guidstr, &size ) && type == REG_SZ) { RtlInitUnicodeString( &str, guidstr ); if (!RtlGUIDFromString( &str, &guid )) @@ -581,14 +603,15 @@ static const struct sortguid *get_language_sort( const WCHAR *locale ) } break; } - for (p = end = buffer; *p; p++) if (*p == '-' || *p == '_') end = p; - if (end == buffer) break; - *end = 0; + if (!name[0]) break; + name = locale_strings + (SORTIDFROMLCID( lcid ) ? locale->sname : locale->sparent) + 1; + if (!(locale = get_locale_by_name( name, &lcid ))) break; } } - ret = find_sortguid( &default_sort_guid ); + ret = &sort.guids[0]; done: RegCloseKey( key ); + if (ret) locale_sorts[entry - lcnames_index] = ret; return ret; } @@ -1790,7 +1813,6 @@ void init_locale( HMODULE module ) { USHORT utf8[2] = { 0, CP_UTF8 }; USHORT *ansi_ptr, *oem_ptr; - void *sort_ptr; WCHAR bufferW[LOCALE_NAME_MAX_LENGTH]; DYNAMIC_TIME_ZONE_INFORMATION timezone; const WCHAR *user_locale_name; @@ -1800,6 +1822,7 @@ void init_locale( HMODULE module ) kernelbase_handle = module; load_locale_nls(); + load_sortdefault_nls(); if (system_lcid == LOCALE_CUSTOM_UNSPECIFIED) system_lcid = MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ); system_locale = NlsValidateLocale( &system_lcid, 0 ); @@ -1817,13 +1840,11 @@ void init_locale( HMODULE module ) if (GetEnvironmentVariableW( L"WINEUNIXCP", bufferW, ARRAY_SIZE(bufferW) )) unix_cp = wcstoul( bufferW, NULL, 10 ); - NtGetNlsSectionPtr( 9, 0, NULL, &sort_ptr, &size ); NtGetNlsSectionPtr( 12, NormalizationC, NULL, (void **)&norm_info, &size ); - init_sortkeys( sort_ptr ); ansi_ptr = NtCurrentTeb()->Peb->AnsiCodePageData ? NtCurrentTeb()->Peb->AnsiCodePageData : utf8; oem_ptr = NtCurrentTeb()->Peb->OemCodePageData ? NtCurrentTeb()->Peb->OemCodePageData : utf8; - RtlInitNlsTables( ansi_ptr, oem_ptr, sort.casemap, &nls_info ); + RtlInitNlsTables( ansi_ptr, oem_ptr, (USHORT *)sort.casemap, &nls_info ); RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Control\\Nls", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &nls_key, NULL ); @@ -5003,7 +5024,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetNLSVersion( NLS_FUNCTION func, LCID lcid, NLSVE BOOL WINAPI DECLSPEC_HOTPATCH GetNLSVersionEx( NLS_FUNCTION func, const WCHAR *locale, NLSVERSIONINFOEX *info ) { - LCID lcid = 0; + const struct sortguid *sortid; if (func != COMPARE_STRING) { @@ -5016,15 +5037,17 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetNLSVersionEx( NLS_FUNCTION func, const WCHAR *l SetLastError( ERROR_INSUFFICIENT_BUFFER ); return FALSE; } - - if (!(lcid = LocaleNameToLCID( locale, 0 ))) return FALSE; + if (!(sortid = get_language_sort( locale ))) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return 0; + } info->dwNLSVersion = info->dwDefinedVersion = sort.version; if (info->dwNLSVersionInfoSize >= sizeof(*info)) { - const struct sortguid *sortid = get_language_sort( locale ); - info->dwEffectiveId = lcid; - info->guidCustomVersion = sortid ? sortid->id : default_sort_guid; + info->dwEffectiveId = LocaleNameToLCID( locale, 0 ); + info->guidCustomVersion = sortid->id; } return TRUE; }
1
0
0
0
Alexandre Julliard : kernelbase: Move get_language_sort() to avoid forward declarations.
by Alexandre Julliard
16 May '22
16 May '22
Module: wine Branch: master Commit: 093f6cbb8cc7126d1624771f67619e54c43de53c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=093f6cbb8cc7126d1624771f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon May 16 18:16:04 2022 +0200 kernelbase: Move get_language_sort() to avoid forward declarations. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/locale.c | 86 ++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 73e6953ec51..5986e3537ee 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -439,49 +439,6 @@ static const struct sortguid *find_sortguid( const GUID *guid ) } -static const struct sortguid *get_language_sort( const WCHAR *locale ) -{ - WCHAR *p, *end, buffer[LOCALE_NAME_MAX_LENGTH], guidstr[39]; - const struct sortguid *ret; - UNICODE_STRING str; - GUID guid; - HKEY key = 0; - DWORD size, type; - - if (locale == LOCALE_NAME_USER_DEFAULT) - { - if (current_locale_sort) return current_locale_sort; - GetUserDefaultLocaleName( buffer, ARRAY_SIZE( buffer )); - } - else lstrcpynW( buffer, locale, LOCALE_NAME_MAX_LENGTH ); - - if (buffer[0] && !RegOpenKeyExW( nls_key, L"Sorting\\Ids", 0, KEY_READ, &key )) - { - for (;;) - { - size = sizeof(guidstr); - if (!RegQueryValueExW( key, buffer, NULL, &type, (BYTE *)guidstr, &size ) && type == REG_SZ) - { - RtlInitUnicodeString( &str, guidstr ); - if (!RtlGUIDFromString( &str, &guid )) - { - ret = find_sortguid( &guid ); - goto done; - } - break; - } - for (p = end = buffer; *p; p++) if (*p == '-' || *p == '_') end = p; - if (end == buffer) break; - *end = 0; - } - } - ret = find_sortguid( &default_sort_guid ); -done: - RegCloseKey( key ); - return ret; -} - - static const NLS_LOCALE_DATA *get_locale_data( UINT idx ) { ULONG offset = locale_table->locales_offset + idx * locale_table->locale_size; @@ -593,6 +550,49 @@ static const NLS_LOCALE_DATA *get_locale_by_name( const WCHAR *name, LCID *lcid } +static const struct sortguid *get_language_sort( const WCHAR *locale ) +{ + WCHAR *p, *end, buffer[LOCALE_NAME_MAX_LENGTH], guidstr[39]; + const struct sortguid *ret; + UNICODE_STRING str; + GUID guid; + HKEY key = 0; + DWORD size, type; + + if (locale == LOCALE_NAME_USER_DEFAULT) + { + if (current_locale_sort) return current_locale_sort; + GetUserDefaultLocaleName( buffer, ARRAY_SIZE( buffer )); + } + else lstrcpynW( buffer, locale, LOCALE_NAME_MAX_LENGTH ); + + if (buffer[0] && !RegOpenKeyExW( nls_key, L"Sorting\\Ids", 0, KEY_READ, &key )) + { + for (;;) + { + size = sizeof(guidstr); + if (!RegQueryValueExW( key, buffer, NULL, &type, (BYTE *)guidstr, &size ) && type == REG_SZ) + { + RtlInitUnicodeString( &str, guidstr ); + if (!RtlGUIDFromString( &str, &guid )) + { + ret = find_sortguid( &guid ); + goto done; + } + break; + } + for (p = end = buffer; *p; p++) if (*p == '-' || *p == '_') end = p; + if (end == buffer) break; + *end = 0; + } + } + ret = find_sortguid( &default_sort_guid ); +done: + RegCloseKey( key ); + return ret; +} + + /****************************************************************************** * NlsValidateLocale (kernelbase.@) *
1
0
0
0
Paul Gofman : ntdll: Collect logical processor info at process start.
by Alexandre Julliard
16 May '22
16 May '22
Module: wine Branch: master Commit: 05676e83e975816b3c0d87b4b18b5cd15a372489 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=05676e83e975816b3c0d87b4…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue May 3 18:35:04 2022 -0500 ntdll: Collect logical processor info at process start. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/system.c | 533 +++++++++++++++++++++-------------------------- 1 file changed, 239 insertions(+), 294 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=05676e83e975816b3c0d…
1
0
0
0
← Newer
1
...
48
49
50
51
52
53
54
...
91
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
87
88
89
90
91
Results per page:
10
25
50
100
200