From df529736f3b307ab9dace0fa7bf10a251d434a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 4 Jan 2015 17:08:41 +0000 Subject: [PATCH] [FREELDR]: DiskGetBootPath can recognize ramdisk now. svn path=/trunk/; revision=65974 --- reactos/boot/freeldr/freeldr/disk/disk.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/disk/disk.c b/reactos/boot/freeldr/freeldr/disk/disk.c index c6e061c2089..6909b46387d 100644 --- a/reactos/boot/freeldr/freeldr/disk/disk.c +++ b/reactos/boot/freeldr/freeldr/disk/disk.c @@ -106,11 +106,23 @@ DiskGetBootPath(char *BootPath, unsigned Size) { static char Path[] = "multi(0)disk(0)"; char Device[4]; - char Partition[4]; - PARTITION_TABLE_ENTRY PartitionEntry; MASTER_BOOT_RECORD MasterBootRecord; - if (FrldrBootDrive < 0x80) + /* 0x49 is our magic ramdisk drive, so try to detect it first */ + if (FrldrBootDrive == 0x49) + { + /* This is the ramdisk. See ArmDiskGetBootPath too... */ + + PCCH RamDiskPath = "ramdisk(0)"; + + if (Size < sizeof(RamDiskPath)) + { + return FALSE; + } + + strcpy(BootPath, RamDiskPath); + } + else if (FrldrBootDrive < 0x80) { /* This is a floppy */ @@ -132,6 +144,8 @@ DiskGetBootPath(char *BootPath, unsigned Size) else if (DiskReadBootRecord(FrldrBootDrive, 0, &MasterBootRecord)) { ULONG BootPartition; + PARTITION_TABLE_ENTRY PartitionEntry; + char Partition[4]; /* This is a hard disk */ if (!DiskGetActivePartitionEntry(FrldrBootDrive, &PartitionEntry, &BootPartition))