[BOOT] Create input parameters structures.
This commit is contained in:
84
BOOT/ENVIRON/LIB/rtl.c
Normal file
84
BOOT/ENVIRON/LIB/rtl.c
Normal file
@@ -0,0 +1,84 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
|
||||
rtl.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Runtime library routines.
|
||||
|
||||
--*/
|
||||
|
||||
#include <nt.h>
|
||||
|
||||
PVOID
|
||||
RtlCopyMemory (
|
||||
PVOID Destination,
|
||||
CONST PVOID Source,
|
||||
ULONG Length
|
||||
)
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Copies a block of memory from Source to Destination.
|
||||
|
||||
Arguments:
|
||||
|
||||
Destination - the address to copy to.
|
||||
|
||||
Source - the address to copy from.
|
||||
|
||||
Length - the number of bytes to copy.
|
||||
|
||||
Return Value:
|
||||
|
||||
Returns Destination.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
for (ULONG Index = 0; Index < Length; Index++) {
|
||||
((PCHAR)Destination)[Index] = ((PCHAR)Source)[Index];
|
||||
}
|
||||
|
||||
return Destination;
|
||||
}
|
||||
|
||||
|
||||
PVOID
|
||||
RtlZeroMemory (
|
||||
PVOID Destination,
|
||||
ULONG Length
|
||||
)
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Sets a block of memory to zero.
|
||||
|
||||
Arguments:
|
||||
|
||||
Destination - the address to zero at.
|
||||
|
||||
Length - the number of bytes to set.
|
||||
|
||||
Return Value:
|
||||
|
||||
Returns Destination.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
for (ULONG Index = 0; Index < Length; Index++) {
|
||||
((PCHAR)Destination)[Index] = 0;
|
||||
}
|
||||
|
||||
return Destination;
|
||||
}
|
||||
Reference in New Issue
Block a user