3 * Copyright (C) 2003 ReactOS Team
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.
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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS text-mode setup
22 * FILE: subsys/system/usetup/format.c
23 * PURPOSE: Filesystem format support functions
24 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
27 /* INCLUDES *****************************************************************/
34 PPROGRESSBAR ProgressBar
= NULL
;
36 /* FUNCTIONS ****************************************************************/
40 FormatCallback (CALLBACKCOMMAND Command
,
44 // DPRINT1 ("FormatCallback() called\n");
52 Percent
= (PULONG
)Argument
;
53 DPRINT ("%lu percent completed\n", *Percent
);
55 ProgressSetStep (ProgressBar
, *Percent
);
61 // PTEXTOUTPUT Output;
62 // output = (PTEXTOUTPUT) Argument;
63 // fprintf(stdout, "%s", output->Output);
71 // status = (PBOOLEAN) Argument;
72 // if ( *status == FALSE )
74 // wprintf(L"FormatEx was unable to complete successfully.\n\n");
81 DPRINT ("Unknown callback %lu\n", (ULONG
)Command
);
85 // DPRINT1 ("FormatCallback() done\n");
92 FormatPartition (PUNICODE_STRING DriveRoot
)
98 GetScreenSize(&xScreen
, &yScreen
);
100 ProgressBar
= CreateProgressBar (6,
104 "Setup is formatting your disk");
106 ProgressSetStepCount (ProgressBar
, 100);
110 Status
= VfatFormat (DriveRoot
,
113 TRUE
, /* QuickFormat */
115 (PFMIFSCALLBACK
)FormatCallback
); /* Callback */
119 DestroyProgressBar (ProgressBar
);
122 DPRINT ("VfatFormat() status 0x%.08x\n", Status
);