/* INCLUDES *****************************************************************/
+#if !defined(_X86_)
+
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
WCHAR PathSetup[] = L"\\SystemRoot\\";
CHAR DriverNameLow[256];
ULONG Base;
+ size_t Remaining;
+ WCHAR *StringEnd;
#if defined(_PPC_)
ULONG KernelBase = RosLoaderBlock->ModsAddr[0].ModStart;
#endif
/* Construct a correct full name */
BldrModuleStringsFull[i][0] = 0;
- LdrEntry->FullDllName.MaximumLength = 260 * sizeof(WCHAR);
+ LdrEntry->FullDllName.MaximumLength = sizeof(BldrModuleStringsFull[i]);
LdrEntry->FullDllName.Length = 0;
LdrEntry->FullDllName.Buffer = BldrModuleStringsFull[i];
0,
&Base);
- //
- // Check if we have a ramdisk
- //
+ /* Check if we have a ramdisk */
if ((RosLoaderBlock->RdAddr) && (RosLoaderBlock->RdLength))
{
- //
- // Build a descriptor for it
- //
+ /* Build a descriptor for it */
KiRosAllocateNtDescriptor(LoaderXIPRom,
KERNEL_DESCRIPTOR_PAGE(RosLoaderBlock->RdAddr),
(RosLoaderBlock->RdLength + PAGE_SIZE - 1) >> PAGE_SHIFT,
/* Find the first \, separating the ARC path from NT path */
BootPath = strchr(CommandLine, '\\');
*BootPath = ANSI_NULL;
- strncpy(BldrArcBootPath, CommandLine, 63);
+ RtlStringCbCopyA(BldrArcBootPath, sizeof(BldrArcBootPath), CommandLine);
LoaderBlock->ArcBootDeviceName = BldrArcBootPath;
/* The rest of the string is the NT path */
HalPath = strchr(BootPath + 1, ' ');
*HalPath = ANSI_NULL;
- BldrNtBootPath[0] = '\\';
- strncat(BldrNtBootPath, BootPath + 1, 63);
- strcat(BldrNtBootPath,"\\");
+ Remaining = sizeof(BldrNtBootPath);
+ RtlStringCbCopyExA(BldrNtBootPath, Remaining, "\\", &StringEnd, &Remaining, 0);
+ RtlStringCbCopyExA(StringEnd, Remaining, BootPath + 1, &StringEnd, &Remaining, 0);
+ RtlStringCbCopyA(StringEnd, Remaining, "\\");
LoaderBlock->NtBootPathName = BldrNtBootPath;
/* Set the HAL paths */
- strncpy(BldrArcHalPath, BldrArcBootPath, 63);
+ RtlStringCbCopyA(BldrArcHalPath, sizeof(BldrArcHalPath), BldrArcBootPath);
LoaderBlock->ArcHalDeviceName = BldrArcHalPath;
strcpy(BldrNtHalPath, "\\");
LoaderBlock->NtHalPathName = BldrNtHalPath;
/* Use this new command line */
- strncpy(LoaderBlock->LoadOptions, HalPath + 2, 255);
+ RtlStringCbCopyA(LoaderBlock->LoadOptions, 255, HalPath + 2);
/* Parse it and change every slash to a space */
BootPath = LoaderBlock->LoadOptions;
KiSetupSyscallHandler();
VOID
-FASTCALL
-KiRosPrepareForSystemStartup(IN ULONG Dummy,
- IN PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
+NTAPI
+KiRosPrepareForSystemStartup(IN PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
{
PLOADER_PARAMETER_BLOCK NtLoaderBlock;
ULONG size, i = 0, *ent;
#endif
/* Do general System Startup */
- KiSystemStartupReal(NtLoaderBlock);
+ KiSystemStartup(NtLoaderBlock);
}
+#endif