mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
Don't fallback to linear search for exports, it's not needed.
svn path=/trunk/; revision=16963
This commit is contained in:
parent
1dfc824d91
commit
2b6bb7a79e
1 changed files with 1 additions and 27 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue