- Fix binary search algorithm in LdrGetProcedureAddress

- Fix temporary ntdll export hack (r24395)

svn path=/trunk/; revision=24397
This commit is contained in:
Thomas Bluemel 2006-10-04 16:51:51 +00:00
parent 7e6d549b19
commit 80da4a434c
4 changed files with 8 additions and 15 deletions

View file

@ -38,7 +38,7 @@ KiUserApcDispatcher@16
KiUserCallbackDispatcher@12
KiUserExceptionDispatcher@8
KiIntSystemCall@0
KeFastSystemCallRet@0 ; big hack since LdrGetProcedureAddress is broken
KiFastSystemCallRet@0
KiFastSystemCall@0
LdrAccessResource@16
LdrAddRefDll@8

View file

@ -257,9 +257,9 @@ _KiFastSystemCall@0:
sysenter
.endfunc
.func KeFastSystemCallRet@0
.globl _KeFastSystemCallRet@0
_KeFastSystemCallRet@0:
.func KiFastSystemCallRet@0
.globl _KiFastSystemCallRet@0
_KiFastSystemCallRet@0:
/* Just return to caller */
ret

View file

@ -69,22 +69,15 @@ LdrGetProcedureAddress (IN PVOID BaseAddress,
{
mid = (minn + maxn) / 2;
CurrentNamePtr = (PCHAR)RVA(BaseAddress, NamePtr[mid]);
res = strncmp(CurrentNamePtr, Name->Buffer, Name->Length);
res = strcmp(CurrentNamePtr, Name->Buffer);
if (res == 0)
{
/*
* Check if the beginning of the name matched, but it's still
* not the whole name.
*/
if (CurrentNamePtr[Name->Length] != 0)
{
res = -1;
}
else
{
*ProcedureAddress = (PVOID)RVA(BaseAddress, AddressPtr[OrdinalPtr[mid]]);
return STATUS_SUCCESS;
}
*ProcedureAddress = (PVOID)RVA(BaseAddress, AddressPtr[OrdinalPtr[mid]]);
return STATUS_SUCCESS;
}
if (res > 0)
maxn = mid - 1;

View file

@ -42,7 +42,7 @@ ANSI_STRING ExceptName = RTL_CONSTANT_STRING("KiUserExceptionDispatcher");
ANSI_STRING CallbackName = RTL_CONSTANT_STRING("KiUserCallbackDispatcher");
ANSI_STRING RaiseName = RTL_CONSTANT_STRING("KiRaiseUserExceptionDispatcher");
ANSI_STRING FastName = RTL_CONSTANT_STRING("KiFastSystemCall");
ANSI_STRING FastReturnName = RTL_CONSTANT_STRING("KeFastSystemCallRet");
ANSI_STRING FastReturnName = RTL_CONSTANT_STRING("KiFastSystemCallRet");
ANSI_STRING InterruptName = RTL_CONSTANT_STRING("KiIntSystemCall");
PHANDLE_TABLE PspCidTable;