Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
50f0ed75
Commit
50f0ed75
authored
Feb 13, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Also create the initial process parameters with RtlCreateProcessParametersEx().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3af4ebf2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
28 deletions
+30
-28
env.c
dlls/ntdll/env.c
+29
-6
thread.c
dlls/ntdll/thread.c
+1
-22
No files found.
dlls/ntdll/env.c
View file @
50f0ed75
...
...
@@ -22,6 +22,9 @@
#include <assert.h>
#include <stdarg.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
...
...
@@ -34,6 +37,10 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
environ
);
static
WCHAR
empty
[]
=
{
0
};
static
const
UNICODE_STRING
empty_str
=
{
0
,
sizeof
(
empty
),
empty
};
static
const
UNICODE_STRING
null_str
=
{
0
,
0
,
NULL
};
/******************************************************************************
* NtQuerySystemEnvironmentValue [NTDLL.@]
*/
...
...
@@ -454,10 +461,6 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu
const
UNICODE_STRING
*
RuntimeInfo
,
ULONG
flags
)
{
static
WCHAR
empty
[]
=
{
0
};
static
const
UNICODE_STRING
empty_str
=
{
0
,
sizeof
(
empty
),
empty
};
static
const
UNICODE_STRING
null_str
=
{
0
,
0
,
NULL
};
UNICODE_STRING
curdir
;
const
RTL_USER_PROCESS_PARAMETERS
*
cur_params
;
SIZE_T
size
,
env_size
=
0
;
...
...
@@ -479,7 +482,7 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu
curdir
.
MaximumLength
=
MAX_PATH
*
sizeof
(
WCHAR
);
if
(
!
CommandLine
)
CommandLine
=
ImagePathName
;
if
(
!
Environment
)
Environment
=
cur_params
->
Environment
;
if
(
!
Environment
&&
cur_params
)
Environment
=
cur_params
->
Environment
;
if
(
!
WindowTitle
)
WindowTitle
=
&
empty_str
;
if
(
!
Desktop
)
Desktop
=
&
empty_str
;
if
(
!
ShellInfo
)
ShellInfo
=
&
empty_str
;
...
...
@@ -509,7 +512,7 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu
params
->
AllocationSize
=
size
;
params
->
Size
=
size
;
params
->
Flags
=
PROCESS_PARAMS_FLAG_NORMALIZED
;
params
->
ConsoleFlags
=
cur_params
->
ConsoleFlags
;
if
(
cur_params
)
params
->
ConsoleFlags
=
cur_params
->
ConsoleFlags
;
/* all other fields are zero */
ptr
=
params
+
1
;
...
...
@@ -584,6 +587,26 @@ void init_user_process_params( SIZE_T data_size )
RTL_USER_PROCESS_PARAMETERS
*
params
=
NULL
;
UNICODE_STRING
curdir
,
dllpath
,
imagepath
,
cmdline
,
title
,
desktop
,
shellinfo
,
runtime
;
if
(
!
data_size
)
{
if
(
RtlCreateProcessParametersEx
(
&
params
,
&
null_str
,
&
null_str
,
&
empty_str
,
&
null_str
,
NULL
,
&
null_str
,
&
null_str
,
&
null_str
,
&
null_str
,
PROCESS_PARAMS_FLAG_NORMALIZED
))
return
;
NtCurrentTeb
()
->
Peb
->
ProcessParameters
=
params
;
if
(
isatty
(
0
)
||
isatty
(
1
)
||
isatty
(
2
))
params
->
ConsoleHandle
=
(
HANDLE
)
2
;
/* see kernel32/kernel_private.h */
if
(
!
isatty
(
0
))
wine_server_fd_to_handle
(
0
,
GENERIC_READ
|
SYNCHRONIZE
,
OBJ_INHERIT
,
&
params
->
hStdInput
);
if
(
!
isatty
(
1
))
wine_server_fd_to_handle
(
1
,
GENERIC_WRITE
|
SYNCHRONIZE
,
OBJ_INHERIT
,
&
params
->
hStdOutput
);
if
(
!
isatty
(
2
))
wine_server_fd_to_handle
(
2
,
GENERIC_WRITE
|
SYNCHRONIZE
,
OBJ_INHERIT
,
&
params
->
hStdError
);
params
->
wShowWindow
=
1
;
/* SW_SHOWNORMAL */
return
;
}
if
(
!
(
info
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
data_size
)))
return
;
SERVER_START_REQ
(
get_startup_info
)
...
...
dlls/ntdll/thread.c
View file @
50f0ed75
...
...
@@ -67,8 +67,6 @@ struct startup_info
static
PEB
*
peb
;
static
PEB_LDR_DATA
ldr
;
static
RTL_USER_PROCESS_PARAMETERS
params
;
/* default parameters if no parent */
static
WCHAR
current_dir
[
MAX_PATH
];
static
RTL_BITMAP
tls_bitmap
;
static
RTL_BITMAP
tls_expansion_bitmap
;
static
RTL_BITMAP
fls_bitmap
;
...
...
@@ -192,7 +190,6 @@ void thread_init(void)
peb
=
addr
;
peb
->
FastPebLock
=
&
peb_lock
;
peb
->
ProcessParameters
=
&
params
;
peb
->
TlsBitmap
=
&
tls_bitmap
;
peb
->
TlsExpansionBitmap
=
&
tls_expansion_bitmap
;
peb
->
FlsBitmap
=
&
fls_bitmap
;
...
...
@@ -201,9 +198,6 @@ void thread_init(void)
peb
->
OSMinorVersion
=
1
;
peb
->
OSBuildNumber
=
0xA28
;
peb
->
OSPlatformId
=
VER_PLATFORM_WIN32_NT
;
params
.
CurrentDirectory
.
DosPath
.
Buffer
=
current_dir
;
params
.
CurrentDirectory
.
DosPath
.
MaximumLength
=
sizeof
(
current_dir
);
params
.
wShowWindow
=
1
;
/* SW_SHOWNORMAL */
ldr
.
Length
=
sizeof
(
ldr
);
ldr
.
Initialized
=
TRUE
;
RtlInitializeBitMap
(
&
tls_bitmap
,
peb
->
TlsBitmapBits
,
sizeof
(
peb
->
TlsBitmapBits
)
*
8
);
...
...
@@ -257,22 +251,7 @@ void thread_init(void)
exit
(
1
);
}
/* allocate user parameters */
if
(
info_size
)
{
init_user_process_params
(
info_size
);
}
else
{
if
(
isatty
(
0
)
||
isatty
(
1
)
||
isatty
(
2
))
params
.
ConsoleHandle
=
(
HANDLE
)
2
;
/* see kernel32/kernel_private.h */
if
(
!
isatty
(
0
))
wine_server_fd_to_handle
(
0
,
GENERIC_READ
|
SYNCHRONIZE
,
OBJ_INHERIT
,
&
params
.
hStdInput
);
if
(
!
isatty
(
1
))
wine_server_fd_to_handle
(
1
,
GENERIC_WRITE
|
SYNCHRONIZE
,
OBJ_INHERIT
,
&
params
.
hStdOutput
);
if
(
!
isatty
(
2
))
wine_server_fd_to_handle
(
2
,
GENERIC_WRITE
|
SYNCHRONIZE
,
OBJ_INHERIT
,
&
params
.
hStdError
);
}
init_user_process_params
(
info_size
);
/* initialize time values in user_shared_data */
NtQuerySystemTime
(
&
now
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment