mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 09:06:22 +00:00
[FORMATTING] Fix tab/space mess by replacing them by 4 spaces. No code change
svn path=/trunk/; revision=23970
This commit is contained in:
parent
1b337150cc
commit
8c22629a9e
4 changed files with 156 additions and 158 deletions
|
@ -16,8 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id$
|
/* COPYRIGHT: See COPYING in the top level directory
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS text-mode setup
|
* PROJECT: ReactOS text-mode setup
|
||||||
* FILE: subsys/system/usetup/format.c
|
* FILE: subsys/system/usetup/format.c
|
||||||
* PURPOSE: Filesystem format support functions
|
* PURPOSE: Filesystem format support functions
|
||||||
|
@ -35,14 +34,12 @@ PPROGRESSBAR ProgressBar = NULL;
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
|
static BOOLEAN NTAPI
|
||||||
BOOLEAN NTAPI
|
FormatCallback(
|
||||||
FormatCallback (CALLBACKCOMMAND Command,
|
IN CALLBACKCOMMAND Command,
|
||||||
ULONG Modifier,
|
IN ULONG Modifier,
|
||||||
PVOID Argument)
|
IN PVOID Argument)
|
||||||
{
|
{
|
||||||
// DPRINT1 ("FormatCallback() called\n");
|
|
||||||
|
|
||||||
switch (Command)
|
switch (Command)
|
||||||
{
|
{
|
||||||
case PROGRESS:
|
case PROGRESS:
|
||||||
|
@ -50,72 +47,66 @@ FormatCallback (CALLBACKCOMMAND Command,
|
||||||
PULONG Percent;
|
PULONG Percent;
|
||||||
|
|
||||||
Percent = (PULONG)Argument;
|
Percent = (PULONG)Argument;
|
||||||
DPRINT ("%lu percent completed\n", *Percent);
|
DPRINT("%lu percent completed\n", *Percent);
|
||||||
|
|
||||||
ProgressSetStep (ProgressBar, *Percent);
|
ProgressSetStep(ProgressBar, *Percent);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// case OUTPUT:
|
/*case OUTPUT:
|
||||||
// {
|
{
|
||||||
// PTEXTOUTPUT Output;
|
PTEXTOUTPUT Output;
|
||||||
// output = (PTEXTOUTPUT) Argument;
|
output = (PTEXTOUTPUT) Argument;
|
||||||
// fprintf(stdout, "%s", output->Output);
|
DPRINT("%s\n", output->Output);
|
||||||
// }
|
break;
|
||||||
// break;
|
}*/
|
||||||
|
|
||||||
case DONE:
|
case DONE:
|
||||||
{
|
{
|
||||||
DPRINT ("Done\n");
|
/*PBOOLEAN Success;*/
|
||||||
// PBOOLEAN Success;
|
DPRINT("Done\n");
|
||||||
// status = (PBOOLEAN) Argument;
|
|
||||||
// if ( *status == FALSE )
|
/*Success = (PBOOLEAN)Argument;
|
||||||
// {
|
if (*Success == FALSE)
|
||||||
// wprintf(L"FormatEx was unable to complete successfully.\n\n");
|
{
|
||||||
// Error = TRUE;
|
DPRINT("FormatEx was unable to complete successfully.\n\n");
|
||||||
// }
|
}*/
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DPRINT ("Unknown callback %lu\n", (ULONG)Command);
|
DPRINT("Unknown callback %lu\n", (ULONG)Command);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DPRINT1 ("FormatCallback() done\n");
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
FormatPartition (PUNICODE_STRING DriveRoot)
|
FormatPartition(
|
||||||
|
IN PUNICODE_STRING DriveRoot)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
SHORT xScreen;
|
|
||||||
SHORT yScreen;
|
|
||||||
|
|
||||||
CONSOLE_GetScreenSize(&xScreen, &yScreen);
|
ProgressBar = CreateProgressBar(6,
|
||||||
|
|
||||||
ProgressBar = CreateProgressBar (6,
|
|
||||||
yScreen - 14,
|
yScreen - 14,
|
||||||
xScreen - 7,
|
xScreen - 7,
|
||||||
yScreen - 10,
|
yScreen - 10,
|
||||||
"Setup is formatting your disk");
|
"Setup is formatting your disk");
|
||||||
|
|
||||||
ProgressSetStepCount (ProgressBar, 100);
|
ProgressSetStepCount(ProgressBar, 100);
|
||||||
|
|
||||||
Status = VfatFormat (DriveRoot,
|
Status = VfatFormat(DriveRoot,
|
||||||
0, /* MediaFlag */
|
FMIFS_HARDDISK, /* MediaFlag */
|
||||||
NULL, /* Label */
|
NULL, /* Label */
|
||||||
TRUE, /* QuickFormat */
|
TRUE, /* QuickFormat */
|
||||||
0, /* ClusterSize */
|
0, /* ClusterSize */
|
||||||
(PFMIFSCALLBACK)FormatCallback); /* Callback */
|
FormatCallback); /* Callback */
|
||||||
|
|
||||||
DestroyProgressBar (ProgressBar);
|
DestroyProgressBar(ProgressBar);
|
||||||
ProgressBar = NULL;
|
ProgressBar = NULL;
|
||||||
|
|
||||||
DPRINT ("VfatFormat() status 0x%.08x\n", Status);
|
DPRINT("FormatEx() finished with status 0x%08lx\n", Status);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
#define __FORMAT_H__
|
#define __FORMAT_H__
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
FormatPartition(PUNICODE_STRING DriveRoot);
|
FormatPartition(
|
||||||
|
IN PUNICODE_STRING DriveRoot);
|
||||||
|
|
||||||
#endif /* __FILESUP_H__ */
|
#endif /* __FILESUP_H__ */
|
||||||
|
|
||||||
|
|
|
@ -33,14 +33,15 @@
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
PFILE_SYSTEM_LIST
|
PFILE_SYSTEM_LIST
|
||||||
CreateFileSystemList (SHORT Left,
|
CreateFileSystemList(
|
||||||
SHORT Top,
|
IN SHORT Left,
|
||||||
BOOLEAN ForceFormat,
|
IN SHORT Top,
|
||||||
FILE_SYSTEM ForceFileSystem)
|
IN BOOLEAN ForceFormat,
|
||||||
|
IN FILE_SYSTEM ForceFileSystem)
|
||||||
{
|
{
|
||||||
PFILE_SYSTEM_LIST List;
|
PFILE_SYSTEM_LIST List;
|
||||||
|
|
||||||
List = (PFILE_SYSTEM_LIST)RtlAllocateHeap (ProcessHeap, 0, sizeof(FILE_SYSTEM_LIST));
|
List = (PFILE_SYSTEM_LIST)RtlAllocateHeap(ProcessHeap, 0, sizeof(FILE_SYSTEM_LIST));
|
||||||
if (List == NULL)
|
if (List == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -62,16 +63,16 @@ CreateFileSystemList (SHORT Left,
|
||||||
return List;
|
return List;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
DestroyFileSystemList (PFILE_SYSTEM_LIST List)
|
DestroyFileSystemList(
|
||||||
|
IN PFILE_SYSTEM_LIST List)
|
||||||
{
|
{
|
||||||
RtlFreeHeap (ProcessHeap, 0, List);
|
RtlFreeHeap(ProcessHeap, 0, List);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
DrawFileSystemList (PFILE_SYSTEM_LIST List)
|
DrawFileSystemList(
|
||||||
|
IN PFILE_SYSTEM_LIST List)
|
||||||
{
|
{
|
||||||
COORD coPos;
|
COORD coPos;
|
||||||
ULONG Written;
|
ULONG Written;
|
||||||
|
@ -81,12 +82,12 @@ DrawFileSystemList (PFILE_SYSTEM_LIST List)
|
||||||
|
|
||||||
coPos.X = List->Left;
|
coPos.X = List->Left;
|
||||||
coPos.Y = List->Top + Index;
|
coPos.Y = List->Top + Index;
|
||||||
FillConsoleOutputAttribute (StdOutput,
|
FillConsoleOutputAttribute(StdOutput,
|
||||||
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||||
50,
|
50,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
FillConsoleOutputCharacterA (StdOutput,
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
' ',
|
' ',
|
||||||
50,
|
50,
|
||||||
coPos,
|
coPos,
|
||||||
|
@ -94,13 +95,13 @@ DrawFileSystemList (PFILE_SYSTEM_LIST List)
|
||||||
|
|
||||||
if (List->CurrentFileSystem == FsFat)
|
if (List->CurrentFileSystem == FsFat)
|
||||||
{
|
{
|
||||||
CONSOLE_SetInvertedTextXY (List->Left,
|
CONSOLE_SetInvertedTextXY(List->Left,
|
||||||
List->Top + Index,
|
List->Top + Index,
|
||||||
" Format partition as FAT file system ");
|
" Format partition as FAT file system ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CONSOLE_SetTextXY (List->Left,
|
CONSOLE_SetTextXY(List->Left,
|
||||||
List->Top + Index,
|
List->Top + Index,
|
||||||
" Format partition as FAT file system ");
|
" Format partition as FAT file system ");
|
||||||
}
|
}
|
||||||
|
@ -110,12 +111,12 @@ DrawFileSystemList (PFILE_SYSTEM_LIST List)
|
||||||
{
|
{
|
||||||
coPos.X = List->Left;
|
coPos.X = List->Left;
|
||||||
coPos.Y = List->Top + Index;
|
coPos.Y = List->Top + Index;
|
||||||
FillConsoleOutputAttribute (StdOutput,
|
FillConsoleOutputAttribute(StdOutput,
|
||||||
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||||
50,
|
50,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
FillConsoleOutputCharacterA (StdOutput,
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
' ',
|
' ',
|
||||||
50,
|
50,
|
||||||
coPos,
|
coPos,
|
||||||
|
@ -123,38 +124,38 @@ DrawFileSystemList (PFILE_SYSTEM_LIST List)
|
||||||
|
|
||||||
if (List->CurrentFileSystem == FsKeep)
|
if (List->CurrentFileSystem == FsKeep)
|
||||||
{
|
{
|
||||||
CONSOLE_SetInvertedTextXY (List->Left,
|
CONSOLE_SetInvertedTextXY(List->Left,
|
||||||
List->Top + Index,
|
List->Top + Index,
|
||||||
" Keep current file system (no changes) ");
|
" Keep current file system (no changes) ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CONSOLE_SetTextXY (List->Left,
|
CONSOLE_SetTextXY(List->Left,
|
||||||
List->Top + Index,
|
List->Top + Index,
|
||||||
" Keep current file system (no changes) ");
|
" Keep current file system (no changes) ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ScrollDownFileSystemList (PFILE_SYSTEM_LIST List)
|
ScrollDownFileSystemList(
|
||||||
|
IN PFILE_SYSTEM_LIST List)
|
||||||
{
|
{
|
||||||
if ((ULONG) List->CurrentFileSystem < List->FileSystemCount - 1)
|
if ((ULONG)List->CurrentFileSystem < List->FileSystemCount - 1)
|
||||||
{
|
{
|
||||||
List->CurrentFileSystem++;
|
List->CurrentFileSystem++;
|
||||||
DrawFileSystemList (List);
|
DrawFileSystemList(List);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ScrollUpFileSystemList (PFILE_SYSTEM_LIST List)
|
ScrollUpFileSystemList(
|
||||||
|
IN PFILE_SYSTEM_LIST List)
|
||||||
{
|
{
|
||||||
if ((ULONG) List->CurrentFileSystem > 0)
|
if ((ULONG)List->CurrentFileSystem > 0)
|
||||||
{
|
{
|
||||||
List->CurrentFileSystem--;
|
List->CurrentFileSystem--;
|
||||||
DrawFileSystemList (List);
|
DrawFileSystemList(List);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,22 +45,27 @@ typedef struct _FILE_SYSTEM_LIST
|
||||||
|
|
||||||
|
|
||||||
PFILE_SYSTEM_LIST
|
PFILE_SYSTEM_LIST
|
||||||
CreateFileSystemList (SHORT Left,
|
CreateFileSystemList(
|
||||||
SHORT Top,
|
IN SHORT Left,
|
||||||
BOOLEAN ForceFormat,
|
IN SHORT Top,
|
||||||
FILE_SYSTEM ForceFileSystem);
|
IN BOOLEAN ForceFormat,
|
||||||
|
IN FILE_SYSTEM ForceFileSystem);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
DestroyFileSystemList (PFILE_SYSTEM_LIST List);
|
DestroyFileSystemList(
|
||||||
|
IN PFILE_SYSTEM_LIST List);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
DrawFileSystemList (PFILE_SYSTEM_LIST List);
|
DrawFileSystemList(
|
||||||
|
IN PFILE_SYSTEM_LIST List);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ScrollDownFileSystemList (PFILE_SYSTEM_LIST List);
|
ScrollDownFileSystemList(
|
||||||
|
IN PFILE_SYSTEM_LIST List);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ScrollUpFileSystemList (PFILE_SYSTEM_LIST List);
|
ScrollUpFileSystemList(
|
||||||
|
IN PFILE_SYSTEM_LIST List);
|
||||||
|
|
||||||
#endif /* __FSLIST_H__ */
|
#endif /* __FSLIST_H__ */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue