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