winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 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
1024 discussions
Start a n
N
ew thread
Nikolay Sivov : xmllite/tests: Use wide string literals for the writer tests.
by Alexandre Julliard
05 Apr '22
05 Apr '22
Module: wine Branch: master Commit: 70af1f774b224d2c3d89fad2b156f17fa11eda61 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=70af1f774b224d2c3d89fad2…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Apr 5 18:58:19 2022 +0300 xmllite/tests: Use wide string literals for the writer tests. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/xmllite/tests/writer.c | 674 +++++++++++++++++--------------------------- 1 file changed, 266 insertions(+), 408 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=70af1f774b224d2c3d89…
1
0
0
0
Nikolay Sivov : shell32/tests: Use CRT memory allocation functions.
by Alexandre Julliard
05 Apr '22
05 Apr '22
Module: wine Branch: master Commit: 9140c673070f4061b3ff7e2b5d948861c3ef9d2e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9140c673070f4061b3ff7e2b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Apr 5 18:09:07 2022 +0300 shell32/tests: Use CRT memory allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/tests/assoc.c | 7 +++---- dlls/shell32/tests/autocomplete.c | 5 ++--- dlls/shell32/tests/ebrowser.c | 13 ++++++------- dlls/shell32/tests/msg.h | 9 ++++----- dlls/shell32/tests/shelldispatch.c | 5 ++--- dlls/shell32/tests/shelllink.c | 5 ++--- dlls/shell32/tests/shlexec.c | 9 ++++----- dlls/shell32/tests/shlfolder.c | 21 ++++++++++----------- dlls/shell32/tests/shlview.c | 9 ++++----- 9 files changed, 37 insertions(+), 46 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=9140c673070f4061b3ff…
1
0
0
0
Rémi Bernon : kernel32/tests: Cleanup and add more heap layout tests.
by Alexandre Julliard
05 Apr '22
05 Apr '22
Module: wine Branch: master Commit: f411193781895e20ae57c287a26577789509b19f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f411193781895e20ae57c287…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Apr 5 15:16:59 2022 +0200 kernel32/tests: Cleanup and add more heap layout tests. Updating the tests to check the new, post-vista, layout. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/heap.c | 140 ++++++++++++++++++++++++++++++--------------- 1 file changed, 94 insertions(+), 46 deletions(-) diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c index a27e3296c01..7469de223b8 100644 --- a/dlls/kernel32/tests/heap.c +++ b/dlls/kernel32/tests/heap.c @@ -31,6 +31,7 @@ #include "wine/test.h" /* some undocumented flags (names are made up) */ +#define HEAP_PRIVATE 0x00001000 #define HEAP_PAGE_ALLOCS 0x01000000 #define HEAP_VALIDATE 0x10000000 #define HEAP_VALIDATE_ALL 0x20000000 @@ -43,12 +44,16 @@ static BOOL (WINAPI *pHeapQueryInformation)(HANDLE, HEAP_INFORMATION_CLASS, PVOI static BOOL (WINAPI *pGetPhysicallyInstalledSystemMemory)(ULONGLONG *); static ULONG (WINAPI *pRtlGetNtGlobalFlags)(void); -struct heap_layout +struct heap { - DWORD_PTR unknown[2]; - DWORD pattern; - DWORD flags; - DWORD force_flags; + UINT_PTR unknown1[2]; + UINT ffeeffee; + UINT auto_flags; + UINT_PTR unknown2[7]; + UINT unknown3[2]; + UINT_PTR unknown4[3]; + UINT flags; + UINT force_flags; }; static SIZE_T resize_9x(SIZE_T size) @@ -1127,7 +1132,6 @@ static void test_heap_checks( DWORD flags ) SIZE_T i, size, large_size = 3000 * 1024 + 37; if (flags & HEAP_PAGE_ALLOCS) return; /* no tests for that case yet */ - trace( "testing heap flags %08lx\n", flags ); p = pHeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 17 ); ok( p != NULL, "HeapAlloc failed\n" ); @@ -1348,68 +1352,112 @@ static DWORD heap_flags_from_global_flag( DWORD flag ) if (flag & FLG_HEAP_ENABLE_FREE_CHECK) ret |= HEAP_FREE_CHECKING_ENABLED; if (flag & FLG_HEAP_VALIDATE_PARAMETERS) - ret |= HEAP_VALIDATE_PARAMS | HEAP_VALIDATE | HEAP_TAIL_CHECKING_ENABLED | HEAP_FREE_CHECKING_ENABLED; + ret |= HEAP_VALIDATE_PARAMS | HEAP_TAIL_CHECKING_ENABLED | HEAP_FREE_CHECKING_ENABLED; if (flag & FLG_HEAP_VALIDATE_ALL) - ret |= HEAP_VALIDATE_ALL | HEAP_VALIDATE | HEAP_TAIL_CHECKING_ENABLED | HEAP_FREE_CHECKING_ENABLED; + ret |= HEAP_VALIDATE_ALL | HEAP_TAIL_CHECKING_ENABLED | HEAP_FREE_CHECKING_ENABLED; if (flag & FLG_HEAP_DISABLE_COALESCING) ret |= HEAP_DISABLE_COALESCE_ON_FREE; if (flag & FLG_HEAP_PAGE_ALLOCS) - ret |= HEAP_PAGE_ALLOCS | HEAP_GROWABLE; + ret |= HEAP_PAGE_ALLOCS; return ret; } +static void test_heap_layout( HANDLE handle, DWORD global_flag, DWORD heap_flags ) +{ + DWORD force_flags = heap_flags & ~(HEAP_SHARED|HEAP_DISABLE_COALESCE_ON_FREE); + struct heap *heap = handle; + + if (global_flag & FLG_HEAP_ENABLE_TAGGING) heap_flags |= HEAP_SHARED; + if (!(global_flag & FLG_HEAP_PAGE_ALLOCS)) force_flags &= ~(HEAP_GROWABLE|HEAP_PRIVATE); + + todo_wine_if( force_flags & (HEAP_PRIVATE|HEAP_NO_SERIALIZE) ) + ok( heap->force_flags == force_flags, "got force_flags %#x\n", heap->force_flags ); + todo_wine_if( heap_flags & (HEAP_VALIDATE_ALL|HEAP_VALIDATE_PARAMS|HEAP_SHARED|HEAP_PRIVATE) ) + ok( heap->flags == heap_flags, "got flags %#x\n", heap->flags ); + + if (heap->flags & HEAP_PAGE_ALLOCS) + { + struct heap expect_heap; + memset( &expect_heap, 0xee, sizeof(expect_heap) ); + expect_heap.force_flags = heap->force_flags; + expect_heap.flags = heap->flags; + todo_wine + ok( !memcmp( heap, &expect_heap, sizeof(expect_heap) ), "got unexpected data\n" ); + } + else + { + todo_wine + ok( heap->ffeeffee == 0xffeeffee, "got ffeeffee %#x\n", heap->ffeeffee ); + ok( heap->auto_flags == (heap_flags & HEAP_GROWABLE) || !heap->auto_flags, + "got auto_flags %#x\n", heap->auto_flags ); + } +} + static void test_child_heap( const char *arg ) { - struct heap_layout *heap = GetProcessHeap(); - DWORD expected = strtoul( arg, 0, 16 ); - DWORD expect_heap; + char buffer[32]; + DWORD global_flags = strtoul( arg, 0, 16 ), type, size = sizeof(buffer); + DWORD heap_flags; + HANDLE heap; + HKEY hkey; + BOOL ret; - if (expected == 0xdeadbeef) /* expected value comes from Session Manager global flags */ + if (global_flags == 0xdeadbeef) /* global_flags value comes from Session Manager global flags */ { - HKEY hkey; - expected = 0; - if (!RegOpenKeyA( HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager", &hkey )) + ret = RegOpenKeyA( HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager", &hkey ); + if (!ret) { - char buffer[32]; - DWORD type, size = sizeof(buffer); - - if (!RegQueryValueExA( hkey, "GlobalFlag", 0, &type, (BYTE *)buffer, &size )) - { - if (type == REG_DWORD) expected = *(DWORD *)buffer; - else if (type == REG_SZ) expected = strtoul( buffer, 0, 16 ); - } - RegCloseKey( hkey ); + skip( "Session Manager flags not set\n" ); + return; } + + ret = RegQueryValueExA( hkey, "GlobalFlag", 0, &type, (BYTE *)buffer, &size ); + ok( ret, "RegQueryValueExA failed, error %lu\n", GetLastError() ); + + if (type == REG_DWORD) global_flags = *(DWORD *)buffer; + else if (type == REG_SZ) global_flags = strtoul( buffer, 0, 16 ); + + ret = RegCloseKey( hkey ); + ok( ret, "RegCloseKey failed, error %lu\n", GetLastError() ); } - if (expected && !pRtlGetNtGlobalFlags()) /* not working on NT4 */ + if (global_flags && !pRtlGetNtGlobalFlags()) /* not working on NT4 */ { win_skip( "global flags not set\n" ); return; } - ok( pRtlGetNtGlobalFlags() == expected, - "%s: got global flags %08lx expected %08lx\n", arg, pRtlGetNtGlobalFlags(), expected ); + heap_flags = heap_flags_from_global_flag( global_flags ); + trace( "testing global flags %#lx, heap flags %08lx\n", global_flags, heap_flags ); - expect_heap = heap_flags_from_global_flag( expected ); + ok( pRtlGetNtGlobalFlags() == global_flags, "got global flags %#lx\n", pRtlGetNtGlobalFlags() ); - if (!(heap->flags & HEAP_GROWABLE) || heap->pattern == 0xffeeffee) /* vista layout */ - { - ok( (heap->flags & ~HEAP_GROWABLE) == 0, "%s: got heap flags %08lx\n", arg, heap->flags ); - } - else if (heap->pattern == 0xeeeeeeee && heap->flags == 0xeeeeeeee) - { - ok( expected & FLG_HEAP_PAGE_ALLOCS, "%s: got heap flags 0xeeeeeeee without page alloc\n", arg ); - } - else - { - ok( heap->flags == (expect_heap | HEAP_GROWABLE), - "%s: got heap flags %08lx expected %08lx\n", arg, heap->flags, expect_heap ); - ok( heap->force_flags == (expect_heap & ~0x18000080), - "%s: got heap force flags %08lx expected %08lx\n", arg, heap->force_flags, expect_heap ); - expect_heap = heap->flags; - } + test_heap_layout( GetProcessHeap(), global_flags, heap_flags|HEAP_GROWABLE ); + + heap = HeapCreate( 0, 0, 0 ); + ok( heap != GetProcessHeap(), "got unexpected heap\n" ); + test_heap_layout( heap, global_flags, heap_flags|HEAP_GROWABLE|HEAP_PRIVATE ); + ret = HeapDestroy( heap ); + ok( ret, "HeapDestroy failed, error %lu\n", GetLastError() ); + + heap = HeapCreate( HEAP_NO_SERIALIZE, 0, 0 ); + ok( heap != GetProcessHeap(), "got unexpected heap\n" ); + test_heap_layout( heap, global_flags, heap_flags|HEAP_NO_SERIALIZE|HEAP_GROWABLE|HEAP_PRIVATE ); + ret = HeapDestroy( heap ); + ok( ret, "HeapDestroy failed, error %lu\n", GetLastError() ); + + heap = HeapCreate( 0, 0x1000, 0x10000 ); + ok( heap != GetProcessHeap(), "got unexpected heap\n" ); + test_heap_layout( heap, global_flags, heap_flags|HEAP_PRIVATE ); + ret = HeapDestroy( heap ); + ok( ret, "HeapDestroy failed, error %lu\n", GetLastError() ); + + heap = HeapCreate( HEAP_SHARED, 0, 0 ); + ok( heap != GetProcessHeap(), "got unexpected heap\n" ); + test_heap_layout( heap, global_flags, heap_flags|HEAP_GROWABLE|HEAP_PRIVATE ); + ret = HeapDestroy( heap ); + ok( ret, "HeapDestroy failed, error %lu\n", GetLastError() ); - test_heap_checks( expect_heap ); + test_heap_checks( heap_flags ); } static void test_GetPhysicallyInstalledSystemMemory(void)
1
0
0
0
Rémi Bernon : kernel32/tests: Add broken results for GlobalMemoryStatus test.
by Alexandre Julliard
05 Apr '22
05 Apr '22
Module: wine Branch: master Commit: 727a162fc65b85e6f42e25e265584d1accf0db2b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=727a162fc65b85e6f42e25e2…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Apr 5 15:16:58 2022 +0200 kernel32/tests: Add broken results for GlobalMemoryStatus test. As seen on win81_cw-gtx560-32 and win81_cw-rx460-32. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/heap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c index 566e2d6b987..a27e3296c01 100644 --- a/dlls/kernel32/tests/heap.c +++ b/dlls/kernel32/tests/heap.c @@ -1505,8 +1505,12 @@ static void test_GlobalMemoryStatus(void) ok( memex.ullAvailExtendedVirtual == 0, "got ullAvailExtendedVirtual %#I64x\n", memex.ullAvailExtendedVirtual ); ok( mem.dwMemoryLoad == memex.dwMemoryLoad, "got dwMemoryLoad %lu\n", mem.dwMemoryLoad ); - ok( mem.dwTotalPhys == min( ~(SIZE_T)0 >> 1, memex.ullTotalPhys ), "got dwTotalPhys %#Ix\n", mem.dwTotalPhys ); - ok( IS_WITHIN_RANGE( mem.dwAvailPhys, min( ~(SIZE_T)0 >> 1, memex.ullAvailPhys ) ), "got dwAvailPhys %#Ix\n", mem.dwAvailPhys ); + ok( mem.dwTotalPhys == min( ~(SIZE_T)0 >> 1, memex.ullTotalPhys ) || + broken( mem.dwTotalPhys == ~(SIZE_T)0 ) /* Win <= 8.1 with RAM size > 4GB */, + "got dwTotalPhys %#Ix\n", mem.dwTotalPhys ); + ok( IS_WITHIN_RANGE( mem.dwAvailPhys, min( ~(SIZE_T)0 >> 1, memex.ullAvailPhys ) ) || + broken( mem.dwAvailPhys == ~(SIZE_T)0 ) /* Win <= 8.1 with RAM size > 4GB */, + "got dwAvailPhys %#Ix\n", mem.dwAvailPhys ); #ifndef _WIN64 todo_wine_if(memex.ullTotalPageFile > 0xfff7ffff) #endif
1
0
0
0
Ziqing Hui : d2d1/tests: Add tests for D2D1Grayscale effect.
by Alexandre Julliard
05 Apr '22
05 Apr '22
Module: wine Branch: master Commit: ca5a2bf0767a74d6167fdef7e0bb7543cc31e383 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ca5a2bf0767a74d6167fdef7…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Tue Apr 5 13:04:31 2022 +0800 d2d1/tests: Add tests for D2D1Grayscale effect. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d2d1/effect.c | 1 + dlls/d2d1/tests/d2d1.c | 119 ++++++++++++++++++++++++++++++++++++++++++---- include/d2d1effects_2.idl | 1 + 3 files changed, 111 insertions(+), 10 deletions(-) diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c index e7215c4b38a..601932b005b 100644 --- a/dlls/d2d1/effect.c +++ b/dlls/d2d1/effect.c @@ -27,6 +27,7 @@ static const struct d2d_effect_info builtin_effects[] = {&CLSID_D2D1Composite, 2, 1, 0xffffffff}, {&CLSID_D2D1Crop, 1, 1, 1}, {&CLSID_D2D1Shadow, 1, 1, 1}, + {&CLSID_D2D1Grayscale, 1, 1, 1}, }; static inline struct d2d_effect *impl_from_ID2D1Effect(ID2D1Effect *iface) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 722f46bffe6..826526d9d38 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -20,7 +20,7 @@ #include <limits.h> #include <math.h> #include <float.h> -#include "d2d1_1.h" +#include "d2d1_3.h" #include "d3d11.h" #include "wincrypt.h" #include "wine/test.h" @@ -9925,13 +9925,15 @@ static void test_mt_factory(BOOL d3d11) static void test_effect(BOOL d3d11) { - unsigned int i, j, min_inputs, max_inputs, str_size, input_count; + unsigned int i, j, min_inputs, max_inputs, str_size, input_count, factory_version; D2D1_BITMAP_PROPERTIES bitmap_desc; D2D1_BUFFER_PRECISION precision; ID2D1Image *image_a, *image_b; struct d2d1_test_context ctx; ID2D1DeviceContext *context; - ID2D1Factory1 *factory; + ID2D1Factory1 *factory1; + ID2D1Factory2 *factory2; + ID2D1Factory3 *factory3; ID2D1Bitmap *bitmap; ID2D1Effect *effect; D2D1_SIZE_U size; @@ -9943,28 +9945,43 @@ static void test_effect(BOOL d3d11) const struct effect_test { const CLSID *clsid; + UINT32 factory_version; UINT32 default_input_count; UINT32 min_inputs; UINT32 max_inputs; } effect_tests[] = { - {&CLSID_D2D12DAffineTransform, 1, 1, 1}, - {&CLSID_D2D13DPerspectiveTransform, 1, 1, 1}, - {&CLSID_D2D1Composite, 2, 1, 0xffffffff}, - {&CLSID_D2D1Crop, 1, 1, 1}, - {&CLSID_D2D1Shadow, 1, 1, 1}, + {&CLSID_D2D12DAffineTransform, 1, 1, 1, 1}, + {&CLSID_D2D13DPerspectiveTransform, 1, 1, 1, 1}, + {&CLSID_D2D1Composite, 1, 2, 1, 0xffffffff}, + {&CLSID_D2D1Crop, 1, 1, 1, 1}, + {&CLSID_D2D1Shadow, 1, 1, 1, 1}, + {&CLSID_D2D1Grayscale, 3, 1, 1, 1}, }; if (!init_test_context(&ctx, d3d11)) return; - if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory))) + if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory1))) { win_skip("ID2D1Factory1 is not supported.\n"); release_test_context(&ctx); return; } + factory_version = 1; + if (SUCCEEDED(ID2D1Factory1_QueryInterface(factory1, &IID_ID2D1Factory2, (void **)&factory2))) + { + ID2D1Factory2_Release(factory2); + factory_version = 2; + } + if (SUCCEEDED(ID2D1Factory1_QueryInterface(factory1, &IID_ID2D1Factory3, (void **)&factory3))) + { + ID2D1Factory3_Release(factory3); + factory_version = 3; + } + if (factory_version < 3) + win_skip("ID2D1Factory%u is not supported.\n", factory_version + 1); hr = ID2D1RenderTarget_QueryInterface(ctx.rt, &IID_ID2D1DeviceContext, (void **)&context); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); @@ -9973,6 +9990,9 @@ static void test_effect(BOOL d3d11) { const struct effect_test *test = effect_tests + i; + if (factory_version < test->factory_version) + continue; + winetest_push_context("Test %u", i); hr = ID2D1DeviceContext_CreateEffect(context, test->clsid, &effect); @@ -10109,7 +10129,7 @@ static void test_effect(BOOL d3d11) } ID2D1DeviceContext_Release(context); - ID2D1Factory1_Release(factory); + ID2D1Factory1_Release(factory1); release_test_context(&ctx); } @@ -10350,6 +10370,84 @@ static void test_effect_crop(BOOL d3d11) release_test_context(&ctx); } +static void test_effect_grayscale(BOOL d3d11) +{ + DWORD colour, expected_colour, luminance; + D2D1_BITMAP_PROPERTIES1 bitmap_desc; + struct d2d1_test_context ctx; + struct resource_readback rb; + ID2D1DeviceContext *context; + D2D1_SIZE_U input_size; + ID2D1Factory3 *factory; + ID2D1Bitmap1 *bitmap; + ID2D1Effect *effect; + ID2D1Image *output; + unsigned int i; + HRESULT hr; + + const DWORD test_pixels[] = {0xffffffff, 0x12345678, 0x89abcdef, 0x77777777, 0xdeadbeef}; + + if (!init_test_context(&ctx, d3d11)) + return; + + if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory3, NULL, (void **)&factory))) + { + win_skip("ID2D1Factory3 is not supported.\n"); + release_test_context(&ctx); + return; + } + + hr = ID2D1RenderTarget_QueryInterface(ctx.rt, &IID_ID2D1DeviceContext, (void **)&context); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID2D1DeviceContext_CreateEffect(context, &CLSID_D2D1Grayscale, &effect); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + for (i = 0; i < ARRAY_SIZE(test_pixels); ++i) + { + DWORD pixel = test_pixels[i]; + winetest_push_context("Test %u", i); + + set_size_u(&input_size, 1, 1); + bitmap_desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM; + bitmap_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE; + bitmap_desc.dpiX = 96.0f; + bitmap_desc.dpiY = 96.0f; + bitmap_desc.bitmapOptions = D2D1_BITMAP_OPTIONS_NONE; + bitmap_desc.colorContext = NULL; + hr = ID2D1DeviceContext_CreateBitmap(context, input_size, &pixel, sizeof(pixel), &bitmap_desc, &bitmap); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID2D1Effect_SetInput(effect, 0, (ID2D1Image *)bitmap, FALSE); + ID2D1Effect_GetOutput(effect, &output); + + ID2D1DeviceContext_BeginDraw(context); + ID2D1DeviceContext_Clear(context, 0); + ID2D1DeviceContext_DrawImage(context, output, NULL, NULL, 0, 0); + hr = ID2D1DeviceContext_EndDraw(context, NULL, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + get_surface_readback(&ctx, &rb); + colour = get_readback_colour(&rb, 0, 0); + luminance = (DWORD)(0.299f * ((pixel >> 16) & 0xff) + + 0.587f * ((pixel >> 8) & 0xff) + + 0.114f * ((pixel >> 0) & 0xff) + 0.5f); + expected_colour = (pixel & 0xff000000) | (luminance << 16) | (luminance << 8) | luminance; + todo_wine ok(compare_colour(colour, expected_colour, 1), + "Got unexpected colour %#lx, expected %#lx.\n", colour, expected_colour); + release_resource_readback(&rb); + + ID2D1Image_Release(output); + ID2D1Bitmap1_Release(bitmap); + winetest_pop_context(); + } + + ID2D1Effect_Release(effect); + ID2D1DeviceContext_Release(context); + ID2D1Factory3_Release(factory); + release_test_context(&ctx); +} + static void test_stroke_contains_point(BOOL d3d11) { ID2D1TransformedGeometry *transformed_geometry; @@ -10735,6 +10833,7 @@ START_TEST(d2d1) queue_test(test_effect); queue_test(test_effect_2d_affine); queue_test(test_effect_crop); + queue_test(test_effect_grayscale); queue_d3d10_test(test_stroke_contains_point); run_queued_tests(); diff --git a/include/d2d1effects_2.idl b/include/d2d1effects_2.idl index 79895361118..9cd93a8d3bf 100644 --- a/include/d2d1effects_2.idl +++ b/include/d2d1effects_2.idl @@ -18,6 +18,7 @@ import "d2d1effects_1.idl"; +cpp_quote("DEFINE_GUID(CLSID_D2D1Grayscale, 0x36dde0eb,0x3725,0x42e0,0x83,0x6d,0x52,0xfb,0x20,0xae,0xe6,0x44);") cpp_quote("DEFINE_GUID(CLSID_D2D1HighlightsShadows, 0xcadc8384,0x323f,0x4c7e,0xa3,0x61,0x2e,0x2b,0x24,0xdf,0x6e,0xe4);") typedef enum D2D1_HIGHLIGHTSANDSHADOWS_PROP
1
0
0
0
Jacek Caban : user32: Use NtUserMessageCall for SendMessageCallbackA implementation.
by Alexandre Julliard
05 Apr '22
05 Apr '22
Module: wine Branch: master Commit: 37de5d24a881e1830c672853e8e31a4844d3f52e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=37de5d24a881e1830c672853…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 4 16:59:28 2022 +0200 user32: Use NtUserMessageCall for SendMessageCallbackA implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/message.c | 570 +------------------------------------------ dlls/win32u/message.c | 2 +- dlls/win32u/sysparams.c | 3 - dlls/win32u/win32u_private.h | 1 - include/ntuser.h | 1 - 5 files changed, 4 insertions(+), 573 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=37de5d24a881e1830c67…
1
0
0
0
Jacek Caban : win32u: Move SendMessageCallbackW implementation from user32.
by Alexandre Julliard
05 Apr '22
05 Apr '22
Module: wine Branch: master Commit: b99778a531ed3dc2c5bb069d9351b0979c08414f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b99778a531ed3dc2c5bb069d…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 4 16:59:02 2022 +0200 win32u: Move SendMessageCallbackW implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/message.c | 20 ++------------------ dlls/win32u/message.c | 27 +++++++++++++++++++++++++++ dlls/win32u/tests/win32u.c | 1 - 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index cdf84523be0..00a2a89e08a 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2296,24 +2296,8 @@ BOOL WINAPI SendMessageCallbackA( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa BOOL WINAPI SendMessageCallbackW( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, SENDASYNCPROC callback, ULONG_PTR data ) { - struct send_message_info info; - - if (is_pointer_message( msg, wparam )) - { - SetLastError( ERROR_MESSAGE_SYNC_ONLY ); - return FALSE; - } - - info.type = MSG_CALLBACK; - info.hwnd = hwnd; - info.msg = msg; - info.wparam = wparam; - info.lparam = lparam; - info.callback = callback; - info.data = data; - info.flags = 0; - - return send_message( &info, NULL, TRUE ); + struct send_message_callback_params params = { .callback = callback, .data = data }; + return NtUserMessageCall( hwnd, msg, wparam, lparam, ¶ms, FNID_SENDMESSAGECALLBACK, FALSE ); } diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index a8db3016358..67008dcd2b5 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2372,6 +2372,31 @@ static BOOL send_notify_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar return process_message( &info, NULL, ansi ); } +/* see SendMessageCallbackW */ +static BOOL send_message_callback( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, + const struct send_message_callback_params *params, BOOL ansi ) +{ + struct send_message_info info; + + if (is_pointer_message( msg, wparam )) + { + SetLastError( ERROR_MESSAGE_SYNC_ONLY ); + return FALSE; + } + + info.type = MSG_CALLBACK; + info.hwnd = hwnd; + info.msg = msg; + info.wparam = wparam; + info.lparam = lparam; + info.callback = params->callback; + info.data = params->data; + info.flags = 0; + info.wm_char = WMCHAR_MAP_SENDMESSAGETIMEOUT; + + return process_message( &info, NULL, ansi ); +} + /*********************************************************************** * NtUserPostMessage (win32u.@) */ @@ -2402,6 +2427,8 @@ LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa } case FNID_SENDNOTIFYMESSAGE: return send_notify_message( hwnd, msg, wparam, lparam, ansi ); + case FNID_SENDMESSAGECALLBACK: + return send_message_callback( hwnd, msg, wparam, lparam, (void *)result_info, ansi ); case FNID_SPYENTER: spy_enter_message( ansi, hwnd, msg, wparam, lparam ); return 0; diff --git a/dlls/win32u/tests/win32u.c b/dlls/win32u/tests/win32u.c index e93ad416d2b..a463b6269a6 100644 --- a/dlls/win32u/tests/win32u.c +++ b/dlls/win32u/tests/win32u.c @@ -466,7 +466,6 @@ static void test_message_call(void) res = NtUserMessageCall( hwnd, WM_USER, 1, 2, &callback_params, FNID_SENDMESSAGECALLBACK, FALSE ); - todo_wine ok( res == 1, "res = %Iu\n", res ); DestroyWindow( hwnd );
1
0
0
0
Jacek Caban : user32: Use NtUserMessageCall for SendNotifyMessageA implementation.
by Alexandre Julliard
05 Apr '22
05 Apr '22
Module: wine Branch: master Commit: 2c01eb392b0fd85a0b8c1be653a6356bee8e2942 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2c01eb392b0fd85a0b8c1be6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 4 16:58:49 2022 +0200 user32: Use NtUserMessageCall for SendNotifyMessageA implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/message.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 220b0b94d4f..cdf84523be0 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2246,23 +2246,10 @@ LRESULT WINAPI SendMessageA( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) */ BOOL WINAPI SendNotifyMessageA( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { - struct send_message_info info; - - if (is_pointer_message( msg, wparam )) - { - SetLastError( ERROR_MESSAGE_SYNC_ONLY ); + if (!WIN_IsCurrentThread( hwnd ) && !map_wparam_AtoW( msg, &wparam, WMCHAR_MAP_SENDMESSAGE )) return FALSE; - } - info.type = MSG_NOTIFY; - info.hwnd = hwnd; - info.msg = msg; - info.wparam = wparam; - info.lparam = lparam; - info.flags = 0; - info.wm_char = WMCHAR_MAP_SENDMESSAGETIMEOUT; - - return send_message( &info, NULL, FALSE ); + return NtUserMessageCall( hwnd, msg, wparam, lparam, 0, FNID_SENDNOTIFYMESSAGE, TRUE ); }
1
0
0
0
Jacek Caban : win32u: Move SendNotifyMessageW implementation from user32.
by Alexandre Julliard
05 Apr '22
05 Apr '22
Module: wine Branch: master Commit: 980de6afe48b4b51e4e8c0af25f54e16a4eb219d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=980de6afe48b4b51e4e8c0af…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 4 16:58:35 2022 +0200 win32u: Move SendNotifyMessageW implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/message.c | 17 +------- dlls/user32/user_main.c | 1 - dlls/win32u/message.c | 94 +++++++++++++++++++++++++++++++++++++++++++- dlls/win32u/ntuser_private.h | 1 - 4 files changed, 94 insertions(+), 19 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index a67032ef917..220b0b94d4f 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2271,22 +2271,7 @@ BOOL WINAPI SendNotifyMessageA( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara */ BOOL WINAPI SendNotifyMessageW( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { - struct send_message_info info; - - if (is_pointer_message( msg, wparam )) - { - SetLastError( ERROR_MESSAGE_SYNC_ONLY ); - return FALSE; - } - - info.type = MSG_NOTIFY; - info.hwnd = hwnd; - info.msg = msg; - info.wparam = wparam; - info.lparam = lparam; - info.flags = 0; - - return send_message( &info, NULL, TRUE ); + return NtUserMessageCall( hwnd, msg, wparam, lparam, 0, FNID_SENDNOTIFYMESSAGE, FALSE ); } diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 3fd05ec3f01..1b3e67c6d61 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -165,7 +165,6 @@ static const struct user_callbacks user_funcs = EndMenu, HideCaret, PostMessageW, - SendNotifyMessageW, SetSystemMenu, ShowCaret, free_menu_items, diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 41d97e648a0..a8db3016358 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -111,6 +111,82 @@ struct send_message_info static const INPUT_MESSAGE_SOURCE msg_source_unavailable = { IMDT_UNAVAILABLE, IMO_UNAVAILABLE }; +/* flag for messages that contain pointers */ +/* 32 messages per entry, messages 0..31 map to bits 0..31 */ + +#define SET(msg) (1 << ((msg) & 31)) + +static const unsigned int message_pointer_flags[] = +{ + /* 0x00 - 0x1f */ + SET(WM_CREATE) | SET(WM_SETTEXT) | SET(WM_GETTEXT) | + SET(WM_WININICHANGE) | SET(WM_DEVMODECHANGE), + /* 0x20 - 0x3f */ + SET(WM_GETMINMAXINFO) | SET(WM_DRAWITEM) | SET(WM_MEASUREITEM) | SET(WM_DELETEITEM) | + SET(WM_COMPAREITEM), + /* 0x40 - 0x5f */ + SET(WM_WINDOWPOSCHANGING) | SET(WM_WINDOWPOSCHANGED) | SET(WM_COPYDATA) | SET(WM_HELP), + /* 0x60 - 0x7f */ + SET(WM_STYLECHANGING) | SET(WM_STYLECHANGED), + /* 0x80 - 0x9f */ + SET(WM_NCCREATE) | SET(WM_NCCALCSIZE) | SET(WM_GETDLGCODE), + /* 0xa0 - 0xbf */ + SET(EM_GETSEL) | SET(EM_GETRECT) | SET(EM_SETRECT) | SET(EM_SETRECTNP), + /* 0xc0 - 0xdf */ + SET(EM_REPLACESEL) | SET(EM_GETLINE) | SET(EM_SETTABSTOPS), + /* 0xe0 - 0xff */ + SET(SBM_GETRANGE) | SET(SBM_SETSCROLLINFO) | SET(SBM_GETSCROLLINFO) | SET(SBM_GETSCROLLBARINFO), + /* 0x100 - 0x11f */ + 0, + /* 0x120 - 0x13f */ + 0, + /* 0x140 - 0x15f */ + SET(CB_GETEDITSEL) | SET(CB_ADDSTRING) | SET(CB_DIR) | SET(CB_GETLBTEXT) | + SET(CB_INSERTSTRING) | SET(CB_FINDSTRING) | SET(CB_SELECTSTRING) | + SET(CB_GETDROPPEDCONTROLRECT) | SET(CB_FINDSTRINGEXACT), + /* 0x160 - 0x17f */ + 0, + /* 0x180 - 0x19f */ + SET(LB_ADDSTRING) | SET(LB_INSERTSTRING) | SET(LB_GETTEXT) | SET(LB_SELECTSTRING) | + SET(LB_DIR) | SET(LB_FINDSTRING) | + SET(LB_GETSELITEMS) | SET(LB_SETTABSTOPS) | SET(LB_ADDFILE) | SET(LB_GETITEMRECT), + /* 0x1a0 - 0x1bf */ + SET(LB_FINDSTRINGEXACT), + /* 0x1c0 - 0x1df */ + 0, + /* 0x1e0 - 0x1ff */ + 0, + /* 0x200 - 0x21f */ + SET(WM_NEXTMENU) | SET(WM_SIZING) | SET(WM_MOVING) | SET(WM_DEVICECHANGE), + /* 0x220 - 0x23f */ + SET(WM_MDICREATE) | SET(WM_MDIGETACTIVE) | SET(WM_DROPOBJECT) | + SET(WM_QUERYDROPOBJECT) | SET(WM_DRAGLOOP) | SET(WM_DRAGSELECT) | SET(WM_DRAGMOVE), + /* 0x240 - 0x25f */ + 0, + /* 0x260 - 0x27f */ + 0, + /* 0x280 - 0x29f */ + 0, + /* 0x2a0 - 0x2bf */ + 0, + /* 0x2c0 - 0x2df */ + 0, + /* 0x2e0 - 0x2ff */ + 0, + /* 0x300 - 0x31f */ + SET(WM_ASKCBFORMATNAME) +}; + +/* check whether a given message type includes pointers */ +static inline BOOL is_pointer_message( UINT message, WPARAM wparam ) +{ + if (message >= 8*sizeof(message_pointer_flags)) return FALSE; + if (message == WM_DEVICECHANGE && !(wparam & 0x8000)) return FALSE; + return (message_pointer_flags[message / 32] & SET(message)) != 0; +} + +#undef SET + static BOOL init_win_proc_params( struct win_proc_params *params, HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi ) { @@ -2277,7 +2353,23 @@ LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) /* see SendNotifyMessageW */ static BOOL send_notify_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi ) { - return user_callbacks && user_callbacks->pSendNotifyMessageW( hwnd, msg, wparam, lparam ); + struct send_message_info info; + + if (is_pointer_message( msg, wparam )) + { + SetLastError( ERROR_MESSAGE_SYNC_ONLY ); + return FALSE; + } + + info.type = MSG_NOTIFY; + info.hwnd = hwnd; + info.msg = msg; + info.wparam = wparam; + info.lparam = lparam; + info.flags = 0; + info.wm_char = WMCHAR_MAP_SENDMESSAGETIMEOUT; + + return process_message( &info, NULL, ansi ); } /*********************************************************************** diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index f9623446f6d..6afe3955787 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -38,7 +38,6 @@ struct user_callbacks BOOL (WINAPI *pEndMenu)(void); BOOL (WINAPI *pHideCaret)( HWND hwnd ); BOOL (WINAPI *pPostMessageW)( HWND, UINT, WPARAM, LPARAM ); - BOOL (WINAPI *pSendNotifyMessageW)( HWND, UINT, WPARAM, LPARAM ); BOOL (WINAPI *pSetSystemMenu)( HWND hwnd, HMENU menu ); BOOL (WINAPI *pShowCaret)( HWND hwnd ); void (CDECL *free_menu_items)( void *ptr );
1
0
0
0
Jacek Caban : user32: Use NtUserMessageCall for SendMessageA implementation.
by Alexandre Julliard
05 Apr '22
05 Apr '22
Module: wine Branch: master Commit: d42888f07c6e3e491c99bb5c8b62b568264e990c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d42888f07c6e3e491c99bb5c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 4 16:58:21 2022 +0200 user32: Use NtUserMessageCall for SendMessageA implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/message.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index e42ab74cf3f..a67032ef917 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2230,20 +2230,14 @@ LRESULT WINAPI SendMessageW( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) */ LRESULT WINAPI SendMessageA( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { - DWORD_PTR res = 0; - struct send_message_info info; - - info.type = MSG_ASCII; - info.hwnd = hwnd; - info.msg = msg; - info.wparam = wparam; - info.lparam = lparam; - info.flags = SMTO_NORMAL; - info.timeout = 0; - info.wm_char = WMCHAR_MAP_SENDMESSAGE; + if (msg == WM_CHAR && !WIN_IsCurrentThread( hwnd )) + { + if (!map_wparam_AtoW( msg, &wparam, WMCHAR_MAP_SENDMESSAGE )) + return 0; + return NtUserMessageCall( hwnd, msg, wparam, lparam, NULL, FNID_SENDMESSAGE, FALSE ); + } - send_message( &info, &res, FALSE ); - return res; + return NtUserMessageCall( hwnd, msg, wparam, lparam, NULL, FNID_SENDMESSAGE, TRUE ); }
1
0
0
0
← Newer
1
...
88
89
90
91
92
93
94
...
103
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
92
93
94
95
96
97
98
99
100
101
102
103
Results per page:
10
25
50
100
200