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
b5d4484c
Commit
b5d4484c
authored
Oct 16, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Allocate process parameters on the heap in RtlCreateProcessParametersEx().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
179c0ee6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
env.c
dlls/ntdll/env.c
+7
-10
No files found.
dlls/ntdll/env.c
View file @
b5d4484c
...
...
@@ -460,10 +460,10 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu
UNICODE_STRING
curdir
;
const
RTL_USER_PROCESS_PARAMETERS
*
cur_params
;
SIZE_T
size
,
env_size
,
total_size
;
SIZE_T
size
,
env_size
;
void
*
ptr
;
const
WCHAR
*
env
;
NTSTATUS
status
;
NTSTATUS
status
=
STATUS_SUCCESS
;
RtlAcquirePebLock
();
cur_params
=
NtCurrentTeb
()
->
Peb
->
ProcessParameters
;
...
...
@@ -500,13 +500,10 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu
+
ROUND_SIZE
(
ShellInfo
->
MaximumLength
)
+
ROUND_SIZE
(
RuntimeInfo
->
MaximumLength
));
total_size
=
size
+
env_size
;
ptr
=
NULL
;
if
((
status
=
NtAllocateVirtualMemory
(
NtCurrentProcess
(),
&
ptr
,
0
,
&
total_size
,
MEM_COMMIT
,
PAGE_READWRITE
))
==
STATUS_SUCCESS
)
if
((
ptr
=
RtlAllocateHeap
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
+
env_size
)))
{
RTL_USER_PROCESS_PARAMETERS
*
params
=
ptr
;
params
->
AllocationSize
=
total_
size
;
params
->
AllocationSize
=
size
;
params
->
Size
=
size
;
params
->
Flags
=
PROCESS_PARAMS_FLAG_NORMALIZED
;
params
->
ConsoleFlags
=
cur_params
->
ConsoleFlags
;
...
...
@@ -526,6 +523,8 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu
*
result
=
params
;
if
(
!
(
flags
&
PROCESS_PARAMS_FLAG_NORMALIZED
))
RtlDeNormalizeProcessParams
(
params
);
}
else
status
=
STATUS_NO_MEMORY
;
RtlReleasePebLock
();
return
status
;
}
...
...
@@ -555,7 +554,5 @@ NTSTATUS WINAPI RtlCreateProcessParameters( RTL_USER_PROCESS_PARAMETERS **result
*/
void
WINAPI
RtlDestroyProcessParameters
(
RTL_USER_PROCESS_PARAMETERS
*
params
)
{
void
*
ptr
=
params
;
SIZE_T
size
=
0
;
NtFreeVirtualMemory
(
NtCurrentProcess
(),
&
ptr
,
&
size
,
MEM_RELEASE
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
params
);
}
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