ReactOS  0.4.15-dev-1187-g119f102
fsutil.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Setup Library
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: Filesystem support functions
5  * COPYRIGHT: Copyright 2003-2019 Casper S. Hornstrup (chorns@users.sourceforge.net)
6  * Copyright 2017-2020 Hermes Belusca-Maito
7  */
8 
9 #pragma once
10 
11 #include <fmifs/fmifs.h>
12 
14 BOOLEAN
16  IN ULONG Index,
17  OUT PCWSTR* FileSystemName);
18 
19 
23  IN PUNICODE_STRING DriveRoot,
24  IN PCWSTR FileSystemName,
27  IN BOOLEAN CheckOnlyIfDirty,
28  IN BOOLEAN ScanDrive,
30 
33  IN PCWSTR DriveRoot,
34  IN PCWSTR FileSystemName,
37  IN BOOLEAN CheckOnlyIfDirty,
38  IN BOOLEAN ScanDrive,
40 
41 
45  IN PUNICODE_STRING DriveRoot,
46  IN PCWSTR FileSystemName,
47  IN FMIFS_MEDIA_FLAG MediaFlag,
52 
55  IN PCWSTR DriveRoot,
56  IN PCWSTR FileSystemName,
57  IN FMIFS_MEDIA_FLAG MediaFlag,
58  IN PCWSTR Label,
62 
63 
64 //
65 // Bootsector routines
66 //
67 
68 #define FAT_BOOTSECTOR_SIZE (1 * SECTORSIZE)
69 #define FAT32_BOOTSECTOR_SIZE (1 * SECTORSIZE) // Counts only the primary sector.
70 #define BTRFS_BOOTSECTOR_SIZE (3 * SECTORSIZE)
71 
72 typedef NTSTATUS
73 (/*NTAPI*/ *PFS_INSTALL_BOOTCODE)(
74  IN PCWSTR SrcPath, // Bootsector source file (on the installation medium)
75  IN HANDLE DstPath, // Where to save the bootsector built from the source + partition information
76  IN HANDLE RootPartition); // Partition holding the (old) bootsector data information
77 
80  IN PCWSTR SrcPath,
83 
84 #define InstallFat12BootCode InstallFatBootCode
85 #define InstallFat16BootCode InstallFatBootCode
86 
89  IN PCWSTR SrcPath,
92 
95  IN PCWSTR SrcPath,
98 
99 
100 //
101 // Formatting routines
102 //
103 
104 struct _PARTENTRY; // Defined in partlist.h
105 
106 BOOLEAN
108  IN struct _PARTENTRY* PartEntry,
110 
111 /* EOF */
NTSTATUS InstallBtrfsBootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
Definition: fsutil.c:508
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
NTSTATUS InstallFatBootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
Definition: fsutil.c:329
BOOLEAN PreparePartitionForFormatting(IN struct _PARTENTRY *PartEntry, IN PCWSTR FileSystemName)
Definition: fsutil.c:620
typedef NTSTATUS(*PFS_INSTALL_BOOTCODE)(IN PCWSTR SrcPath
BOOL Verbose
Definition: chkdsk.c:72
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN GetRegisteredFileSystems(IN ULONG Index, OUT PCWSTR *FileSystemName)
Definition: fsutil.c:155
IN HANDLE DstPath
Definition: fsutil.h:75
unsigned char BOOLEAN
BOOL QuickFormat
Definition: format.c:66
DWORD ClusterSize
Definition: format.c:67
static const UCHAR Index[8]
Definition: usbohci.c:18
IN HANDLE IN HANDLE RootPartition
Definition: fsutil.h:75
NTSTATUS ChkdskFileSystem(IN PCWSTR DriveRoot, IN PCWSTR FileSystemName, IN BOOLEAN FixErrors, IN BOOLEAN Verbose, IN BOOLEAN CheckOnlyIfDirty, IN BOOLEAN ScanDrive, IN PFMIFSCALLBACK Callback)
Definition: fsutil.c:246
BOOLEAN(NTAPI * PFMIFSCALLBACK)(IN CALLBACKCOMMAND Command, IN ULONG SubAction, IN PVOID ActionInfo)
Definition: fmifs.h:89
BOOL FixErrors
Definition: chkdsk.c:69
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)
Definition: fsutil.c:299
#define OUT
Definition: typedefs.h:40
NTSTATUS InstallFat32BootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
Definition: fsutil.c:387
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)
Definition: fsutil.c:217
unsigned int ULONG
Definition: retypes.h:1
PWCHAR Label
Definition: format.c:70
CHAR FileSystemName[9]
Definition: diskpart.h:99
LPFNPSPCALLBACK Callback
Definition: desk.c:112
FMIFS_MEDIA_FLAG
Definition: fmifs.h:37
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)
Definition: fsutil.c:270