reactos/base/setup/lib/fsutil.h
Hermès Bélusca-Maïto 08924c1850
[USETUP][SETUPLIB] Continue hiding the FAT32 format in the format list, but take it into account anyway later on.
The formatter will select it anyway as soon as the partition size
permits it. We make it available internally however so as to "emulate"
FMIFS functionality.

Now rely on the partition filesystem for InstallVBRToPartition() instead
of the unreliable and deprecated partition type.
2020-10-20 01:19:58 +02:00

112 lines
2.6 KiB
C

/*
* PROJECT: ReactOS Setup Library
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: Filesystem support functions
* COPYRIGHT: Copyright 2003-2019 Casper S. Hornstrup (chorns@users.sourceforge.net)
* Copyright 2017-2020 Hermes Belusca-Maito
*/
#pragma once
#include <fmifs/fmifs.h>
/** QueryAvailableFileSystemFormat() **/
BOOLEAN
GetRegisteredFileSystems(
IN ULONG Index,
OUT PCWSTR* FileSystemName);
/** 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);
/** 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);
//
// Bootsector routines
//
#define FAT_BOOTSECTOR_SIZE (1 * SECTORSIZE)
#define FAT32_BOOTSECTOR_SIZE (1 * SECTORSIZE) // Counts only the primary sector.
#define BTRFS_BOOTSECTOR_SIZE (3 * SECTORSIZE)
typedef NTSTATUS
(/*NTAPI*/ *PFS_INSTALL_BOOTCODE)(
IN PCWSTR SrcPath, // Bootsector source file (on the installation medium)
IN HANDLE DstPath, // Where to save the bootsector built from the source + partition information
IN HANDLE RootPartition); // Partition holding the (old) bootsector data information
NTSTATUS
InstallFatBootCode(
IN PCWSTR SrcPath,
IN HANDLE DstPath,
IN HANDLE RootPartition);
#define InstallFat12BootCode InstallFatBootCode
#define InstallFat16BootCode InstallFatBootCode
NTSTATUS
InstallFat32BootCode(
IN PCWSTR SrcPath,
IN HANDLE DstPath,
IN HANDLE RootPartition);
NTSTATUS
InstallBtrfsBootCode(
IN PCWSTR SrcPath,
IN HANDLE DstPath,
IN HANDLE RootPartition);
//
// Formatting routines
//
struct _PARTENTRY; // Defined in partlist.h
BOOLEAN
PreparePartitionForFormatting(
IN struct _PARTENTRY* PartEntry,
IN PCWSTR FileSystemName);
/* EOF */