mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 17:41:56 +00:00
[KERNEL32]
Fix finding the environment multi-string size (use the same code as in RtlpInitEnvironment instead of using hackish and broken code; the two while() are here because the environment string is a "multi-string", hence a list of strings, each terminated by a NULL char, and the whole multi-string is terminated by two NULL chars (the one of the last string plus an empty string). Also fix a cast. This fixes the launch of some programs, and this was triggered by tring to compiling the host-tools of the ReactOS source code with RosBE, on ReactOS. CORE-7870 #resolve #comment Fixed in revision 62060. svn path=/trunk/; revision=62060
This commit is contained in:
parent
535049cf93
commit
cc269f9cb4
1 changed files with 2 additions and 3 deletions
|
@ -673,9 +673,8 @@ BasePushProcessParameters(IN ULONG ParameterFlags,
|
|||
if (lpEnvironment)
|
||||
{
|
||||
/* Find the environment size */
|
||||
while ((ScanChar[0]) || (ScanChar[1])) ++ScanChar;
|
||||
ScanChar += (2 * sizeof(UNICODE_NULL));
|
||||
EnviroSize = (ULONG_PTR)ScanChar - (ULONG_PTR)lpEnvironment;
|
||||
while (*ScanChar++) while (*ScanChar++);
|
||||
EnviroSize = (ULONG)((ULONG_PTR)ScanChar - (ULONG_PTR)lpEnvironment);
|
||||
|
||||
/* Allocate and Initialize new Environment Block */
|
||||
Size = EnviroSize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue