mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
Reapply r43141: Remove now unneeded ARC cdrom hack in NTLDR boot-style. We're now able to boot from a LiveCD, even if ReactOS directory is not "reactos"
Keep the existing hack for FreeLdr boot-style, which should be removed one day svn path=/trunk/; revision=43227
This commit is contained in:
parent
ac2285ed31
commit
a471bf9bb0
1 changed files with 34 additions and 3 deletions
|
@ -17,6 +17,7 @@
|
|||
|
||||
UNICODE_STRING IoArcHalDeviceName, IoArcBootDeviceName;
|
||||
PCHAR IoLoaderArcBootDeviceName;
|
||||
extern PROS_LOADER_PARAMETER_BLOCK KeRosLoaderBlock;
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
|
@ -278,7 +279,8 @@ IopGetDiskInformation(IN ULONG i,
|
|||
BOOLEAN
|
||||
INIT_FUNCTION
|
||||
NTAPI
|
||||
IopAssignArcNamesToCdrom(IN PULONG Buffer,
|
||||
IopAssignArcNamesToCdrom(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
IN PULONG Buffer,
|
||||
IN ULONG DiskNumber)
|
||||
{
|
||||
CHAR ArcBuffer[128];
|
||||
|
@ -292,6 +294,10 @@ IopAssignArcNamesToCdrom(IN PULONG Buffer,
|
|||
ULONG i, CheckSum = 0;
|
||||
PDEVICE_OBJECT DeviceObject;
|
||||
PFILE_OBJECT FileObject;
|
||||
PARC_DISK_INFORMATION ArcDiskInfo = LoaderBlock->ArcDiskInformation;
|
||||
PLIST_ENTRY NextEntry;
|
||||
PARC_DISK_SIGNATURE ArcDiskEntry;
|
||||
BOOLEAN IsBootCdRom = FALSE;
|
||||
|
||||
/* Build the device name */
|
||||
sprintf(ArcBuffer, "\\Device\\CdRom%lu", DiskNumber);
|
||||
|
@ -348,6 +354,28 @@ IopAssignArcNamesToCdrom(IN PULONG Buffer,
|
|||
/* Now calculate the checksum */
|
||||
for (i = 0; i < 2048 / sizeof(ULONG); i++) CheckSum += Buffer[i];
|
||||
|
||||
if (KeRosLoaderBlock) goto freeldrhack;
|
||||
|
||||
/* Search if this device is the actual boot CD */
|
||||
for (NextEntry = ArcDiskInfo->DiskSignatureListHead.Flink;
|
||||
NextEntry != &ArcDiskInfo->DiskSignatureListHead;
|
||||
NextEntry = NextEntry->Flink)
|
||||
{
|
||||
/* Get the current ARC disk signature entry */
|
||||
ArcDiskEntry = CONTAINING_RECORD(NextEntry,
|
||||
ARC_DISK_SIGNATURE,
|
||||
ListEntry);
|
||||
/* And check if checksums and arc names match */
|
||||
if (CheckSum == ArcDiskEntry->CheckSum &&
|
||||
strcmp(KeLoaderBlock->ArcBootDeviceName, ArcDiskEntry->ArcName) == 0)
|
||||
{
|
||||
IsBootCdRom = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
goto checkbootcd;
|
||||
|
||||
freeldrhack:
|
||||
/*
|
||||
* FIXME: In normal conditions, NTLDR/FreeLdr sends the *proper* CDROM
|
||||
* ARC Path name, and what happens here is a comparision of both checksums
|
||||
|
@ -363,7 +391,10 @@ IopAssignArcNamesToCdrom(IN PULONG Buffer,
|
|||
* The signature code stays however, because eventually FreeLDR will work
|
||||
* like NTLDR, and, conversly, we do want to be able to be booted by NTLDR.
|
||||
*/
|
||||
if (IopApplyRosCdromArcHack(DiskNumber))
|
||||
IsBootCdRom = IopApplyRosCdromArcHack(DiskNumber);
|
||||
|
||||
checkbootcd:
|
||||
if (IsBootCdRom)
|
||||
{
|
||||
/* This is the boot CD-ROM, build the ARC name */
|
||||
sprintf(ArcBuffer, "\\ArcName\\%s", KeLoaderBlock->ArcBootDeviceName);
|
||||
|
@ -583,7 +614,7 @@ IopCreateArcNames(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
for (i = 0; i < ConfigInfo->CdRomCount; i++)
|
||||
{
|
||||
/* Give it an ARC name */
|
||||
if (IopAssignArcNamesToCdrom(PartitionBuffer, i)) break;
|
||||
if (IopAssignArcNamesToCdrom(LoaderBlock, PartitionBuffer, i)) break;
|
||||
}
|
||||
|
||||
/* Free the buffer */
|
||||
|
|
Loading…
Reference in a new issue