mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:43:01 +00:00
[FREELDR] Trivial improvements (#1757)
* [FREELDR] Fix uninitialized string in DiskGetBootPath() CORE-16216 CORE-16248 * [FREELDR] xboxdisk: Add comment and fix code style
This commit is contained in:
parent
b6135732d4
commit
8f25e464c2
2 changed files with 5 additions and 1 deletions
|
@ -30,6 +30,7 @@ DBG_DEFAULT_CHANNEL(DISK);
|
||||||
#define XBOX_IDE_COMMAND_PORT 0x1f0
|
#define XBOX_IDE_COMMAND_PORT 0x1f0
|
||||||
#define XBOX_IDE_CONTROL_PORT 0x170
|
#define XBOX_IDE_CONTROL_PORT 0x170
|
||||||
|
|
||||||
|
/* BRFR signature at disk offset 0x600 */
|
||||||
#define XBOX_SIGNATURE_SECTOR 3
|
#define XBOX_SIGNATURE_SECTOR 3
|
||||||
#define XBOX_SIGNATURE ('B' | ('R' << 8) | ('F' << 16) | ('R' << 24))
|
#define XBOX_SIGNATURE ('B' | ('R' << 8) | ('F' << 16) | ('R' << 24))
|
||||||
|
|
||||||
|
@ -479,7 +480,7 @@ XboxDiskGetPartitionEntry(UCHAR DriveNumber, ULONG PartitionNumber, PPARTITION_T
|
||||||
* This is the Xbox, chances are that there is a Xbox-standard
|
* This is the Xbox, chances are that there is a Xbox-standard
|
||||||
* partitionless disk in it so let's check that first.
|
* partitionless disk in it so let's check that first.
|
||||||
*/
|
*/
|
||||||
if (1 <= PartitionNumber && PartitionNumber <= sizeof(XboxPartitions) / sizeof(XboxPartitions[0]) &&
|
if (PartitionNumber >= 1 && PartitionNumber <= sizeof(XboxPartitions) / sizeof(XboxPartitions[0]) &&
|
||||||
MachDiskReadLogicalSectors(DriveNumber, XBOX_SIGNATURE_SECTOR, 1, SectorData))
|
MachDiskReadLogicalSectors(DriveNumber, XBOX_SIGNATURE_SECTOR, 1, SectorData))
|
||||||
{
|
{
|
||||||
if (*((PULONG) SectorData) == XBOX_SIGNATURE)
|
if (*((PULONG) SectorData) == XBOX_SIGNATURE)
|
||||||
|
|
|
@ -104,6 +104,9 @@ BOOLEAN DiskGetBootPath(OUT PCHAR BootPath, IN ULONG Size)
|
||||||
if (*FrldrBootPath)
|
if (*FrldrBootPath)
|
||||||
goto Done;
|
goto Done;
|
||||||
|
|
||||||
|
if (Size)
|
||||||
|
BootPath[0] = ANSI_NULL;
|
||||||
|
|
||||||
/* 0x49 is our magic ramdisk drive, so try to detect it first */
|
/* 0x49 is our magic ramdisk drive, so try to detect it first */
|
||||||
if (FrldrBootDrive == 0x49)
|
if (FrldrBootDrive == 0x49)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue