ReactOS  0.4.15-dev-3295-gaa8fc87
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 Format and ChkDsk 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 NTSTATUS
106  IN PPARTENTRY PartEntry,
109  IN BOOLEAN CheckOnlyIfDirty,
110  IN BOOLEAN ScanDrive,
112 
113 NTSTATUS
115  IN PPARTENTRY PartEntry,
116  IN PCWSTR FileSystemName,
117  IN FMIFS_MEDIA_FLAG MediaFlag,
118  IN PCWSTR Label,
122 
123 /* EOF */
NTSTATUS InstallBtrfsBootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
Definition: fsutil.c:556
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:377
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:153
IN HANDLE DstPath
Definition: fsutil.h:75
unsigned char BOOLEAN
BOOL QuickFormat
Definition: format.c:66
_In_ WDFCOLLECTION _In_ ULONG Index
DWORD ClusterSize
Definition: format.c:67
IN HANDLE IN HANDLE RootPartition
Definition: fsutil.h:75
NTSTATUS FormatPartition(IN PPARTENTRY PartEntry, IN PCWSTR FileSystemName, IN FMIFS_MEDIA_FLAG MediaFlag, IN PCWSTR Label, IN BOOLEAN QuickFormat, IN ULONG ClusterSize, IN PFMIFSCALLBACK Callback)
Definition: fsutil.c:713
NTSTATUS ChkdskPartition(IN PPARTENTRY PartEntry, IN BOOLEAN FixErrors, IN BOOLEAN Verbose, IN BOOLEAN CheckOnlyIfDirty, IN BOOLEAN ScanDrive, IN PFMIFSCALLBACK Callback)
Definition: fsutil.c:668
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:258
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:456
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:347
#define OUT
Definition: typedefs.h:40
NTSTATUS InstallFat32BootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
Definition: fsutil.c:435
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:215
unsigned int ULONG
Definition: retypes.h:1
PWCHAR Label
Definition: format.c:70
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:282