[FORMATTING] Fix tab/space mess by replacing them by 4 spaces. No code change

svn path=/trunk/; revision=23970
This commit is contained in:
Hervé Poussineau 2006-09-07 20:15:45 +00:00
parent 1b337150cc
commit 8c22629a9e
4 changed files with 156 additions and 158 deletions

View file

@ -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,89 +34,81 @@ 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:
{ {
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 )
// {
// wprintf(L"FormatEx was unable to complete successfully.\n\n");
// Error = TRUE;
// }
}
break;
default: /*Success = (PBOOLEAN)Argument;
DPRINT ("Unknown callback %lu\n", (ULONG)Command); if (*Success == FALSE)
break; {
DPRINT("FormatEx was unable to complete successfully.\n\n");
}*/
break;
}
default:
DPRINT("Unknown callback %lu\n", (ULONG)Command);
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,
yScreen - 14,
xScreen - 7,
yScreen - 10,
"Setup is formatting your disk");
ProgressBar = CreateProgressBar (6, ProgressSetStepCount(ProgressBar, 100);
yScreen - 14,
xScreen - 7,
yScreen - 10,
"Setup is formatting your disk");
ProgressSetStepCount (ProgressBar, 100); Status = VfatFormat(DriveRoot,
FMIFS_HARDDISK, /* MediaFlag */
NULL, /* Label */
TRUE, /* QuickFormat */
0, /* ClusterSize */
FormatCallback); /* Callback */
Status = VfatFormat (DriveRoot, DestroyProgressBar(ProgressBar);
0, /* MediaFlag */ ProgressBar = NULL;
NULL, /* Label */
TRUE, /* QuickFormat */
0, /* ClusterSize */
(PFMIFSCALLBACK)FormatCallback); /* Callback */
DestroyProgressBar (ProgressBar); DPRINT("FormatEx() finished with status 0x%08lx\n", Status);
ProgressBar = NULL;
DPRINT ("VfatFormat() status 0x%.08x\n", Status); return Status;
return Status;
} }
/* EOF */ /* EOF */

View file

@ -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__ */

View file

@ -33,128 +33,129 @@
/* 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;
List->Left = Left; List->Left = Left;
List->Top = Top; List->Top = Top;
List->ForceFormat = ForceFormat; List->ForceFormat = ForceFormat;
List->FileSystemCount = 1; List->FileSystemCount = 1;
if (ForceFormat) if (ForceFormat)
{ {
List->CurrentFileSystem = ForceFileSystem; List->CurrentFileSystem = ForceFileSystem;
} }
else else
{ {
List->FileSystemCount++; List->FileSystemCount++;
List->CurrentFileSystem = FsKeep; List->CurrentFileSystem = FsKeep;
} }
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;
ULONG Index; ULONG Index;
Index = 0; Index = 0;
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,
&Written); &Written);
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 ");
} }
Index++; Index++;
if (List->ForceFormat == FALSE) if (List->ForceFormat == FALSE)
{ {
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,
&Written); &Written);
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);
} }
} }

View file

@ -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__ */