mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:05:41 +00:00
[RTL] Introduce RtlpImageNtHeader,
which implements the required functionality. ntdll and ntoskrnl now have a wrapper for this, with SEH. This protects the function against malformed / bad images, whilst still being able to use the code in freeldr et al. Idea from Thomas. CORE-14857
This commit is contained in:
parent
4b2665046d
commit
177ae91bf6
7 changed files with 156 additions and 13 deletions
|
@ -57,3 +57,30 @@ RtlpSafeCopyMemory(
|
|||
RtlCopyMemory(Destination, Source, Length);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Ldr access to IMAGE_NT_HEADERS without SEH */
|
||||
|
||||
/* Rtl SEH-Free version of this */
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlpImageNtHeaderEx(
|
||||
_In_ ULONG Flags,
|
||||
_In_ PVOID Base,
|
||||
_In_ ULONG64 Size,
|
||||
_Out_ PIMAGE_NT_HEADERS *OutHeaders);
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlImageNtHeaderEx(
|
||||
_In_ ULONG Flags,
|
||||
_In_ PVOID Base,
|
||||
_In_ ULONG64 Size,
|
||||
_Out_ PIMAGE_NT_HEADERS *OutHeaders)
|
||||
{
|
||||
return RtlpImageNtHeaderEx(Flags, Base, Size, OutHeaders);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue