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 2023
----- 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
775 discussions
Start a n
N
ew thread
Alexandre Julliard : start: Move memory allocation into parse_title().
by Alexandre Julliard
24 May '23
24 May '23
Module: wine Branch: master Commit: 4ae7de5bf786ead7d453f66540f797ff6d49682b URL:
https://gitlab.winehq.org/wine/wine/-/commit/4ae7de5bf786ead7d453f66540f797…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 24 09:12:31 2023 +0200 start: Move memory allocation into parse_title(). --- programs/start/start.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/programs/start/start.c b/programs/start/start.c index 4fd6cfc4481..c1cc58df7c1 100644 --- a/programs/start/start.c +++ b/programs/start/start.c @@ -220,7 +220,7 @@ static BOOL is_option(const WCHAR* arg, const WCHAR* opt) arg, -1, opt, -1) == CSTR_EQUAL; } -static void parse_title(const WCHAR *arg, WCHAR *title, int size) +static WCHAR *parse_title(const WCHAR *arg) { /* See: * WCMD_start() in programs/cmd/builtins.c @@ -228,15 +228,13 @@ static void parse_title(const WCHAR *arg, WCHAR *title, int size) * The shell has already tokenized the command line for us. * All we need to do is filter out all the quotes. */ - int next; const WCHAR *p = arg; + WCHAR *title = malloc( wcslen(arg) * sizeof(WCHAR) ); - for (next = 0; next < (size-1) && *p; p++) { - if (*p != '"') - title[next++] = *p; - } - title[next] = '\0'; + for (next = 0; *p; p++) if (*p != '"') title[next++] = *p; + title[next] = 0; + return title; } static BOOL search_path(const WCHAR *firstParam, WCHAR **full_path) @@ -417,15 +415,7 @@ int __cdecl wmain (int argc, WCHAR *argv[]) for (i=1; i<argc; i++) { /* parse first quoted argument as console title */ if (!title && argv[i][0] == '"') { - /* it will remove at least 1 quote */ - int maxChars = lstrlenW(argv[1]); - title = HeapAlloc(GetProcessHeap(), 0, maxChars*sizeof(WCHAR)); - if (title) - parse_title(argv[i], title, maxChars); - else { - WINE_ERR("out of memory\n"); - ExitProcess(1); - } + title = parse_title(argv[i]); continue; } if (argv[i][0] != '/') @@ -669,7 +659,6 @@ done: HeapFree( GetProcessHeap(), 0, dos_filename ); HeapFree( GetProcessHeap(), 0, fullpath ); HeapFree( GetProcessHeap(), 0, parent_directory ); - HeapFree( GetProcessHeap(), 0, title ); if (sei.fMask & SEE_MASK_NOCLOSEPROCESS) { DWORD exitcode;
1
0
0
0
Alexandre Julliard : kernelbase: Add support for the PROC_THREAD_ATTRIBUTE_MACHINE_TYPE attribute.
by Alexandre Julliard
24 May '23
24 May '23
Module: wine Branch: master Commit: d203af0fd74a72ffc01e4f3c090d8d285bad7742 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d203af0fd74a72ffc01e4f3c090d8d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 24 09:11:48 2023 +0200 kernelbase: Add support for the PROC_THREAD_ATTRIBUTE_MACHINE_TYPE attribute. --- dlls/kernelbase/process.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 3be5fc22596..54a524abe04 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -257,13 +257,14 @@ struct _PROC_THREAD_ATTRIBUTE_LIST static NTSTATUS create_nt_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES *tsa, DWORD process_flags, RTL_USER_PROCESS_PARAMETERS *params, - RTL_USER_PROCESS_INFORMATION *info, HANDLE parent, + RTL_USER_PROCESS_INFORMATION *info, + HANDLE parent, USHORT machine, const struct proc_thread_attr *handle_list, const struct proc_thread_attr *job_list) { OBJECT_ATTRIBUTES process_attr, thread_attr; PS_CREATE_INFO create_info; - ULONG_PTR buffer[offsetof( PS_ATTRIBUTE_LIST, Attributes[8] ) / sizeof(ULONG_PTR)]; + ULONG_PTR buffer[offsetof( PS_ATTRIBUTE_LIST, Attributes[9] ) / sizeof(ULONG_PTR)]; PS_ATTRIBUTE_LIST *attr = (PS_ATTRIBUTE_LIST *)buffer; UNICODE_STRING nameW; NTSTATUS status; @@ -330,6 +331,14 @@ static NTSTATUS create_nt_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBUT attr->Attributes[pos].ReturnLength = NULL; pos++; } + if (machine) + { + attr->Attributes[pos].Attribute = PS_ATTRIBUTE_MACHINE_TYPE; + attr->Attributes[pos].Size = sizeof(machine); + attr->Attributes[pos].Value = machine; + attr->Attributes[pos].ReturnLength = NULL; + pos++; + } attr->TotalLength = offsetof( PS_ATTRIBUTE_LIST, Attributes[pos] ); InitializeObjectAttributes( &process_attr, NULL, 0, NULL, psa ? psa->lpSecurityDescriptor : NULL ); @@ -371,7 +380,7 @@ static NTSTATUS create_vdm_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBU winevdm, params->ImagePathName.Buffer, params->CommandLine.Buffer ); RtlInitUnicodeString( ¶ms->ImagePathName, winevdm ); RtlInitUnicodeString( ¶ms->CommandLine, newcmdline ); - status = create_nt_process( token, debug, psa, tsa, flags, params, info, NULL, NULL, NULL ); + status = create_nt_process( token, debug, psa, tsa, flags, params, info, 0, 0, NULL, NULL ); HeapFree( GetProcessHeap(), 0, newcmdline ); return status; } @@ -400,7 +409,7 @@ static NTSTATUS create_cmd_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBU swprintf( newcmdline, len, L"%s /s/c \"%s\"", comspec, params->CommandLine.Buffer ); RtlInitUnicodeString( ¶ms->ImagePathName, comspec ); RtlInitUnicodeString( ¶ms->CommandLine, newcmdline ); - status = create_nt_process( token, debug, psa, tsa, flags, params, info, NULL, NULL, NULL ); + status = create_nt_process( token, debug, psa, tsa, flags, params, info, 0, 0, NULL, NULL ); RtlFreeHeap( GetProcessHeap(), 0, newcmdline ); return status; } @@ -510,6 +519,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR RTL_USER_PROCESS_INFORMATION rtl_info; HANDLE parent = 0, debug = 0; ULONG nt_flags = 0; + USHORT machine = 0; NTSTATUS status; /* Process the AppName and/or CmdLine to get module name and path */ @@ -602,6 +612,10 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR TRACE( "PROC_THREAD_ATTRIBUTE_JOB_LIST handle count %Iu.\n", attrs->attrs[i].size / sizeof(HANDLE) ); break; + case PROC_THREAD_ATTRIBUTE_MACHINE_TYPE: + machine = *(USHORT *)attrs->attrs[i].value; + TRACE( "PROC_THREAD_ATTRIBUTE_MACHINE %x.\n", machine ); + break; default: FIXME("Unsupported attribute %#Ix.\n", attrs->attrs[i].attr); break; @@ -616,7 +630,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR if (flags & CREATE_SUSPENDED) nt_flags |= PROCESS_CREATE_FLAGS_SUSPENDED; status = create_nt_process( token, debug, process_attr, thread_attr, - nt_flags, params, &rtl_info, parent, handle_list, job_list ); + nt_flags, params, &rtl_info, parent, machine, handle_list, job_list ); switch (status) { case STATUS_SUCCESS: @@ -1722,6 +1736,9 @@ static inline DWORD validate_proc_thread_attribute( DWORD_PTR attr, SIZE_T size case PROC_THREAD_ATTRIBUTE_JOB_LIST: if ((size / sizeof(HANDLE)) * sizeof(HANDLE) != size) return ERROR_BAD_LENGTH; break; + case PROC_THREAD_ATTRIBUTE_MACHINE_TYPE: + if (size != sizeof(USHORT)) return ERROR_BAD_LENGTH; + break; default: FIXME( "Unhandled attribute %Iu\n", attr & PROC_THREAD_ATTRIBUTE_NUMBER ); return ERROR_NOT_SUPPORTED;
1
0
0
0
Alexandre Julliard : kernelbase: Add a helper function to validate process/thread attributes.
by Alexandre Julliard
24 May '23
24 May '23
Module: wine Branch: master Commit: ca7a7abe856c972fc08717595e95fa23551f34bc URL:
https://gitlab.winehq.org/wine/wine/-/commit/ca7a7abe856c972fc08717595e95fa…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 24 09:11:26 2023 +0200 kernelbase: Add a helper function to validate process/thread attributes. --- dlls/kernelbase/process.c | 93 +++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 59 deletions(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 837bdfd5e87..3be5fc22596 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -1696,85 +1696,60 @@ BOOL WINAPI DECLSPEC_HOTPATCH InitializeProcThreadAttributeList( struct _PROC_TH } -/*********************************************************************** - * UpdateProcThreadAttribute (kernelbase.@) - */ -BOOL WINAPI DECLSPEC_HOTPATCH UpdateProcThreadAttribute( struct _PROC_THREAD_ATTRIBUTE_LIST *list, - DWORD flags, DWORD_PTR attr, void *value, - SIZE_T size, void *prev_ret, SIZE_T *size_ret ) +static inline DWORD validate_proc_thread_attribute( DWORD_PTR attr, SIZE_T size ) { - DWORD mask; - struct proc_thread_attr *entry; - - TRACE( "(%p %lx %08Ix %p %Id %p %p)\n", list, flags, attr, value, size, prev_ret, size_ret ); - - if (list->count >= list->size) - { - SetLastError( ERROR_GEN_FAILURE ); - return FALSE; - } - switch (attr) { case PROC_THREAD_ATTRIBUTE_PARENT_PROCESS: - if (size != sizeof(HANDLE)) - { - SetLastError( ERROR_BAD_LENGTH ); - return FALSE; - } + if (size != sizeof(HANDLE)) return ERROR_BAD_LENGTH; break; - case PROC_THREAD_ATTRIBUTE_HANDLE_LIST: - if ((size / sizeof(HANDLE)) * sizeof(HANDLE) != size) - { - SetLastError( ERROR_BAD_LENGTH ); - return FALSE; - } + if ((size / sizeof(HANDLE)) * sizeof(HANDLE) != size) return ERROR_BAD_LENGTH; break; - case PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR: - if (size != sizeof(PROCESSOR_NUMBER)) - { - SetLastError( ERROR_BAD_LENGTH ); - return FALSE; - } + if (size != sizeof(PROCESSOR_NUMBER)) return ERROR_BAD_LENGTH; break; - case PROC_THREAD_ATTRIBUTE_CHILD_PROCESS_POLICY: - if (size != sizeof(DWORD) && size != sizeof(DWORD64)) - { - SetLastError( ERROR_BAD_LENGTH ); - return FALSE; - } + if (size != sizeof(DWORD) && size != sizeof(DWORD64)) return ERROR_BAD_LENGTH; break; - case PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY: if (size != sizeof(DWORD) && size != sizeof(DWORD64) && size != sizeof(DWORD64) * 2) - { - SetLastError( ERROR_BAD_LENGTH ); - return FALSE; - } + return ERROR_BAD_LENGTH; break; - case PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE: - if (size != sizeof(HPCON)) - { - SetLastError( ERROR_BAD_LENGTH ); - return FALSE; - } + if (size != sizeof(HPCON)) return ERROR_BAD_LENGTH; break; - case PROC_THREAD_ATTRIBUTE_JOB_LIST: - if ((size / sizeof(HANDLE)) * sizeof(HANDLE) != size) - { - SetLastError( ERROR_BAD_LENGTH ); - return FALSE; - } + if ((size / sizeof(HANDLE)) * sizeof(HANDLE) != size) return ERROR_BAD_LENGTH; break; - default: - SetLastError( ERROR_NOT_SUPPORTED ); FIXME( "Unhandled attribute %Iu\n", attr & PROC_THREAD_ATTRIBUTE_NUMBER ); + return ERROR_NOT_SUPPORTED; + } + return 0; +} + + +/*********************************************************************** + * UpdateProcThreadAttribute (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH UpdateProcThreadAttribute( struct _PROC_THREAD_ATTRIBUTE_LIST *list, + DWORD flags, DWORD_PTR attr, void *value, + SIZE_T size, void *prev_ret, SIZE_T *size_ret ) +{ + DWORD mask, err; + struct proc_thread_attr *entry; + + TRACE( "(%p %lx %08Ix %p %Id %p %p)\n", list, flags, attr, value, size, prev_ret, size_ret ); + + if (list->count >= list->size) + { + SetLastError( ERROR_GEN_FAILURE ); + return FALSE; + } + if ((err = validate_proc_thread_attribute( attr, size ))) + { + SetLastError( err ); return FALSE; }
1
0
0
0
Alexandre Julliard : ntdll: Support the PS_ATTRIBUTE_MACHINE_TYPE attribute for new processes.
by Alexandre Julliard
24 May '23
24 May '23
Module: wine Branch: master Commit: 4356fe0d830759a4bc194f21f3c8fc3a36ca2ca0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4356fe0d830759a4bc194f21f3c8fc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 24 09:10:38 2023 +0200 ntdll: Support the PS_ATTRIBUTE_MACHINE_TYPE attribute for new processes. --- dlls/ntdll/unix/env.c | 8 +++++--- dlls/ntdll/unix/loader.c | 13 +++++++------ dlls/ntdll/unix/process.c | 10 ++++++++-- dlls/ntdll/unix/unix_private.h | 4 ++-- include/wine/server_protocol.h | 5 +++-- server/process.c | 2 ++ server/protocol.def | 1 + server/request.h | 1 + server/trace.c | 1 + 9 files changed, 30 insertions(+), 15 deletions(-)
1
0
0
0
Alexandre Julliard : ntdll: Don't even try to load .so libraries for a different machine.
by Alexandre Julliard
24 May '23
24 May '23
Module: wine Branch: master Commit: bce5a7910e4b3cf38a52a6f42e4c81f720f364e9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bce5a7910e4b3cf38a52a6f42e4c81…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 24 14:48:02 2023 +0200 ntdll: Don't even try to load .so libraries for a different machine. We are not going to support multi-machine .so modules. --- dlls/ntdll/unix/loader.c | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 4f485655fe2..cc99b3f76be 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1418,14 +1418,12 @@ static NTSTATUS open_builtin_pe_file( const char *name, OBJECT_ATTRIBUTES *attr, * open_builtin_so_file */ static NTSTATUS open_builtin_so_file( const char *name, OBJECT_ATTRIBUTES *attr, void **module, - SECTION_IMAGE_INFORMATION *image_info, - WORD machine, BOOL prefer_native ) + SECTION_IMAGE_INFORMATION *image_info, BOOL prefer_native ) { NTSTATUS status; int fd; *module = NULL; - if (machine != current_machine) return STATUS_DLL_NOT_FOUND; if ((fd = open( name, O_RDONLY )) == -1) return STATUS_DLL_NOT_FOUND; if (check_library_arch( fd )) @@ -1461,6 +1459,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T OBJECT_ATTRIBUTES attr; NTSTATUS status = STATUS_DLL_NOT_FOUND; BOOL found_image = FALSE; + BOOL try_so = (search_machine == current_machine && (!load_machine || load_machine == search_machine)); for (i = namepos = 0; i < len; i++) if (nt_name->Buffer[i] == '/' || nt_name->Buffer[i] == '\\') namepos = i + 1; @@ -1493,9 +1492,12 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T limit, load_machine, prefer_native ); ptr = prepend_build_dir_path( file + pos, ".dll", "", "/dlls" ); if (status != STATUS_DLL_NOT_FOUND) goto done; - strcpy( file + pos + len + 1, ".so" ); - status = open_builtin_so_file( ptr, &attr, module, image_info, load_machine, prefer_native ); - if (status != STATUS_DLL_NOT_FOUND) goto done; + if (try_so) + { + strcpy( file + pos + len + 1, ".so" ); + status = open_builtin_so_file( ptr, &attr, module, image_info, prefer_native ); + if (status != STATUS_DLL_NOT_FOUND) goto done; + } /* now as a program */ file[pos + len + 1] = 0; @@ -1504,9 +1506,12 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T limit, load_machine, prefer_native ); ptr = prepend_build_dir_path( file + pos, ".exe", "", "/programs" ); if (status != STATUS_DLL_NOT_FOUND) goto done; - strcpy( file + pos + len + 1, ".so" ); - status = open_builtin_so_file( ptr, &attr, module, image_info, load_machine, prefer_native ); - if (status != STATUS_DLL_NOT_FOUND) goto done; + if (try_so) + { + strcpy( file + pos + len + 1, ".so" ); + status = open_builtin_so_file( ptr, &attr, module, image_info, prefer_native ); + if (status != STATUS_DLL_NOT_FOUND) goto done; + } } for (i = 0; dll_paths[i]; i++) @@ -1522,9 +1527,12 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T ptr = prepend( ptr, so_dir, strlen(so_dir) ); ptr = prepend( ptr, dll_paths[i], strlen(dll_paths[i]) ); if (status != STATUS_DLL_NOT_FOUND) goto done; - strcpy( file + pos + len + 1, ".so" ); - status = open_builtin_so_file( ptr, &attr, module, image_info, load_machine, prefer_native ); - if (status != STATUS_DLL_NOT_FOUND) goto done; + if (try_so) + { + strcpy( file + pos + len + 1, ".so" ); + status = open_builtin_so_file( ptr, &attr, module, image_info, prefer_native ); + if (status != STATUS_DLL_NOT_FOUND) goto done; + } file[pos + len + 1] = 0; ptr = prepend( file + pos, dll_paths[i], strlen(dll_paths[i]) ); status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, limit, @@ -1535,8 +1543,9 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T continue; } if (status != STATUS_DLL_NOT_FOUND) goto done; + if (!try_so) continue; strcpy( file + pos + len + 1, ".so" ); - status = open_builtin_so_file( ptr, &attr, module, image_info, load_machine, prefer_native ); + status = open_builtin_so_file( ptr, &attr, module, image_info, prefer_native ); if (status == STATUS_NOT_SUPPORTED) found_image = TRUE; else if (status != STATUS_DLL_NOT_FOUND) goto done; } @@ -1896,7 +1905,7 @@ static void load_ntdll(void) if (status == STATUS_DLL_NOT_FOUND) { sprintf( name, "%s/ntdll.dll.so", ntdll_dir ); - status = open_builtin_so_file( name, &attr, &module, &info, current_machine, FALSE ); + status = open_builtin_so_file( name, &attr, &module, &info, FALSE ); } if (status == STATUS_IMAGE_NOT_AT_BASE) relocate_ntdll( module ); else if (status) fatal_error( "failed to load %s error %x\n", name, status );
1
0
0
0
Francisco Casas : vkd3d-shader/hlsl: Extend the liveness of nodes produced outside loops.
by Alexandre Julliard
24 May '23
24 May '23
Module: vkd3d Branch: master Commit: e060773c1951ceb4a7cca8b61ebecf661fe0f5e0 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/e060773c1951ceb4a7cca8b61ebec…
Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Wed May 10 12:30:39 2023 -0400 vkd3d-shader/hlsl: Extend the liveness of nodes produced outside loops. Otherwise, it is possible that the register used by the temp is overridden by a subsequent instruction within the same loop. --- libs/vkd3d-shader/hlsl_codegen.c | 54 ++++++++++++++++++++-------------------- tests/loop.shader_test | 4 +-- tests/return.shader_test | 6 ++--- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index b4e10c97..bbb5223b 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -2587,9 +2587,9 @@ static void allocate_register_reservations(struct hlsl_ctx *ctx) /* Compute the earliest and latest liveness for each variable. In the case that * a variable is accessed inside of a loop, we promote its liveness to extend - * to at least the range of the entire loop. Note that we don't need to do this - * for anonymous nodes, since there's currently no way to use a node which was - * calculated in an earlier iteration of the loop. */ + * to at least the range of the entire loop. We also do this for nodes, so that + * nodes produced before the loop have their temp register protected from being + * overridden after the last read within an iteration. */ static void compute_liveness_recurse(struct hlsl_block *block, unsigned int loop_first, unsigned int loop_last) { struct hlsl_ir_node *instr; @@ -2597,7 +2597,7 @@ static void compute_liveness_recurse(struct hlsl_block *block, unsigned int loop LIST_FOR_EACH_ENTRY(instr, &block->instrs, struct hlsl_ir_node, entry) { - const unsigned int var_last_read = loop_last ? max(instr->index, loop_last) : instr->index; + const unsigned int last_read = loop_last ? max(instr->index, loop_last) : instr->index; switch (instr->type) { @@ -2612,9 +2612,9 @@ static void compute_liveness_recurse(struct hlsl_block *block, unsigned int loop var = store->lhs.var; if (!var->first_write) var->first_write = loop_first ? min(instr->index, loop_first) : instr->index; - store->rhs.node->last_read = instr->index; + store->rhs.node->last_read = last_read; if (store->lhs.offset.node) - store->lhs.offset.node->last_read = instr->index; + store->lhs.offset.node->last_read = last_read; break; } case HLSL_IR_EXPR: @@ -2623,7 +2623,7 @@ static void compute_liveness_recurse(struct hlsl_block *block, unsigned int loop unsigned int i; for (i = 0; i < ARRAY_SIZE(expr->operands) && expr->operands[i].node; ++i) - expr->operands[i].node->last_read = instr->index; + expr->operands[i].node->last_read = last_read; break; } case HLSL_IR_IF: @@ -2632,7 +2632,7 @@ static void compute_liveness_recurse(struct hlsl_block *block, unsigned int loop compute_liveness_recurse(&iff->then_block, loop_first, loop_last); compute_liveness_recurse(&iff->else_block, loop_first, loop_last); - iff->condition.node->last_read = instr->index; + iff->condition.node->last_read = last_read; break; } case HLSL_IR_LOAD: @@ -2640,9 +2640,9 @@ static void compute_liveness_recurse(struct hlsl_block *block, unsigned int loop struct hlsl_ir_load *load = hlsl_ir_load(instr); var = load->src.var; - var->last_read = max(var->last_read, var_last_read); + var->last_read = max(var->last_read, last_read); if (load->src.offset.node) - load->src.offset.node->last_read = instr->index; + load->src.offset.node->last_read = last_read; break; } case HLSL_IR_LOOP: @@ -2658,28 +2658,28 @@ static void compute_liveness_recurse(struct hlsl_block *block, unsigned int loop struct hlsl_ir_resource_load *load = hlsl_ir_resource_load(instr); var = load->resource.var; - var->last_read = max(var->last_read, var_last_read); + var->last_read = max(var->last_read, last_read); if (load->resource.offset.node) - load->resource.offset.node->last_read = instr->index; + load->resource.offset.node->last_read = last_read; if ((var = load->sampler.var)) { - var->last_read = max(var->last_read, var_last_read); + var->last_read = max(var->last_read, last_read); if (load->sampler.offset.node) - load->sampler.offset.node->last_read = instr->index; + load->sampler.offset.node->last_read = last_read; } - load->coords.node->last_read = instr->index; + load->coords.node->last_read = last_read; if (load->texel_offset.node) - load->texel_offset.node->last_read = instr->index; + load->texel_offset.node->last_read = last_read; if (load->lod.node) - load->lod.node->last_read = instr->index; + load->lod.node->last_read = last_read; if (load->ddx.node) - load->ddx.node->last_read = instr->index; + load->ddx.node->last_read = last_read; if (load->ddy.node) - load->ddy.node->last_read = instr->index; + load->ddy.node->last_read = last_read; if (load->sample_index.node) - load->sample_index.node->last_read = instr->index; + load->sample_index.node->last_read = last_read; break; } case HLSL_IR_RESOURCE_STORE: @@ -2687,26 +2687,26 @@ static void compute_liveness_recurse(struct hlsl_block *block, unsigned int loop struct hlsl_ir_resource_store *store = hlsl_ir_resource_store(instr); var = store->resource.var; - var->last_read = max(var->last_read, var_last_read); + var->last_read = max(var->last_read, last_read); if (store->resource.offset.node) - store->resource.offset.node->last_read = instr->index; - store->coords.node->last_read = instr->index; - store->value.node->last_read = instr->index; + store->resource.offset.node->last_read = last_read; + store->coords.node->last_read = last_read; + store->value.node->last_read = last_read; break; } case HLSL_IR_SWIZZLE: { struct hlsl_ir_swizzle *swizzle = hlsl_ir_swizzle(instr); - swizzle->val.node->last_read = instr->index; + swizzle->val.node->last_read = last_read; break; } case HLSL_IR_INDEX: { struct hlsl_ir_index *index = hlsl_ir_index(instr); - index->val.node->last_read = instr->index; - index->idx.node->last_read = instr->index; + index->val.node->last_read = last_read; + index->idx.node->last_read = last_read; break; } case HLSL_IR_CONSTANT: diff --git a/tests/loop.shader_test b/tests/loop.shader_test index 08cf7e55..75a31f7a 100644 --- a/tests/loop.shader_test +++ b/tests/loop.shader_test @@ -17,7 +17,7 @@ float4 main() : sv_target [test] uniform 0 float 5.0 draw quad -todo probe all rgba (50.0, 50.0, 50.0, 50.0) +probe all rgba (50.0, 50.0, 50.0, 50.0) [pixel shader] @@ -40,4 +40,4 @@ float4 main() : sv_target [test] uniform 0 float 4.0 draw quad -todo probe all rgba (20.0, 20.0, 20.0, 20.0) +probe all rgba (20.0, 20.0, 20.0, 20.0) diff --git a/tests/return.shader_test b/tests/return.shader_test index 3c9ea611..9f800d1a 100644 --- a/tests/return.shader_test +++ b/tests/return.shader_test @@ -175,15 +175,15 @@ probe all rgba (0.2, 0.2, 0.2, 0.2) 1 uniform 0 float 0.3 draw quad -todo probe all rgba (0.4, 0.4, 0.4, 0.4) 1 +probe all rgba (0.4, 0.4, 0.4, 0.4) 1 uniform 0 float 0.7 draw quad -todo probe all rgba (0.8, 0.8, 0.8, 0.8) 1 +probe all rgba (0.8, 0.8, 0.8, 0.8) 1 uniform 0 float 0.9 draw quad -todo probe all rgba (0.9, 0.9, 0.9, 0.9) 1 +probe all rgba (0.9, 0.9, 0.9, 0.9) 1 [pixel shader]
1
0
0
0
Francisco Casas : tests: Add minimal tests for temp lifetimes within a loop.
by Alexandre Julliard
24 May '23
24 May '23
Module: vkd3d Branch: master Commit: fbd2df2ad5080f689d8c5548fe9ca91b8481162e URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/fbd2df2ad5080f689d8c5548fe9ca…
Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Mon May 15 15:57:38 2023 -0400 tests: Add minimal tests for temp lifetimes within a loop. --- Makefile.am | 1 + tests/loop.shader_test | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/Makefile.am b/Makefile.am index 0a61365d..954b0ffd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -136,6 +136,7 @@ vkd3d_shader_tests = \ tests/load-level.shader_test \ tests/log.shader_test \ tests/logic-operations.shader_test \ + tests/loop.shader_test \ tests/majority-syntax.shader_test \ tests/math.shader_test \ tests/matrix-semantics.shader_test \ diff --git a/tests/loop.shader_test b/tests/loop.shader_test new file mode 100644 index 00000000..08cf7e55 --- /dev/null +++ b/tests/loop.shader_test @@ -0,0 +1,43 @@ +[pixel shader] +float a; + +float4 main() : sv_target +{ + float res = 0; + + for (int i = 0; i < 10; ++i) + { + res += a; + // The temp copy of 'a' must reserve its registers for the rest of the loop. + // It shall not be overwritten. + } + return res; +} + +[test] +uniform 0 float 5.0 +draw quad +todo probe all rgba (50.0, 50.0, 50.0, 50.0) + + +[pixel shader] +float a; + +float4 main() : sv_target +{ + float res = 0; + + for (int i = 0; i < 10; ++i) + { + res += a; + // The temp copy of 'a' must reserve its registers for the rest of the loop. + // It shall not be overwritten. + i++; + } + return res; +} + +[test] +uniform 0 float 4.0 +draw quad +todo probe all rgba (20.0, 20.0, 20.0, 20.0)
1
0
0
0
Davide Beatrici : explorer: Fix uninitialized variable warning.
by Alexandre Julliard
23 May '23
23 May '23
Module: wine Branch: master Commit: f266dc094a9b4fbe95792ed706891609901834e3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f266dc094a9b4fbe95792ed7068916…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Sat May 20 07:34:03 2023 +0200 explorer: Fix uninitialized variable warning. programs/explorer/desktop.c:104:16: warning: ‘hres’ may be used uninitialized in this function [-Wmaybe-uninitialized] 104 | return hres; | ^~~~ --- programs/explorer/desktop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 81eb0d1d01b..0e370fe3c2f 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -98,10 +98,11 @@ static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo) { HRESULT hres; - if (!typelib) + if (!typelib) { hres = load_typelib(); - if (!typelib) - return hres; + if (!typelib) + return hres; + } if (!typeinfos[tid]) { ITypeInfo *ti;
1
0
0
0
Bartosz Kosiorek : gdiplus: Improve performance of DrawImagePointsRect by avoid TransformMatrixPoints.
by Alexandre Julliard
23 May '23
23 May '23
Module: wine Branch: master Commit: f898f206f63744a2cc696d2b9ef81b95816d31cd URL:
https://gitlab.winehq.org/wine/wine/-/commit/f898f206f63744a2cc696d2b9ef81b…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Tue May 23 04:39:33 2023 +0200 gdiplus: Improve performance of DrawImagePointsRect by avoid TransformMatrixPoints. Using TransformMatrixPoints is not needed and all values could be taken from transformation matrix: - ShearX from m11, m12 - ShearY from m21, m22 - Translation mdx, mdy The result could be calculated by taking destination points values: {{0.0, 0.0}, {1.0, 0.0}, {0.0, 1.0}} and calculating it with GdipTransformMatrixPoints function: dst_to_src_points[0].X = dst_to_src.matrix[4]; dst_to_src_points[0].Y = dst_to_src.matrix[5]; dst_to_src_points[1].X = dst_to_src.matrix[0] + dst_to_src.matrix[4]; dst_to_src_points[1].Y = dst_to_src.matrix[1] + dst_to_src.matrix[5]; dst_to_src_points[2].X = dst_to_src.matrix[2] + dst_to_src.matrix[4]; dst_to_src_points[2].Y = dst_to_src.matrix[3] + dst_to_src.matrix[5]; --- dlls/gdiplus/graphics.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index fb848ed8a9c..03542b31ea7 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -3234,14 +3234,13 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image { GpMatrix dst_to_src; REAL m11, m12, m21, m22, mdx, mdy; - GpPointF dst_to_src_points[3] = {{0.0, 0.0}, {1.0, 0.0}, {0.0, 1.0}}; REAL x_dx, x_dy, y_dx, y_dy; ARGB *dst_color; GpPointF src_pointf_row, src_pointf; m11 = (ptf[1].X - ptf[0].X) / srcwidth; - m21 = (ptf[2].X - ptf[0].X) / srcheight; m12 = (ptf[1].Y - ptf[0].Y) / srcwidth; + m21 = (ptf[2].X - ptf[0].X) / srcheight; m22 = (ptf[2].Y - ptf[0].Y) / srcheight; mdx = ptf[0].X - m11 * srcx - m21 * srcy; mdy = ptf[0].Y - m12 * srcx - m22 * srcy; @@ -3252,13 +3251,10 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image if (stat != Ok) return stat; dst_stride = sizeof(ARGB) * (dst_area.right - dst_area.left); - - GdipTransformMatrixPoints(&dst_to_src, dst_to_src_points, 3); - - x_dx = dst_to_src_points[1].X - dst_to_src_points[0].X; - x_dy = dst_to_src_points[1].Y - dst_to_src_points[0].Y; - y_dx = dst_to_src_points[2].X - dst_to_src_points[0].X; - y_dy = dst_to_src_points[2].Y - dst_to_src_points[0].Y; + x_dx = dst_to_src.matrix[0]; + x_dy = dst_to_src.matrix[1]; + y_dx = dst_to_src.matrix[2]; + y_dy = dst_to_src.matrix[3]; /* Transform the bits as needed to the destination. */ dst_data = dst_dyn_data = heap_alloc_zero(sizeof(ARGB) * (dst_area.right - dst_area.left) * (dst_area.bottom - dst_area.top)); @@ -3271,9 +3267,9 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image /* Calculate top left point of transformed image. It would be used as reference point for adding */ - src_pointf_row.X = dst_to_src_points[0].X + + src_pointf_row.X = dst_to_src.matrix[4] + dst_area.left * x_dx + dst_area.top * y_dx; - src_pointf_row.Y = dst_to_src_points[0].Y + + src_pointf_row.Y = dst_to_src.matrix[5] + dst_area.left * x_dy + dst_area.top * y_dy; for (y = dst_area.top; y < dst_area.bottom;
1
0
0
0
Bartosz Kosiorek : gdiplus: Use float increment instead of calculation to impove perf.
by Alexandre Julliard
23 May '23
23 May '23
Module: wine Branch: master Commit: 382603afa751469e5a14c8e3ac1398c3bccbae7c URL:
https://gitlab.winehq.org/wine/wine/-/commit/382603afa751469e5a14c8e3ac1398…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Sun May 21 20:35:32 2023 +0200 gdiplus: Use float increment instead of calculation to impove perf. Improves efficiency by using addition instead of float numbers multiplication for destination points. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53947
--- dlls/gdiplus/graphics.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 04ac89ec128..fb848ed8a9c 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -3237,6 +3237,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image GpPointF dst_to_src_points[3] = {{0.0, 0.0}, {1.0, 0.0}, {0.0, 1.0}}; REAL x_dx, x_dy, y_dx, y_dy; ARGB *dst_color; + GpPointF src_pointf_row, src_pointf; m11 = (ptf[1].X - ptf[0].X) / srcwidth; m21 = (ptf[2].X - ptf[0].X) / srcheight; @@ -3266,16 +3267,21 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image heap_free(src_data); return OutOfMemory; } - dst_color = (ARGB*)(dst_data); - for (y = dst_area.top; y < dst_area.bottom; y++) + + /* Calculate top left point of transformed image. + It would be used as reference point for adding */ + src_pointf_row.X = dst_to_src_points[0].X + + dst_area.left * x_dx + dst_area.top * y_dx; + src_pointf_row.Y = dst_to_src_points[0].Y + + dst_area.left * x_dy + dst_area.top * y_dy; + + for (y = dst_area.top; y < dst_area.bottom; + y++, src_pointf_row.X += y_dx, src_pointf_row.Y += y_dy) { - for (x = dst_area.left; x < dst_area.right; x++) + for (x = dst_area.left, src_pointf = src_pointf_row; x < dst_area.right; + x++, src_pointf.X += x_dx, src_pointf.Y += x_dy) { - GpPointF src_pointf; - src_pointf.X = dst_to_src_points[0].X + x * x_dx + y * y_dx; - src_pointf.Y = dst_to_src_points[0].Y + x * x_dy + y * y_dy; - if (src_pointf.X >= srcx && src_pointf.X < srcx + srcwidth && src_pointf.Y >= srcy && src_pointf.Y < srcy + srcheight) *dst_color = resample_bitmap_pixel(&src_area, src_data, bitmap->width, bitmap->height, &src_pointf,
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
78
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
Results per page:
10
25
50
100
200