ReactOS 0.4.15-dev-7942-gd23573b
format.c
Go to the documentation of this file.
1/*
2 * ReactOS kernel
3 * Copyright (C) 2003 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19/*
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS text-mode setup
22 * FILE: base/setup/usetup/format.c
23 * PURPOSE: Filesystem format support functions
24 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
25 */
26
27/* INCLUDES *****************************************************************/
28
29#include "usetup.h"
30
31#define NDEBUG
32#include <debug.h>
33
35
36/* FUNCTIONS ****************************************************************/
37
38static
43 IN ULONG Modifier,
44 IN PVOID Argument)
45{
46 switch (Command)
47 {
48 case PROGRESS:
49 {
50 PULONG Percent;
51
52 Percent = (PULONG)Argument;
53 DPRINT("%lu percent completed\n", *Percent);
54
56 break;
57 }
58
59#if 0
60 case OUTPUT:
61 {
63 output = (PTEXTOUTPUT) Argument;
64 DPRINT("%s\n", output->Output);
65 break;
66 }
67#endif
68
69 case DONE:
70 {
71 // PBOOLEAN Success;
72 DPRINT("Done\n");
73#if 0
74 Success = (PBOOLEAN)Argument;
75 if (*Success == FALSE)
76 {
77 DPRINT("FormatEx was unable to complete successfully.\n\n");
78 }
79#endif
80 break;
81 }
82
83 default:
84 DPRINT("Unknown callback %lu\n", (ULONG)Command);
85 break;
86 }
87
88 return TRUE;
89}
90
93 IN PPARTENTRY PartEntry,
94 IN PCWSTR FileSystemName,
96{
98
100 yScreen - 14,
101 xScreen - 7,
102 yScreen - 10,
103 10,
104 24,
105 TRUE,
107
109
110 // TODO: Think about which values could be defaulted...
111 Status = FormatPartition(PartEntry,
112 FileSystemName,
113 FMIFS_HARDDISK, /* MediaFlag */
114 NULL, /* Label */
115 QuickFormat, /* QuickFormat */
116 0, /* ClusterSize */
117 FormatCallback); /* Callback */
118
121
122 DPRINT("FormatPartition() finished with status 0x%08lx\n", Status);
123
124 return Status;
125}
126
127/* EOF */
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS DoFormat(IN PPARTENTRY PartEntry, IN PCWSTR FileSystemName, IN BOOLEAN QuickFormat)
Definition: format.c:92
static PPROGRESSBAR FormatProgressBar
Definition: format.c:34
static BOOLEAN NTAPI FormatCallback(IN CALLBACKCOMMAND Command, IN ULONG Modifier, IN PVOID Argument)
Definition: format.c:41
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
BOOL QuickFormat
Definition: format.c:66
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
Status
Definition: gdiplustypes.h:25
#define DONE
Definition: rnr20lib.h:14
@ Output
Definition: arc.h:85
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
#define DPRINT
Definition: sndvol32.h:71
Definition: shell.h:41
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
PCSTR MUIGetString(ULONG Number)
Definition: mui.c:251
#define STRING_FORMATTINGPART
Definition: mui.h:168