ReactOS  0.4.15-dev-2961-gecb0c09
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 
38 static
39 BOOLEAN
40 NTAPI
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 */
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
NTSTATUS DoFormat(IN PPARTENTRY PartEntry, IN PCWSTR FileSystemName, IN BOOLEAN QuickFormat)
Definition: format.c:92
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
SHORT xScreen
Definition: consup.c:39
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
Definition: fmifs.h:68
VOID ProgressSetStep(IN PPROGRESSBAR Bar, IN ULONG Step)
Definition: progress.c:368
VOID DestroyProgressBar(IN OUT PPROGRESSBAR Bar)
Definition: progress.c:339
Definition: shell.h:41
CALLBACKCOMMAND
Definition: fmifs.h:66
struct TEXTOUTPUT * PTEXTOUTPUT
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
VOID ProgressSetStepCount(IN PPROGRESSBAR Bar, IN ULONG StepCount)
Definition: progress.c:347
unsigned char BOOLEAN
BOOL QuickFormat
Definition: format.c:66
PCSTR MUIGetString(ULONG Number)
Definition: mui.c:230
Status
Definition: gdiplustypes.h:24
#define STRING_FORMATTINGDISK
Definition: mui.h:146
char * PBOOLEAN
Definition: retypes.h:11
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:715
SHORT yScreen
Definition: consup.c:40
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
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
static BOOLEAN NTAPI FormatCallback(IN CALLBACKCOMMAND Command, IN ULONG Modifier, IN PVOID Argument)
Definition: format.c:41
static PPROGRESSBAR FormatProgressBar
Definition: format.c:34
unsigned int ULONG
Definition: retypes.h:1
#define DONE
Definition: rnr20lib.h:14
Definition: fmifs.h:82
#define DPRINT
Definition: sndvol32.h:71