mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 05:37:44 +00:00
Fixed binary search algroithm in LdrGetExportByOrdinal - numbers can reach negative values.
svn path=/trunk/; revision=7870
This commit is contained in:
parent
5f474aea89
commit
09fa2c188b
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: utils.c,v 1.79 2004/01/24 23:44:26 navaraf Exp $
|
/* $Id: utils.c,v 1.80 2004/01/25 08:32:49 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -1056,7 +1056,7 @@ LdrGetExportByName(PVOID BaseAddress,
|
||||||
PVOID ExName;
|
PVOID ExName;
|
||||||
ULONG Ordinal;
|
ULONG Ordinal;
|
||||||
PVOID Function;
|
PVOID Function;
|
||||||
ULONG minn, maxn;
|
LONG minn, maxn;
|
||||||
ULONG ExportDirSize;
|
ULONG ExportDirSize;
|
||||||
|
|
||||||
DPRINT("LdrGetExportByName %x %s %hu\n", BaseAddress, SymbolName, Hint);
|
DPRINT("LdrGetExportByName %x %s %hu\n", BaseAddress, SymbolName, Hint);
|
||||||
|
@ -1123,7 +1123,7 @@ LdrGetExportByName(PVOID BaseAddress,
|
||||||
maxn = ExportDir->NumberOfNames - 1;
|
maxn = ExportDir->NumberOfNames - 1;
|
||||||
while (minn <= maxn)
|
while (minn <= maxn)
|
||||||
{
|
{
|
||||||
ULONG mid;
|
LONG mid;
|
||||||
LONG res;
|
LONG res;
|
||||||
|
|
||||||
mid = (minn + maxn) / 2;
|
mid = (minn + maxn) / 2;
|
||||||
|
|
Loading…
Reference in a new issue