ntdll: Pass RTL_USER_PROCESS_PARAMETERS to get_initial_console.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ef57a8df8b
commit
6bcc1b9225
|
@ -1254,8 +1254,7 @@ void init_user_process_params(void)
|
|||
RtlFreeUnicodeString( &cmdline );
|
||||
RtlReleasePath( load_path );
|
||||
|
||||
unix_funcs->get_initial_console( ¶ms->ConsoleHandle, ¶ms->hStdInput,
|
||||
¶ms->hStdOutput, ¶ms->hStdError );
|
||||
unix_funcs->get_initial_console( params );
|
||||
params->wShowWindow = 1; /* SW_SHOWNORMAL */
|
||||
|
||||
run_wineboot( ¶ms->Environment );
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include "winternl.h"
|
||||
#include "winbase.h"
|
||||
#include "winnls.h"
|
||||
#include "wine/condrv.h"
|
||||
#include "wine/debug.h"
|
||||
#include "unix_private.h"
|
||||
|
||||
|
@ -1151,13 +1152,12 @@ NTSTATUS CDECL get_dynamic_environment( WCHAR *env, SIZE_T *size )
|
|||
*
|
||||
* Return the initial console handles.
|
||||
*/
|
||||
void CDECL get_initial_console( HANDLE *handle, HANDLE *std_in, HANDLE *std_out, HANDLE *std_err )
|
||||
void CDECL get_initial_console( RTL_USER_PROCESS_PARAMETERS *params )
|
||||
{
|
||||
*handle = *std_in = *std_out = *std_err = 0;
|
||||
if (isatty(0) || isatty(1) || isatty(2)) *handle = (HANDLE)2; /* see kernel32/kernel_private.h */
|
||||
if (!isatty(0)) wine_server_fd_to_handle( 0, GENERIC_READ|SYNCHRONIZE, OBJ_INHERIT, std_in );
|
||||
if (!isatty(1)) wine_server_fd_to_handle( 1, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, std_out );
|
||||
if (!isatty(2)) wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, std_err );
|
||||
if (isatty(0) || isatty(1) || isatty(2)) params->ConsoleHandle = CONSOLE_HANDLE_SHELL;
|
||||
if (!isatty(0)) wine_server_fd_to_handle( 0, GENERIC_READ|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdInput );
|
||||
if (!isatty(1)) wine_server_fd_to_handle( 1, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdOutput );
|
||||
if (!isatty(2)) wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdError );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ extern NTSTATUS CDECL get_initial_environment( WCHAR **wargv[], WCHAR *env, SIZE
|
|||
extern NTSTATUS CDECL get_startup_info( startup_info_t *info, SIZE_T *total_size, SIZE_T *info_size ) DECLSPEC_HIDDEN;
|
||||
extern NTSTATUS CDECL get_dynamic_environment( WCHAR *env, SIZE_T *size ) DECLSPEC_HIDDEN;
|
||||
extern void CDECL get_initial_directory( UNICODE_STRING *dir ) DECLSPEC_HIDDEN;
|
||||
extern void CDECL get_initial_console( HANDLE *handle, HANDLE *std_in, HANDLE *std_out, HANDLE *std_err ) DECLSPEC_HIDDEN;
|
||||
extern void CDECL get_initial_console( RTL_USER_PROCESS_PARAMETERS *params ) DECLSPEC_HIDDEN;
|
||||
extern USHORT * CDECL get_unix_codepage_data(void) DECLSPEC_HIDDEN;
|
||||
extern void CDECL get_locales( WCHAR *sys, WCHAR *user ) DECLSPEC_HIDDEN;
|
||||
extern void CDECL virtual_release_address_space(void) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
struct _DISPATCHER_CONTEXT;
|
||||
|
||||
/* increment this when you change the function table */
|
||||
#define NTDLL_UNIXLIB_VERSION 105
|
||||
#define NTDLL_UNIXLIB_VERSION 106
|
||||
|
||||
struct unix_funcs
|
||||
{
|
||||
|
@ -72,8 +72,7 @@ struct unix_funcs
|
|||
NTSTATUS (CDECL *get_initial_environment)( WCHAR **wargv[], WCHAR *env, SIZE_T *size );
|
||||
NTSTATUS (CDECL *get_startup_info)( startup_info_t *info, SIZE_T *total_size, SIZE_T *info_size );
|
||||
NTSTATUS (CDECL *get_dynamic_environment)( WCHAR *env, SIZE_T *size );
|
||||
void (CDECL *get_initial_console)( HANDLE *handle, HANDLE *std_in,
|
||||
HANDLE *std_out, HANDLE *std_err );
|
||||
void (CDECL *get_initial_console)( RTL_USER_PROCESS_PARAMETERS *params );
|
||||
void (CDECL *get_initial_directory)( UNICODE_STRING *dir );
|
||||
USHORT * (CDECL *get_unix_codepage_data)(void);
|
||||
void (CDECL *get_locales)( WCHAR *sys, WCHAR *user );
|
||||
|
|
|
@ -244,5 +244,6 @@ struct condrv_ctrl_event
|
|||
|
||||
/* Wine specific values for console inheritance (params->ConsoleHandle) */
|
||||
#define CONSOLE_HANDLE_ALLOC ((HANDLE)1)
|
||||
#define CONSOLE_HANDLE_SHELL ((HANDLE)2)
|
||||
|
||||
#endif /* _INC_CONDRV */
|
||||
|
|
Loading…
Reference in New Issue