From 31273508a75f72cc05c2798ec677cc3320655493 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sat, 17 Jan 2004 10:30:53 +0000 Subject: [PATCH] Fixed RtlImageDirectoryEntryToData. svn path=/trunk/; revision=7711 --- reactos/lib/ntdll/rtl/image.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/reactos/lib/ntdll/rtl/image.c b/reactos/lib/ntdll/rtl/image.c index 1f477b7920a..2fd86411c48 100644 --- a/reactos/lib/ntdll/rtl/image.c +++ b/reactos/lib/ntdll/rtl/image.c @@ -1,4 +1,4 @@ -/* $Id: image.c,v 1.6 2003/07/11 13:50:23 royce Exp $ +/* $Id: image.c,v 1.7 2004/01/17 10:30:53 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -56,9 +56,7 @@ RtlImageDirectoryEntryToData ( ) { PIMAGE_NT_HEADERS NtHeader; - PIMAGE_SECTION_HEADER SectionHeader; ULONG Va; - ULONG Count; NtHeader = RtlImageNtHeader (BaseAddress); if (NtHeader == NULL) @@ -78,16 +76,7 @@ RtlImageDirectoryEntryToData ( return (PVOID)(BaseAddress + Va); /* image mapped as ordinary file, we must find raw pointer */ - SectionHeader = (PIMAGE_SECTION_HEADER)(NtHeader + 1); - Count = NtHeader->FileHeader.NumberOfSections; - while (Count--) - { - if (SectionHeader->VirtualAddress == Va) - return (PVOID)(BaseAddress + SectionHeader->PointerToRawData); - SectionHeader++; - } - - return NULL; + return (PVOID)RtlImageRvaToVa (NtHeader, BaseAddress, Va, NULL); }