mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:02:59 +00:00
[SETUPLIB][USETUP] Bring some suggestions from PR #59 in.
- Use OBJ_CASE_INSENSITIVE when initializing object attributes (no actual reason why to keep case sensitivity there). - Check the success of a RtlStringCchPrintfW call in EnumerateReactOSEntries(). - Explicitly check for returned STATUS_NOT_SUPPORTED from ChkdskPartition() or FormatPartition(), and display an appropriate error message. - Remove some left-over comments but also explain why I kept some commented code (mainly for future reference).
This commit is contained in:
parent
a7a11dd60d
commit
765994c9e3
7 changed files with 99 additions and 54 deletions
|
@ -341,6 +341,7 @@ EnumerateReactOSEntries(
|
||||||
IN PBOOT_STORE_ENTRY BootEntry,
|
IN PBOOT_STORE_ENTRY BootEntry,
|
||||||
IN PVOID Parameter OPTIONAL)
|
IN PVOID Parameter OPTIONAL)
|
||||||
{
|
{
|
||||||
|
NTSTATUS Status;
|
||||||
PENUM_REACTOS_ENTRIES_DATA Data = (PENUM_REACTOS_ENTRIES_DATA)Parameter;
|
PENUM_REACTOS_ENTRIES_DATA Data = (PENUM_REACTOS_ENTRIES_DATA)Parameter;
|
||||||
PNTOS_OPTIONS Options = (PNTOS_OPTIONS)&BootEntry->OsOptions;
|
PNTOS_OPTIONS Options = (PNTOS_OPTIONS)&BootEntry->OsOptions;
|
||||||
WCHAR SystemPath[MAX_PATH];
|
WCHAR SystemPath[MAX_PATH];
|
||||||
|
@ -372,16 +373,19 @@ EnumerateReactOSEntries(
|
||||||
goto SkipThisEntry;
|
goto SkipThisEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlStringCchPrintfW(SystemPath, ARRAYSIZE(SystemPath), L"\"%s\"", Data->ArcPath);
|
if (_wcsicmp(Options->OsLoadPath, Data->ArcPath) != 0)
|
||||||
if ((_wcsicmp(Options->OsLoadPath, Data->ArcPath) != 0) &&
|
|
||||||
(_wcsicmp(Options->OsLoadPath, SystemPath) != 0))
|
|
||||||
{
|
{
|
||||||
/*
|
/* Not found, retry with a quoted path */
|
||||||
* This entry is a ReactOS entry, but the SystemRoot
|
Status = RtlStringCchPrintfW(SystemPath, ARRAYSIZE(SystemPath), L"\"%s\"", Data->ArcPath);
|
||||||
* does not match the one we are looking for.
|
if (!NT_SUCCESS(Status) || _wcsicmp(Options->OsLoadPath, SystemPath) != 0)
|
||||||
*/
|
{
|
||||||
/* Continue the enumeration */
|
/*
|
||||||
goto SkipThisEntry;
|
* This entry is a ReactOS entry, but the SystemRoot
|
||||||
|
* does not match the one we are looking for.
|
||||||
|
*/
|
||||||
|
/* Continue the enumeration */
|
||||||
|
goto SkipThisEntry;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT1(" Found a candidate Win2k3 install '%S' with ARC path '%S'\n",
|
DPRINT1(" Found a candidate Win2k3 install '%S' with ARC path '%S'\n",
|
||||||
|
@ -668,10 +672,9 @@ SaveBootSector(
|
||||||
|
|
||||||
/* Write bootsector to DstPath */
|
/* Write bootsector to DstPath */
|
||||||
RtlInitUnicodeString(&Name, DstPath);
|
RtlInitUnicodeString(&Name, DstPath);
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
0,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -780,7 +783,6 @@ InstallMbrBootCodeToDiskHelper(
|
||||||
|
|
||||||
/* Read new bootsector from SrcPath */
|
/* Read new bootsector from SrcPath */
|
||||||
RtlInitUnicodeString(&Name, SrcPath);
|
RtlInitUnicodeString(&Name, SrcPath);
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
|
@ -835,7 +837,7 @@ InstallMbrBootCodeToDiskHelper(
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
0,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -882,6 +884,12 @@ InstallMbrBootCodeToDisk(
|
||||||
WCHAR DstPath[MAX_PATH];
|
WCHAR DstPath[MAX_PATH];
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
/*
|
||||||
|
* The DestinationDevicePathBuffer parameter has been built with
|
||||||
|
* the following instruction by the caller; I'm not yet sure whether
|
||||||
|
* I actually want this function to build the path instead, hence
|
||||||
|
* I keep this code here but disabled for now...
|
||||||
|
*/
|
||||||
WCHAR DestinationDevicePathBuffer[MAX_PATH];
|
WCHAR DestinationDevicePathBuffer[MAX_PATH];
|
||||||
RtlStringCchPrintfW(DestinationDevicePathBuffer, ARRAYSIZE(DestinationDevicePathBuffer),
|
RtlStringCchPrintfW(DestinationDevicePathBuffer, ARRAYSIZE(DestinationDevicePathBuffer),
|
||||||
L"\\Device\\Harddisk%d\\Partition0",
|
L"\\Device\\Harddisk%d\\Partition0",
|
||||||
|
@ -1038,7 +1046,7 @@ InstallFat12BootCodeToFloppy(
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
0,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -1127,6 +1135,7 @@ InstallFat16BootCode(
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
Status = NtOpenFile(&FileHandle,
|
Status = NtOpenFile(&FileHandle,
|
||||||
GENERIC_READ | SYNCHRONIZE,
|
GENERIC_READ | SYNCHRONIZE,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -1211,6 +1220,7 @@ InstallFat16BootCodeToFile(
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
Status = NtOpenFile(&PartitionHandle,
|
Status = NtOpenFile(&PartitionHandle,
|
||||||
GENERIC_READ | SYNCHRONIZE,
|
GENERIC_READ | SYNCHRONIZE,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -1224,9 +1234,10 @@ InstallFat16BootCodeToFile(
|
||||||
RtlInitUnicodeString(&Name, DstPath);
|
RtlInitUnicodeString(&Name, DstPath);
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
0, // OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
Status = NtCreateFile(&FileHandle,
|
Status = NtCreateFile(&FileHandle,
|
||||||
GENERIC_WRITE | SYNCHRONIZE,
|
GENERIC_WRITE | SYNCHRONIZE,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -1280,6 +1291,7 @@ InstallFat16BootCodeToDisk(
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
Status = NtOpenFile(&PartitionHandle,
|
Status = NtOpenFile(&PartitionHandle,
|
||||||
GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE,
|
GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -1353,6 +1365,7 @@ InstallFat32BootCode(
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
Status = NtOpenFile(&FileHandle,
|
Status = NtOpenFile(&FileHandle,
|
||||||
GENERIC_READ | SYNCHRONIZE,
|
GENERIC_READ | SYNCHRONIZE,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -1503,6 +1516,7 @@ InstallFat32BootCodeToFile(
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
Status = NtOpenFile(&PartitionHandle,
|
Status = NtOpenFile(&PartitionHandle,
|
||||||
GENERIC_READ | SYNCHRONIZE,
|
GENERIC_READ | SYNCHRONIZE,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -1516,9 +1530,10 @@ InstallFat32BootCodeToFile(
|
||||||
RtlInitUnicodeString(&Name, DstPath);
|
RtlInitUnicodeString(&Name, DstPath);
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
0, // OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
Status = NtCreateFile(&FileHandle,
|
Status = NtCreateFile(&FileHandle,
|
||||||
GENERIC_WRITE | SYNCHRONIZE,
|
GENERIC_WRITE | SYNCHRONIZE,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -1572,6 +1587,7 @@ InstallFat32BootCodeToDisk(
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
Status = NtOpenFile(&PartitionHandle,
|
Status = NtOpenFile(&PartitionHandle,
|
||||||
GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE,
|
GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -1721,7 +1737,7 @@ InstallBtrfsBootCodeToDisk(
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
0,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,11 @@
|
||||||
|
|
||||||
FILE_SYSTEM RegisteredFileSystems[] =
|
FILE_SYSTEM RegisteredFileSystems[] =
|
||||||
{
|
{
|
||||||
|
/* NOTE: The FAT formatter automatically determines
|
||||||
|
* whether it will use FAT-16 or FAT-32. */
|
||||||
{ L"FAT" , VfatFormat, VfatChkdsk },
|
{ L"FAT" , VfatFormat, VfatChkdsk },
|
||||||
// { L"FAT32", VfatFormat, VfatChkdsk },
|
|
||||||
#if 0
|
#if 0
|
||||||
|
{ L"FAT32", VfatFormat, VfatChkdsk }, // Do we support specific FAT sub-formats specifications?
|
||||||
{ L"FATX" , VfatxFormat, VfatxChkdsk },
|
{ L"FATX" , VfatxFormat, VfatxChkdsk },
|
||||||
{ L"NTFS" , NtfsFormat, NtfsChkdsk },
|
{ L"NTFS" , NtfsFormat, NtfsChkdsk },
|
||||||
|
|
||||||
|
|
|
@ -212,8 +212,8 @@ InstallSetupInfFile(
|
||||||
PINICACHE UnattendCache;
|
PINICACHE UnattendCache;
|
||||||
PINICACHEITERATOR Iterator;
|
PINICACHEITERATOR Iterator;
|
||||||
#else
|
#else
|
||||||
// PCWSTR CrLf = L"\r\n";
|
// WCHAR CrLf[] = {L'\r', L'\n'};
|
||||||
PCSTR CrLf = "\r\n";
|
CHAR CrLf[] = {'\r', '\n'};
|
||||||
HANDLE FileHandle, UnattendFileHandle, SectionHandle;
|
HANDLE FileHandle, UnattendFileHandle, SectionHandle;
|
||||||
FILE_STANDARD_INFORMATION FileInfo;
|
FILE_STANDARD_INFORMATION FileInfo;
|
||||||
ULONG FileSize;
|
ULONG FileSize;
|
||||||
|
@ -360,7 +360,7 @@ Quit:
|
||||||
NULL,
|
NULL,
|
||||||
&IoStatusBlock,
|
&IoStatusBlock,
|
||||||
(PVOID)CrLf,
|
(PVOID)CrLf,
|
||||||
2 * sizeof(CHAR), // 2 * sizeof(WCHAR),
|
sizeof(CrLf),
|
||||||
&FileInfo.EndOfFile,
|
&FileInfo.EndOfFile,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,6 @@ SetupCopyFile(
|
||||||
LARGE_INTEGER ByteOffset;
|
LARGE_INTEGER ByteOffset;
|
||||||
|
|
||||||
RtlInitUnicodeString(&FileName, SourceFileName);
|
RtlInitUnicodeString(&FileName, SourceFileName);
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&FileName,
|
&FileName,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
|
@ -206,7 +205,6 @@ SetupCopyFile(
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlInitUnicodeString(&FileName, DestinationFileName);
|
RtlInitUnicodeString(&FileName, DestinationFileName);
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&FileName,
|
&FileName,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
|
@ -594,7 +592,6 @@ DoesPathExist(
|
||||||
IO_STATUS_BLOCK IoStatusBlock;
|
IO_STATUS_BLOCK IoStatusBlock;
|
||||||
|
|
||||||
RtlInitUnicodeString(&Name, PathName);
|
RtlInitUnicodeString(&Name, PathName);
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
|
@ -756,7 +753,6 @@ OpenAndMapFile(
|
||||||
/* Open the file */
|
/* Open the file */
|
||||||
|
|
||||||
RtlInitUnicodeString(&FileName, PathNameToFile);
|
RtlInitUnicodeString(&FileName, PathNameToFile);
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&FileName,
|
&FileName,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
|
|
|
@ -1249,7 +1249,7 @@ CreatePartitionList(VOID)
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
0,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -2777,9 +2777,10 @@ WritePartitions(
|
||||||
L"\\Device\\Harddisk%lu\\Partition0",
|
L"\\Device\\Harddisk%lu\\Partition0",
|
||||||
DiskEntry->DiskNumber);
|
DiskEntry->DiskNumber);
|
||||||
RtlInitUnicodeString(&Name, DstPath);
|
RtlInitUnicodeString(&Name, DstPath);
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
0,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -2882,6 +2883,7 @@ SetMountedDeviceValue(
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
Status = NtOpenKey(&KeyHandle,
|
Status = NtOpenKey(&KeyHandle,
|
||||||
KEY_ALL_ACCESS,
|
KEY_ALL_ACCESS,
|
||||||
&ObjectAttributes);
|
&ObjectAttributes);
|
||||||
|
|
|
@ -107,7 +107,7 @@ InstallDriver(
|
||||||
|
|
||||||
/* Create service key */
|
/* Create service key */
|
||||||
RtlInitUnicodeString(&StringU, Driver);
|
RtlInitUnicodeString(&StringU, Driver);
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &StringU, 0, hServices, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &StringU, OBJ_CASE_INSENSITIVE, hServices, NULL);
|
||||||
Status = NtCreateKey(&hService, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_NON_VOLATILE, &Disposition);
|
Status = NtCreateKey(&hService, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_NON_VOLATILE, &Disposition);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -218,7 +218,7 @@ InstallDevice(
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
RtlInitUnicodeString(&DeviceIdU, DeviceId);
|
RtlInitUnicodeString(&DeviceIdU, DeviceId);
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &DeviceIdU, 0, hEnum, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &DeviceIdU, OBJ_CASE_INSENSITIVE, hEnum, NULL);
|
||||||
Status = NtOpenKey(&hDeviceKey, KEY_QUERY_VALUE | KEY_SET_VALUE, &ObjectAttributes);
|
Status = NtOpenKey(&hDeviceKey, KEY_QUERY_VALUE | KEY_SET_VALUE, &ObjectAttributes);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
|
|
@ -2915,12 +2915,13 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
|
||||||
static PAGE_NUMBER
|
static PAGE_NUMBER
|
||||||
FormatPartitionPage(PINPUT_RECORD Ir)
|
FormatPartitionPage(PINPUT_RECORD Ir)
|
||||||
{
|
{
|
||||||
UNICODE_STRING PartitionRootPath;
|
NTSTATUS Status;
|
||||||
WCHAR PathBuffer[MAX_PATH];
|
|
||||||
PDISKENTRY DiskEntry;
|
PDISKENTRY DiskEntry;
|
||||||
PPARTENTRY PartEntry;
|
PPARTENTRY PartEntry;
|
||||||
PFILE_SYSTEM_ITEM SelectedFileSystem;
|
PFILE_SYSTEM_ITEM SelectedFileSystem;
|
||||||
NTSTATUS Status;
|
UNICODE_STRING PartitionRootPath;
|
||||||
|
WCHAR PathBuffer[MAX_PATH];
|
||||||
|
CHAR Buffer[MAX_PATH];
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
ULONG Line;
|
ULONG Line;
|
||||||
|
@ -3016,7 +3017,38 @@ FormatPartitionPage(PINPUT_RECORD Ir)
|
||||||
{
|
{
|
||||||
Status = FormatPartition(&PartitionRootPath,
|
Status = FormatPartition(&PartitionRootPath,
|
||||||
SelectedFileSystem);
|
SelectedFileSystem);
|
||||||
if (!NT_SUCCESS(Status))
|
if (Status == STATUS_NOT_SUPPORTED)
|
||||||
|
{
|
||||||
|
sprintf(Buffer,
|
||||||
|
"Setup is currently unable to format a partition in %S.\n"
|
||||||
|
"\n"
|
||||||
|
" \x07 Press ENTER to continue Setup.\n"
|
||||||
|
" \x07 Press F3 to quit Setup.",
|
||||||
|
SelectedFileSystem->FileSystem->FileSystemName);
|
||||||
|
|
||||||
|
PopupError(Buffer,
|
||||||
|
MUIGetString(STRING_QUITCONTINUE),
|
||||||
|
NULL, POPUP_WAIT_NONE);
|
||||||
|
|
||||||
|
while (TRUE)
|
||||||
|
{
|
||||||
|
CONSOLE_ConInKey(Ir);
|
||||||
|
|
||||||
|
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x00 &&
|
||||||
|
Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3) /* F3 */
|
||||||
|
{
|
||||||
|
if (ConfirmQuit(Ir))
|
||||||
|
return QUIT_PAGE;
|
||||||
|
else
|
||||||
|
return SELECT_FILE_SYSTEM_PAGE;
|
||||||
|
}
|
||||||
|
else if (Ir->Event.KeyEvent.uChar.AsciiChar == VK_RETURN) /* ENTER */
|
||||||
|
{
|
||||||
|
return SELECT_FILE_SYSTEM_PAGE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("FormatPartition() failed with status 0x%08lx\n", Status);
|
DPRINT1("FormatPartition() failed with status 0x%08lx\n", Status);
|
||||||
MUIDisplayError(ERROR_FORMATTING_PARTITION, Ir, POPUP_WAIT_ANY_KEY, PathBuffer);
|
MUIDisplayError(ERROR_FORMATTING_PARTITION, Ir, POPUP_WAIT_ANY_KEY, PathBuffer);
|
||||||
|
@ -3057,13 +3089,13 @@ FormatPartitionPage(PINPUT_RECORD Ir)
|
||||||
static PAGE_NUMBER
|
static PAGE_NUMBER
|
||||||
CheckFileSystemPage(PINPUT_RECORD Ir)
|
CheckFileSystemPage(PINPUT_RECORD Ir)
|
||||||
{
|
{
|
||||||
|
NTSTATUS Status;
|
||||||
|
PDISKENTRY DiskEntry;
|
||||||
|
PPARTENTRY PartEntry;
|
||||||
PFILE_SYSTEM CurrentFileSystem;
|
PFILE_SYSTEM CurrentFileSystem;
|
||||||
UNICODE_STRING PartitionRootPath;
|
UNICODE_STRING PartitionRootPath;
|
||||||
WCHAR PathBuffer[MAX_PATH];
|
WCHAR PathBuffer[MAX_PATH];
|
||||||
CHAR Buffer[MAX_PATH];
|
CHAR Buffer[MAX_PATH];
|
||||||
PDISKENTRY DiskEntry;
|
|
||||||
PPARTENTRY PartEntry;
|
|
||||||
NTSTATUS Status;
|
|
||||||
|
|
||||||
if (PartitionList == NULL)
|
if (PartitionList == NULL)
|
||||||
{
|
{
|
||||||
|
@ -3099,7 +3131,8 @@ CheckFileSystemPage(PINPUT_RECORD Ir)
|
||||||
return CHECK_FILE_SYSTEM_PAGE;
|
return CHECK_FILE_SYSTEM_PAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CurrentFileSystem->ChkdskFunc == NULL)
|
Status = ChkdskPartition(&PartitionRootPath, CurrentFileSystem);
|
||||||
|
if (Status == STATUS_NOT_SUPPORTED)
|
||||||
{
|
{
|
||||||
sprintf(Buffer,
|
sprintf(Buffer,
|
||||||
"Setup is currently unable to check a partition formatted in %S.\n"
|
"Setup is currently unable to check a partition formatted in %S.\n"
|
||||||
|
@ -3131,26 +3164,22 @@ CheckFileSystemPage(PINPUT_RECORD Ir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
Status = ChkdskPartition(&PartitionRootPath, CurrentFileSystem);
|
DPRINT("ChkdskPartition() failed with status 0x%08lx\n", Status);
|
||||||
if (!NT_SUCCESS(Status))
|
// sprintf(Buffer, "Setup failed to verify the selected partition.\n"
|
||||||
{
|
sprintf(Buffer, "ChkDsk detected some disk errors.\n"
|
||||||
DPRINT("ChkdskPartition() failed with status 0x%08lx\n", Status);
|
"(Status 0x%08lx).\n", Status);
|
||||||
// sprintf(Buffer, "Setup failed to verify the selected partition.\n"
|
PopupError(Buffer,
|
||||||
sprintf(Buffer, "ChkDsk detected some disk errors.\n"
|
// MUIGetString(STRING_REBOOTCOMPUTER),
|
||||||
"(Status 0x%08lx).\n", Status);
|
MUIGetString(STRING_CONTINUE),
|
||||||
PopupError(Buffer,
|
Ir, POPUP_WAIT_ENTER);
|
||||||
// MUIGetString(STRING_REBOOTCOMPUTER),
|
|
||||||
MUIGetString(STRING_CONTINUE),
|
|
||||||
Ir, POPUP_WAIT_ENTER);
|
|
||||||
|
|
||||||
// return QUIT_PAGE;
|
// return QUIT_PAGE;
|
||||||
}
|
|
||||||
|
|
||||||
PartEntry->NeedsCheck = FALSE;
|
|
||||||
return CHECK_FILE_SYSTEM_PAGE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PartEntry->NeedsCheck = FALSE;
|
||||||
|
return CHECK_FILE_SYSTEM_PAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue