2015-09-05 16:05:20 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING.ARM in the top level directory
|
|
|
|
* PROJECT: ReactOS UEFI Boot Manager
|
2016-01-20 06:59:12 +00:00
|
|
|
* FILE: boot/environ/lib/misc/rtlcompat.c
|
2015-09-05 16:05:20 +00:00
|
|
|
* PURPOSE: RTL Library Compatibility Routines
|
|
|
|
* PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
2016-01-20 06:59:12 +00:00
|
|
|
#include "bl.h"
|
2015-09-05 16:05:20 +00:00
|
|
|
|
|
|
|
/* FUNCTIONS *****************************************************************/
|
|
|
|
|
|
|
|
#if DBG
|
|
|
|
VOID FASTCALL
|
|
|
|
CHECK_PAGED_CODE_RTL (
|
|
|
|
char *file,
|
|
|
|
int line
|
|
|
|
)
|
|
|
|
{
|
|
|
|
// boot-code is always ok
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-03-18 15:10:41 +00:00
|
|
|
#ifdef _WIN64
|
|
|
|
PVOID MmHighestUserAddress = (PVOID)0xFFFFFFFFULL; // CHECKME
|
|
|
|
#else
|
2016-01-06 04:43:23 +00:00
|
|
|
PVOID MmHighestUserAddress = (PVOID)0xFFFFFFFF;
|
2018-03-18 15:10:41 +00:00
|
|
|
#endif
|
2016-01-06 04:43:23 +00:00
|
|
|
|
2015-09-05 16:05:20 +00:00
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlpAllocateMemory (
|
|
|
|
_In_ ULONG Bytes,
|
|
|
|
_In_ ULONG Tag
|
|
|
|
)
|
|
|
|
{
|
2016-01-05 05:12:01 +00:00
|
|
|
UNREFERENCED_PARAMETER(Tag);
|
|
|
|
return BlMmAllocateHeap(Bytes);
|
2015-09-05 16:05:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlpFreeMemory (
|
|
|
|
_In_ PVOID Mem,
|
|
|
|
_In_ ULONG Tag
|
|
|
|
)
|
|
|
|
{
|
2016-01-05 05:12:01 +00:00
|
|
|
UNREFERENCED_PARAMETER(Tag);
|
|
|
|
BlMmFreeHeap(Mem);
|
2015-09-05 16:05:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlpSafeCopyMemory (
|
|
|
|
_Out_writes_bytes_all_(Length) VOID UNALIGNED *Destination,
|
|
|
|
_In_reads_bytes_(Length) CONST VOID UNALIGNED *Source,
|
|
|
|
_In_ SIZE_T Length
|
|
|
|
)
|
|
|
|
{
|
|
|
|
RtlCopyMemory(Destination, Source, Length);
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlAssert (
|
|
|
|
IN PVOID FailedAssertion,
|
|
|
|
IN PVOID FileName,
|
|
|
|
IN ULONG LineNumber,
|
|
|
|
IN PCHAR Message OPTIONAL
|
|
|
|
)
|
|
|
|
{
|
2018-08-08 19:37:22 +00:00
|
|
|
if (Message != NULL)
|
|
|
|
{
|
|
|
|
EfiPrintf(L"*** ASSERTION \'%S\' FAILED AT line %lu in %S (%S) ***\r\n",
|
|
|
|
(PCHAR)FailedAssertion,
|
|
|
|
LineNumber,
|
|
|
|
(PCHAR)FileName,
|
|
|
|
Message);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
EfiPrintf(L"*** ASSERTION \'%S\' FAILED AT line %lu in %S ***\r\n",
|
|
|
|
(PCHAR)FailedAssertion,
|
|
|
|
LineNumber,
|
|
|
|
(PCHAR)FileName);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Issue a breakpoint */
|
|
|
|
__debugbreak();
|
2015-09-05 16:05:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ULONG
|
|
|
|
DbgPrint (
|
|
|
|
const char *Format,
|
|
|
|
...
|
|
|
|
)
|
|
|
|
{
|
2018-08-08 19:37:22 +00:00
|
|
|
EfiPrintf(L"%S\r\n", Format);
|
2015-09-05 16:05:20 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2016-01-05 01:51:54 +00:00
|
|
|
|
2020-06-06 15:50:14 +00:00
|
|
|
// FIXME: DECLSPEC_NORETURN
|
2016-01-05 01:51:54 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
KeBugCheckEx(
|
|
|
|
_In_ ULONG BugCheckCode,
|
|
|
|
_In_ ULONG_PTR BugCheckParameter1,
|
|
|
|
_In_ ULONG_PTR BugCheckParameter2,
|
|
|
|
_In_ ULONG_PTR BugCheckParameter3,
|
|
|
|
_In_ ULONG_PTR BugCheckParameter4)
|
|
|
|
{
|
|
|
|
__assume(0);
|
|
|
|
}
|