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 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
705 discussions
Start a n
N
ew thread
Rémi Bernon : user32/tests: Add more SetThreadDpiAwarenessContext tests.
by Alexandre Julliard
24 May '24
24 May '24
Module: wine Branch: master Commit: b3739dcc9cc6f0238ac636d0c0e8f2213b5f423b URL:
https://gitlab.winehq.org/wine/wine/-/commit/b3739dcc9cc6f0238ac636d0c0e8f2…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu May 23 20:28:19 2024 +0200 user32/tests: Add more SetThreadDpiAwarenessContext tests. --- dlls/user32/tests/sysparams.c | 169 ++++++++++++++++++++++++++++++------------ 1 file changed, 122 insertions(+), 47 deletions(-)
1
0
0
0
Rémi Bernon : user32/tests: Add some SetProcessDpiAwarenessContext tests.
by Alexandre Julliard
24 May '24
24 May '24
Module: wine Branch: master Commit: 6b68b55ce34c67ce95586a7cccee58ac2f6ee5f4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6b68b55ce34c67ce95586a7cccee58…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu May 23 14:57:58 2024 +0200 user32/tests: Add some SetProcessDpiAwarenessContext tests. --- dlls/user32/tests/sysparams.c | 155 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 151 insertions(+), 4 deletions(-) diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 2528d4d4398..7714b41010e 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -173,6 +173,24 @@ static int last_bpp; static BOOL displaychange_ok = FALSE, displaychange_test_active = FALSE; static HANDLE displaychange_sem = 0; +#define run_in_process( a, b ) run_in_process_( __FILE__, __LINE__, a, b ) +static void run_in_process_( const char *file, int line, char **argv, const char *args ) +{ + STARTUPINFOA startup = {.cb = sizeof(STARTUPINFOA)}; + PROCESS_INFORMATION info = {0}; + char cmdline[MAX_PATH * 2]; + DWORD ret; + + sprintf( cmdline, "%s %s %s", argv[0], argv[1], args ); + ret = CreateProcessA( NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info ); + ok_(file, line)( ret, "CreateProcessA failed, error %lu\n", GetLastError() ); + if (!ret) return; + + wait_child_process( info.hProcess ); + CloseHandle( info.hThread ); + CloseHandle( info.hProcess ); +} + static BOOL get_reg_dword(HKEY base, const char *key_name, const char *value_name, DWORD *value) { HKEY key; @@ -194,13 +212,19 @@ static BOOL get_reg_dword(HKEY base, const char *key_name, const char *value_nam static DWORD get_real_dpi(void) { + DPI_AWARENESS_CONTEXT ctx; DWORD dpi; if (pSetThreadDpiAwarenessContext) { - DPI_AWARENESS_CONTEXT context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ); + ctx = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ); + todo_wine ok( ctx == (DPI_AWARENESS_CONTEXT)0x80006010, "got %p\n", ctx ); dpi = pGetDpiForSystem(); - pSetThreadDpiAwarenessContext( context ); + ok( dpi, "GetDpiForSystem failed\n" ); + /* restore process-wide DPI awareness context */ + ctx = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x80006010 ); + todo_wine ok( ctx == (DPI_AWARENESS_CONTEXT)((UINT_PTR)0x11 | (dpi << 8)), "got %p\n", ctx ); + if (!ctx) pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x80000010 ); return dpi; } if (get_reg_dword(HKEY_CURRENT_USER, "Control Panel\\Desktop", "LogPixels", &dpi)) @@ -3871,6 +3895,102 @@ static void test_AreDpiAwarenessContextsEqual(ULONG_PTR flags) } } +static void test_SetProcessDpiAwarenessContext( ULONG arg ) +{ + DPI_AWARENESS_CONTEXT contexts[] = + { + (DPI_AWARENESS_CONTEXT)0x6010, + (DPI_AWARENESS_CONTEXT)0x40006010, + (DPI_AWARENESS_CONTEXT)((UINT_PTR)0x11 | (real_dpi << 8)), + (DPI_AWARENESS_CONTEXT)0x12, + (DPI_AWARENESS_CONTEXT)0x22, + }; + DPI_AWARENESS_CONTEXT context, ctx, expect_ctx; + UINT ret, i; + + /* 0x11 is system aware DPI and only works with the current system DPI */ + if (arg == 0x11) context = contexts[2]; + else context = LongToHandle( arg ) /* sign-extend */; + + if (context == DPI_AWARENESS_CONTEXT_UNAWARE) expect_ctx = contexts[0]; + else if (context == DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED) expect_ctx = contexts[1]; + else if (context == DPI_AWARENESS_CONTEXT_SYSTEM_AWARE) expect_ctx = contexts[2]; + else if (context == DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE) expect_ctx = contexts[3]; + else if (context == DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) expect_ctx = contexts[4]; + else if ((arg & 0xff000000) == 0x80000000) expect_ctx = ULongToHandle( arg ) /* no sign-extend */; + else expect_ctx = context; + + winetest_push_context( "%#lx", arg ); + + ctx = pGetThreadDpiAwarenessContext(); + todo_wine ok( ctx == (DPI_AWARENESS_CONTEXT)0x6010, "got %p\n", ctx ); + + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( 0 ); + ok( !ret, "SetProcessDpiAwarenessContext succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x11 ); + ok( !ret, "SetProcessDpiAwarenessContext succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ACCESS_DENIED, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x21 ); + ok( !ret, "SetProcessDpiAwarenessContext succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x32 ); + ok( !ret, "SetProcessDpiAwarenessContext succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x6012 ); + ok( !ret, "SetProcessDpiAwarenessContext succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x6022 ); + ok( !ret, "SetProcessDpiAwarenessContext succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x40006011 ); + ok( !ret, "SetProcessDpiAwarenessContext succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x40000012 ); + ok( !ret, "SetProcessDpiAwarenessContext succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x7810 ); + ok( !ret, "SetProcessDpiAwarenessContext succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x1ff11 ); + ok( !ret, "SetProcessDpiAwarenessContext succeeded\n" ); + todo_wine ok( GetLastError() == ERROR_ACCESS_DENIED, "got %#lx\n", GetLastError() ); + ctx = pGetThreadDpiAwarenessContext(); + todo_wine ok( ctx == (DPI_AWARENESS_CONTEXT)0x6010, "got %p\n", ctx ); + + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( context ); + todo_wine ok( ret, "SetProcessDpiAwarenessContext failed, error %lu\n", GetLastError() ); + todo_wine ok( GetLastError() == 0xdeadbeef, "got %#lx\n", GetLastError() ); + ctx = pGetThreadDpiAwarenessContext(); + todo_wine_if( arg != 0x12 && context != DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ) + ok( ctx == expect_ctx, "got %p\n", ctx ); + + for (i = 0; i < ARRAY_SIZE(contexts); i++) + { + SetLastError( 0xdeadbeef ); + ret = pSetProcessDpiAwarenessContext( contexts[i] ); + ok( !ret, "SetProcessDpiAwarenessContext succeeded\n" ); + todo_wine_if( i < 3 ) + ok( GetLastError() == ERROR_ACCESS_DENIED, "got %#lx\n", GetLastError() ); + ctx = pGetThreadDpiAwarenessContext(); + todo_wine_if( arg != 0x12 && context != DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ) + ok( ctx == expect_ctx, "got %p\n", ctx ); + } + + winetest_pop_context(); +} + static void test_dpi_context(void) { DPI_AWARENESS awareness; @@ -4320,7 +4440,6 @@ START_TEST(sysparams) hdc = GetDC(0); dpi = GetDeviceCaps( hdc, LOGPIXELSY); real_dpi = get_real_dpi(); - trace("dpi %d real_dpi %d\n", dpi, real_dpi); ReleaseDC( 0, hdc); /* This test requires interactivity, if we don't have it, give up */ @@ -4329,7 +4448,14 @@ START_TEST(sysparams) argc = winetest_get_mainargs(&argv); strict=(argc >= 3 && strcmp(argv[2],"strict")==0); - trace("strict=%d\n",strict); + + if (argc > 3 && !strcmp( argv[2], "SetProcessDpiAwarenessContext" )) + { + test_SetProcessDpiAwarenessContext( strtoul( argv[3], NULL, 16 ) ); + return; + } + + trace("dpi %d real_dpi %d, strict %d\n", dpi, real_dpi, strict); test_LOGFONT_charset(); @@ -4379,4 +4505,25 @@ START_TEST(sysparams) else win_skip( "SetThreadDpiAwarenessContext not supported\n" ); test_dpi_aware(); + + if (!pSetProcessDpiAwarenessContext || !pSetThreadDpiAwarenessContext || !pGetThreadDpiAwarenessContext) + win_skip( "SetProcessDpiAwarenessContext not supported\n" ); + else + { + run_in_process( argv, "SetProcessDpiAwarenessContext 0x6010" ); + run_in_process( argv, "SetProcessDpiAwarenessContext 0x11" ); + run_in_process( argv, "SetProcessDpiAwarenessContext 0x12" ); + run_in_process( argv, "SetProcessDpiAwarenessContext 0x22" ); + run_in_process( argv, "SetProcessDpiAwarenessContext 0x40006010" ); + run_in_process( argv, "SetProcessDpiAwarenessContext 0x80006010" ); + run_in_process( argv, "SetProcessDpiAwarenessContext 0x80000012" ); + run_in_process( argv, "SetProcessDpiAwarenessContext 0x80000022" ); + + /* user32 allows abstract DPI contexts to be used */ + run_in_process( argv, "SetProcessDpiAwarenessContext 0xffffffff" ); + run_in_process( argv, "SetProcessDpiAwarenessContext 0xfffffffe" ); + run_in_process( argv, "SetProcessDpiAwarenessContext 0xfffffffd" ); + run_in_process( argv, "SetProcessDpiAwarenessContext 0xfffffffc" ); + run_in_process( argv, "SetProcessDpiAwarenessContext 0xfffffffb" ); + } }
1
0
0
0
Rémi Bernon : win32u: Fix NtUserSetProcessDpiAwarenessContext.
by Alexandre Julliard
24 May '24
24 May '24
Module: wine Branch: master Commit: 6ee5c60d5dd4d7ff86d21f847a1c589f034c94f2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6ee5c60d5dd4d7ff86d21f847a1c58…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu May 23 13:32:45 2024 +0200 win32u: Fix NtUserSetProcessDpiAwarenessContext. --- dlls/user32/sysparams.c | 12 ++++++---- dlls/win32u/sysparams.c | 59 ++++++++++++++++++++++++++++++++++++------------- include/ntuser.h | 21 +++++++++++++----- 3 files changed, 67 insertions(+), 25 deletions(-) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index a3f768ff66d..f5f6bf2eec9 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -615,7 +615,8 @@ BOOL WINAPI SetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT context ) */ BOOL WINAPI GetProcessDpiAwarenessInternal( HANDLE process, DPI_AWARENESS *awareness ) { - *awareness = NtUserGetProcessDpiAwarenessContext( process ) & 3; + ULONG context = NtUserGetProcessDpiAwarenessContext( process ); + *awareness = NTUSER_DPI_CONTEXT_GET_AWARENESS( context ); return TRUE; } @@ -732,9 +733,12 @@ UINT WINAPI GetDpiForSystem(void) DPI_AWARENESS_CONTEXT WINAPI GetThreadDpiAwarenessContext(void) { struct ntuser_thread_info *info = NtUserGetThreadInfo(); + ULONG context; if (info->dpi_awareness) return ULongToHandle( info->dpi_awareness ); - return UlongToHandle( (NtUserGetProcessDpiAwarenessContext( GetCurrentProcess() ) & 3 ) | 0x10 ); + + context = NtUserGetProcessDpiAwarenessContext( GetCurrentProcess() ); + return UlongToHandle( NTUSER_DPI_CONTEXT_GET_AWARENESS( context ) | 0x10 ); } /********************************************************************** @@ -753,8 +757,8 @@ DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT } if (!(prev = info->dpi_awareness)) { - prev = NtUserGetProcessDpiAwarenessContext( GetCurrentProcess() ) & 3; - prev |= 0x80000010; /* restore to process default */ + ULONG process_ctx = NtUserGetProcessDpiAwarenessContext( GetCurrentProcess() ); + prev = NTUSER_DPI_CONTEXT_GET_AWARENESS( process_ctx ) | 0x80000010; /* restore to process default */ } 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) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index c6eb09c4268..c51275a294f 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2107,6 +2107,35 @@ UINT get_win_monitor_dpi( HWND hwnd ) return system_dpi; } +/* keep in sync with user32 */ +static BOOL is_valid_dpi_awareness_context( UINT context, UINT dpi ) +{ + switch (NTUSER_DPI_CONTEXT_GET_AWARENESS( context )) + { + case DPI_AWARENESS_UNAWARE: + if (NTUSER_DPI_CONTEXT_GET_FLAGS( context ) & ~NTUSER_DPI_CONTEXT_FLAG_VALID_MASK) return FALSE; + if (NTUSER_DPI_CONTEXT_GET_VERSION( context ) != 1) return FALSE; + if (NTUSER_DPI_CONTEXT_GET_DPI( context ) != USER_DEFAULT_SCREEN_DPI) return FALSE; + return TRUE; + + case DPI_AWARENESS_SYSTEM_AWARE: + if (NTUSER_DPI_CONTEXT_GET_FLAGS( context ) & ~NTUSER_DPI_CONTEXT_FLAG_VALID_MASK) return FALSE; + if (NTUSER_DPI_CONTEXT_GET_FLAGS( context ) & NTUSER_DPI_CONTEXT_FLAG_GDISCALED) return FALSE; + if (NTUSER_DPI_CONTEXT_GET_VERSION( context ) != 1) return FALSE; + if (dpi && NTUSER_DPI_CONTEXT_GET_DPI( context ) != dpi) return FALSE; + return TRUE; + + case DPI_AWARENESS_PER_MONITOR_AWARE: + if (NTUSER_DPI_CONTEXT_GET_FLAGS( context ) & ~NTUSER_DPI_CONTEXT_FLAG_VALID_MASK) return FALSE; + if (NTUSER_DPI_CONTEXT_GET_FLAGS( context ) & NTUSER_DPI_CONTEXT_FLAG_GDISCALED) return FALSE; + if (NTUSER_DPI_CONTEXT_GET_VERSION( context ) != 1 && NTUSER_DPI_CONTEXT_GET_VERSION( context ) != 2) return FALSE; + if (NTUSER_DPI_CONTEXT_GET_DPI( context )) return FALSE; + return TRUE; + } + + return FALSE; +} + /* copied from user32 GetAwarenessFromDpiAwarenessContext, make sure to keep that in sync */ static DPI_AWARENESS get_awareness_from_dpi_awareness_context( DPI_AWARENESS_CONTEXT context ) { @@ -6202,27 +6231,27 @@ BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *va } -static LONG dpi_awareness; +static LONG dpi_context; /*********************************************************************** * NtUserSetProcessDpiAwarenessContext (win32u.@) */ -BOOL WINAPI NtUserSetProcessDpiAwarenessContext( ULONG awareness, ULONG unknown ) +BOOL WINAPI NtUserSetProcessDpiAwarenessContext( ULONG context, ULONG unknown ) { - switch (awareness) + if (!is_valid_dpi_awareness_context( context, system_dpi )) { - case NTUSER_DPI_UNAWARE: - case NTUSER_DPI_SYSTEM_AWARE: - case NTUSER_DPI_PER_MONITOR_AWARE: - case NTUSER_DPI_PER_MONITOR_AWARE_V2: - case NTUSER_DPI_PER_UNAWARE_GDISCALED: - break; - default: RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; } - return !InterlockedCompareExchange( &dpi_awareness, awareness, 0 ); + if (InterlockedCompareExchange( &dpi_context, context, 0 )) + { + RtlSetLastWin32Error( ERROR_ACCESS_DENIED ); + return FALSE; + } + + TRACE( "set to %#x\n", (UINT)context ); + return TRUE; } /*********************************************************************** @@ -6230,7 +6259,7 @@ BOOL WINAPI NtUserSetProcessDpiAwarenessContext( ULONG awareness, ULONG unknown */ ULONG WINAPI NtUserGetProcessDpiAwarenessContext( HANDLE process ) { - DPI_AWARENESS val; + ULONG context; if (process && process != GetCurrentProcess()) { @@ -6238,9 +6267,9 @@ ULONG WINAPI NtUserGetProcessDpiAwarenessContext( HANDLE process ) return NTUSER_DPI_UNAWARE; } - val = ReadNoFence( &dpi_awareness ); - if (!val) return NTUSER_DPI_UNAWARE; - return val; + context = ReadNoFence( &dpi_context ); + if (!context) return NTUSER_DPI_UNAWARE; + return context; } BOOL message_beep( UINT i ) diff --git a/include/ntuser.h b/include/ntuser.h index f947fec7fea..419ba2e86c3 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -281,12 +281,21 @@ struct unpack_dde_message_result LPARAM lparam; }; -/* process DPI awareness contexts */ -#define NTUSER_DPI_UNAWARE 0x00006010 -#define NTUSER_DPI_SYSTEM_AWARE 0x00006011 -#define NTUSER_DPI_PER_MONITOR_AWARE 0x00000012 -#define NTUSER_DPI_PER_MONITOR_AWARE_V2 0x00000022 -#define NTUSER_DPI_PER_UNAWARE_GDISCALED 0x40006010 +/* DPI awareness contexts */ +#define MAKE_NTUSER_DPI_CONTEXT( awareness, version, dpi, flags ) ((awareness) | ((version) << 4) | ((dpi) << 8) | (flags)) +#define NTUSER_DPI_CONTEXT_GET_AWARENESS( ctx ) ((ctx) & 0x0f) +#define NTUSER_DPI_CONTEXT_GET_VERSION( ctx ) (((ctx) & 0xf0) >> 4) +#define NTUSER_DPI_CONTEXT_GET_DPI( ctx ) ((((ctx) & 0x1ff00) >> 8)) +#define NTUSER_DPI_CONTEXT_GET_FLAGS( ctx ) ((ctx) & 0xfffe0000) +#define NTUSER_DPI_CONTEXT_FLAG_GDISCALED 0x40000000 +#define NTUSER_DPI_CONTEXT_FLAG_PROCESS 0x80000000 +#define NTUSER_DPI_CONTEXT_FLAG_VALID_MASK (NTUSER_DPI_CONTEXT_FLAG_PROCESS | NTUSER_DPI_CONTEXT_FLAG_GDISCALED) + +#define NTUSER_DPI_UNAWARE MAKE_NTUSER_DPI_CONTEXT( DPI_AWARENESS_UNAWARE, 1, USER_DEFAULT_SCREEN_DPI, 0 ) +#define NTUSER_DPI_SYSTEM_AWARE MAKE_NTUSER_DPI_CONTEXT( DPI_AWARENESS_SYSTEM_AWARE, 1, system_dpi, 0 ) +#define NTUSER_DPI_PER_MONITOR_AWARE MAKE_NTUSER_DPI_CONTEXT( DPI_AWARENESS_PER_MONITOR_AWARE, 1, 0, 0 ) +#define NTUSER_DPI_PER_MONITOR_AWARE_V2 MAKE_NTUSER_DPI_CONTEXT( DPI_AWARENESS_PER_MONITOR_AWARE, 2, 0, 0 ) +#define NTUSER_DPI_PER_UNAWARE_GDISCALED MAKE_NTUSER_DPI_CONTEXT( DPI_AWARENESS_UNAWARE, 1, USER_DEFAULT_SCREEN_DPI, NTUSER_DPI_CONTEXT_FLAG_GDISCALED ) /* message spy definitions */ #define SPY_DISPATCHMESSAGE 0x0100
1
0
0
0
Rémi Bernon : win32u/tests: Add NtUser(Get|Set)ProcessDpiAwarenessContext tests.
by Alexandre Julliard
24 May '24
24 May '24
Module: wine Branch: master Commit: d75f9dfbb81ccf1145a0c52c07f3a8a7efd4cada URL:
https://gitlab.winehq.org/wine/wine/-/commit/d75f9dfbb81ccf1145a0c52c07f3a8…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu May 23 13:18:40 2024 +0200 win32u/tests: Add NtUser(Get|Set)ProcessDpiAwarenessContext tests. --- dlls/win32u/tests/win32u.c | 135 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) diff --git a/dlls/win32u/tests/win32u.c b/dlls/win32u/tests/win32u.c index 78d2f21295c..7606b7d23ba 100644 --- a/dlls/win32u/tests/win32u.c +++ b/dlls/win32u/tests/win32u.c @@ -2043,6 +2043,126 @@ static void test_wndproc_hook(void) UnregisterClassW( L"TestLParamClass", NULL ); } +static DWORD get_real_dpi(void) +{ + DPI_AWARENESS_CONTEXT ctx; + DWORD dpi; + + ctx = SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ); + todo_wine ok( ctx == (DPI_AWARENESS_CONTEXT)0x80006010, "got %p\n", ctx ); + dpi = GetDpiForSystem(); + ok( dpi, "GetDpiForSystem failed\n" ); + /* restore process-wide DPI awareness context */ + ctx = SetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x80006010 ); + todo_wine ok( ctx == (DPI_AWARENESS_CONTEXT)((UINT_PTR)0x11 | (dpi << 8)), "got %p\n", ctx ); + if (!ctx) SetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x80000010 ); + + return dpi; +} + +static void test_NtUserSetProcessDpiAwarenessContext( ULONG context ) +{ + UINT contexts[] = + { + 0x6010, + 0x40006010, + 0x11 | (get_real_dpi() << 8), + 0x12, + 0x22, + }; + UINT ret, i; + + /* 0x11 is system aware DPI and only works with the current system DPI */ + if (context == 0x11) context = contexts[1]; + + winetest_push_context( "%#lx", context ); + + ret = NtUserGetProcessDpiAwarenessContext( GetCurrentProcess() ); + todo_wine ok( ret == 0x6010, "got %#x\n", ret ); + + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( 0, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + + /* win32u doesn't allow abstract DPI awareness contexts */ + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( (LONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( (LONG_PTR)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( (LONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( (LONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( (LONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( 0x11, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( 0x21, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( 0x32, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( 0x6012, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( 0x6022, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( 0x40006011, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( 0x40000012, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( 0x7810, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = NtUserSetProcessDpiAwarenessContext( 0x1ff11, 0 ); + ok( ret == 0, "got %#x\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %#lx\n", GetLastError() ); + ret = NtUserGetProcessDpiAwarenessContext( GetCurrentProcess() ); + todo_wine ok( ret == 0x6010, "got %#x\n", ret ); + + ret = NtUserSetProcessDpiAwarenessContext( context, 0 ); + todo_wine ok( ret == 1, "got %#x\n", ret ); + ret = NtUserGetProcessDpiAwarenessContext( GetCurrentProcess() ); + todo_wine_if( context != 0x12 ) + ok( ret == context, "got %#x\n", ret ); + + for (i = 0; i < ARRAY_SIZE(contexts); i++) + { + ret = NtUserSetProcessDpiAwarenessContext( contexts[i], 0 ); + ok( !ret, "got %#x\n", ret ); + ret = NtUserGetProcessDpiAwarenessContext( GetCurrentProcess() ); + todo_wine_if( context != 0x12 ) + ok( ret == context, "got %#x\n", ret ); + } + + winetest_pop_context(); +} + START_TEST(win32u) { char **argv; @@ -2066,6 +2186,12 @@ START_TEST(win32u) return; } + if (argc > 3 && !strcmp( argv[2], "NtUserSetProcessDpiAwarenessContext" )) + { + test_NtUserSetProcessDpiAwarenessContext( strtoul( argv[3], NULL, 16 ) ); + return; + } + test_NtUserEnumDisplayDevices(); test_window_props(); test_class(); @@ -2086,4 +2212,13 @@ START_TEST(win32u) run_in_process( argv, "NtUserEnableMouseInPointer 0" ); run_in_process( argv, "NtUserEnableMouseInPointer 1" ); + + run_in_process( argv, "NtUserSetProcessDpiAwarenessContext 0x6010" ); + run_in_process( argv, "NtUserSetProcessDpiAwarenessContext 0x11" ); + run_in_process( argv, "NtUserSetProcessDpiAwarenessContext 0x12" ); + run_in_process( argv, "NtUserSetProcessDpiAwarenessContext 0x22" ); + run_in_process( argv, "NtUserSetProcessDpiAwarenessContext 0x40006010" ); + run_in_process( argv, "NtUserSetProcessDpiAwarenessContext 0x80006010" ); + run_in_process( argv, "NtUserSetProcessDpiAwarenessContext 0x80000012" ); + run_in_process( argv, "NtUserSetProcessDpiAwarenessContext 0x80000022" ); }
1
0
0
0
Rémi Bernon : win32u/tests: Introduce a new run_in_process helper.
by Alexandre Julliard
24 May '24
24 May '24
Module: wine Branch: master Commit: ef224f1dd8033dc76fb8ac7b76ce50b3de70480a URL:
https://gitlab.winehq.org/wine/wine/-/commit/ef224f1dd8033dc76fb8ac7b76ce50…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu May 23 13:18:40 2024 +0200 win32u/tests: Introduce a new run_in_process helper. --- dlls/win32u/tests/win32u.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/dlls/win32u/tests/win32u.c b/dlls/win32u/tests/win32u.c index f7fe74ed34c..78d2f21295c 100644 --- a/dlls/win32u/tests/win32u.c +++ b/dlls/win32u/tests/win32u.c @@ -29,6 +29,24 @@ #define check_member( val, exp, fmt, member ) \ check_member_( __FILE__, __LINE__, val, exp, fmt, member ) +#define run_in_process( a, b ) run_in_process_( __FILE__, __LINE__, a, b ) +static void run_in_process_( const char *file, int line, char **argv, const char *args ) +{ + STARTUPINFOA startup = {.cb = sizeof(STARTUPINFOA)}; + PROCESS_INFORMATION info = {0}; + char cmdline[MAX_PATH * 2]; + DWORD ret; + + sprintf( cmdline, "%s %s %s", argv[0], argv[1], args ); + ret = CreateProcessA( NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info ); + ok_(file, line)( ret, "CreateProcessA failed, error %lu\n", GetLastError() ); + if (!ret) return; + + wait_child_process( info.hProcess ); + CloseHandle( info.hThread ); + CloseHandle( info.hProcess ); +} + static void flush_events(void) { int min_timeout = 100, diff = 200; @@ -1305,7 +1323,7 @@ done: ok( ret, "UnregisterClassW failed: %lu\n", GetLastError() ); } -static void test_NtUserEnableMouseInPointer_process( const char *arg ) +static void test_NtUserEnableMouseInPointer( const char *arg ) { DWORD enable = strtoul( arg, 0, 10 ); BOOL ret; @@ -1339,23 +1357,6 @@ static void test_NtUserEnableMouseInPointer_process( const char *arg ) test_NtUserGetPointerInfoList( enable ); } -static void test_NtUserEnableMouseInPointer( char **argv, BOOL enable ) -{ - STARTUPINFOA startup = {.cb = sizeof(STARTUPINFOA)}; - PROCESS_INFORMATION info = {0}; - char cmdline[MAX_PATH * 2]; - BOOL ret; - - sprintf( cmdline, "%s %s NtUserEnableMouseInPointer %u", argv[0], argv[1], enable ); - ret = CreateProcessA( NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info ); - ok( ret, "CreateProcessA failed, error %lu\n", GetLastError() ); - if (!ret) return; - - wait_child_process( info.hProcess ); - CloseHandle( info.hThread ); - CloseHandle( info.hProcess ); -} - struct lparam_hook_test { const char *name; @@ -2060,7 +2061,7 @@ START_TEST(win32u) if (argc > 3 && !strcmp( argv[2], "NtUserEnableMouseInPointer" )) { winetest_push_context( "enable %s", argv[3] ); - test_NtUserEnableMouseInPointer_process( argv[3] ); + test_NtUserEnableMouseInPointer( argv[3] ); winetest_pop_context(); return; } @@ -2083,6 +2084,6 @@ START_TEST(win32u) test_NtUserCloseWindowStation(); test_NtUserDisplayConfigGetDeviceInfo(); - test_NtUserEnableMouseInPointer( argv, FALSE ); - test_NtUserEnableMouseInPointer( argv, TRUE ); + run_in_process( argv, "NtUserEnableMouseInPointer 0" ); + run_in_process( argv, "NtUserEnableMouseInPointer 1" ); }
1
0
0
0
Rémi Bernon : winegstreamer: Implement WMA DMO Get(Input|Output)CurrentType.
by Alexandre Julliard
24 May '24
24 May '24
Module: wine Branch: master Commit: 52ae7e7b642195777b62986110f878b437b7d194 URL:
https://gitlab.winehq.org/wine/wine/-/commit/52ae7e7b642195777b62986110f878…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri May 24 12:01:08 2024 +0200 winegstreamer: Implement WMA DMO Get(Input|Output)CurrentType. --- dlls/mf/tests/transform.c | 33 +++++---------------------------- dlls/winegstreamer/wma_decoder.c | 26 ++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index e7d8f924b70..0291fe16e18 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -3519,37 +3519,26 @@ static void test_wma_decoder_dmo_input_type(void) hr = IMediaObject_SetInputType(dmo, 0, NULL, DMO_SET_TYPEF_CLEAR); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 1, NULL); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, NULL); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 1, &type); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, &type); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_SetInputType(dmo, 0, good_input_type, 0); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 1, NULL); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, NULL); - todo_wine ok(hr == E_POINTER, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 1, &type); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, &type); - todo_wine ok(hr == S_OK, "GetInputCurrentType returned %#lx.\n", hr); - if (hr == S_OK) - { - check_dmo_media_type(&type, good_input_type); - MoFreeMediaType(&type); - } + check_dmo_media_type(&type, good_input_type); + MoFreeMediaType(&type); /* Cleanup. */ ret = IMediaObject_Release(dmo); @@ -3721,8 +3710,6 @@ static void test_wma_decoder_dmo_output_type(void) /* Test GetOutputCurrentType. */ hr = IMediaObject_SetOutputType(dmo, 0, NULL, DMO_SET_TYPEF_CLEAR); ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr); - todo_wine - { hr = IMediaObject_GetOutputCurrentType(dmo, 1, NULL); ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, NULL); @@ -3731,12 +3718,9 @@ static void test_wma_decoder_dmo_output_type(void) ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputCurrentType returned %#lx.\n", hr); - } hr = IMediaObject_SetOutputType(dmo, 0, good_output_type, 0); ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr); - todo_wine - { hr = IMediaObject_GetOutputCurrentType(dmo, 1, NULL); ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, NULL); @@ -3745,12 +3729,8 @@ static void test_wma_decoder_dmo_output_type(void) ok(hr == DMO_E_INVALIDSTREAMINDEX, "GetOutputCurrentType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); ok(hr == S_OK, "GetOutputCurrentType returned %#lx.\n", hr); - } - if (hr == S_OK) - { - check_dmo_media_type(&type, good_output_type); - MoFreeMediaType(&type); - } + check_dmo_media_type(&type, good_output_type); + MoFreeMediaType(&type); /* Test GetOutputSizeInfo. */ hr = IMediaObject_GetOutputSizeInfo(dmo, 1, NULL, NULL); @@ -3767,20 +3747,17 @@ static void test_wma_decoder_dmo_output_type(void) ok(alignment == 1, "Unexpected alignment %lu.\n", alignment); hr = IMediaObject_GetInputCurrentType(dmo, 0, input_type); - todo_wine ok(hr == S_OK, "GetInputCurrentType returned %#lx.\n", hr); hr = IMediaObject_SetInputType(dmo, 0, input_type, 0); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); - todo_wine ok(hr == S_OK, "GetOutputCurrentType returned %#lx.\n", hr); init_dmo_media_type_audio(input_type, input_subtype, channel_count, rate * 2, 32); hr = IMediaObject_SetInputType(dmo, 0, input_type, 0); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &type); - todo_wine - ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputCurrentType returned %#lx.\n", hr); + todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputCurrentType returned %#lx.\n", hr); /* Cleanup. */ ret = IMediaObject_Release(dmo); diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index bc11383fc64..8aa55b9b137 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -813,14 +813,32 @@ static HRESULT WINAPI media_object_SetOutputType(IMediaObject *iface, DWORD inde static HRESULT WINAPI media_object_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) { - FIXME("iface %p, index %lu, type %p stub!\n", iface, index, type); - return E_NOTIMPL; + struct wma_decoder *decoder = impl_from_IMediaObject(iface); + + TRACE("iface %p, index %lu, type %p\n", iface, index, type); + + if (index) + return DMO_E_INVALIDSTREAMINDEX; + if (IsEqualGUID(&decoder->input_type.majortype, &GUID_NULL)) + return DMO_E_TYPE_NOT_SET; + if (!type) + return E_POINTER; + return MoCopyMediaType(type, &decoder->input_type); } static HRESULT WINAPI media_object_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) { - FIXME("iface %p, index %lu, type %p stub!\n", iface, index, type); - return E_NOTIMPL; + struct wma_decoder *decoder = impl_from_IMediaObject(iface); + + TRACE("iface %p, index %lu, type %p\n", iface, index, type); + + if (index) + return DMO_E_INVALIDSTREAMINDEX; + if (IsEqualGUID(&decoder->output_type.majortype, &GUID_NULL)) + return DMO_E_TYPE_NOT_SET; + if (!type) + return E_POINTER; + return MoCopyMediaType(type, &decoder->output_type); } static HRESULT WINAPI media_object_GetInputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size,
1
0
0
0
Rémi Bernon : winegstreamer: Use DMO_MEDIA_TYPE in the WMA decoder.
by Alexandre Julliard
24 May '24
24 May '24
Module: wine Branch: master Commit: d05cd460e4e9a791eb2df093d513873d60512f38 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d05cd460e4e9a791eb2df093d51387…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Apr 24 12:01:47 2024 +0200 winegstreamer: Use DMO_MEDIA_TYPE in the WMA decoder. --- dlls/winegstreamer/wma_decoder.c | 155 +++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 79 deletions(-)
1
0
0
0
Alexandre Julliard : winegcc: Don't print a potentially reallocated pointer.
by Alexandre Julliard
24 May '24
24 May '24
Module: wine Branch: master Commit: a03bd94204a1d71e63c0cca72f37596eda4ad572 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a03bd94204a1d71e63c0cca72f3759…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri May 24 18:41:12 2024 +0200 winegcc: Don't print a potentially reallocated pointer. --- tools/winegcc/utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/winegcc/utils.c b/tools/winegcc/utils.c index f79bfdf5877..65882758a7f 100644 --- a/tools/winegcc/utils.c +++ b/tools/winegcc/utils.c @@ -199,13 +199,14 @@ const char *find_binary( struct strarray prefix, const char *name ) int spawn(struct strarray prefix, struct strarray args, int ignore_errors) { int status; + const char *cmd; - args.str[0] = find_binary( prefix, args.str[0] ); + cmd = args.str[0] = find_binary( prefix, args.str[0] ); if (verbose) strarray_trace( args ); if ((status = strarray_spawn( args )) && !ignore_errors) { - if (status > 0) error("%s failed\n", args.str[0]); + if (status > 0) error("%s failed\n", cmd); else perror("winegcc"); exit(3); }
1
0
0
0
Alexandre Julliard : conhost: Fix a printf format warning.
by Alexandre Julliard
24 May '24
24 May '24
Module: wine Branch: master Commit: 83888e37df06f8e6d85536d355332734986bc633 URL:
https://gitlab.winehq.org/wine/wine/-/commit/83888e37df06f8e6d85536d3553327…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri May 24 12:35:38 2024 +0200 conhost: Fix a printf format warning. --- programs/conhost/conhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 419d94c3eed..4272e8b12f5 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -1313,7 +1313,7 @@ static NTSTATUS process_console_input( struct console *console ) ctrl_value = ir.Event.KeyEvent.uChar.UnicodeChar; ctrl_keyvalue = ir.Event.KeyEvent.dwControlKeyState; ctx->status = STATUS_SUCCESS; - TRACE("Found ctrl char in mask: ^%lc %x\n", ir.Event.KeyEvent.uChar.UnicodeChar + '@', ctx->ctrl_mask); + TRACE("Found ctrl char in mask: ^%c %x\n", ir.Event.KeyEvent.uChar.UnicodeChar + '@', ctx->ctrl_mask); continue; } if (ir.Event.KeyEvent.uChar.UnicodeChar == 10) continue;
1
0
0
0
Alexandre Julliard : wbemprox: Don't reference yysymbol_name on older bisons.
by Alexandre Julliard
24 May '24
24 May '24
Module: wine Branch: master Commit: 5df6f5a513bcefd723a3ad226e6c77947a71af1d URL:
https://gitlab.winehq.org/wine/wine/-/commit/5df6f5a513bcefd723a3ad226e6c77…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri May 24 12:25:17 2024 +0200 wbemprox: Don't reference yysymbol_name on older bisons. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56718
--- dlls/wbemprox/wql.y | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/wbemprox/wql.y b/dlls/wbemprox/wql.y index 541cd2450f0..d71475fc827 100644 --- a/dlls/wbemprox/wql.y +++ b/dlls/wbemprox/wql.y @@ -299,7 +299,9 @@ associatorsof: } PARSER_BUBBLE_UP_VIEW( parser, $$, view ); +#if YYBISON >= 30704 (void)yysymbol_name; /* avoid unused function warning */ +#endif } | TK_ASSOCIATORS TK_OF path TK_WHERE keywordlist {
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
71
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
Results per page:
10
25
50
100
200