ReactOS  0.4.13-dev-544-gede3fdd
rtlcompat.c
Go to the documentation of this file.
1 /*
2 * COPYRIGHT: See COPYING.ARM in the top level directory
3 * PROJECT: ReactOS UEFI Boot Manager
4 * FILE: boot/environ/lib/misc/rtlcompat.c
5 * PURPOSE: RTL Library Compatibility Routines
6 * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8 
9 /* INCLUDES ******************************************************************/
10 
11 #include "bl.h"
12 
13 /* FUNCTIONS *****************************************************************/
14 
15 #if DBG
17 CHECK_PAGED_CODE_RTL (
18  char *file,
19  int line
20  )
21 {
22  // boot-code is always ok
23 }
24 #endif
25 
26 #ifdef _WIN64
27 PVOID MmHighestUserAddress = (PVOID)0xFFFFFFFFULL; // CHECKME
28 #else
30 #endif
31 
32 PVOID
33 NTAPI
36  _In_ ULONG Tag
37  )
38 {
40  return BlMmAllocateHeap(Bytes);
41 }
42 
43 VOID
44 NTAPI
46  _In_ PVOID Mem,
47  _In_ ULONG Tag
48  )
49 {
51  BlMmFreeHeap(Mem);
52 }
53 
55 NTAPI
60  )
61 {
63  return STATUS_SUCCESS;
64 }
65 
66 VOID
67 NTAPI
69  IN PVOID FailedAssertion,
73  )
74 {
75  if (Message != NULL)
76  {
77  EfiPrintf(L"*** ASSERTION \'%S\' FAILED AT line %lu in %S (%S) ***\r\n",
78  (PCHAR)FailedAssertion,
79  LineNumber,
80  (PCHAR)FileName,
81  Message);
82  }
83  else
84  {
85  EfiPrintf(L"*** ASSERTION \'%S\' FAILED AT line %lu in %S ***\r\n",
86  (PCHAR)FailedAssertion,
87  LineNumber,
88  (PCHAR)FileName);
89  }
90 
91  /* Issue a breakpoint */
92  __debugbreak();
93 }
94 
95 ULONG
97  const char *Format,
98  ...
99  )
100 {
101  EfiPrintf(L"%S\r\n", Format);
102  return 0;
103 }
104 
105 VOID
106 NTAPI
108  _In_ ULONG BugCheckCode,
109  _In_ ULONG_PTR BugCheckParameter1,
110  _In_ ULONG_PTR BugCheckParameter2,
111  _In_ ULONG_PTR BugCheckParameter3,
112  _In_ ULONG_PTR BugCheckParameter4)
113 {
114  __assume(0);
115 }
signed char * PCHAR
Definition: retypes.h:7
#define IN
Definition: typedefs.h:38
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
_In_ ULONG _Out_writes_bytes_all_(Length) PUCHAR Buffer
Definition: ntddpcm.h:100
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTSTATUS
Definition: precomp.h:26
_In_ UINT Bytes
Definition: mmcopy.h:9
VOID NTAPI RtlpFreeMemory(_In_ PVOID Mem, _In_ ULONG Tag)
Definition: rtlcompat.c:45
#define FASTCALL
Definition: nt_native.h:50
NTSTATUS BlMmFreeHeap(_In_ PVOID Buffer)
Definition: heapalloc.c:663
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
uint32_t ULONG_PTR
Definition: typedefs.h:63
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID NTAPI RtlAssert(IN PVOID FailedAssertion, IN PVOID FileName, IN ULONG LineNumber, IN PCHAR Message OPTIONAL)
Definition: rtlcompat.c:68
PVOID NTAPI RtlpAllocateMemory(_In_ ULONG Bytes, _In_ ULONG Tag)
Definition: rtlcompat.c:34
ULONG DbgPrint(const char *Format,...)
Definition: rtlcompat.c:96
smooth NULL
Definition: ftsmooth.c:416
PVOID BlMmAllocateHeap(_In_ SIZE_T Size)
Definition: heapalloc.c:569
Definition: parser.c:48
void * PVOID
Definition: retypes.h:9
#define UNALIGNED
Definition: crtdefs.h:132
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2875
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
CHAR Message[80]
Definition: alive.c:5
static const WCHAR L[]
Definition: oid.c:1250
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
#define _In_
Definition: no_sal2.h:204
ULONG_PTR SIZE_T
Definition: typedefs.h:78
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
Definition: acpixf.h:1194
NTSTATUS NTAPI RtlpSafeCopyMemory(_Out_writes_bytes_all_(Length) VOID UNALIGNED *Destination, _In_reads_bytes_(Length) CONST VOID UNALIGNED *Source, _In_ SIZE_T Length)
Definition: rtlcompat.c:56
VOID EfiPrintf(_In_ PWCHAR Format,...)
Definition: firmware.c:126
PVOID MmHighestUserAddress
Definition: rtlcompat.c:29
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
unsigned int ULONG
Definition: retypes.h:1
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define CONST
Definition: pedump.c:81
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:107
Definition: fci.c:126
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68