ReactOS 0.4.15-dev-8614-gbc76250
fmtchk.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS text-mode setup
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Filesystem Format and ChkDsk support functions
5 * COPYRIGHT: Copyright 2003 Casper S. Hornstrup <chorns@users.sourceforge.net>
6 * Copyright 2006 Hervé Poussineau <hpoussin@reactos.org>
7 * Copyright 2024 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
8 */
9
10/* INCLUDES ******************************************************************/
11
12#include "usetup.h"
13
14#define NDEBUG
15#include <debug.h>
16
18
19/* FORMAT FUNCTIONS **********************************************************/
20
21static
26 _In_ ULONG Modifier,
27 _In_ PVOID Argument)
28{
29 switch (Command)
30 {
31 case PROGRESS:
32 {
33 PULONG Percent = (PULONG)Argument;
34 DPRINT("%lu percent completed\n", *Percent);
36 break;
37 }
38
39#if 0
40 case OUTPUT:
41 {
42 PTEXTOUTPUT output = (PTEXTOUTPUT)Argument;
43 DPRINT("%s\n", output->Output);
44 break;
45 }
46#endif
47
48 case DONE:
49 {
50#if 0
51 PBOOLEAN Success = (PBOOLEAN)Argument;
52 if (*Success == FALSE)
53 {
54 DPRINT("FormatEx was unable to complete successfully.\n\n");
55 }
56#endif
57 DPRINT("Done\n");
58 break;
59 }
60
61 default:
62 DPRINT("Unknown callback %lu\n", (ULONG)Command);
63 break;
64 }
65
66 return TRUE;
67}
68
69VOID
72 _In_ PFILE_SYSTEM_ITEM SelectedFileSystem)
73{
74 ASSERT(SelectedFileSystem && SelectedFileSystem->FileSystem);
75
76 // TODO: Think about which values could be defaulted...
77 FmtInfo->FileSystemName = SelectedFileSystem->FileSystem;
78 FmtInfo->MediaFlag = FMIFS_HARDDISK;
79 FmtInfo->Label = NULL;
80 FmtInfo->QuickFormat = SelectedFileSystem->QuickFormat;
81 FmtInfo->ClusterSize = 0;
82 FmtInfo->Callback = FormatCallback;
83
85 yScreen - 14,
86 xScreen - 7,
87 yScreen - 10,
88 10,
89 24,
90 TRUE,
92
94}
95
96VOID
99{
102
103 DPRINT("FormatPartition() finished with status 0x%08lx\n", Status);
104}
105
106/* CHKDSK FUNCTIONS **********************************************************/
107
108static
110NTAPI
113 _In_ ULONG Modifier,
114 _In_ PVOID Argument)
115{
116 switch (Command)
117 {
118 default:
119 DPRINT("Unknown callback %lu\n", (ULONG)Command);
120 break;
121 }
122
123 return TRUE;
124}
125
126VOID
129{
130 // TODO: Think about which values could be defaulted...
131 ChkInfo->FixErrors = TRUE;
132 ChkInfo->Verbose = FALSE;
133 ChkInfo->CheckOnlyIfDirty = TRUE;
134 ChkInfo->ScanDrive = FALSE;
135 ChkInfo->Callback = ChkdskCallback;
136
138 yScreen - 14,
139 xScreen - 7,
140 yScreen - 10,
141 10,
142 24,
143 TRUE,
145
147}
148
149VOID
152{
155
156 DPRINT("ChkdskPartition() finished with status 0x%08lx\n", Status);
157}
158
159/* EOF */
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
VOID ProgressSetStep(IN PPROGRESSBAR Bar, IN ULONG Step)
Definition: progress.c:368
VOID ProgressSetStepCount(IN PPROGRESSBAR Bar, IN ULONG StepCount)
Definition: progress.c:347
PPROGRESSBAR CreateProgressBar(IN SHORT Left, IN SHORT Top, IN SHORT Right, IN SHORT Bottom, IN SHORT TextTop, IN SHORT TextRight, IN BOOLEAN DoubleEdge, IN PCSTR DescriptionText OPTIONAL)
Definition: progress.c:317
VOID DestroyProgressBar(IN OUT PPROGRESSBAR Bar)
Definition: progress.c:339
SHORT yScreen
Definition: consup.c:40
SHORT xScreen
Definition: consup.c:39
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
@ Success
Definition: eventcreate.c:712
@ FMIFS_HARDDISK
Definition: fmifs.h:51
struct TEXTOUTPUT * PTEXTOUTPUT
CALLBACKCOMMAND
Definition: fmifs.h:67
@ OUTPUT
Definition: fmifs.h:82
@ PROGRESS
Definition: fmifs.h:68
VOID EndCheck(_In_ NTSTATUS Status)
Definition: fmtchk.c:150
VOID StartCheck(_Inout_ PCHECK_VOLUME_INFO ChkInfo)
Definition: fmtchk.c:127
VOID StartFormat(_Inout_ PFORMAT_VOLUME_INFO FmtInfo, _In_ PFILE_SYSTEM_ITEM SelectedFileSystem)
Definition: fmtchk.c:70
static BOOLEAN NTAPI FormatCallback(_In_ CALLBACKCOMMAND Command, _In_ ULONG Modifier, _In_ PVOID Argument)
Definition: fmtchk.c:24
static PPROGRESSBAR ProgressBar
Definition: fmtchk.c:17
VOID EndFormat(_In_ NTSTATUS Status)
Definition: fmtchk.c:97
Status
Definition: gdiplustypes.h:25
#define ASSERT(a)
Definition: mode.c:44
#define _Inout_
Definition: ms_sal.h:378
#define _In_
Definition: ms_sal.h:308
#define DONE
Definition: rnr20lib.h:14
#define DPRINT
Definition: sndvol32.h:73
Definition: shell.h:41
PCHAR Output
Definition: fmifs.h:33
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG
Definition: typedefs.h:59
PCSTR MUIGetString(ULONG Number)
Definition: mui.c:251
#define STRING_FORMATTINGPART
Definition: mui.h:168
#define STRING_CHECKINGDISK
Definition: mui.h:169
PFMIFSCALLBACK ChkdskCallback
Definition: vfatlib.c:43