Author: fireball
Date: Wed Oct 6 17:18:22 2010
New Revision: 49021
URL: http://svn.reactos.org/svn/reactos?rev=49021&view=rev
Log:
[NTDLL]
- 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).
Modified:
trunk/reactos/dll/ntdll/ldr/startup.c
Modified: trunk/reactos/dll/ntdll/ldr/startup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/startup.c?re…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/startup.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/startup.c [iso-8859-1] Wed Oct 6 17:18:22 2010
@@ -71,10 +71,8 @@
{
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 @@
/* 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: