[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
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Setup Library
|
|
|
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
|
|
|
* PURPOSE: Filesystem support functions
|
2019-02-24 16:52:33 +00:00
|
|
|
* COPYRIGHT: Copyright 2003-2019 Casper S. Hornstrup (chorns@users.sourceforge.net)
|
|
|
|
* Copyright 2017-2019 Hermes Belusca-Maito
|
[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
|
|
|
*/
|
|
|
|
|
2017-08-26 11:42:32 +00:00
|
|
|
#pragma once
|
|
|
|
|
[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
|
|
|
#include <fmifs/fmifs.h>
|
|
|
|
|
2019-02-24 16:52:33 +00:00
|
|
|
/** QueryAvailableFileSystemFormat() **/
|
|
|
|
BOOLEAN
|
|
|
|
GetRegisteredFileSystems(
|
|
|
|
IN ULONG Index,
|
|
|
|
OUT PCWSTR* FileSystemName);
|
[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
|
|
|
|
2019-02-24 16:52:33 +00:00
|
|
|
NTSTATUS
|
|
|
|
GetFileSystemNameByHandle(
|
|
|
|
IN HANDLE PartitionHandle,
|
|
|
|
IN OUT PWSTR FileSystemName,
|
|
|
|
IN SIZE_T FileSystemNameSize);
|
[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
|
|
|
|
2019-02-24 16:52:33 +00:00
|
|
|
NTSTATUS
|
|
|
|
GetFileSystemName_UStr(
|
|
|
|
IN PUNICODE_STRING PartitionPath,
|
|
|
|
IN OUT PWSTR FileSystemName,
|
|
|
|
IN SIZE_T FileSystemNameSize);
|
[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
|
|
|
|
2019-02-24 16:52:33 +00:00
|
|
|
NTSTATUS
|
|
|
|
GetFileSystemName(
|
|
|
|
IN PCWSTR Partition,
|
|
|
|
IN OUT PWSTR FileSystemName,
|
|
|
|
IN SIZE_T FileSystemNameSize);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
InferFileSystemByHandle(
|
|
|
|
IN HANDLE PartitionHandle,
|
|
|
|
IN UCHAR PartitionType,
|
|
|
|
IN OUT PWSTR FileSystemName,
|
|
|
|
IN SIZE_T FileSystemNameSize);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
InferFileSystem(
|
|
|
|
IN PCWSTR Partition,
|
|
|
|
IN UCHAR PartitionType,
|
|
|
|
IN OUT PWSTR FileSystemName,
|
|
|
|
IN SIZE_T FileSystemNameSize);
|
|
|
|
|
|
|
|
|
|
|
|
/** ChkdskEx() **/
|
|
|
|
NTSTATUS
|
|
|
|
ChkdskFileSystem_UStr(
|
|
|
|
IN PUNICODE_STRING DriveRoot,
|
|
|
|
IN PCWSTR FileSystemName,
|
|
|
|
IN BOOLEAN FixErrors,
|
|
|
|
IN BOOLEAN Verbose,
|
|
|
|
IN BOOLEAN CheckOnlyIfDirty,
|
|
|
|
IN BOOLEAN ScanDrive,
|
|
|
|
IN PFMIFSCALLBACK Callback);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
ChkdskFileSystem(
|
|
|
|
IN PCWSTR DriveRoot,
|
|
|
|
IN PCWSTR FileSystemName,
|
|
|
|
IN BOOLEAN FixErrors,
|
|
|
|
IN BOOLEAN Verbose,
|
|
|
|
IN BOOLEAN CheckOnlyIfDirty,
|
|
|
|
IN BOOLEAN ScanDrive,
|
|
|
|
IN PFMIFSCALLBACK Callback);
|
[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
|
|
|
|
|
|
|
|
2019-02-24 16:52:33 +00:00
|
|
|
/** FormatEx() **/
|
|
|
|
NTSTATUS
|
|
|
|
FormatFileSystem_UStr(
|
|
|
|
IN PUNICODE_STRING DriveRoot,
|
|
|
|
IN PCWSTR FileSystemName,
|
|
|
|
IN FMIFS_MEDIA_FLAG MediaFlag,
|
|
|
|
IN PUNICODE_STRING Label,
|
|
|
|
IN BOOLEAN QuickFormat,
|
|
|
|
IN ULONG ClusterSize,
|
|
|
|
IN PFMIFSCALLBACK Callback);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
FormatFileSystem(
|
|
|
|
IN PCWSTR DriveRoot,
|
|
|
|
IN PCWSTR FileSystemName,
|
|
|
|
IN FMIFS_MEDIA_FLAG MediaFlag,
|
|
|
|
IN PCWSTR Label,
|
|
|
|
IN BOOLEAN QuickFormat,
|
|
|
|
IN ULONG ClusterSize,
|
|
|
|
IN PFMIFSCALLBACK Callback);
|
|
|
|
|
|
|
|
|
|
|
|
UCHAR
|
|
|
|
FileSystemToPartitionType(
|
|
|
|
IN PCWSTR FileSystem,
|
|
|
|
IN PULARGE_INTEGER StartSector,
|
|
|
|
IN PULARGE_INTEGER SectorCount);
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Formatting routines
|
|
|
|
//
|
|
|
|
|
|
|
|
struct _PARTENTRY; // Defined in partlist.h
|
2017-05-17 23:31:52 +00:00
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
PreparePartitionForFormatting(
|
|
|
|
IN struct _PARTENTRY* PartEntry,
|
2019-02-24 16:52:33 +00:00
|
|
|
IN PCWSTR FileSystemName);
|
2017-05-17 23:31:52 +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
|
|
|
/* EOF */
|