mirror of
https://github.com/reactos/reactos.git
synced 2025-01-04 21:38:43 +00:00
[NTDLL]
Move RtlPcToFileHeader to rtl/libsupp.c svn path=/trunk/; revision=50092
This commit is contained in:
parent
372bbf2a73
commit
1f982b1479
2 changed files with 33 additions and 33 deletions
|
@ -2662,39 +2662,6 @@ LdrAddRefDll(IN ULONG Flags,
|
|||
return Status;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
PVOID NTAPI
|
||||
RtlPcToFileHeader(IN PVOID PcValue,
|
||||
PVOID* BaseOfImage)
|
||||
{
|
||||
PLIST_ENTRY ModuleListHead;
|
||||
PLIST_ENTRY Entry;
|
||||
PLDR_DATA_TABLE_ENTRY Module;
|
||||
PVOID ImageBase = NULL;
|
||||
|
||||
RtlEnterCriticalSection (NtCurrentPeb()->LoaderLock);
|
||||
ModuleListHead = &NtCurrentPeb()->Ldr->InLoadOrderModuleList;
|
||||
Entry = ModuleListHead->Flink;
|
||||
while (Entry != ModuleListHead)
|
||||
{
|
||||
Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
|
||||
|
||||
if ((ULONG_PTR)PcValue >= (ULONG_PTR)Module->DllBase &&
|
||||
(ULONG_PTR)PcValue < (ULONG_PTR)Module->DllBase + Module->SizeOfImage)
|
||||
{
|
||||
ImageBase = Module->DllBase;
|
||||
break;
|
||||
}
|
||||
Entry = Entry->Flink;
|
||||
}
|
||||
RtlLeaveCriticalSection (NtCurrentPeb()->LoaderLock);
|
||||
|
||||
*BaseOfImage = ImageBase;
|
||||
return ImageBase;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
|
|
@ -486,3 +486,36 @@ done:
|
|||
*ret = resdirptr;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
PVOID NTAPI
|
||||
RtlPcToFileHeader(IN PVOID PcValue,
|
||||
PVOID* BaseOfImage)
|
||||
{
|
||||
PLIST_ENTRY ModuleListHead;
|
||||
PLIST_ENTRY Entry;
|
||||
PLDR_DATA_TABLE_ENTRY Module;
|
||||
PVOID ImageBase = NULL;
|
||||
|
||||
RtlEnterCriticalSection (NtCurrentPeb()->LoaderLock);
|
||||
ModuleListHead = &NtCurrentPeb()->Ldr->InLoadOrderModuleList;
|
||||
Entry = ModuleListHead->Flink;
|
||||
while (Entry != ModuleListHead)
|
||||
{
|
||||
Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
|
||||
|
||||
if ((ULONG_PTR)PcValue >= (ULONG_PTR)Module->DllBase &&
|
||||
(ULONG_PTR)PcValue < (ULONG_PTR)Module->DllBase + Module->SizeOfImage)
|
||||
{
|
||||
ImageBase = Module->DllBase;
|
||||
break;
|
||||
}
|
||||
Entry = Entry->Flink;
|
||||
}
|
||||
RtlLeaveCriticalSection (NtCurrentPeb()->LoaderLock);
|
||||
|
||||
*BaseOfImage = ImageBase;
|
||||
return ImageBase;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue