- Fix loading of GlobalFlags in Image File Execution Options. I really wonder who had that brilliant idea that bitwise flags would be stored as a string in the registry.
- If there is a GlobalFlags value specified in the registr for that specific image, it means that value should overwrite NtGlobalFlags. Fix that too (previously it was ORing which made no sense).

svn path=/trunk/; revision=49021
This commit is contained in:
Aleksey Bragin 2010-10-06 17:18:22 +00:00
parent 2ff3b055ce
commit 83b1daf183

View file

@ -71,10 +71,8 @@ LoadImageFileExecutionOptions(PPEB Peb)
{
NTSTATUS Status = STATUS_SUCCESS;
ULONG Value = 0;
UNICODE_STRING ValueString;
UNICODE_STRING ImageName;
UNICODE_STRING ImagePathName;
WCHAR ValueBuffer[64];
ULONG ValueSize;
if (Peb->ProcessParameters &&
@ -106,21 +104,14 @@ LoadImageFileExecutionOptions(PPEB Peb)
/* global flag */
Status = LdrQueryImageFileExecutionOptions(&ImageName,
L"GlobalFlag",
REG_SZ,
(PVOID)ValueBuffer,
sizeof(ValueBuffer),
REG_DWORD,
(PVOID)&Value,
sizeof(Value),
&ValueSize);
if (NT_SUCCESS(Status))
{
ValueString.Buffer = ValueBuffer;
ValueString.Length = ValueSize - sizeof(WCHAR);
ValueString.MaximumLength = sizeof(ValueBuffer);
Status = RtlUnicodeStringToInteger(&ValueString, 16, &Value);
if (NT_SUCCESS(Status))
{
Peb->NtGlobalFlag |= Value;
DPRINT("GlobalFlag: Key='%S', Value=0x%lx\n", ValueBuffer, Value);
}
Peb->NtGlobalFlag = Value;
DPRINT("GlobalFlag: Value=0x%lx\n", Value);
}
/*
* FIXME: