mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:56:00 +00:00
[RTL]
- Acquire the PEB lock before reading Peb->ProcessParameters->Environment in RtlQueryEnvironmentVariable_U. Patch by Mark Jansen. CORE-10381 svn path=/trunk/; revision=69939
This commit is contained in:
parent
bd198a5fd5
commit
84db6add79
1 changed files with 3 additions and 2 deletions
|
@ -524,6 +524,7 @@ RtlQueryEnvironmentVariable_U(PWSTR Environment,
|
||||||
{
|
{
|
||||||
PPEB Peb = RtlGetCurrentPeb();
|
PPEB Peb = RtlGetCurrentPeb();
|
||||||
if (Peb) {
|
if (Peb) {
|
||||||
|
RtlAcquirePebLock();
|
||||||
Environment = Peb->ProcessParameters->Environment;
|
Environment = Peb->ProcessParameters->Environment;
|
||||||
SysEnvUsed = TRUE;
|
SysEnvUsed = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -531,12 +532,12 @@ RtlQueryEnvironmentVariable_U(PWSTR Environment,
|
||||||
|
|
||||||
if (Environment == NULL)
|
if (Environment == NULL)
|
||||||
{
|
{
|
||||||
|
if (SysEnvUsed)
|
||||||
|
RtlReleasePebLock();
|
||||||
return(STATUS_VARIABLE_NOT_FOUND);
|
return(STATUS_VARIABLE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
Value->Length = 0;
|
Value->Length = 0;
|
||||||
if (SysEnvUsed)
|
|
||||||
RtlAcquirePebLock();
|
|
||||||
|
|
||||||
wcs = Environment;
|
wcs = Environment;
|
||||||
DPRINT("Starting search at :%p\n", wcs);
|
DPRINT("Starting search at :%p\n", wcs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue