mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:53:06 +00:00
[USETUP] Add a couple of missing TrimTrailingPathSeparators_UStr() calls.
Fixes in particular a regression brought by 57402ee
(thanks George Bisoc
for having noticed this), where the BTRFS bootsector code could not be
installed anymore.
CORE-15192
This commit is contained in:
parent
e723b9f4b4
commit
bd9fa3d701
1 changed files with 12 additions and 6 deletions
|
@ -811,8 +811,9 @@ InstallMbrBootCodeToDisk(
|
||||||
/* Free the original boot sector */
|
/* Free the original boot sector */
|
||||||
RtlFreeHeap(ProcessHeap, 0, OrigBootSector);
|
RtlFreeHeap(ProcessHeap, 0, OrigBootSector);
|
||||||
|
|
||||||
/* Write new bootsector to RootPath */
|
/* Open the root partition - Remove any trailing backslash if needed */
|
||||||
RtlInitUnicodeString(&Name, RootPath);
|
RtlInitUnicodeString(&Name, RootPath);
|
||||||
|
TrimTrailingPathSeparators_UStr(&Name);
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
|
@ -833,6 +834,7 @@ InstallMbrBootCodeToDisk(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Write new bootsector to RootPath */
|
||||||
FileOffset.QuadPart = 0ULL;
|
FileOffset.QuadPart = 0ULL;
|
||||||
Status = NtWriteFile(FileHandle,
|
Status = NtWriteFile(FileHandle,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -970,8 +972,9 @@ InstallFat12BootCodeToFloppy(
|
||||||
/* Free the original boot sector */
|
/* Free the original boot sector */
|
||||||
RtlFreeHeap(ProcessHeap, 0, OrigBootSector);
|
RtlFreeHeap(ProcessHeap, 0, OrigBootSector);
|
||||||
|
|
||||||
/* Write new bootsector to RootPath */
|
/* Open the root partition - Remove any trailing backslash if needed */
|
||||||
RtlInitUnicodeString(&Name, RootPath);
|
RtlInitUnicodeString(&Name, RootPath);
|
||||||
|
TrimTrailingPathSeparators_UStr(&Name);
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
|
@ -992,6 +995,7 @@ InstallFat12BootCodeToFloppy(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Write new bootsector to RootPath */
|
||||||
FileOffset.QuadPart = 0ULL;
|
FileOffset.QuadPart = 0ULL;
|
||||||
Status = NtWriteFile(FileHandle,
|
Status = NtWriteFile(FileHandle,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1529,8 +1533,8 @@ InstallFat32BootCodeToDisk(
|
||||||
static
|
static
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
InstallBtrfsBootCodeToDisk(
|
InstallBtrfsBootCodeToDisk(
|
||||||
PWSTR SrcPath,
|
IN PCWSTR SrcPath,
|
||||||
PWSTR RootPath)
|
IN PCWSTR RootPath)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING Name;
|
UNICODE_STRING Name;
|
||||||
|
@ -1651,8 +1655,9 @@ InstallBtrfsBootCodeToDisk(
|
||||||
// RtlFreeHeap(ProcessHeap, 0, OrigBootSector);
|
// RtlFreeHeap(ProcessHeap, 0, OrigBootSector);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Write new bootsector to RootPath */
|
/* Open the root partition - Remove any trailing backslash if needed */
|
||||||
RtlInitUnicodeString(&Name, RootPath);
|
RtlInitUnicodeString(&Name, RootPath);
|
||||||
|
TrimTrailingPathSeparators_UStr(&Name);
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
|
@ -1684,7 +1689,6 @@ InstallBtrfsBootCodeToDisk(
|
||||||
0,
|
0,
|
||||||
&PartInfo,
|
&PartInfo,
|
||||||
sizeof(PartInfo));
|
sizeof(PartInfo));
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("IOCTL_DISK_GET_PARTITION_INFO_EX failed (Status %lx)\n", Status);
|
DPRINT1("IOCTL_DISK_GET_PARTITION_INFO_EX failed (Status %lx)\n", Status);
|
||||||
|
@ -1693,6 +1697,8 @@ InstallBtrfsBootCodeToDisk(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Write new bootsector to RootPath */
|
||||||
|
|
||||||
NewBootSector->PartitionStartLBA = PartInfo.StartingOffset.QuadPart / SECTORSIZE;
|
NewBootSector->PartitionStartLBA = PartInfo.StartingOffset.QuadPart / SECTORSIZE;
|
||||||
|
|
||||||
/* Write sector 0 */
|
/* Write sector 0 */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue