mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 13:56:56 +00:00
The return size calculation's of GetEnvironmentVariable string was wrong. Thx to <Bizzy_D> to find out cd %windir% did not work. Now it will
svn path=/trunk/; revision=16528
This commit is contained in:
parent
67af25e720
commit
e43573196c
1 changed files with 4 additions and 4 deletions
|
@ -70,7 +70,7 @@ GetEnvironmentVariableA (
|
||||||
SetLastErrorByStatus (Status);
|
SetLastErrorByStatus (Status);
|
||||||
if (Status == STATUS_BUFFER_TOO_SMALL)
|
if (Status == STATUS_BUFFER_TOO_SMALL)
|
||||||
{
|
{
|
||||||
return VarValueU.Length / sizeof(WCHAR) + 1;
|
return VarValueU.Length / sizeof(WCHAR) + sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -91,7 +91,7 @@ GetEnvironmentVariableA (
|
||||||
/* free unicode variable name string */
|
/* free unicode variable name string */
|
||||||
RtlFreeUnicodeString (&VarNameU);
|
RtlFreeUnicodeString (&VarNameU);
|
||||||
|
|
||||||
return (VarValueU.Length / sizeof(WCHAR));
|
return (VarValueU.Length / sizeof(WCHAR) + sizeof(WCHAR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ GetEnvironmentVariableW (
|
||||||
SetLastErrorByStatus (Status);
|
SetLastErrorByStatus (Status);
|
||||||
if (Status == STATUS_BUFFER_TOO_SMALL)
|
if (Status == STATUS_BUFFER_TOO_SMALL)
|
||||||
{
|
{
|
||||||
return (VarValue.Length / sizeof(WCHAR)) + 1;
|
return (VarValue.Length / sizeof(WCHAR)) + sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -133,7 +133,7 @@ GetEnvironmentVariableW (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (VarValue.Length / sizeof(WCHAR));
|
return (VarValue.Length / sizeof(WCHAR) + sizeof(WCHAR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue