From 2b6bb7a79e880cfa5015589ed4b5b34a20e70d06 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 1 Aug 2005 18:11:54 +0000 Subject: [PATCH] Don't fallback to linear search for exports, it's not needed. svn path=/trunk/; revision=16963 --- reactos/lib/ntdll/ldr/utils.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/reactos/lib/ntdll/ldr/utils.c b/reactos/lib/ntdll/ldr/utils.c index 6ccecc12771..178f25ef4c4 100644 --- a/reactos/lib/ntdll/ldr/utils.c +++ b/reactos/lib/ntdll/ldr/utils.c @@ -1077,7 +1077,6 @@ LdrGetExportByName(PVOID BaseAddress, PDWORD * ExFunctions; PDWORD * ExNames; USHORT * ExOrdinals; - ULONG i; PVOID ExName; ULONG Ordinal; PVOID Function; @@ -1142,7 +1141,7 @@ LdrGetExportByName(PVOID BaseAddress, } /* - * Try a binary search first + * Binary search */ minn = 0; maxn = ExportDir->NumberOfNames - 1; @@ -1188,31 +1187,6 @@ LdrGetExportByName(PVOID BaseAddress, } } - /* - * Fall back on a linear search - */ - DPRINT("LdrGetExportByName(): Falling back on a linear search of export table\n"); - for (i = 0; i < ExportDir->NumberOfNames; i++) - { - ExName = RVA(BaseAddress, ExNames[i]); - if (strcmp(ExName, (PCHAR)SymbolName) == 0) - { - Ordinal = ExOrdinals[i]; - Function = RVA(BaseAddress, ExFunctions[Ordinal]); - DPRINT("%x %x %x\n", Function, ExportDir, ExportDir + ExportDirSize); - if (((ULONG)Function >= (ULONG)ExportDir) && - ((ULONG)Function < (ULONG)ExportDir + (ULONG)ExportDirSize)) - { - DPRINT("Forward: %s\n", (PCHAR)Function); - Function = LdrFixupForward((PCHAR)Function); - } - if (Function == NULL) - { - break; - } - return Function; - } - } DPRINT1("LdrGetExportByName(): failed to find %s\n",SymbolName); return (PVOID)NULL; }