Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions boot/LoadReactOS.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,26 @@ int LoadReactOSFATX(FATXPartition *partition, CONFIGENTRY *config) {
}

CONFIGENTRY *DetectReactOSCD(int cdromId) {
long dwSize;
long dwFreeldrSize, dwSetupldrSize;
CONFIGENTRY *config;

dwSize = BootIso9660GetFile(cdromId, "/loader/setupldr.sys", FREELDR_LOAD_AREA, FREELDR_MAX_SIZE);
dwFreeldrSize = BootIso9660GetFile(cdromId, "/loader/freeldr.sys", FREELDR_LOAD_AREA, FREELDR_MAX_SIZE);

// Failed to load freeloader
if (dwSize <= 0)
return NULL;
if (dwFreeldrSize <= 0)
{
/* Try setupldr.sys for older versions of ReactOS */
dwSetupldrSize = BootIso9660GetFile(cdromId, "/loader/setupldr.sys", FREELDR_LOAD_AREA, FREELDR_MAX_SIZE);
if (dwSetupldrSize <= 0)
return NULL;
}

// Freeloader found
config = (CONFIGENTRY *)malloc(sizeof(CONFIGENTRY));
memset(config, 0x00, sizeof(CONFIGENTRY));
config->bootSystem = SYS_REACTOS;
strcpy(config->title, "ReactOS");
strcpy(config->szPath, "/loader/setupldr.sys");
strcpy(config->szPath, (dwFreeldrSize > 0) ? "/loader/freeldr.sys" : "/loader/setupldr.sys");

return config;
}
Expand Down
Loading