ReactOS 0.4.15-dev-5666-gc548b97
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
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,
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#define NTFS_BOOTSECTOR_SIZE (16 * SECTORSIZE)
72
73typedef NTSTATUS
74(/*NTAPI*/ *PFS_INSTALL_BOOTCODE)(
75 IN PCWSTR SrcPath, // Bootsector source file (on the installation medium)
76 IN HANDLE DstPath, // Where to save the bootsector built from the source + partition information
77 IN HANDLE RootPartition); // Partition holding the (old) bootsector data information
78
81 IN PCWSTR SrcPath,
84
85#define InstallFat12BootCode InstallFatBootCode
86#define InstallFat16BootCode InstallFatBootCode
87
90 IN PCWSTR SrcPath,
93
96 IN PCWSTR SrcPath,
99
102 IN PCWSTR SrcPath,
105
106
107//
108// Formatting routines
109//
110
113 IN PPARTENTRY PartEntry,
116 IN BOOLEAN CheckOnlyIfDirty,
117 IN BOOLEAN ScanDrive,
119
122 IN PPARTENTRY PartEntry,
123 IN PCWSTR FileSystemName,
124 IN FMIFS_MEDIA_FLAG MediaFlag,
129
130/* EOF */
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
BOOL FixErrors
Definition: chkdsk.c:69
BOOL Verbose
Definition: chkdsk.c:72
BOOL QuickFormat
Definition: format.c:66
PWCHAR Label
Definition: format.c:70
DWORD ClusterSize
Definition: format.c:67
#define NTSTATUS
Definition: precomp.h:20
FMIFS_MEDIA_FLAG
Definition: fmifs.h:38
BOOLEAN(NTAPI * PFMIFSCALLBACK)(IN CALLBACKCOMMAND Command, IN ULONG SubAction, IN PVOID ActionInfo)
Definition: fmifs.h:89
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS InstallFat32BootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
Definition: fsutil.c:464
IN HANDLE IN HANDLE RootPartition
Definition: fsutil.h:77
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:287
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:311
NTSTATUS ChkdskPartition(IN PPARTENTRY PartEntry, IN BOOLEAN FixErrors, IN BOOLEAN Verbose, IN BOOLEAN CheckOnlyIfDirty, IN BOOLEAN ScanDrive, IN PFMIFSCALLBACK Callback)
Definition: fsutil.c:757
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:376
NTSTATUS InstallBtrfsBootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
Definition: fsutil.c:585
BOOLEAN GetRegisteredFileSystems(IN ULONG Index, OUT PCWSTR *FileSystemName)
Definition: fsutil.c:182
NTSTATUS InstallNtfsBootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
Definition: fsutil.c:692
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:244
NTSTATUS InstallFatBootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
Definition: fsutil.c:406
IN HANDLE DstPath
Definition: fsutil.h:76
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:802
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
#define OUT
Definition: typedefs.h:40
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458