diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 24c1e5c69fd..4e164c11b3d 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -4951,7 +4951,7 @@ static void test_CreateProcessCUI(void) }, with_console_tests[] = { -/* 0*/ {FALSE, 0, NULL_STD, 0, TRUE}, +/* 0*/ {FALSE, 0, NULL_STD, 0}, {FALSE, DETACHED_PROCESS, NULL_STD, 0}, {FALSE, CREATE_NEW_CONSOLE, NULL_STD, 0}, {FALSE, CREATE_NO_WINDOW, NULL_STD, 0}, diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index fd505a7d2c2..8aa41aba183 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -2128,7 +2128,7 @@ void init_startup_info(void) * create_startup_info */ void *create_startup_info( const UNICODE_STRING *nt_image, const RTL_USER_PROCESS_PARAMETERS *params, - DWORD *info_size ) + const pe_image_info_t *pe_info, DWORD *info_size ) { startup_info_t *info; UNICODE_STRING dos_image = *nt_image; @@ -2154,7 +2154,8 @@ void *create_startup_info( const UNICODE_STRING *nt_image, const RTL_USER_PROCES info->debug_flags = params->DebugFlags; info->console_flags = params->ConsoleFlags; - info->console = wine_server_obj_handle( params->ConsoleHandle ); + if (pe_info->subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI) + info->console = wine_server_obj_handle( params->ConsoleHandle ); info->hstdin = wine_server_obj_handle( params->hStdInput ); info->hstdout = wine_server_obj_handle( params->hStdOutput ); info->hstderr = wine_server_obj_handle( params->hStdError ); diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index fa8022d9968..91771705b67 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -802,7 +802,8 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_ goto done; } if (!machine) machine = pe_info.machine; - if (!(startup_info = create_startup_info( attr.ObjectName, params, &startup_info_size ))) goto done; + if (!(startup_info = create_startup_info( attr.ObjectName, params, &pe_info, &startup_info_size ))) + goto done; env_size = get_env_size( params, &winedebug ); if ((status = alloc_object_attributes( process_attr, &objattr, &attr_len ))) goto done; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 1f49d957e0d..6862d74b863 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -172,7 +172,7 @@ extern struct ldt_copy __wine_ldt_copy DECLSPEC_HIDDEN; extern void init_environment( int argc, char *argv[], char *envp[] ) DECLSPEC_HIDDEN; extern void init_startup_info(void) DECLSPEC_HIDDEN; extern void *create_startup_info( const UNICODE_STRING *nt_image, const RTL_USER_PROCESS_PARAMETERS *params, - DWORD *info_size ) DECLSPEC_HIDDEN; + const pe_image_info_t *pe_info, DWORD *info_size ) DECLSPEC_HIDDEN; extern char **build_envp( const WCHAR *envW ) DECLSPEC_HIDDEN; extern char *get_alternate_wineloader( WORD machine ) DECLSPEC_HIDDEN; extern NTSTATUS exec_wineloader( char **argv, int socketfd, const pe_image_info_t *pe_info ) DECLSPEC_HIDDEN;