2003-08-09 16:32:26 +00:00
|
|
|
/*
|
|
|
|
* ReactOS kernel
|
|
|
|
* Copyright (C) 2003 ReactOS Team
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
2009-10-27 10:34:16 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2003-08-09 16:32:26 +00:00
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS text-mode setup
|
2015-09-13 16:40:36 +00:00
|
|
|
* FILE: base/setup/usetup/fslist.c
|
2003-08-09 16:32:26 +00:00
|
|
|
* PURPOSE: Filesystem list functions
|
2018-05-27 19:33:07 +00:00
|
|
|
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
2003-08-09 16:32:26 +00:00
|
|
|
*/
|
|
|
|
|
2006-08-31 09:13:03 +00:00
|
|
|
#include "usetup.h"
|
2003-08-09 16:32:26 +00:00
|
|
|
|
2010-06-07 21:38:49 +00:00
|
|
|
#define NDEBUG
|
2005-06-20 22:49:45 +00:00
|
|
|
#include <debug.h>
|
2003-08-09 16:32:26 +00:00
|
|
|
|
2020-10-19 21:49:26 +00:00
|
|
|
/* Enable this define to hide FAT32 choice in case FAT is already present */
|
|
|
|
#define HIDE_FAT32_CHOICE
|
|
|
|
|
2003-08-09 16:32:26 +00:00
|
|
|
/* FUNCTIONS ****************************************************************/
|
|
|
|
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
static VOID
|
2018-05-15 21:35:17 +00:00
|
|
|
AddProvider(
|
2006-09-07 22:42:28 +00:00
|
|
|
IN OUT PFILE_SYSTEM_LIST List,
|
2019-02-24 16:52:33 +00:00
|
|
|
IN PCWSTR FileSystem)
|
2006-09-07 22:42:28 +00:00
|
|
|
{
|
|
|
|
PFILE_SYSTEM_ITEM Item;
|
|
|
|
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
Item = (PFILE_SYSTEM_ITEM)RtlAllocateHeap(ProcessHeap, 0, sizeof(*Item));
|
2006-09-07 22:42:28 +00:00
|
|
|
if (!Item)
|
|
|
|
return;
|
|
|
|
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
Item->FileSystem = FileSystem;
|
2014-07-06 12:33:11 +00:00
|
|
|
Item->QuickFormat = TRUE;
|
2006-09-07 22:42:28 +00:00
|
|
|
InsertTailList(&List->ListHead, &Item->ListEntry);
|
|
|
|
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
if (!FileSystem)
|
2006-09-07 22:42:28 +00:00
|
|
|
return;
|
|
|
|
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
Item = (PFILE_SYSTEM_ITEM)RtlAllocateHeap(ProcessHeap, 0, sizeof(*Item));
|
2006-09-07 22:42:28 +00:00
|
|
|
if (!Item)
|
|
|
|
return;
|
|
|
|
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
Item->FileSystem = FileSystem;
|
2014-07-06 12:33:11 +00:00
|
|
|
Item->QuickFormat = FALSE;
|
2006-09-07 22:42:28 +00:00
|
|
|
InsertTailList(&List->ListHead, &Item->ListEntry);
|
|
|
|
}
|
|
|
|
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
static VOID
|
|
|
|
InitializeFileSystemList(
|
2020-10-19 21:49:26 +00:00
|
|
|
IN OUT PFILE_SYSTEM_LIST List,
|
2019-02-24 16:52:33 +00:00
|
|
|
IN BOOLEAN ForceFormat)
|
2016-02-28 16:01:54 +00:00
|
|
|
{
|
2019-02-24 16:52:33 +00:00
|
|
|
PCWSTR FileSystemName;
|
2020-10-19 21:49:26 +00:00
|
|
|
ULONG Index;
|
|
|
|
|
|
|
|
#ifdef HIDE_FAT32_CHOICE
|
|
|
|
BOOLEAN FatPresent = FALSE;
|
|
|
|
|
|
|
|
/* Check whether the FAT filesystem is present */
|
|
|
|
Index = 0;
|
|
|
|
while (GetRegisteredFileSystems(Index++, &FileSystemName))
|
|
|
|
{
|
|
|
|
if (wcsicmp(FileSystemName, L"FAT") == 0)
|
|
|
|
{
|
|
|
|
FatPresent = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2016-02-28 16:01:54 +00:00
|
|
|
|
2020-10-19 21:49:26 +00:00
|
|
|
Index = 0;
|
2019-02-24 16:52:33 +00:00
|
|
|
while (GetRegisteredFileSystems(Index++, &FileSystemName))
|
|
|
|
{
|
2020-10-19 21:49:26 +00:00
|
|
|
#ifdef HIDE_FAT32_CHOICE
|
|
|
|
/* USETUP only: If the FAT filesystem is present, show it, but
|
|
|
|
* don't display FAT32. The FAT formatter will automatically
|
|
|
|
* determine whether to use FAT12/16 or FAT32. */
|
|
|
|
if (FatPresent && wcsicmp(FileSystemName, L"FAT32") == 0)
|
|
|
|
continue;
|
|
|
|
#endif
|
2019-02-24 16:52:33 +00:00
|
|
|
AddProvider(List, FileSystemName);
|
|
|
|
}
|
2017-05-13 16:20:10 +00:00
|
|
|
|
2019-02-24 16:52:33 +00:00
|
|
|
if (!ForceFormat)
|
2017-05-13 16:20:10 +00:00
|
|
|
{
|
2019-02-24 16:52:33 +00:00
|
|
|
/* Add the 'Keep existing filesystem' dummy provider */
|
|
|
|
AddProvider(List, NULL);
|
2017-05-13 16:20:10 +00:00
|
|
|
}
|
2016-02-28 16:01:54 +00:00
|
|
|
}
|
|
|
|
|
2003-08-09 16:32:26 +00:00
|
|
|
PFILE_SYSTEM_LIST
|
2006-09-07 20:15:45 +00:00
|
|
|
CreateFileSystemList(
|
|
|
|
IN SHORT Left,
|
|
|
|
IN SHORT Top,
|
|
|
|
IN BOOLEAN ForceFormat,
|
2017-05-13 16:20:10 +00:00
|
|
|
IN PCWSTR SelectFileSystem)
|
2003-08-09 16:32:26 +00:00
|
|
|
{
|
2006-09-07 20:15:45 +00:00
|
|
|
PFILE_SYSTEM_LIST List;
|
2006-09-07 22:42:28 +00:00
|
|
|
PFILE_SYSTEM_ITEM Item;
|
|
|
|
PLIST_ENTRY ListEntry;
|
2003-08-09 16:32:26 +00:00
|
|
|
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
List = (PFILE_SYSTEM_LIST)RtlAllocateHeap(ProcessHeap, 0, sizeof(*List));
|
2006-09-07 20:15:45 +00:00
|
|
|
if (List == NULL)
|
|
|
|
return NULL;
|
2003-08-09 16:32:26 +00:00
|
|
|
|
2006-09-07 20:15:45 +00:00
|
|
|
List->Left = Left;
|
|
|
|
List->Top = Top;
|
2006-09-07 22:42:28 +00:00
|
|
|
List->Selected = NULL;
|
|
|
|
InitializeListHead(&List->ListHead);
|
2003-08-09 16:32:26 +00:00
|
|
|
|
2019-02-24 16:52:33 +00:00
|
|
|
InitializeFileSystemList(List, ForceFormat);
|
2006-09-07 22:42:28 +00:00
|
|
|
|
2017-05-13 16:20:10 +00:00
|
|
|
/* Search for SelectFileSystem in list */
|
2006-09-07 22:42:28 +00:00
|
|
|
ListEntry = List->ListHead.Flink;
|
|
|
|
while (ListEntry != &List->ListHead)
|
2003-08-09 16:32:26 +00:00
|
|
|
{
|
2006-09-07 22:42:28 +00:00
|
|
|
Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry);
|
2019-02-24 16:52:33 +00:00
|
|
|
if (Item->FileSystem && wcsicmp(SelectFileSystem, Item->FileSystem) == 0)
|
2006-09-07 22:42:28 +00:00
|
|
|
{
|
|
|
|
List->Selected = Item;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
ListEntry = ListEntry->Flink;
|
2003-08-09 16:32:26 +00:00
|
|
|
}
|
2006-09-07 22:42:28 +00:00
|
|
|
if (!List->Selected)
|
|
|
|
List->Selected = CONTAINING_RECORD(List->ListHead.Flink, FILE_SYSTEM_ITEM, ListEntry);
|
2003-08-09 16:32:26 +00:00
|
|
|
|
2006-09-07 20:15:45 +00:00
|
|
|
return List;
|
2003-08-09 16:32:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
2006-09-07 20:15:45 +00:00
|
|
|
DestroyFileSystemList(
|
|
|
|
IN PFILE_SYSTEM_LIST List)
|
2003-08-09 16:32:26 +00:00
|
|
|
{
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
PLIST_ENTRY ListEntry;
|
2006-09-07 22:42:28 +00:00
|
|
|
PFILE_SYSTEM_ITEM Item;
|
|
|
|
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
ListEntry = List->ListHead.Flink;
|
|
|
|
while (!IsListEmpty(&List->ListHead))
|
2006-09-07 22:42:28 +00:00
|
|
|
{
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
ListEntry = RemoveHeadList(&List->ListHead);
|
2006-09-07 22:42:28 +00:00
|
|
|
Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry);
|
|
|
|
RtlFreeHeap(ProcessHeap, 0, Item);
|
|
|
|
}
|
[SETUPLIB][USETUP] Introduce a 'SetupLib' library. CORE-13544
- Create the beginnings of a "setuplib" library, whose aim is to be shared between the (currently existing) 1st-stage text-mode installer, and the (future) 1st-stage GUI installer.
- Finish to split the GenList and PartList codes into their UI part, which remain in usetup, and their algorithmic part, which go into setuplib.
- Move SetMountedDeviceValue into the PartList module.
- Split the FileSystem list code into its UI and the algorithmic part (which goes into setuplib under the name fsutil.c).
* The algo part is meant to be able to manage the filesystems available on the running system, similarly to what is mostly done (in scattered form) in fmifs, format, chkdsk / autochk codes...
It also manages the partition filesystem recognition, using OS routines.
* The UI part manages the FS list as it appears on screen, showing only the possible FSes that can be used to format the selected partition (a bit similar to what we do in the shell32's drive.c, etc...).
- Adapt the calling code to these changes.
- Remove some "host" code that was dating back from the dark old times.
svn path=/branches/setup_improvements/; revision=74570
svn path=/branches/setup_improvements/; revision=74659
2017-05-17 23:37:41 +00:00
|
|
|
|
2006-09-07 20:15:45 +00:00
|
|
|
RtlFreeHeap(ProcessHeap, 0, List);
|
2003-08-09 16:32:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
2006-09-07 20:15:45 +00:00
|
|
|
DrawFileSystemList(
|
|
|
|
IN PFILE_SYSTEM_LIST List)
|
2003-08-09 16:32:26 +00:00
|
|
|
{
|
2006-09-07 22:42:28 +00:00
|
|
|
PLIST_ENTRY ListEntry;
|
|
|
|
PFILE_SYSTEM_ITEM Item;
|
2006-09-07 20:15:45 +00:00
|
|
|
COORD coPos;
|
2007-07-28 18:24:09 +00:00
|
|
|
DWORD Written;
|
2006-09-07 22:42:28 +00:00
|
|
|
ULONG Index = 0;
|
2016-02-02 02:23:56 +00:00
|
|
|
CHAR Buffer[128];
|
2003-08-09 16:32:26 +00:00
|
|
|
|
2006-09-07 22:42:28 +00:00
|
|
|
ListEntry = List->ListHead.Flink;
|
|
|
|
while (ListEntry != &List->ListHead)
|
2003-08-09 16:32:26 +00:00
|
|
|
{
|
2006-09-07 22:42:28 +00:00
|
|
|
Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry);
|
|
|
|
|
2006-09-07 20:15:45 +00:00
|
|
|
coPos.X = List->Left;
|
2006-11-10 21:00:24 +00:00
|
|
|
coPos.Y = List->Top + (SHORT)Index;
|
2006-09-07 20:15:45 +00:00
|
|
|
FillConsoleOutputAttribute(StdOutput,
|
|
|
|
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
2006-09-07 22:42:28 +00:00
|
|
|
sizeof(Buffer),
|
2006-09-07 20:15:45 +00:00
|
|
|
coPos,
|
|
|
|
&Written);
|
|
|
|
FillConsoleOutputCharacterA(StdOutput,
|
|
|
|
' ',
|
2006-09-07 22:42:28 +00:00
|
|
|
sizeof(Buffer),
|
2006-09-07 20:15:45 +00:00
|
|
|
coPos,
|
|
|
|
&Written);
|
|
|
|
|
2019-02-24 16:52:33 +00:00
|
|
|
if (Item->FileSystem)
|
2006-09-07 20:15:45 +00:00
|
|
|
{
|
2019-02-24 16:52:33 +00:00
|
|
|
snprintf(Buffer, sizeof(Buffer),
|
|
|
|
MUIGetString(Item->QuickFormat ? STRING_FORMATDISK1
|
|
|
|
: STRING_FORMATDISK2),
|
|
|
|
Item->FileSystem);
|
2006-09-07 20:15:45 +00:00
|
|
|
}
|
|
|
|
else
|
2017-05-13 16:20:10 +00:00
|
|
|
{
|
2014-10-04 21:24:16 +00:00
|
|
|
snprintf(Buffer, sizeof(Buffer), MUIGetString(STRING_KEEPFORMAT));
|
2017-05-13 16:20:10 +00:00
|
|
|
}
|
2006-09-07 22:42:28 +00:00
|
|
|
|
|
|
|
if (ListEntry == &List->Selected->ListEntry)
|
2019-02-24 16:52:33 +00:00
|
|
|
{
|
2006-09-07 22:42:28 +00:00
|
|
|
CONSOLE_SetInvertedTextXY(List->Left,
|
2011-06-26 10:08:31 +00:00
|
|
|
List->Top + (SHORT)Index,
|
2006-09-07 22:42:28 +00:00
|
|
|
Buffer);
|
2019-02-24 16:52:33 +00:00
|
|
|
}
|
2006-09-07 22:42:28 +00:00
|
|
|
else
|
2019-02-24 16:52:33 +00:00
|
|
|
{
|
2006-09-07 20:15:45 +00:00
|
|
|
CONSOLE_SetTextXY(List->Left,
|
2011-06-26 10:08:31 +00:00
|
|
|
List->Top + (SHORT)Index,
|
2006-09-07 22:42:28 +00:00
|
|
|
Buffer);
|
2019-02-24 16:52:33 +00:00
|
|
|
}
|
2006-09-07 22:42:28 +00:00
|
|
|
Index++;
|
|
|
|
ListEntry = ListEntry->Flink;
|
2003-08-09 16:32:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
2006-09-07 20:15:45 +00:00
|
|
|
ScrollDownFileSystemList(
|
|
|
|
IN PFILE_SYSTEM_LIST List)
|
2003-08-09 16:32:26 +00:00
|
|
|
{
|
2006-09-07 22:42:28 +00:00
|
|
|
if (List->Selected->ListEntry.Flink != &List->ListHead)
|
2003-08-09 16:32:26 +00:00
|
|
|
{
|
2006-09-07 22:42:28 +00:00
|
|
|
List->Selected = CONTAINING_RECORD(List->Selected->ListEntry.Flink, FILE_SYSTEM_ITEM, ListEntry);
|
2006-09-07 20:15:45 +00:00
|
|
|
DrawFileSystemList(List);
|
2003-08-09 16:32:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
2006-09-07 20:15:45 +00:00
|
|
|
ScrollUpFileSystemList(
|
|
|
|
IN PFILE_SYSTEM_LIST List)
|
2003-08-09 16:32:26 +00:00
|
|
|
{
|
2006-09-07 22:42:28 +00:00
|
|
|
if (List->Selected->ListEntry.Blink != &List->ListHead)
|
2003-08-09 16:32:26 +00:00
|
|
|
{
|
2006-09-07 22:42:28 +00:00
|
|
|
List->Selected = CONTAINING_RECORD(List->Selected->ListEntry.Blink, FILE_SYSTEM_ITEM, ListEntry);
|
2006-09-07 20:15:45 +00:00
|
|
|
DrawFileSystemList(List);
|
2003-08-09 16:32:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|