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
179c0ee6
Commit
179c0ee6
authored
Oct 16, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Align string data in RtlCreateProcessParametersEx().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ae7ccbba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
env.c
dlls/ntdll/env.c
+18
-12
No files found.
dlls/ntdll/env.c
View file @
179c0ee6
...
...
@@ -421,15 +421,21 @@ PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams( RTL_USER_PROCES
}
#define ROUND_SIZE(size) (((size) + sizeof(void *) - 1) & ~(sizeof(void *) - 1))
/* append a unicode string to the process params data; helper for RtlCreateProcessParameters */
static
void
append_unicode_string
(
void
**
data
,
const
UNICODE_STRING
*
src
,
UNICODE_STRING
*
dst
)
{
dst
->
Length
=
src
->
Length
;
dst
->
MaximumLength
=
src
->
MaximumLength
;
dst
->
Buffer
=
*
data
;
memcpy
(
dst
->
Buffer
,
src
->
Buffer
,
dst
->
MaximumLength
);
*
data
=
(
char
*
)
dst
->
Buffer
+
dst
->
MaximumLength
;
if
(
dst
->
MaximumLength
)
{
dst
->
Buffer
=
*
data
;
memcpy
(
dst
->
Buffer
,
src
->
Buffer
,
dst
->
Length
);
*
data
=
(
char
*
)
dst
->
Buffer
+
ROUND_SIZE
(
dst
->
MaximumLength
);
}
else
dst
->
Buffer
=
NULL
;
}
...
...
@@ -482,17 +488,17 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu
env
=
Environment
;
while
(
*
env
)
env
+=
strlenW
(
env
)
+
1
;
env
++
;
env_size
=
(
env
-
Environment
)
*
sizeof
(
WCHAR
);
env_size
=
ROUND_SIZE
(
(
env
-
Environment
)
*
sizeof
(
WCHAR
)
);
size
=
(
sizeof
(
RTL_USER_PROCESS_PARAMETERS
)
+
ImagePathName
->
MaximumLength
+
DllPath
->
MaximumLength
+
CurrentDirectoryName
->
MaximumLength
+
CommandLine
->
MaximumLength
+
WindowTitle
->
MaximumLength
+
Desktop
->
MaximumLength
+
ShellInfo
->
MaximumLength
+
R
untimeInfo
->
MaximumLength
);
+
ROUND_SIZE
(
ImagePathName
->
MaximumLength
)
+
ROUND_SIZE
(
DllPath
->
MaximumLength
)
+
ROUND_SIZE
(
curdir
.
MaximumLength
)
+
ROUND_SIZE
(
CommandLine
->
MaximumLength
)
+
ROUND_SIZE
(
WindowTitle
->
MaximumLength
)
+
ROUND_SIZE
(
Desktop
->
MaximumLength
)
+
ROUND_SIZE
(
ShellInfo
->
MaximumLength
)
+
R
OUND_SIZE
(
RuntimeInfo
->
MaximumLength
)
);
total_size
=
size
+
env_size
;
ptr
=
NULL
;
...
...
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