From e6a7608b4dead984617aad1c72b0cec44643c164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 21 Aug 2024 21:51:10 +0200 Subject: [PATCH] **** Possible FIXMEs / TODOs for the future --- base/setup/lib/fsutil.c | 2 ++ base/setup/lib/setuplib.c | 2 +- base/setup/lib/setuplib.h | 2 +- base/setup/lib/utils/filesup.c | 3 +++ base/setup/lib/utils/partlist.h | 4 ++++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/base/setup/lib/fsutil.c b/base/setup/lib/fsutil.c index 875e8ec7f9dea..c5b55fb22f74b 100644 --- a/base/setup/lib/fsutil.c +++ b/base/setup/lib/fsutil.c @@ -831,6 +831,8 @@ FormatVolume( return Status; /* Set the new volume's file system and label */ + // TODO: Here, call a volutil.c function that updates + // the actual FS name and the label fields of the volume. RtlStringCbCopyW(Volume->FileSystem, sizeof(Volume->FileSystem), FileSystemName); if (!Label) Label = L""; RtlStringCbCopyW(Volume->VolumeLabel, sizeof(Volume->VolumeLabel), Label); diff --git a/base/setup/lib/setuplib.c b/base/setup/lib/setuplib.c index 632db24ec295f..ae22b4c6f155b 100644 --- a/base/setup/lib/setuplib.c +++ b/base/setup/lib/setuplib.c @@ -855,7 +855,7 @@ NTSTATUS InitDestinationPaths( _Inout_ PUSETUP_DATA pSetupData, _In_ PCWSTR InstallationDir, - _In_ PVOLENTRY Volume) + _In_ PVOLENTRY Volume) // FIXME: HACK! { NTSTATUS Status; PPARTENTRY PartEntry = Volume->PartEntry; diff --git a/base/setup/lib/setuplib.h b/base/setup/lib/setuplib.h index a69f7bba877ae..d59f52217fa9d 100644 --- a/base/setup/lib/setuplib.h +++ b/base/setup/lib/setuplib.h @@ -207,7 +207,7 @@ NTSTATUS InitDestinationPaths( _Inout_ PUSETUP_DATA pSetupData, _In_ PCWSTR InstallationDir, - _In_ PVOLENTRY Volume); + _In_ PVOLENTRY Volume); // FIXME: HACK! // NTSTATUS ERROR_NUMBER diff --git a/base/setup/lib/utils/filesup.c b/base/setup/lib/utils/filesup.c index 81da91faa125a..d6204ab865c55 100644 --- a/base/setup/lib/utils/filesup.c +++ b/base/setup/lib/utils/filesup.c @@ -708,6 +708,9 @@ DoesPathExist_UStr( RootDirectory, NULL); + // Investigate: check for presence of FILE_ATTRIBUTE_DIRECTORY + // or FILE_ATTRIBUTE_REPARSE_POINT for directories? + Status = NtOpenFile(&FileHandle, IsDirectory ? (FILE_LIST_DIRECTORY | SYNCHRONIZE) : FILE_GENERIC_READ, // Contains SYNCHRONIZE diff --git a/base/setup/lib/utils/partlist.h b/base/setup/lib/utils/partlist.h index 1685cfa20e7c0..e4ba700cfac11 100644 --- a/base/setup/lib/utils/partlist.h +++ b/base/setup/lib/utils/partlist.h @@ -47,6 +47,8 @@ typedef struct _VOLENTRY VOLINFO Info; FORMATSTATE FormatState; +/** The following properties may be replaced by flags **/ + /* Volume must be checked */ BOOLEAN NeedsCheck; /* Volume is new and has not yet been actually formatted and mounted */ @@ -76,6 +78,8 @@ typedef struct _PARTENTRY ULONG PartitionIndex; /* Index in the LayoutBuffer->PartitionEntry[] cached array of the corresponding DiskEntry */ WCHAR DeviceName[MAX_PATH]; ///< NT device name: "\Device\HarddiskM\PartitionN" +/** The following properties may be replaced by flags **/ + BOOLEAN LogicalPartition; /* Partition is partitioned disk space */