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
February 2024
----- 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
716 discussions
Start a n
N
ew thread
Fabian Maurer : user32: Fix AreDpiAwarenessContextsEqual behavior for DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2.
by Alexandre Julliard
27 Feb '24
27 Feb '24
Module: wine Branch: master Commit: c77d2e8a97b0f961e53b6cea5d274edf42956002 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c77d2e8a97b0f961e53b6cea5d274e…
Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Sat Feb 24 22:13:15 2024 +0100 user32: Fix AreDpiAwarenessContextsEqual behavior for DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56360
--- dlls/user32/sysparams.c | 11 +++++++++-- dlls/user32/tests/sysparams.c | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index d30bed44b31..9fa37a292d1 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -636,13 +636,20 @@ BOOL WINAPI SetProcessDpiAwarenessInternal( DPI_AWARENESS awareness ) return SetProcessDpiAwarenessContext( contexts[awareness] ); } +static ULONG_PTR map_awareness_context( DPI_AWARENESS_CONTEXT ctx ) +{ + if (ctx == DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 || ctx == (DPI_AWARENESS_CONTEXT)0x22 || ctx == (DPI_AWARENESS_CONTEXT)0x80000022) + return 0x22; + return GetAwarenessFromDpiAwarenessContext(ctx); +} + /*********************************************************************** * AreDpiAwarenessContextsEqual (USER32.@) */ BOOL WINAPI AreDpiAwarenessContextsEqual( DPI_AWARENESS_CONTEXT ctx1, DPI_AWARENESS_CONTEXT ctx2 ) { - DPI_AWARENESS aware1 = GetAwarenessFromDpiAwarenessContext( ctx1 ); - DPI_AWARENESS aware2 = GetAwarenessFromDpiAwarenessContext( ctx2 ); + DPI_AWARENESS aware1 = map_awareness_context( ctx1 ); + DPI_AWARENESS aware2 = map_awareness_context( ctx2 ); return aware1 != DPI_AWARENESS_INVALID && aware1 == aware2; } diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 508ee456777..2528d4d4398 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -3866,7 +3866,6 @@ static void test_AreDpiAwarenessContextsEqual(ULONG_PTR flags) int map_i = map_context(contexts[i], flags); int map_j = map_context(contexts[j], flags); BOOL equal_expected = map_i == map_j; - todo_wine_if((map_i == 0x22 && map_j == 0x12) || (map_j == 0x22 && map_i == 0x12)) ok(equal == equal_expected, "(%d, %d) (%p == %p) - Expected equal to be %d but got %d\n", i, j, (DPI_AWARENESS_CONTEXT)contexts[i], (DPI_AWARENESS_CONTEXT)contexts[j], equal_expected, equal); } }
1
0
0
0
Fabian Maurer : user32/tests: Add tests for AreDpiAwarenessContextsEqual.
by Alexandre Julliard
27 Feb '24
27 Feb '24
Module: wine Branch: master Commit: f541d947bb087e1bb58082c4e6fedc238b3a9d22 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f541d947bb087e1bb58082c4e6fedc…
Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Sat Feb 24 22:05:08 2024 +0100 user32/tests: Add tests for AreDpiAwarenessContextsEqual. --- dlls/user32/tests/sysparams.c | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index d086725a2b6..508ee456777 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -49,6 +49,7 @@ static BOOL (WINAPI *pAdjustWindowRectExForDpi)(LPRECT,DWORD,BOOL,DWORD,UINT); static BOOL (WINAPI *pLogicalToPhysicalPointForPerMonitorDPI)(HWND,POINT*); static BOOL (WINAPI *pPhysicalToLogicalPointForPerMonitorDPI)(HWND,POINT*); static LONG (WINAPI *pGetAutoRotationState)(PAR_STATE); +static BOOL (WINAPI *pAreDpiAwarenessContextsEqual)(DPI_AWARENESS_CONTEXT,DPI_AWARENESS_CONTEXT); static BOOL strict; static int dpi, real_dpi; @@ -3823,6 +3824,54 @@ static void test_ThreadDpiAwarenessContext(ULONG_PTR flags) } } +static int map_context(ULONG_PTR context, ULONG_PTR flags) +{ + switch (context) + { + case (ULONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE: + case (ULONG_PTR)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE: + case (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE: + return (~(ULONG_PTR)context) | 0x10; + case (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2: + return 0x22; + default: + context = context & (~flags); + return context & 0x33; + } +} + +static void test_AreDpiAwarenessContextsEqual(ULONG_PTR flags) +{ + int i, j; + ULONG_PTR contexts[] = { + 0x10 | flags, + 0x11 | flags, + 0x12, + 0x22, + 0x80000010 | flags, + 0x80000011 | flags, + 0x80000012, + 0x80000022, + (ULONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE, + (ULONG_PTR)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE, + (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE, + (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2, + }; + + for (i = 0; i < ARRAY_SIZE(contexts); i++) + { + for (j = 0; j < ARRAY_SIZE(contexts); j++) + { + BOOL equal = pAreDpiAwarenessContextsEqual((DPI_AWARENESS_CONTEXT)contexts[i], (DPI_AWARENESS_CONTEXT)contexts[j]); + int map_i = map_context(contexts[i], flags); + int map_j = map_context(contexts[j], flags); + BOOL equal_expected = map_i == map_j; + todo_wine_if((map_i == 0x22 && map_j == 0x12) || (map_j == 0x22 && map_i == 0x12)) + ok(equal == equal_expected, "(%d, %d) (%p == %p) - Expected equal to be %d but got %d\n", i, j, (DPI_AWARENESS_CONTEXT)contexts[i], (DPI_AWARENESS_CONTEXT)contexts[j], equal_expected, equal); + } + } +} + static void test_dpi_context(void) { DPI_AWARENESS awareness; @@ -3970,6 +4019,7 @@ static void test_dpi_context(void) ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context ); test_ThreadDpiAwarenessContext(flags); + test_AreDpiAwarenessContextsEqual(flags); for (i = 0; i < 0x100; i++) { @@ -4265,6 +4315,7 @@ START_TEST(sysparams) pLogicalToPhysicalPointForPerMonitorDPI = (void*)GetProcAddress(hdll, "LogicalToPhysicalPointForPerMonitorDPI"); pPhysicalToLogicalPointForPerMonitorDPI = (void*)GetProcAddress(hdll, "PhysicalToLogicalPointForPerMonitorDPI"); pGetAutoRotationState = (void*)GetProcAddress(hdll, "GetAutoRotationState"); + pAreDpiAwarenessContextsEqual = (void*)GetProcAddress(hdll, "AreDpiAwarenessContextsEqual"); hInstance = GetModuleHandleA( NULL ); hdc = GetDC(0);
1
0
0
0
Fabian Maurer : user32: Fix Set/GetThreadDpiAwarenessContext for DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2.
by Alexandre Julliard
27 Feb '24
27 Feb '24
Module: wine Branch: master Commit: 21bdc585f3eb8b23b7973b01e60543e417492a8a URL:
https://gitlab.winehq.org/wine/wine/-/commit/21bdc585f3eb8b23b7973b01e60543…
Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Sat Feb 24 20:29:05 2024 +0100 user32: Fix Set/GetThreadDpiAwarenessContext for DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56360
--- dlls/user32/sysparams.c | 4 +++- dlls/user32/tests/sysparams.c | 10 +++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index ec8dc11af17..d30bed44b31 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -747,7 +747,9 @@ DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT prev = NtUserGetProcessDpiAwarenessContext( GetCurrentProcess() ) & 3; prev |= 0x80000010; /* restore to process default */ } - if (((ULONG_PTR)context & ~(ULONG_PTR)0x13) == 0x80000000) info->dpi_awareness = 0; + if (((ULONG_PTR)context & ~(ULONG_PTR)0x33) == 0x80000000) info->dpi_awareness = 0; + else if (context == DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 || context == (DPI_AWARENESS_CONTEXT)0x22) + info->dpi_awareness = 0x22; else info->dpi_awareness = val | 0x10; return ULongToHandle( prev ); } diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 68fe455a002..d086725a2b6 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -3790,21 +3790,19 @@ static void test_ThreadDpiAwarenessContext(ULONG_PTR flags) ULONG_PTR context; ULONG_PTR result_get; ULONG_PTR result_set; - BOOL todo_get; - BOOL todo_set; } awareness_contexts[] = { { 0x10 | flags, 0x10 | flags, 0x10 | flags }, { 0x11 | flags, 0x11 | flags, 0x11 | flags }, { 0x12, 0x12, 0x12 }, - { 0x22, 0x22, 0x22, TRUE, TRUE }, + { 0x22, 0x22, 0x22}, { 0x80000010 | flags, 0x10 | awareness | flags, 0x80000010 | awareness | flags }, { 0x80000011 | flags, 0x10 | awareness | flags, 0x80000010 | awareness | flags }, { 0x80000012, 0x10 | awareness | flags, 0x80000010 | awareness | flags }, - { 0x80000022, 0x10 | awareness | flags, 0x80000010 | awareness | flags, FALSE, TRUE }, + { 0x80000022, 0x10 | awareness | flags, 0x80000010 | awareness | flags }, { (ULONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE, 0x10 | flags, 0x10 | flags }, { (ULONG_PTR)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE, 0x11 | flags, 0x11 | flags }, { (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE, 0x12, 0x12 }, - { (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2, 0x22, 0x22, TRUE, TRUE }, + { (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2, 0x22, 0x22 }, { 0x12, 0x12 }, /* Only for last_result test */ }; @@ -3818,11 +3816,9 @@ static void test_ThreadDpiAwarenessContext(ULONG_PTR flags) if (i != 0) { struct awareness_context_thread *last = &awareness_contexts[i - 1]; - todo_wine_if(awareness_contexts[i - 1].todo_set) ok( last_context == (DPI_AWARENESS_CONTEXT)last->result_set, "For context %p - after set expected %p, got %p\n", (DPI_AWARENESS_CONTEXT)last->context, (DPI_AWARENESS_CONTEXT)last->result_set, last_context ); } context = pGetThreadDpiAwarenessContext(); - todo_wine_if(item->todo_get) ok( context == (DPI_AWARENESS_CONTEXT)item->result_get, "For context %p - after get expected %p, got %p\n", (DPI_AWARENESS_CONTEXT)item->context, (DPI_AWARENESS_CONTEXT)item->result_get, context ); } }
1
0
0
0
Fabian Maurer : user32/tests: Add exhaustive tests for Get/SetThreadDpiAwarenessContext.
by Alexandre Julliard
27 Feb '24
27 Feb '24
Module: wine Branch: master Commit: 9ccfac44d55687fd6e9a9fac8a7135d1dd70a8b7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9ccfac44d55687fd6e9a9fac8a7135…
Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Sat Feb 24 18:23:22 2024 +0100 user32/tests: Add exhaustive tests for Get/SetThreadDpiAwarenessContext. --- dlls/user32/tests/sysparams.c | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 16756ecb06a..68fe455a002 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -3778,6 +3778,55 @@ static void test_dpi_aware(void) test_metrics_for_dpi( 192 ); } +static void test_ThreadDpiAwarenessContext(ULONG_PTR flags) +{ + int i; + DPI_AWARENESS_CONTEXT context, last_context; + DPI_AWARENESS awareness; + BOOL ret = pGetProcessDpiAwarenessInternal(GetCurrentProcess(), &awareness); + + struct awareness_context_thread + { + ULONG_PTR context; + ULONG_PTR result_get; + ULONG_PTR result_set; + BOOL todo_get; + BOOL todo_set; + } awareness_contexts[] = { + { 0x10 | flags, 0x10 | flags, 0x10 | flags }, + { 0x11 | flags, 0x11 | flags, 0x11 | flags }, + { 0x12, 0x12, 0x12 }, + { 0x22, 0x22, 0x22, TRUE, TRUE }, + { 0x80000010 | flags, 0x10 | awareness | flags, 0x80000010 | awareness | flags }, + { 0x80000011 | flags, 0x10 | awareness | flags, 0x80000010 | awareness | flags }, + { 0x80000012, 0x10 | awareness | flags, 0x80000010 | awareness | flags }, + { 0x80000022, 0x10 | awareness | flags, 0x80000010 | awareness | flags, FALSE, TRUE }, + { (ULONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE, 0x10 | flags, 0x10 | flags }, + { (ULONG_PTR)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE, 0x11 | flags, 0x11 | flags }, + { (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE, 0x12, 0x12 }, + { (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2, 0x22, 0x22, TRUE, TRUE }, + { 0x12, 0x12 }, /* Only for last_result test */ + }; + + ok(ret, "GetProcessDpiAwarenessInternal failed\n"); + + for (i = 0; i < ARRAY_SIZE(awareness_contexts); i++) + { + struct awareness_context_thread *item = &awareness_contexts[i]; + last_context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)item->context ); + ok(last_context != 0, "Failed to set context %p\n", (DPI_AWARENESS_CONTEXT)item->context ); + if (i != 0) + { + struct awareness_context_thread *last = &awareness_contexts[i - 1]; + todo_wine_if(awareness_contexts[i - 1].todo_set) + ok( last_context == (DPI_AWARENESS_CONTEXT)last->result_set, "For context %p - after set expected %p, got %p\n", (DPI_AWARENESS_CONTEXT)last->context, (DPI_AWARENESS_CONTEXT)last->result_set, last_context ); + } + context = pGetThreadDpiAwarenessContext(); + todo_wine_if(item->todo_get) + ok( context == (DPI_AWARENESS_CONTEXT)item->result_get, "For context %p - after get expected %p, got %p\n", (DPI_AWARENESS_CONTEXT)item->context, (DPI_AWARENESS_CONTEXT)item->result_get, context ); + } +} + static void test_dpi_context(void) { DPI_AWARENESS awareness; @@ -3923,6 +3972,9 @@ static void test_dpi_context(void) context = pGetThreadDpiAwarenessContext(); todo_wine ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context ); + + test_ThreadDpiAwarenessContext(flags); + for (i = 0; i < 0x100; i++) { awareness = pGetAwarenessFromDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)i );
1
0
0
0
Fabian Maurer : win32u: Refactor get_thread_dpi_awareness to use get_awareness_from_dpi_awareness_context.
by Alexandre Julliard
27 Feb '24
27 Feb '24
Module: wine Branch: master Commit: cbcf609108b1e6de53e83c7f066ff4a04c6c48b3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cbcf609108b1e6de53e83c7f066ff4…
Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Sat Feb 24 17:53:29 2024 +0100 win32u: Refactor get_thread_dpi_awareness to use get_awareness_from_dpi_awareness_context. --- dlls/win32u/sysparams.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 5e48a09522c..7dc807bb909 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2216,24 +2216,10 @@ DPI_AWARENESS get_thread_dpi_awareness(void) struct ntuser_thread_info *info = NtUserGetThreadInfo(); ULONG_PTR context = info->dpi_awareness; - switch (context) - { - case 0: /* process default */ + if (context == 0) /* process default */ return NtUserGetProcessDpiAwarenessContext( NULL ) & 3; - case 0x10: - case 0x11: - case 0x12: - case 0x80000010: - case 0x80000011: - case 0x80000012: - return context & 3; - case (ULONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE: - case (ULONG_PTR)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE: - case (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE: - return ~context; - default: - return DPI_AWARENESS_INVALID; - } + + return get_awareness_from_dpi_awareness_context((DPI_AWARENESS_CONTEXT)context); } DWORD get_process_layout(void)
1
0
0
0
Fabian Maurer : win32u: Move get_awareness_from_dpi_awareness_context.
by Alexandre Julliard
27 Feb '24
27 Feb '24
Module: wine Branch: master Commit: d96754213c4a722ffc5cf483e12c984fb20e7c21 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d96754213c4a722ffc5cf483e12c98…
Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Sat Feb 24 17:50:59 2024 +0100 win32u: Move get_awareness_from_dpi_awareness_context. --- dlls/win32u/sysparams.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 5dcf42ff7f5..5e48a09522c 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2187,6 +2187,27 @@ UINT get_win_monitor_dpi( HWND hwnd ) return system_dpi; } +/* see GetAwarenessFromDpiAwarenessContext */ +static DPI_AWARENESS get_awareness_from_dpi_awareness_context( DPI_AWARENESS_CONTEXT context ) +{ + switch ((ULONG_PTR)context) + { + case 0x10: + case 0x11: + case 0x12: + case 0x80000010: + case 0x80000011: + case 0x80000012: + return (ULONG_PTR)context & 3; + case (ULONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE: + case (ULONG_PTR)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE: + case (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE: + return ~(ULONG_PTR)context; + default: + return DPI_AWARENESS_INVALID; + } +} + /********************************************************************** * get_thread_dpi_awareness */ @@ -2240,27 +2261,6 @@ UINT get_system_dpi(void) return system_dpi; } -/* see GetAwarenessFromDpiAwarenessContext */ -static DPI_AWARENESS get_awareness_from_dpi_awareness_context( DPI_AWARENESS_CONTEXT context ) -{ - switch ((ULONG_PTR)context) - { - case 0x10: - case 0x11: - case 0x12: - case 0x80000010: - case 0x80000011: - case 0x80000012: - return (ULONG_PTR)context & 3; - case (ULONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE: - case (ULONG_PTR)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE: - case (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE: - return ~(ULONG_PTR)context; - default: - return DPI_AWARENESS_INVALID; - } -} - /********************************************************************** * SetThreadDpiAwarenessContext (win32u.so) */
1
0
0
0
Zebediah Figura : shell32: Stub IObjectWithSite on the New menu.
by Alexandre Julliard
27 Feb '24
27 Feb '24
Module: wine Branch: master Commit: 777a9d0f51f2a2b4939d2c19c8d76b0b7b4cb0ce URL:
https://gitlab.winehq.org/wine/wine/-/commit/777a9d0f51f2a2b4939d2c19c8d76b…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Sun Feb 25 18:09:43 2024 -0600 shell32: Stub IObjectWithSite on the New menu. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=24812
--- dlls/shell32/new_menu.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ dlls/shell32/tests/shlview.c | 5 ++--- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/new_menu.c b/dlls/shell32/new_menu.c index 83e07b70988..87ea93f9964 100644 --- a/dlls/shell32/new_menu.c +++ b/dlls/shell32/new_menu.c @@ -28,6 +28,7 @@ struct new_menu { IShellExtInit IShellExtInit_iface; IContextMenu3 IContextMenu3_iface; + IObjectWithSite IObjectWithSite_iface; LONG refcount; }; @@ -48,6 +49,8 @@ static HRESULT WINAPI ext_init_QueryInterface(IShellExtInit *iface, REFIID iid, || IsEqualGUID(iid, &IID_IContextMenu2) || IsEqualGUID(iid, &IID_IContextMenu3)) *out = &menu->IContextMenu3_iface; + else if (IsEqualGUID(iid, &IID_IObjectWithSite)) + *out = &menu->IObjectWithSite_iface; else { *out = NULL; @@ -178,6 +181,55 @@ static const IContextMenu3Vtbl context_menu_vtbl = context_menu_HandleMenuMsg2, }; +static struct new_menu *impl_from_IObjectWithSite(IObjectWithSite *iface) +{ + return CONTAINING_RECORD(iface, struct new_menu, IObjectWithSite_iface); +} + +static HRESULT WINAPI object_with_site_QueryInterface(IObjectWithSite *iface, REFIID iid, void **out) +{ + struct new_menu *menu = impl_from_IObjectWithSite(iface); + + return IShellExtInit_QueryInterface(&menu->IShellExtInit_iface, iid, out); +} + +static ULONG WINAPI object_with_site_AddRef(IObjectWithSite *iface) +{ + struct new_menu *menu = impl_from_IObjectWithSite(iface); + + return IShellExtInit_AddRef(&menu->IShellExtInit_iface); +} + +static ULONG WINAPI object_with_site_Release(IObjectWithSite *iface) +{ + struct new_menu *menu = impl_from_IObjectWithSite(iface); + + return IShellExtInit_Release(&menu->IShellExtInit_iface); +} + +static HRESULT WINAPI object_with_site_SetSite(IObjectWithSite *iface, IUnknown *site) +{ + FIXME("iface %p, site %p, stub!\n", iface, site); + + return E_NOTIMPL; +} + +static HRESULT WINAPI object_with_site_GetSite(IObjectWithSite *iface, REFIID iid, void **out) +{ + FIXME("iface %p, iid %s, out %p, stub!\n", iface, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static const IObjectWithSiteVtbl object_with_site_vtbl = +{ + object_with_site_QueryInterface, + object_with_site_AddRef, + object_with_site_Release, + object_with_site_SetSite, + object_with_site_GetSite, +}; + HRESULT WINAPI new_menu_create(IUnknown *outer, REFIID iid, void **out) { struct new_menu *menu; @@ -191,6 +243,7 @@ HRESULT WINAPI new_menu_create(IUnknown *outer, REFIID iid, void **out) menu->IShellExtInit_iface.lpVtbl = &ext_init_vtbl; menu->IContextMenu3_iface.lpVtbl = &context_menu_vtbl; + menu->IObjectWithSite_iface.lpVtbl = &object_with_site_vtbl; menu->refcount = 1; TRACE("Created New menu %p.\n", menu); diff --git a/dlls/shell32/tests/shlview.c b/dlls/shell32/tests/shlview.c index d2eeafd3323..0de7f2768c1 100644 --- a/dlls/shell32/tests/shlview.c +++ b/dlls/shell32/tests/shlview.c @@ -1493,9 +1493,8 @@ static void test_newmenu(void) IUnknown_Release(unk2); hr = IUnknown_QueryInterface(unk, &IID_IObjectWithSite, (void **)&unk2); - todo_wine ok(hr == S_OK, "Failed to get IObjectWithSite, hr %#lx.\n", hr); - if (hr == S_OK) - IUnknown_Release(unk2); + ok(hr == S_OK, "Failed to get IObjectWithSite, hr %#lx.\n", hr); + IUnknown_Release(unk2); IUnknown_Release(unk); }
1
0
0
0
Zebediah Figura : shell32: Stub IContextMenu3 on the New menu.
by Alexandre Julliard
27 Feb '24
27 Feb '24
Module: wine Branch: master Commit: 667eca5c0cbabedd3c55ffd65cbc9025ba72c943 URL:
https://gitlab.winehq.org/wine/wine/-/commit/667eca5c0cbabedd3c55ffd65cbc90…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Sun Feb 25 18:04:50 2024 -0600 shell32: Stub IContextMenu3 on the New menu. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=24812
--- dlls/shell32/new_menu.c | 85 ++++++++++++++++++++++++++++++++++++++++++++ dlls/shell32/tests/shlview.c | 5 ++- 2 files changed, 87 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/new_menu.c b/dlls/shell32/new_menu.c index 8fc29e7138b..83e07b70988 100644 --- a/dlls/shell32/new_menu.c +++ b/dlls/shell32/new_menu.c @@ -27,6 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); struct new_menu { IShellExtInit IShellExtInit_iface; + IContextMenu3 IContextMenu3_iface; LONG refcount; }; @@ -43,6 +44,10 @@ static HRESULT WINAPI ext_init_QueryInterface(IShellExtInit *iface, REFIID iid, if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IShellExtInit)) *out = &menu->IShellExtInit_iface; + else if (IsEqualGUID(iid, &IID_IContextMenu) + || IsEqualGUID(iid, &IID_IContextMenu2) + || IsEqualGUID(iid, &IID_IContextMenu3)) + *out = &menu->IContextMenu3_iface; else { *out = NULL; @@ -94,6 +99,85 @@ static const IShellExtInitVtbl ext_init_vtbl = ext_init_Initialize, }; +static struct new_menu *impl_from_IContextMenu3(IContextMenu3 *iface) +{ + return CONTAINING_RECORD(iface, struct new_menu, IContextMenu3_iface); +} + +static HRESULT WINAPI context_menu_QueryInterface(IContextMenu3 *iface, REFIID iid, void **out) +{ + struct new_menu *menu = impl_from_IContextMenu3(iface); + + return IShellExtInit_QueryInterface(&menu->IShellExtInit_iface, iid, out); +} + +static ULONG WINAPI context_menu_AddRef(IContextMenu3 *iface) +{ + struct new_menu *menu = impl_from_IContextMenu3(iface); + + return IShellExtInit_AddRef(&menu->IShellExtInit_iface); +} + +static ULONG WINAPI context_menu_Release(IContextMenu3 *iface) +{ + struct new_menu *menu = impl_from_IContextMenu3(iface); + + return IShellExtInit_Release(&menu->IShellExtInit_iface); +} + +static HRESULT WINAPI context_menu_QueryContextMenu(IContextMenu3 *iface, + HMENU hmenu, UINT index, UINT min_id, UINT max_id, UINT flags) +{ + FIXME("iface %p, hmenu %p, index %u, min_id %u, max_id %u, flags %#x, stub!\n", + iface, hmenu, index, min_id, max_id, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI context_menu_InvokeCommand(IContextMenu3 *iface, CMINVOKECOMMANDINFO *info) +{ + FIXME("iface %p, info %p, stub!\n", iface, info); + + return E_NOTIMPL; +} + +static HRESULT WINAPI context_menu_GetCommandString(IContextMenu3 *iface, + UINT_PTR id, UINT type, UINT *reserved, char *string, UINT size) +{ + FIXME("iface %p, id %Iu, type %#x, reserved %p, string %p, size %u, stub!\n", + iface, id, type, reserved, string, size); + + return E_NOTIMPL; +} + +static HRESULT WINAPI context_menu_HandleMenuMsg(IContextMenu3 *iface, UINT msg, WPARAM wparam, LPARAM lparam) +{ + FIXME("iface %p, msg %#x, wparam %#Ix, lparam %#Ix, stub!\n", iface, msg, wparam, lparam); + + return E_NOTIMPL; +} + +static HRESULT WINAPI context_menu_HandleMenuMsg2(IContextMenu3 *iface, + UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *result) +{ + FIXME("iface %p, msg %#x, wparam %#Ix, lparam %#Ix, result %p, stub!\n", + iface, msg, wparam, lparam, result); + + return E_NOTIMPL; +} + +static const IContextMenu3Vtbl context_menu_vtbl = +{ + context_menu_QueryInterface, + context_menu_AddRef, + context_menu_Release, + context_menu_QueryContextMenu, + context_menu_InvokeCommand, + context_menu_GetCommandString, + context_menu_HandleMenuMsg, + context_menu_HandleMenuMsg2, +}; + HRESULT WINAPI new_menu_create(IUnknown *outer, REFIID iid, void **out) { struct new_menu *menu; @@ -106,6 +190,7 @@ HRESULT WINAPI new_menu_create(IUnknown *outer, REFIID iid, void **out) return E_OUTOFMEMORY; menu->IShellExtInit_iface.lpVtbl = &ext_init_vtbl; + menu->IContextMenu3_iface.lpVtbl = &context_menu_vtbl; menu->refcount = 1; TRACE("Created New menu %p.\n", menu); diff --git a/dlls/shell32/tests/shlview.c b/dlls/shell32/tests/shlview.c index 316eb228bae..d2eeafd3323 100644 --- a/dlls/shell32/tests/shlview.c +++ b/dlls/shell32/tests/shlview.c @@ -1489,9 +1489,8 @@ static void test_newmenu(void) IUnknown_Release(unk2); hr = IUnknown_QueryInterface(unk, &IID_IContextMenu3, (void **)&unk2); - todo_wine ok(hr == S_OK, "Failed to get IContextMenu3, hr %#lx.\n", hr); - if (hr == S_OK) - IUnknown_Release(unk2); + ok(hr == S_OK, "Failed to get IContextMenu3, hr %#lx.\n", hr); + IUnknown_Release(unk2); hr = IUnknown_QueryInterface(unk, &IID_IObjectWithSite, (void **)&unk2); todo_wine ok(hr == S_OK, "Failed to get IObjectWithSite, hr %#lx.\n", hr);
1
0
0
0
Zebediah Figura : shell32: Stub CLSID_NewMenu.
by Alexandre Julliard
27 Feb '24
27 Feb '24
Module: wine Branch: master Commit: 1662fa9ab1243dc001425fc37902096a382a0b6b URL:
https://gitlab.winehq.org/wine/wine/-/commit/1662fa9ab1243dc001425fc3790209…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Sun Feb 25 16:15:17 2024 -0600 shell32: Stub CLSID_NewMenu. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=24812
--- dlls/shell32/Makefile.in | 1 + dlls/shell32/new_menu.c | 116 +++++++++++++++++++++++++++++++++++++++ dlls/shell32/shell32_classes.idl | 6 ++ dlls/shell32/shell32_main.h | 2 + dlls/shell32/shellole.c | 1 + dlls/shell32/tests/shlview.c | 16 ++---- 6 files changed, 132 insertions(+), 10 deletions(-) diff --git a/dlls/shell32/Makefile.in b/dlls/shell32/Makefile.in index 743df597ee4..4a906ac59db 100644 --- a/dlls/shell32/Makefile.in +++ b/dlls/shell32/Makefile.in @@ -23,6 +23,7 @@ SOURCES = \ enumidlist.c \ folders.c \ iconcache.c \ + new_menu.c \ pidl.c \ recyclebin.c \ resources/audio.svg \ diff --git a/dlls/shell32/new_menu.c b/dlls/shell32/new_menu.c new file mode 100644 index 00000000000..8fc29e7138b --- /dev/null +++ b/dlls/shell32/new_menu.c @@ -0,0 +1,116 @@ +/* + * Copyright 2015 Michael Müller + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "shobjidl.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + +struct new_menu +{ + IShellExtInit IShellExtInit_iface; + LONG refcount; +}; + +static struct new_menu *impl_from_IShellExtInit(IShellExtInit *iface) +{ + return CONTAINING_RECORD(iface, struct new_menu, IShellExtInit_iface); +} + +static HRESULT WINAPI ext_init_QueryInterface(IShellExtInit *iface, REFIID iid, void **out) +{ + struct new_menu *menu = impl_from_IShellExtInit(iface); + + TRACE("menu %p, iid %s, out %p.\n", menu, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IShellExtInit)) + *out = &menu->IShellExtInit_iface; + else + { + *out = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI ext_init_AddRef(IShellExtInit *iface) +{ + struct new_menu *menu = impl_from_IShellExtInit(iface); + ULONG refcount = InterlockedIncrement(&menu->refcount); + + TRACE("%p increasing refcount to %lu.\n", menu, refcount); + + return refcount; +} + +static ULONG WINAPI ext_init_Release(IShellExtInit *iface) +{ + struct new_menu *menu = impl_from_IShellExtInit(iface); + ULONG refcount = InterlockedDecrement(&menu->refcount); + + TRACE("%p decreasing refcount to %lu.\n", menu, refcount); + + if (!refcount) + free(menu); + + return refcount; +} + +static HRESULT WINAPI ext_init_Initialize(IShellExtInit *iface, LPCITEMIDLIST pidl, IDataObject *obj, HKEY key) +{ + struct new_menu *menu = impl_from_IShellExtInit(iface); + + TRACE("menu %p, pidl %p, obj %p, key %p.\n", menu, pidl, obj, key); + + return S_OK; +} + +static const IShellExtInitVtbl ext_init_vtbl = +{ + ext_init_QueryInterface, + ext_init_AddRef, + ext_init_Release, + ext_init_Initialize, +}; + +HRESULT WINAPI new_menu_create(IUnknown *outer, REFIID iid, void **out) +{ + struct new_menu *menu; + HRESULT hr; + + if (outer) + return CLASS_E_NOAGGREGATION; + + if (!(menu = malloc(sizeof(*menu)))) + return E_OUTOFMEMORY; + + menu->IShellExtInit_iface.lpVtbl = &ext_init_vtbl; + menu->refcount = 1; + + TRACE("Created New menu %p.\n", menu); + + hr = IShellExtInit_QueryInterface(&menu->IShellExtInit_iface, iid, out); + IShellExtInit_Release(&menu->IShellExtInit_iface); + return hr; +} diff --git a/dlls/shell32/shell32_classes.idl b/dlls/shell32/shell32_classes.idl index dc65ed3728d..135ef52f7b0 100644 --- a/dlls/shell32/shell32_classes.idl +++ b/dlls/shell32/shell32_classes.idl @@ -183,3 +183,9 @@ coclass KnownFolderManager { interface IKnownFolderManager; } threading(apartment), uuid(75048700-ef1f-11d0-9888-006097deacf9) ] coclass ActiveDesktop { interface IActiveDesktop; } + +[ + threading(apartment), + uuid(d969a300-e7ff-11d0-a93b-00a0c90f2719) +] +coclass NewMenu {} diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index 3f94385a60f..52c7d44f39f 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -114,6 +114,8 @@ HRESULT WINAPI ApplicationAssociationRegistration_Constructor(IUnknown *outer, R HRESULT WINAPI ApplicationDestinations_Constructor(IUnknown *outer, REFIID riid, LPVOID *ppv); HRESULT WINAPI ApplicationDocumentLists_Constructor(IUnknown *outer, REFIID riid, LPVOID *ppv); +HRESULT WINAPI new_menu_create(IUnknown *outer, REFIID iid, void **out); + HRESULT IShellLink_ConstructFromFile(IUnknown * pUnkOuter, REFIID riid, LPCITEMIDLIST pidl, IUnknown **ppv); LPEXTRACTICONA IExtractIconA_Constructor(LPCITEMIDLIST); diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 52123ac0004..aa9bd3e0f3e 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -70,6 +70,7 @@ static const struct { {&CLSID_MyComputer, ISF_MyComputer_Constructor}, {&CLSID_MyDocuments, MyDocuments_Constructor}, {&CLSID_NetworkPlaces, ISF_NetworkPlaces_Constructor}, + {&CLSID_NewMenu, new_menu_create}, {&CLSID_Printers, Printers_Constructor}, {&CLSID_QueryAssociations, QueryAssociations_Constructor}, {&CLSID_RecycleBin, RecycleBin_Constructor}, diff --git a/dlls/shell32/tests/shlview.c b/dlls/shell32/tests/shlview.c index 89ff2e71eb0..316eb228bae 100644 --- a/dlls/shell32/tests/shlview.c +++ b/dlls/shell32/tests/shlview.c @@ -1482,25 +1482,21 @@ static void test_newmenu(void) HRESULT hr; hr = CoCreateInstance(&CLSID_NewMenu, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk); - todo_wine ok(hr == S_OK, "Failed to create NewMenu object, hr %#lx.\n", hr); - if (hr != S_OK) - { - skip("NewMenu is not supported.\n"); - return; - } hr = IUnknown_QueryInterface(unk, &IID_IShellExtInit, (void **)&unk2); ok(hr == S_OK, "Failed to get IShellExtInit, hr %#lx.\n", hr); IUnknown_Release(unk2); hr = IUnknown_QueryInterface(unk, &IID_IContextMenu3, (void **)&unk2); - ok(hr == S_OK, "Failed to get IContextMenu3, hr %#lx.\n", hr); - IUnknown_Release(unk2); + todo_wine ok(hr == S_OK, "Failed to get IContextMenu3, hr %#lx.\n", hr); + if (hr == S_OK) + IUnknown_Release(unk2); hr = IUnknown_QueryInterface(unk, &IID_IObjectWithSite, (void **)&unk2); - ok(hr == S_OK, "Failed to get IObjectWithSite, hr %#lx.\n", hr); - IUnknown_Release(unk2); + todo_wine ok(hr == S_OK, "Failed to get IObjectWithSite, hr %#lx.\n", hr); + if (hr == S_OK) + IUnknown_Release(unk2); IUnknown_Release(unk); }
1
0
0
0
Brendan Shanks : ntdll: Add native thread renaming for FreeBSD.
by Alexandre Julliard
27 Feb '24
27 Feb '24
Module: wine Branch: master Commit: fe4f138292a81935e5653e94683e3961b7ede4fa URL:
https://gitlab.winehq.org/wine/wine/-/commit/fe4f138292a81935e5653e94683e39…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Mon Feb 26 15:19:39 2024 -0800 ntdll: Add native thread renaming for FreeBSD. --- dlls/ntdll/unix/thread.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 52cb0f26e97..578399f43f3 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -62,6 +62,9 @@ #ifdef __APPLE__ #include <mach/mach.h> #endif +#ifdef __FreeBSD__ +#include <sys/thr.h> +#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -1935,6 +1938,36 @@ static void set_native_thread_name( HANDLE handle, const UNICODE_STRING *name ) len = ntdll_wcstoumbs( name->Buffer, name->Length / sizeof(WCHAR), nameA, sizeof(nameA) - 1, FALSE ); nameA[len] = '\0'; pthread_setname_np( nameA ); +#elif defined(__FreeBSD__) + unsigned int status; + char nameA[64]; + int unix_pid, unix_tid, len; + + SERVER_START_REQ( get_thread_times ) + { + req->handle = wine_server_obj_handle( handle ); + status = wine_server_call( req ); + if (status == STATUS_SUCCESS) + { + unix_pid = reply->unix_pid; + unix_tid = reply->unix_tid; + } + } + SERVER_END_REQ; + + if (status != STATUS_SUCCESS || unix_pid == -1 || unix_tid == -1) + return; + + if (unix_pid != getpid()) + { + static int once; + if (!once++) FIXME("cross-process native thread naming not supported\n"); + return; + } + + len = ntdll_wcstoumbs( name->Buffer, name->Length / sizeof(WCHAR), nameA, sizeof(nameA), FALSE ); + nameA[len] = '\0'; + thr_set_name( unix_tid, nameA ); #else static int once; if (!once++) FIXME("not implemented on this platform\n");
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
72
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
Results per page:
10
25
50
100
200