From 192892221333113b28353fbe428adfc1bf6bbaae Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Sat, 10 Aug 2024 10:35:44 +0200 Subject: [FIX] [newoskrnl.dll] Fixed it's heap and improved it as well. [FIX] Fix memory leak in TrySave. (\Kernel\Sources\User.cxx) Signed-off-by: Amlal EL Mahrouss --- Boot/Sources/HEL/AMD64/BootMain.cxx | 10 +++++++++- Boot/Sources/KernelLoader.cxx | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'Boot/Sources') diff --git a/Boot/Sources/HEL/AMD64/BootMain.cxx b/Boot/Sources/HEL/AMD64/BootMain.cxx index 0e2be7ac..53587e40 100644 --- a/Boot/Sources/HEL/AMD64/BootMain.cxx +++ b/Boot/Sources/HEL/AMD64/BootMain.cxx @@ -118,7 +118,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, vendorTable[4] == 'P' && vendorTable[5] == 'T' && vendorTable[6] == 'R' && vendorTable[7] == ' ') { - writer.Write(L"newosldr: Filling rsdptr...\r"); + writer.Write(L"newosldr: Filling RSD PTR...\r"); handoverHdrPtr->f_HardwareTables.f_VendorPtr = (VoidPtr)vendorTable; break; @@ -163,6 +163,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, handoverHdrPtr->f_VirtualStart = (VoidPtr)Descriptor[cDefaultMemoryMap].VirtualStart; + handoverHdrPtr->f_VirtualSize = Descriptor[cDefaultMemoryMap].NumberOfPages; /* # of pages */ @@ -195,6 +196,13 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, CGDrawInRegion(CGColor(0xFF, 0xFF, 0xFF), handoverHdrPtr->f_GOP.f_Height, handoverHdrPtr->f_GOP.f_Width, 0, 0); CGFini(); + BDiskFormatFactory checkPart; + + if (!checkPart.IsPartitionValid()) + { + writer.Write("newosldr: Warning, partition isn't valid! Need to repartition it.\r"); + } + // ---------------------------------------------------- // // The following checks for an exisiting partition // inside the disk, if it doesn't have one, diff --git a/Boot/Sources/KernelLoader.cxx b/Boot/Sources/KernelLoader.cxx index 02fa97e4..aaabddc3 100644 --- a/Boot/Sources/KernelLoader.cxx +++ b/Boot/Sources/KernelLoader.cxx @@ -93,7 +93,7 @@ namespace Boot UInt64 HandoverMagic; UInt32 HandoverType; - }* structHandover = (struct HANDOVER_INFORMATION_STUB*)(fBlob + sect->mPointerToRawData); + }* structHandover = (struct HANDOVER_INFORMATION_STUB*)((UIntPtr)fBlob + sect->mPointerToRawData); if (structHandover->HandoverMagic != kHandoverMagic || structHandover->HandoverType != kHOTypeKernel) -- cgit v1.2.3