Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
2475cb76
Commit
2475cb76
authored
Oct 08, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Make a copy of the process environment in CreateProcessW().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8908bdbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
process.c
dlls/kernel32/process.c
+14
-2
No files found.
dlls/kernel32/process.c
View file @
2475cb76
...
@@ -2626,7 +2626,19 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
...
@@ -2626,7 +2626,19 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
if
(
GetCurrentDirectoryW
(
MAX_PATH
,
buf
))
unixdir
=
wine_get_unix_file_name
(
buf
);
if
(
GetCurrentDirectoryW
(
MAX_PATH
,
buf
))
unixdir
=
wine_get_unix_file_name
(
buf
);
}
}
if
(
env
&&
!
(
flags
&
CREATE_UNICODE_ENVIRONMENT
))
/* convert environment to unicode */
if
(
!
env
)
{
WCHAR
*
e
;
RtlAcquirePebLock
();
e
=
env
=
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
Environment
;
while
(
*
e
)
e
+=
strlenW
(
e
)
+
1
;
e
++
;
/* final null */
envW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
e
-
(
WCHAR
*
)
env
)
*
sizeof
(
WCHAR
)
);
memcpy
(
envW
,
env
,
(
e
-
(
WCHAR
*
)
env
)
*
sizeof
(
WCHAR
)
);
RtlReleasePebLock
();
}
else
if
(
!
(
flags
&
CREATE_UNICODE_ENVIRONMENT
))
/* convert environment to unicode */
{
{
char
*
e
=
env
;
char
*
e
=
env
;
DWORD
lenW
;
DWORD
lenW
;
...
@@ -2636,8 +2648,8 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
...
@@ -2636,8 +2648,8 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
lenW
=
MultiByteToWideChar
(
CP_ACP
,
0
,
env
,
e
-
(
char
*
)
env
,
NULL
,
0
);
lenW
=
MultiByteToWideChar
(
CP_ACP
,
0
,
env
,
e
-
(
char
*
)
env
,
NULL
,
0
);
envW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lenW
*
sizeof
(
WCHAR
)
);
envW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lenW
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
env
,
e
-
(
char
*
)
env
,
envW
,
lenW
);
MultiByteToWideChar
(
CP_ACP
,
0
,
env
,
e
-
(
char
*
)
env
,
envW
,
lenW
);
flags
|=
CREATE_UNICODE_ENVIRONMENT
;
}
}
flags
|=
CREATE_UNICODE_ENVIRONMENT
;
info
->
hThread
=
info
->
hProcess
=
0
;
info
->
hThread
=
info
->
hProcess
=
0
;
info
->
dwProcessId
=
info
->
dwThreadId
=
0
;
info
->
dwProcessId
=
info
->
dwThreadId
=
0
;
...
...
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