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
ae7ccbba
Commit
ae7ccbba
authored
Oct 16, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fixup size of the current directory in RtlCreateProcessParametersEx().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fce198cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
env.c
dlls/ntdll/env.c
+7
-3
thread.c
dlls/ntdll/thread.c
+4
-4
No files found.
dlls/ntdll/env.c
View file @
ae7ccbba
...
...
@@ -452,6 +452,7 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu
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
,
total_size
;
void
*
ptr
;
...
...
@@ -464,10 +465,13 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu
if
(
!
CurrentDirectoryName
)
{
if
(
NtCurrentTeb
()
->
Tib
.
SubSystemTib
)
/* FIXME: hack */
CurrentDirectoryName
=
&
((
WIN16_SUBSYSTEM_TIB
*
)
NtCurrentTeb
()
->
Tib
.
SubSystemTib
)
->
curdir
.
DosPath
;
curdir
=
((
WIN16_SUBSYSTEM_TIB
*
)
NtCurrentTeb
()
->
Tib
.
SubSystemTib
)
->
curdir
.
DosPath
;
else
CurrentDirectoryName
=
&
cur_params
->
CurrentDirectory
.
DosPath
;
curdir
=
cur_params
->
CurrentDirectory
.
DosPath
;
}
else
curdir
=
*
CurrentDirectoryName
;
curdir
.
MaximumLength
=
MAX_PATH
*
sizeof
(
WCHAR
);
if
(
!
CommandLine
)
CommandLine
=
ImagePathName
;
if
(
!
Environment
)
Environment
=
cur_params
->
Environment
;
if
(
!
WindowTitle
)
WindowTitle
=
&
empty_str
;
...
...
@@ -503,7 +507,7 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu
/* all other fields are zero */
ptr
=
params
+
1
;
append_unicode_string
(
&
ptr
,
CurrentDirectoryName
,
&
params
->
CurrentDirectory
.
DosPath
);
append_unicode_string
(
&
ptr
,
&
curdir
,
&
params
->
CurrentDirectory
.
DosPath
);
append_unicode_string
(
&
ptr
,
DllPath
,
&
params
->
DllPath
);
append_unicode_string
(
&
ptr
,
ImagePathName
,
&
params
->
ImagePathName
);
append_unicode_string
(
&
ptr
,
CommandLine
,
&
params
->
CommandLine
);
...
...
dlls/ntdll/thread.c
View file @
ae7ccbba
...
...
@@ -68,7 +68,7 @@ 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_
NT_PATH_LENG
TH
];
static
WCHAR
current_dir
[
MAX_
PA
TH
];
static
RTL_BITMAP
tls_bitmap
;
static
RTL_BITMAP
tls_expansion_bitmap
;
static
RTL_BITMAP
fls_bitmap
;
...
...
@@ -130,7 +130,7 @@ static NTSTATUS init_user_process_params( SIZE_T data_size )
if
(
status
!=
STATUS_SUCCESS
)
goto
done
;
size
=
sizeof
(
*
params
);
size
+=
MAX_NT_PATH_LENGTH
*
sizeof
(
WCHAR
);
size
+=
sizeof
(
current_dir
);
size
+=
info
->
dllpath_len
+
sizeof
(
WCHAR
);
size
+=
info
->
imagepath_len
+
sizeof
(
WCHAR
);
size
+=
info
->
cmdline_len
+
sizeof
(
WCHAR
);
...
...
@@ -169,8 +169,8 @@ static NTSTATUS init_user_process_params( SIZE_T data_size )
/* current directory needs more space */
get_unicode_string
(
&
params
->
CurrentDirectory
.
DosPath
,
&
src
,
&
dst
,
info
->
curdir_len
);
params
->
CurrentDirectory
.
DosPath
.
MaximumLength
=
MAX_NT_PATH_LENGTH
*
sizeof
(
WCHAR
);
dst
=
(
WCHAR
*
)(
params
+
1
)
+
MAX_NT_PATH_LENGTH
;
params
->
CurrentDirectory
.
DosPath
.
MaximumLength
=
sizeof
(
current_dir
);
dst
=
(
WCHAR
*
)(
params
+
1
)
+
ARRAY_SIZE
(
current_dir
)
;
get_unicode_string
(
&
params
->
DllPath
,
&
src
,
&
dst
,
info
->
dllpath_len
);
get_unicode_string
(
&
params
->
ImagePathName
,
&
src
,
&
dst
,
info
->
imagepath_len
);
...
...
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