Alexandre Julliard : ntdll: Return the full path to start.exe in load_start_exe().
Module: wine Branch: master Commit: 75b1db42e53ec70a4698309ddbe7810dc367252e URL: https://source.winehq.org/git/wine.git/?a=commit;h=75b1db42e53ec70a4698309dd... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 5 11:04:40 2021 +0200 ntdll: Return the full path to start.exe in load_start_exe(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/loader.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index e78df4d73d2..42bcb6f14b8 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1625,22 +1625,20 @@ failed: NTSTATUS load_start_exe( WCHAR **image, void **module ) { static const WCHAR startW[] = {'s','t','a','r','t','.','e','x','e',0}; - WCHAR buffer[sizeof("\\??\\C:\\windows\\system32\\start.exe")]; UNICODE_STRING nt_name; NTSTATUS status; SIZE_T size; - wcscpy( buffer, get_machine_wow64_dir( current_machine )); - wcscat( buffer, startW ); - init_unicode_string( &nt_name, buffer ); + *image = malloc( sizeof("\\??\\C:\\windows\\system32\\start.exe") * sizeof(WCHAR) ); + wcscpy( *image, get_machine_wow64_dir( current_machine )); + wcscat( *image, startW ); + init_unicode_string( &nt_name, *image ); status = find_builtin_dll( &nt_name, module, &size, &main_image_info, current_machine, FALSE ); if (status) { MESSAGE( "wine: failed to load start.exe: %x\n", status ); NtTerminateProcess( GetCurrentProcess(), status ); } - *image = malloc( sizeof(startW) ); - memcpy( *image, startW, sizeof(startW) ); return status; }
participants (1)
-
Alexandre Julliard