mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 06:45:40 +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
|
||||
* 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
|
||||
* FILE: subsys/system/usetup/format.c
|
||||
* PURPOSE: Filesystem format support functions
|
||||
|
@ -35,89 +34,81 @@ PPROGRESSBAR ProgressBar = NULL;
|
|||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
|
||||
BOOLEAN NTAPI
|
||||
FormatCallback (CALLBACKCOMMAND Command,
|
||||
ULONG Modifier,
|
||||
PVOID Argument)
|
||||
static BOOLEAN NTAPI
|
||||
FormatCallback(
|
||||
IN CALLBACKCOMMAND Command,
|
||||
IN ULONG Modifier,
|
||||
IN PVOID Argument)
|
||||
{
|
||||
// DPRINT1 ("FormatCallback() called\n");
|
||||
|
||||
switch (Command)
|
||||
switch (Command)
|
||||
{
|
||||
case PROGRESS:
|
||||
{
|
||||
PULONG Percent;
|
||||
case PROGRESS:
|
||||
{
|
||||
PULONG Percent;
|
||||
|
||||
Percent = (PULONG)Argument;
|
||||
DPRINT ("%lu percent completed\n", *Percent);
|
||||
Percent = (PULONG)Argument;
|
||||
DPRINT("%lu percent completed\n", *Percent);
|
||||
|
||||
ProgressSetStep (ProgressBar, *Percent);
|
||||
}
|
||||
break;
|
||||
ProgressSetStep(ProgressBar, *Percent);
|
||||
break;
|
||||
}
|
||||
|
||||
// case OUTPUT:
|
||||
// {
|
||||
// PTEXTOUTPUT Output;
|
||||
// output = (PTEXTOUTPUT) Argument;
|
||||
// fprintf(stdout, "%s", output->Output);
|
||||
// }
|
||||
// break;
|
||||
/*case OUTPUT:
|
||||
{
|
||||
PTEXTOUTPUT Output;
|
||||
output = (PTEXTOUTPUT) Argument;
|
||||
DPRINT("%s\n", output->Output);
|
||||
break;
|
||||
}*/
|
||||
|
||||
case DONE:
|
||||
{
|
||||
DPRINT ("Done\n");
|
||||
// PBOOLEAN Success;
|
||||
// status = (PBOOLEAN) Argument;
|
||||
// if ( *status == FALSE )
|
||||
// {
|
||||
// wprintf(L"FormatEx was unable to complete successfully.\n\n");
|
||||
// Error = TRUE;
|
||||
// }
|
||||
}
|
||||
break;
|
||||
case DONE:
|
||||
{
|
||||
/*PBOOLEAN Success;*/
|
||||
DPRINT("Done\n");
|
||||
|
||||
default:
|
||||
DPRINT ("Unknown callback %lu\n", (ULONG)Command);
|
||||
break;
|
||||
/*Success = (PBOOLEAN)Argument;
|
||||
if (*Success == FALSE)
|
||||
{
|
||||
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
|
||||
FormatPartition (PUNICODE_STRING DriveRoot)
|
||||
FormatPartition(
|
||||
IN PUNICODE_STRING DriveRoot)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
SHORT xScreen;
|
||||
SHORT yScreen;
|
||||
NTSTATUS Status;
|
||||
|
||||
CONSOLE_GetScreenSize(&xScreen, &yScreen);
|
||||
ProgressBar = CreateProgressBar(6,
|
||||
yScreen - 14,
|
||||
xScreen - 7,
|
||||
yScreen - 10,
|
||||
"Setup is formatting your disk");
|
||||
|
||||
ProgressBar = CreateProgressBar (6,
|
||||
yScreen - 14,
|
||||
xScreen - 7,
|
||||
yScreen - 10,
|
||||
"Setup is formatting your disk");
|
||||
ProgressSetStepCount(ProgressBar, 100);
|
||||
|
||||
ProgressSetStepCount (ProgressBar, 100);
|
||||
Status = VfatFormat(DriveRoot,
|
||||
FMIFS_HARDDISK, /* MediaFlag */
|
||||
NULL, /* Label */
|
||||
TRUE, /* QuickFormat */
|
||||
0, /* ClusterSize */
|
||||
FormatCallback); /* Callback */
|
||||
|
||||
Status = VfatFormat (DriveRoot,
|
||||
0, /* MediaFlag */
|
||||
NULL, /* Label */
|
||||
TRUE, /* QuickFormat */
|
||||
0, /* ClusterSize */
|
||||
(PFMIFSCALLBACK)FormatCallback); /* Callback */
|
||||
DestroyProgressBar(ProgressBar);
|
||||
ProgressBar = NULL;
|
||||
|
||||
DestroyProgressBar (ProgressBar);
|
||||
ProgressBar = NULL;
|
||||
DPRINT("FormatEx() finished with status 0x%08lx\n", Status);
|
||||
|
||||
DPRINT ("VfatFormat() status 0x%.08x\n", Status);
|
||||
|
||||
return Status;
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
#define __FORMAT_H__
|
||||
|
||||
NTSTATUS
|
||||
FormatPartition(PUNICODE_STRING DriveRoot);
|
||||
FormatPartition(
|
||||
IN PUNICODE_STRING DriveRoot);
|
||||
|
||||
#endif /* __FILESUP_H__ */
|
||||
|
||||
|
|
|
@ -33,128 +33,129 @@
|
|||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
PFILE_SYSTEM_LIST
|
||||
CreateFileSystemList (SHORT Left,
|
||||
SHORT Top,
|
||||
BOOLEAN ForceFormat,
|
||||
FILE_SYSTEM ForceFileSystem)
|
||||
CreateFileSystemList(
|
||||
IN SHORT Left,
|
||||
IN SHORT Top,
|
||||
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));
|
||||
if (List == NULL)
|
||||
return NULL;
|
||||
List = (PFILE_SYSTEM_LIST)RtlAllocateHeap(ProcessHeap, 0, sizeof(FILE_SYSTEM_LIST));
|
||||
if (List == NULL)
|
||||
return NULL;
|
||||
|
||||
List->Left = Left;
|
||||
List->Top = Top;
|
||||
List->Left = Left;
|
||||
List->Top = Top;
|
||||
|
||||
List->ForceFormat = ForceFormat;
|
||||
List->FileSystemCount = 1;
|
||||
if (ForceFormat)
|
||||
List->ForceFormat = ForceFormat;
|
||||
List->FileSystemCount = 1;
|
||||
if (ForceFormat)
|
||||
{
|
||||
List->CurrentFileSystem = ForceFileSystem;
|
||||
List->CurrentFileSystem = ForceFileSystem;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
List->FileSystemCount++;
|
||||
List->CurrentFileSystem = FsKeep;
|
||||
List->FileSystemCount++;
|
||||
List->CurrentFileSystem = FsKeep;
|
||||
}
|
||||
|
||||
return List;
|
||||
return List;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
DestroyFileSystemList (PFILE_SYSTEM_LIST List)
|
||||
DestroyFileSystemList(
|
||||
IN PFILE_SYSTEM_LIST List)
|
||||
{
|
||||
RtlFreeHeap (ProcessHeap, 0, List);
|
||||
RtlFreeHeap(ProcessHeap, 0, List);
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
DrawFileSystemList (PFILE_SYSTEM_LIST List)
|
||||
DrawFileSystemList(
|
||||
IN PFILE_SYSTEM_LIST List)
|
||||
{
|
||||
COORD coPos;
|
||||
ULONG Written;
|
||||
ULONG Index;
|
||||
COORD coPos;
|
||||
ULONG Written;
|
||||
ULONG Index;
|
||||
|
||||
Index = 0;
|
||||
Index = 0;
|
||||
|
||||
coPos.X = List->Left;
|
||||
coPos.Y = List->Top + Index;
|
||||
FillConsoleOutputAttribute (StdOutput,
|
||||
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||
50,
|
||||
coPos,
|
||||
&Written);
|
||||
FillConsoleOutputCharacterA (StdOutput,
|
||||
' ',
|
||||
50,
|
||||
coPos,
|
||||
&Written);
|
||||
coPos.X = List->Left;
|
||||
coPos.Y = List->Top + Index;
|
||||
FillConsoleOutputAttribute(StdOutput,
|
||||
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||
50,
|
||||
coPos,
|
||||
&Written);
|
||||
FillConsoleOutputCharacterA(StdOutput,
|
||||
' ',
|
||||
50,
|
||||
coPos,
|
||||
&Written);
|
||||
|
||||
if (List->CurrentFileSystem == FsFat)
|
||||
if (List->CurrentFileSystem == FsFat)
|
||||
{
|
||||
CONSOLE_SetInvertedTextXY (List->Left,
|
||||
List->Top + Index,
|
||||
" Format partition as FAT file system ");
|
||||
CONSOLE_SetInvertedTextXY(List->Left,
|
||||
List->Top + Index,
|
||||
" Format partition as FAT file system ");
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
CONSOLE_SetTextXY (List->Left,
|
||||
List->Top + Index,
|
||||
" Format partition as FAT file system ");
|
||||
CONSOLE_SetTextXY(List->Left,
|
||||
List->Top + Index,
|
||||
" Format partition as FAT file system ");
|
||||
}
|
||||
Index++;
|
||||
Index++;
|
||||
|
||||
if (List->ForceFormat == FALSE)
|
||||
if (List->ForceFormat == FALSE)
|
||||
{
|
||||
coPos.X = List->Left;
|
||||
coPos.Y = List->Top + Index;
|
||||
FillConsoleOutputAttribute (StdOutput,
|
||||
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||
50,
|
||||
coPos,
|
||||
&Written);
|
||||
FillConsoleOutputCharacterA (StdOutput,
|
||||
' ',
|
||||
50,
|
||||
coPos,
|
||||
&Written);
|
||||
coPos.X = List->Left;
|
||||
coPos.Y = List->Top + Index;
|
||||
FillConsoleOutputAttribute(StdOutput,
|
||||
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||
50,
|
||||
coPos,
|
||||
&Written);
|
||||
FillConsoleOutputCharacterA(StdOutput,
|
||||
' ',
|
||||
50,
|
||||
coPos,
|
||||
&Written);
|
||||
|
||||
if (List->CurrentFileSystem == FsKeep)
|
||||
{
|
||||
CONSOLE_SetInvertedTextXY (List->Left,
|
||||
List->Top + Index,
|
||||
" Keep current file system (no changes) ");
|
||||
}
|
||||
else
|
||||
{
|
||||
CONSOLE_SetTextXY (List->Left,
|
||||
List->Top + Index,
|
||||
" Keep current file system (no changes) ");
|
||||
}
|
||||
if (List->CurrentFileSystem == FsKeep)
|
||||
{
|
||||
CONSOLE_SetInvertedTextXY(List->Left,
|
||||
List->Top + Index,
|
||||
" Keep current file system (no changes) ");
|
||||
}
|
||||
else
|
||||
{
|
||||
CONSOLE_SetTextXY(List->Left,
|
||||
List->Top + Index,
|
||||
" Keep current file system (no changes) ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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++;
|
||||
DrawFileSystemList (List);
|
||||
List->CurrentFileSystem++;
|
||||
DrawFileSystemList(List);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ScrollUpFileSystemList (PFILE_SYSTEM_LIST List)
|
||||
ScrollUpFileSystemList(
|
||||
IN PFILE_SYSTEM_LIST List)
|
||||
{
|
||||
if ((ULONG) List->CurrentFileSystem > 0)
|
||||
if ((ULONG)List->CurrentFileSystem > 0)
|
||||
{
|
||||
List->CurrentFileSystem--;
|
||||
DrawFileSystemList (List);
|
||||
List->CurrentFileSystem--;
|
||||
DrawFileSystemList(List);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,22 +45,27 @@ typedef struct _FILE_SYSTEM_LIST
|
|||
|
||||
|
||||
PFILE_SYSTEM_LIST
|
||||
CreateFileSystemList (SHORT Left,
|
||||
SHORT Top,
|
||||
BOOLEAN ForceFormat,
|
||||
FILE_SYSTEM ForceFileSystem);
|
||||
CreateFileSystemList(
|
||||
IN SHORT Left,
|
||||
IN SHORT Top,
|
||||
IN BOOLEAN ForceFormat,
|
||||
IN FILE_SYSTEM ForceFileSystem);
|
||||
|
||||
VOID
|
||||
DestroyFileSystemList (PFILE_SYSTEM_LIST List);
|
||||
DestroyFileSystemList(
|
||||
IN PFILE_SYSTEM_LIST List);
|
||||
|
||||
VOID
|
||||
DrawFileSystemList (PFILE_SYSTEM_LIST List);
|
||||
DrawFileSystemList(
|
||||
IN PFILE_SYSTEM_LIST List);
|
||||
|
||||
VOID
|
||||
ScrollDownFileSystemList (PFILE_SYSTEM_LIST List);
|
||||
ScrollDownFileSystemList(
|
||||
IN PFILE_SYSTEM_LIST List);
|
||||
|
||||
VOID
|
||||
ScrollUpFileSystemList (PFILE_SYSTEM_LIST List);
|
||||
ScrollUpFileSystemList(
|
||||
IN PFILE_SYSTEM_LIST List);
|
||||
|
||||
#endif /* __FSLIST_H__ */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue