Author: ion
Date: Mon Jul 11 00:10:27 2011
New Revision: 52620
URL:
http://svn.reactos.org/svn/reactos?rev=52620&view=rev
Log:
[RTL]: One day, Microsoft is going to stop using flags that are negatives. Fix boot/etc.
Modified:
trunk/reactos/lib/rtl/image.c
Modified: trunk/reactos/lib/rtl/image.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/image.c?rev=52620&…
==============================================================================
--- trunk/reactos/lib/rtl/image.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/image.c [iso-8859-1] Mon Jul 11 00:10:27 2011
@@ -143,6 +143,7 @@
{
PIMAGE_NT_HEADERS NtHeaders;
PIMAGE_DOS_HEADER DosHeader;
+ BOOLEAN WantsRangeCheck;
/* You must want NT Headers, no? */
if (!OutHeaders) return STATUS_INVALID_PARAMETER;
@@ -161,7 +162,8 @@
if (!(Base) || (Base == (PVOID)-1)) return STATUS_INVALID_PARAMETER;
/* Check if the caller wants validation */
- if (Flags & RTL_IMAGE_NT_HEADER_EX_FLAG_NO_RANGE_CHECK)
+ WantsRangeCheck = !(Flags & RTL_IMAGE_NT_HEADER_EX_FLAG_NO_RANGE_CHECK);
+ if (WantsRangeCheck)
{
/* Make sure the image size is at least big enough for the DOS header */
if (Size < sizeof(IMAGE_DOS_HEADER))
@@ -181,7 +183,7 @@
}
/* Check if the caller wants validation */
- if (Flags & RTL_IMAGE_NT_HEADER_EX_FLAG_NO_RANGE_CHECK)
+ if (WantsRangeCheck)
{
/* The offset should fit in the passsed-in size */
if (DosHeader->e_lfanew >= Size)