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
Paul Gofman : nsiproxy.sys: Fix ipv6 route table parsing on Linux.
by Alexandre Julliard
26 Feb '24
26 Feb '24
Module: wine Branch: master Commit: ee069253197a518d3226843f7f23f41c6fe1ef3b URL:
https://gitlab.winehq.org/wine/wine/-/commit/ee069253197a518d3226843f7f23f4…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Feb 23 19:13:16 2024 -0600 nsiproxy.sys: Fix ipv6 route table parsing on Linux. --- dlls/nsiproxy.sys/ip.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c index fe49caa6e57..09f033ac634 100644 --- a/dlls/nsiproxy.sys/ip.c +++ b/dlls/nsiproxy.sys/ip.c @@ -1544,7 +1544,7 @@ struct in6_addr str_to_in6_addr(char *nptr, char **endptr) for (int i = 0; i < sizeof(ret); i++) { - if (!isxdigit( *nptr ) || !isxdigit( *nptr + 1 )) + if (!isxdigit( *nptr ) || !isxdigit( *(nptr + 1) )) { /* invalid hex string */ if (endptr) *endptr = nptr; @@ -1574,7 +1574,7 @@ static NTSTATUS ipv6_forward_enumerate_all( void *key_data, UINT key_size, void #ifdef __linux__ { - char buf[512], *ptr; + char buf[512], *ptr, *end; UINT rtf_flags; FILE *fp; @@ -1582,9 +1582,6 @@ static NTSTATUS ipv6_forward_enumerate_all( void *key_data, UINT key_size, void while ((ptr = fgets( buf, sizeof(buf), fp ))) { - while (!isspace( *ptr )) ptr++; - *ptr++ = '\0'; - entry.prefix = str_to_in6_addr( ptr, &ptr ); entry.prefix_len = strtoul( ptr + 1, &ptr, 16 ); str_to_in6_addr( ptr + 1, &ptr ); /* source network, skip */ @@ -1597,6 +1594,10 @@ static NTSTATUS ipv6_forward_enumerate_all( void *key_data, UINT key_size, void entry.protocol = (rtf_flags & RTF_GATEWAY) ? MIB_IPPROTO_NETMGMT : MIB_IPPROTO_LOCAL; entry.loopback = entry.protocol == MIB_IPPROTO_LOCAL && entry.prefix_len == 32; + while (isspace( *ptr )) ptr++; + end = ptr; + while (*end && !isspace(*end)) ++end; + *end = 0; if (!convert_unix_name_to_luid( ptr, &entry.luid )) continue; if (!convert_luid_to_index( &entry.luid, &entry.if_index )) continue;
1
0
0
0
Eric Pouech : server: Allow 0-write length in WriteProcessMemory().
by Alexandre Julliard
26 Feb '24
26 Feb '24
Module: wine Branch: master Commit: 9897719562fc47d8d3476928d3db0dd5eb6dfb28 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9897719562fc47d8d3476928d3db0d…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Mon Feb 26 12:12:50 2024 +0100 server: Allow 0-write length in WriteProcessMemory(). Adapt to Win >= 10 behavior. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56357
Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/kernel32/tests/virtual.c | 8 ++++++++ server/process.c | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index c54fb16ba15..a023104ad88 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -114,6 +114,14 @@ static void test_VirtualAllocEx(void) ok(b && (bytes_read == alloc_size), "%Iu bytes read\n", bytes_read); ok(!memcmp(src, dst, alloc_size), "Data from remote process differs\n"); + /* test 0 length */ + bytes_written = 0xdeadbeef; + b = WriteProcessMemory(hProcess, addr1, src, 0, &bytes_written); + ok((b && !bytes_written) || broken(!b && GetLastError() == ERROR_INVALID_PARAMETER), "write failed: %lu\n", GetLastError()); + bytes_read = 0xdeadbeef; + b = ReadProcessMemory(hProcess, addr1, src, 0, &bytes_read); + ok(b && !bytes_read, "read failed: %lu\n", GetLastError()); + /* test invalid source buffers */ b = VirtualProtect( src + 0x2000, 0x2000, PAGE_NOACCESS, &old_prot ); diff --git a/server/process.c b/server/process.c index b6c21d15752..349aa87be3d 100644 --- a/server/process.c +++ b/server/process.c @@ -1659,7 +1659,6 @@ DECL_HANDLER(write_process_memory) { data_size_t len = get_req_data_size(); if (len) write_process_memory( process, req->addr, len, get_req_data() ); - else set_error( STATUS_INVALID_PARAMETER ); release_object( process ); } }
1
0
0
0
Alexandre Julliard : ntdll: Add SEH information to ARM64EC breakpoints.
by Alexandre Julliard
26 Feb '24
26 Feb '24
Module: wine Branch: master Commit: 2aee2990c05b659ba39e7b26bfd81f89d284b0e0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2aee2990c05b659ba39e7b26bfd81f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Feb 26 13:29:32 2024 +0100 ntdll: Add SEH information to ARM64EC breakpoints. --- dlls/ntdll/signal_arm64ec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index e03878d521f..a2b21f51ead 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -1817,7 +1817,11 @@ void WINAPI DbgUiRemoteBreakin( void *arg ) */ void __attribute__((naked)) DbgBreakPoint(void) { - asm( "brk #0xf000; ret" ); + asm( ".seh_proc DbgBreakPoint\n\t" + ".seh_endprologue\n\t" + "brk #0xf000\n\t" + "ret\n\t" + ".seh_endproc" ); } @@ -1826,7 +1830,11 @@ void __attribute__((naked)) DbgBreakPoint(void) */ void __attribute__((naked)) DbgUserBreakPoint(void) { - asm( "brk #0xf000; ret" ); + asm( ".seh_proc DbgUserBreakPoint\n\t" + ".seh_endprologue\n\t" + "brk #0xf000\n\t" + "ret\n\t" + ".seh_endproc" ); } #endif /* __arm64ec__ */
1
0
0
0
Alexandre Julliard : include: Add SEH information to ARM64EC syscalls.
by Alexandre Julliard
26 Feb '24
26 Feb '24
Module: wine Branch: master Commit: 0abbb467af8e9b6025a28bd46ea168306ddf0414 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0abbb467af8e9b6025a28bd46ea168…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Feb 26 13:02:58 2024 +0100 include: Add SEH information to ARM64EC syscalls. --- dlls/ntdll/signal_arm64ec.c | 10 +++++----- dlls/win32u/main.c | 2 +- include/wine/asm.h | 18 ++++++++++-------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index 9a20a827964..e03878d521f 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -48,7 +48,7 @@ ALL_SYSCALLS64 }; #define SYSCALL_API __attribute__((naked)) -#define SYSCALL_FUNC(name) __ASM_SYSCALL_FUNC( __id_##name ) +#define SYSCALL_FUNC(name) __ASM_SYSCALL_FUNC( __id_##name, name ) NTSTATUS SYSCALL_API NtAcceptConnectPort( HANDLE *handle, ULONG id, LPC_MESSAGE *msg, BOOLEAN accept, LPC_SECTION_WRITE *write, LPC_SECTION_READ *read ) @@ -203,7 +203,7 @@ NTSTATUS SYSCALL_API NtConnectPort( HANDLE *handle, UNICODE_STRING *name, SECURI static NTSTATUS SYSCALL_API syscall_NtContinue( ARM64_NT_CONTEXT *context, BOOLEAN alertable ) { - __ASM_SYSCALL_FUNC( __id_NtContinue ); + __ASM_SYSCALL_FUNC( __id_NtContinue, syscall_NtContinue ); } NTSTATUS WINAPI NtContinue( CONTEXT *context, BOOLEAN alertable ) @@ -502,7 +502,7 @@ NTSTATUS SYSCALL_API NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTI static NTSTATUS SYSCALL_API syscall_NtGetContextThread( HANDLE handle, ARM64_NT_CONTEXT *context ) { - __ASM_SYSCALL_FUNC( __id_NtGetContextThread ); + __ASM_SYSCALL_FUNC( __id_NtGetContextThread, syscall_NtGetContextThread ); } NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) @@ -995,7 +995,7 @@ NTSTATUS SYSCALL_API NtQueueApcThread( HANDLE handle, PNTAPCFUNC func, ULONG_PTR static NTSTATUS SYSCALL_API syscall_NtRaiseException( EXCEPTION_RECORD *rec, ARM64_NT_CONTEXT *context, BOOL first_chance ) { - __ASM_SYSCALL_FUNC( __id_NtRaiseException ); + __ASM_SYSCALL_FUNC( __id_NtRaiseException, syscall_NtRaiseException ); } NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) @@ -1137,7 +1137,7 @@ NTSTATUS SYSCALL_API NtSecureConnectPort( HANDLE *handle, UNICODE_STRING *name, static NTSTATUS SYSCALL_API syscall_NtSetContextThread( HANDLE handle, const ARM64_NT_CONTEXT *context ) { - __ASM_SYSCALL_FUNC( __id_NtSetContextThread ); + __ASM_SYSCALL_FUNC( __id_NtSetContextThread, syscall_NtSetContextThread ); } NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index 7f88bb0186a..1e6c5c56daf 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -46,7 +46,7 @@ ALL_SYSCALLS64 }; #define SYSCALL_API __attribute__((naked)) -#define SYSCALL_FUNC(name) __ASM_SYSCALL_FUNC( __id_##name ) +#define SYSCALL_FUNC(name) __ASM_SYSCALL_FUNC( __id_##name, name ) INT SYSCALL_API NtGdiAbortDoc( HDC hdc ) { diff --git a/include/wine/asm.h b/include/wine/asm.h index 908c7d7d19a..694e647ac83 100644 --- a/include/wine/asm.h +++ b/include/wine/asm.h @@ -209,7 +209,7 @@ #elif defined __aarch64__ # define __ASM_SYSCALL_FUNC(id,name) \ __ASM_GLOBAL_FUNC( name, \ - __ASM_SEH(".seh_endprologue\n\t") \ + ".seh_endprologue\n\t" \ "mov x8, #(" #id ")\n\t" \ "mov x9, x30\n\t" \ "ldr x16, 1f\n\t" \ @@ -218,13 +218,16 @@ "ret\n" \ "1:\t.quad " __ASM_NAME("__wine_syscall_dispatcher") ) #elif defined __arm64ec__ -# define __ASM_SYSCALL_FUNC(id) \ - asm( "mov x8, #%0\n\t" \ +# define __ASM_SYSCALL_FUNC(id,name) \ + asm( ".seh_proc " #name "\n\t" \ + ".seh_endprologue\n\t" \ + "mov x8, #%0\n\t" \ "mov x9, x30\n\t" \ - "adr x16, " __ASM_NAME("__wine_syscall_dispatcher") "\n\t" \ - "ldr x16, [x16]\n\t" \ + "adrp x16, __wine_syscall_dispatcher\n\t" \ + "ldr x16, [x16, :lo12:__wine_syscall_dispatcher]\n\t" \ "blr x16\n\t" \ - "ret" :: "i" (id) ) + "ret\n\t" \ + ".seh_endproc" :: "i" (id) ) #elif defined __x86_64__ /* Chromium depends on syscall thunks having the same form as on * Windows. For 64-bit systems the only viable form we can emulate is @@ -234,7 +237,7 @@ # ifdef __WINE_PE_BUILD # define __ASM_SYSCALL_FUNC(id,name) \ __ASM_GLOBAL_FUNC( name, \ - __ASM_SEH(".seh_endprologue\n\t") \ + ".seh_endprologue\n\t" \ ".byte 0x4c,0x8b,0xd1\n\t" /* movq %rcx,%r10 */ \ ".byte 0xb8\n\t" /* movl $i,%eax */ \ ".long (" #id ")\n\t" \ @@ -250,7 +253,6 @@ # else # define __ASM_SYSCALL_FUNC(id,name) \ __ASM_GLOBAL_FUNC( name, \ - __ASM_SEH(".seh_endprologue\n\t") \ ".byte 0x4c,0x8b,0xd1\n\t" /* movq %rcx,%r10 */ \ ".byte 0xb8\n\t" /* movl $i,%eax */ \ ".long (" #id ")\n\t" \
1
0
0
0
Alexandre Julliard : win32u: Add a wrapper macro for ARM64EC syscalls.
by Alexandre Julliard
26 Feb '24
26 Feb '24
Module: wine Branch: master Commit: 79b9b60914eefffb529f333d11e8b573ad2a15b0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/79b9b60914eefffb529f333d11e8b5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Feb 26 12:42:45 2024 +0100 win32u: Add a wrapper macro for ARM64EC syscalls. --- dlls/win32u/main.c | 805 +++++++++++++++++++++++++++-------------------------- 1 file changed, 403 insertions(+), 402 deletions(-)
1
0
0
0
Alexandre Julliard : ntdll: Add a wrapper macro for ARM64EC syscalls.
by Alexandre Julliard
26 Feb '24
26 Feb '24
Module: wine Branch: master Commit: 0c59e8622bbd51331a6bb3d0bc7b2a47a9c59a66 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0c59e8622bbd51331a6bb3d0bc7b2a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Feb 26 12:42:29 2024 +0100 ntdll: Add a wrapper macro for ARM64EC syscalls. --- dlls/ntdll/signal_arm64ec.c | 463 ++++++++++++++++++++++---------------------- 1 file changed, 232 insertions(+), 231 deletions(-)
1
0
0
0
Zebediah Figura : shell32: Also zero-initialize the background menu.
by Alexandre Julliard
26 Feb '24
26 Feb '24
Module: wine Branch: master Commit: f7c665fd6ec73bdd781e2f5c3fac41c606172865 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f7c665fd6ec73bdd781e2f5c3fac41…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Sun Feb 25 17:10:32 2024 -0600 shell32: Also zero-initialize the background menu. Fixes: 063a377df4fe7d9118dec1d4fd198f97c2eba710 --- dlls/shell32/shlview_cmenu.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c index 9057d7c0175..a5592d3c830 100644 --- a/dlls/shell32/shlview_cmenu.c +++ b/dlls/shell32/shlview_cmenu.c @@ -1541,8 +1541,8 @@ HRESULT BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop, REFIID ri ContextMenu *This; HRESULT hr; - This = malloc(sizeof(*This)); - if (!This) return E_OUTOFMEMORY; + if (!(This = calloc(1, sizeof(*This)))) + return E_OUTOFMEMORY; This->IContextMenu3_iface.lpVtbl = &BackgroundContextMenuVtbl; This->IShellExtInit_iface.lpVtbl = &ShellExtInitVtbl; @@ -1550,10 +1550,6 @@ HRESULT BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop, REFIID ri This->ref = 1; This->parent = parent; - This->pidl = NULL; - This->apidl = NULL; - This->cidl = 0; - This->desktop = desktop; if (parent) IShellFolder_AddRef(parent);
1
0
0
0
Esme Povirk : gdiplus: Restore hdc argument to gdip_format_string.
by Alexandre Julliard
26 Feb '24
26 Feb '24
Module: wine Branch: master Commit: c37fea89e6202e82e91d6af75f94441a76a9c130 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c37fea89e6202e82e91d6af75f9444…
Author: Esme Povirk <esme(a)codeweavers.com> Date: Fri Feb 23 20:19:14 2024 +0000 gdiplus: Restore hdc argument to gdip_format_string. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56345
--- dlls/gdiplus/gdiplus_private.h | 3 ++- dlls/gdiplus/graphics.c | 27 ++++++++++++++------------- dlls/gdiplus/graphicspath.c | 6 +++--- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index c88b5407257..1ae03d7126e 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -621,6 +621,7 @@ struct gdip_font_link_info { struct gdip_format_string_info { GpGraphics *graphics; + HDC hdc; GDIPCONST WCHAR *string; INT index; INT length; @@ -636,7 +637,7 @@ struct gdip_format_string_info { typedef GpStatus (*gdip_format_string_callback)(struct gdip_format_string_info *info); -GpStatus gdip_format_string(GpGraphics *graphics, +GpStatus gdip_format_string(GpGraphics *graphics, HDC hdc, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, int ignore_empty_clip, gdip_format_string_callback callback, void *user_data); diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 74271a49418..85b25e1ac24 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -5217,7 +5217,7 @@ static void generate_font_link_info(struct gdip_format_string_info *info, DWORD IUnknown_Release(unk); get_font_hfont(info->graphics, base_font, NULL, &hfont, NULL, NULL); - IMLangFontLink_GetFontCodePages(iMLFL, info->graphics->hdc, hfont, &font_codepages); + IMLangFontLink_GetFontCodePages(iMLFL, info->hdc, hfont, &font_codepages); while (progress < length) { @@ -5232,10 +5232,10 @@ static void generate_font_link_info(struct gdip_format_string_info *info, DWORD } else { - IMLangFontLink_MapFont(iMLFL, info->graphics->hdc, string_codepages, hfont, &map_hfont); - old_font = SelectObject(info->graphics->hdc, map_hfont); - GdipCreateFontFromDC(info->graphics->hdc, &gpfont); - SelectObject(info->graphics->hdc, old_font); + IMLangFontLink_MapFont(iMLFL, info->hdc, string_codepages, hfont, &map_hfont); + old_font = SelectObject(info->hdc, map_hfont); + GdipCreateFontFromDC(info->hdc, &gpfont); + SelectObject(info->hdc, old_font); IMLangFontLink_ReleaseFont(iMLFL, map_hfont); section->font = gpfont; } @@ -5271,9 +5271,9 @@ static void font_link_get_text_extent_point(struct gdip_format_string_info *info to_measure_length = min(length - (i - index), section->end - i); get_font_hfont(info->graphics, section->font, NULL, &hfont, NULL, NULL); - oldhfont = SelectObject(info->graphics->hdc, hfont); - GetTextExtentExPointW(info->graphics->hdc, &info->string[i], to_measure_length, max_ext, &fitaux, NULL, &sizeaux); - SelectObject(info->graphics->hdc, oldhfont); + oldhfont = SelectObject(info->hdc, hfont); + GetTextExtentExPointW(info->hdc, &info->string[i], to_measure_length, max_ext, &fitaux, NULL, &sizeaux); + SelectObject(info->hdc, oldhfont); DeleteObject(hfont); max_ext -= sizeaux.cx; @@ -5301,7 +5301,7 @@ static void release_font_link_info(struct gdip_font_link_info *font_link_info) } } -GpStatus gdip_format_string(GpGraphics *graphics, +GpStatus gdip_format_string(GpGraphics *graphics, HDC hdc, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, int ignore_empty_clip, gdip_format_string_callback callback, void *user_data) @@ -5321,6 +5321,7 @@ GpStatus gdip_format_string(GpGraphics *graphics, struct gdip_format_string_info info; info.graphics = graphics; + info.hdc = hdc; info.rect = rect; info.bounds = &bounds; info.user_data = user_data; @@ -5645,7 +5646,7 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics, gdi_transform_acquire(graphics); - stat = gdip_format_string(graphics, string, length, font, &scaled_rect, stringFormat, + stat = gdip_format_string(graphics, hdc, string, length, font, &scaled_rect, stringFormat, (stringFormat->attr & StringFormatFlagsNoClip) != 0, measure_ranges_callback, &args); gdi_transform_release(graphics); @@ -5755,7 +5756,7 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, gdi_transform_acquire(graphics); - gdip_format_string(graphics, string, length, font, &scaled_rect, format, TRUE, + gdip_format_string(graphics, hdc, string, length, font, &scaled_rect, format, TRUE, measure_string_callback, &args); gdi_transform_release(graphics); @@ -5814,7 +5815,7 @@ static GpStatus draw_string_callback(struct gdip_format_string_info *info) REAL underline_y, underline_height; int i; - GetOutlineTextMetricsW(info->graphics->hdc, sizeof(otm), &otm); + GetOutlineTextMetricsW(info->hdc, sizeof(otm), &otm); underline_height = otm.otmsUnderscoreSize / args->rel_height; underline_y = position.Y - otm.otmsUnderscorePosition / args->rel_height - underline_height / 2; @@ -5942,7 +5943,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string GetTextMetricsW(hdc, &textmetric); args.ascent = textmetric.tmAscent / rel_height; - gdip_format_string(graphics, string, length, font, &scaled_rect, format, TRUE, + gdip_format_string(graphics, hdc, string, length, font, &scaled_rect, format, TRUE, draw_string_callback, &args); gdi_transform_release(graphics); diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 6009f941b7d..54d9f252c2f 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1019,7 +1019,7 @@ static GpStatus format_string_callback(struct gdip_format_string_info* info) TTPOLYGONHEADER *ph = NULL, *origph; char *start; DWORD len, ofs = 0; - len = GetGlyphOutlineW(info->graphics->hdc, info->string[i], GGO_BEZIER, &gm, 0, NULL, &identity); + len = GetGlyphOutlineW(info->hdc, info->string[i], GGO_BEZIER, &gm, 0, NULL, &identity); if (len == GDI_ERROR) { status = GenericError; @@ -1033,7 +1033,7 @@ static GpStatus format_string_callback(struct gdip_format_string_info* info) status = OutOfMemory; break; } - GetGlyphOutlineW(info->graphics->hdc, info->string[i], GGO_BEZIER, &gm, len, start, &identity); + GetGlyphOutlineW(info->hdc, info->string[i], GGO_BEZIER, &gm, len, start, &identity); ofs = 0; while (ofs < len) @@ -1161,7 +1161,7 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT args.maxY = 0; args.scale = emSize / native_height; args.ascent = textmetric.tmAscent * args.scale; - status = gdip_format_string(graphics, string, length, NULL, &scaled_layout_rect, + status = gdip_format_string(graphics, dc, string, length, NULL, &scaled_layout_rect, format, TRUE, format_string_callback, &args); DeleteDC(dc);
1
0
0
0
Esme Povirk : gdiplus: Pass gdip_format_string_info to font link functions.
by Alexandre Julliard
26 Feb '24
26 Feb '24
Module: wine Branch: master Commit: 0d0d37bbea2c59820d35082007dbedc0bd531c65 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0d0d37bbea2c59820d35082007dbed…
Author: Esme Povirk <esme(a)codeweavers.com> Date: Fri Feb 23 20:05:12 2024 +0000 gdiplus: Pass gdip_format_string_info to font link functions. --- dlls/gdiplus/graphics.c | 51 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index b7f10d9f56d..74271a49418 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -5199,8 +5199,7 @@ GpStatus WINGDIPAPI GdipIsVisibleRectI(GpGraphics *graphics, INT x, INT y, INT w } /* Populates gdip_font_link_info struct based on the base_font and input string */ -static void generate_font_link_info(GpGraphics *graphics, WCHAR *string, DWORD length, GDIPCONST GpFont *base_font, - struct gdip_font_link_info *font_link_info) +static void generate_font_link_info(struct gdip_format_string_info *info, DWORD length, GDIPCONST GpFont *base_font) { IUnknown *unk; IMLangFontLink *iMLFL; @@ -5210,21 +5209,21 @@ static void generate_font_link_info(GpGraphics *graphics, WCHAR *string, DWORD l struct gdip_font_link_section *section; DWORD font_codepages, string_codepages; - list_init(&font_link_info->sections); - font_link_info->base_font = base_font; + list_init(&info->font_link_info.sections); + info->font_link_info.base_font = base_font; GetGlobalFontLinkObject((void**)&unk); IUnknown_QueryInterface(unk, &IID_IMLangFontLink, (void**)&iMLFL); IUnknown_Release(unk); - get_font_hfont(graphics, base_font, NULL, &hfont, NULL, NULL); - IMLangFontLink_GetFontCodePages(iMLFL, graphics->hdc, hfont, &font_codepages); + get_font_hfont(info->graphics, base_font, NULL, &hfont, NULL, NULL); + IMLangFontLink_GetFontCodePages(iMLFL, info->graphics->hdc, hfont, &font_codepages); while (progress < length) { section = calloc(1, sizeof(*section)); section->start = progress; - IMLangFontLink_GetStrCodePages(iMLFL, &string[progress], length - progress, + IMLangFontLink_GetStrCodePages(iMLFL, &info->string[progress], length - progress, font_codepages, &string_codepages, &processed); if (font_codepages & string_codepages) @@ -5233,16 +5232,16 @@ static void generate_font_link_info(GpGraphics *graphics, WCHAR *string, DWORD l } else { - IMLangFontLink_MapFont(iMLFL, graphics->hdc, string_codepages, hfont, &map_hfont); - old_font = SelectObject(graphics->hdc, map_hfont); - GdipCreateFontFromDC(graphics->hdc, &gpfont); - SelectObject(graphics->hdc, old_font); + IMLangFontLink_MapFont(iMLFL, info->graphics->hdc, string_codepages, hfont, &map_hfont); + old_font = SelectObject(info->graphics->hdc, map_hfont); + GdipCreateFontFromDC(info->graphics->hdc, &gpfont); + SelectObject(info->graphics->hdc, old_font); IMLangFontLink_ReleaseFont(iMLFL, map_hfont); section->font = gpfont; } section->end = section->start + processed; - list_add_tail(&font_link_info->sections, §ion->entry); + list_add_tail(&info->font_link_info.sections, §ion->entry); progress += processed; } @@ -5250,7 +5249,7 @@ static void generate_font_link_info(GpGraphics *graphics, WCHAR *string, DWORD l IMLangFontLink_Release(iMLFL); } -static void font_link_get_text_extent_point(struct gdip_font_link_info *font_link_info, GpGraphics *graphics, LPCWSTR string, +static void font_link_get_text_extent_point(struct gdip_format_string_info *info, INT index, int length, int max_ext, LPINT fit, SIZE *size) { DWORD to_measure_length; @@ -5265,16 +5264,16 @@ static void font_link_get_text_extent_point(struct gdip_font_link_info *font_lin if (fit) *fit = 0; - LIST_FOR_EACH_ENTRY(section, &font_link_info->sections, struct gdip_font_link_section, entry) + LIST_FOR_EACH_ENTRY(section, &info->font_link_info.sections, struct gdip_font_link_section, entry) { if (i >= section->end) continue; to_measure_length = min(length - (i - index), section->end - i); - get_font_hfont(graphics, section->font, NULL, &hfont, NULL, NULL); - oldhfont = SelectObject(graphics->hdc, hfont); - GetTextExtentExPointW(graphics->hdc, &string[i], to_measure_length, max_ext, &fitaux, NULL, &sizeaux); - SelectObject(graphics->hdc, oldhfont); + get_font_hfont(info->graphics, section->font, NULL, &hfont, NULL, NULL); + oldhfont = SelectObject(info->graphics->hdc, hfont); + GetTextExtentExPointW(info->graphics->hdc, &info->string[i], to_measure_length, max_ext, &fitaux, NULL, &sizeaux); + SelectObject(info->graphics->hdc, oldhfont); DeleteObject(hfont); max_ext -= sizeaux.cx; @@ -5393,10 +5392,10 @@ GpStatus gdip_format_string(GpGraphics *graphics, halign = format->align; - generate_font_link_info(graphics, stringdup, length, font, &info.font_link_info); + generate_font_link_info(&info, length, font); while(sum < length){ - font_link_get_text_extent_point(&info.font_link_info, graphics, stringdup, sum, length - sum, nwidth, &fit, &size); + font_link_get_text_extent_point(&info, sum, length - sum, nwidth, &fit, &size); fitcpy = fit; if(fit == 0) @@ -5444,7 +5443,7 @@ GpStatus gdip_format_string(GpGraphics *graphics, else lineend = fit; - font_link_get_text_extent_point(&info.font_link_info, graphics, stringdup, sum, lineend, nwidth, &j, &size); + font_link_get_text_extent_point(&info, sum, lineend, nwidth, &j, &size); bounds.Width = size.cx; @@ -5566,10 +5565,10 @@ static GpStatus measure_ranges_callback(struct gdip_format_string_info *info) range_rect.Y = info->bounds->Y / args->rel_height; range_rect.Height = info->bounds->Height / args->rel_height; - font_link_get_text_extent_point(&info->font_link_info, info->graphics, info->string, info->index, range_start - info->index, INT_MAX, NULL, &range_size); + font_link_get_text_extent_point(info, info->index, range_start - info->index, INT_MAX, NULL, &range_size); range_rect.X = (info->bounds->X + range_size.cx) / args->rel_width; - font_link_get_text_extent_point(&info->font_link_info, info->graphics, info->string, info->index, range_end - info->index, INT_MAX, NULL, &range_size); + font_link_get_text_extent_point(info, info->index, range_end - info->index, INT_MAX, NULL, &range_size); range_rect.Width = (info->bounds->X + range_size.cx) / args->rel_width - range_rect.X; stat = GdipCombineRegionRect(args->regions[i], &range_rect, CombineModeUnion); @@ -5800,7 +5799,7 @@ static GpStatus draw_string_callback(struct gdip_format_string_info *info) to_draw_length = min(info->length - (i - info->index), section->end - i); TRACE("index %d, todraw %ld, used %s\n", i, to_draw_length, section->font == info->font_link_info.base_font ? "base font" : "map"); - font_link_get_text_extent_point(&info->font_link_info, info->graphics, info->string, i, to_draw_length, 0, NULL, &size); + font_link_get_text_extent_point(info, i, to_draw_length, 0, NULL, &size); stat = draw_driver_string(info->graphics, &info->string[i], to_draw_length, section->font, info->format, args->brush, &position, DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, NULL); @@ -5826,10 +5825,10 @@ static GpStatus draw_string_callback(struct gdip_format_string_info *info) SIZE text_size; INT ofs = info->underlined_indexes[i] - info->index; - font_link_get_text_extent_point(&info->font_link_info, info->graphics, info->string, info->index, ofs, INT_MAX, NULL, &text_size); + font_link_get_text_extent_point(info, info->index, ofs, INT_MAX, NULL, &text_size); start_x = text_size.cx / args->rel_width; - font_link_get_text_extent_point(&info->font_link_info, info->graphics, info->string, info->index, ofs+1, INT_MAX, NULL, &text_size); + font_link_get_text_extent_point(info, info->index, ofs+1, INT_MAX, NULL, &text_size); end_x = text_size.cx / args->rel_width; GdipFillRectangle(info->graphics, (GpBrush*)args->brush, position.X+start_x, underline_y, end_x-start_x, underline_height);
1
0
0
0
Esme Povirk : gdiplus: Switch to a struct for gdip_format_string callback args.
by Alexandre Julliard
26 Feb '24
26 Feb '24
Module: wine Branch: master Commit: f2c92c68a21bdda69df0bd24023a658e5e8f9032 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f2c92c68a21bdda69df0bd24023a65…
Author: Esme Povirk <esme(a)codeweavers.com> Date: Fri Feb 23 19:48:59 2024 +0000 gdiplus: Switch to a struct for gdip_format_string callback args. --- dlls/gdiplus/gdiplus_private.h | 22 +++++--- dlls/gdiplus/graphics.c | 116 ++++++++++++++++++++--------------------- dlls/gdiplus/graphicspath.c | 24 ++++----- 3 files changed, 83 insertions(+), 79 deletions(-)
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
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