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/fslist.c
23 * PURPOSE: Filesystem list functions
24 * PROGRAMMER: Eric Kohl
25 * Casper S. Hornstrup (chorns@users.sourceforge.net)
33 /* FUNCTIONS ****************************************************************/
36 CreateFileSystemList (SHORT Left
,
39 FILE_SYSTEM ForceFileSystem
)
41 PFILE_SYSTEM_LIST List
;
43 List
= (PFILE_SYSTEM_LIST
)RtlAllocateHeap (ProcessHeap
, 0, sizeof(FILE_SYSTEM_LIST
));
50 List
->ForceFormat
= ForceFormat
;
51 List
->FileSystemCount
= 1;
54 List
->CurrentFileSystem
= ForceFileSystem
;
58 List
->FileSystemCount
++;
59 List
->CurrentFileSystem
= FsKeep
;
67 DestroyFileSystemList (PFILE_SYSTEM_LIST List
)
69 RtlFreeHeap (ProcessHeap
, 0, List
);
74 DrawFileSystemList (PFILE_SYSTEM_LIST List
)
83 coPos
.Y
= List
->Top
+ Index
;
84 FillConsoleOutputAttribute (0x17,
88 FillConsoleOutputCharacter (' ',
93 if (List
->CurrentFileSystem
== FsFat
)
95 SetInvertedTextXY (List
->Left
,
97 " Format partition as FAT file system ");
101 SetTextXY (List
->Left
,
103 " Format partition as FAT file system ");
107 if (List
->ForceFormat
== FALSE
)
109 coPos
.X
= List
->Left
;
110 coPos
.Y
= List
->Top
+ Index
;
111 FillConsoleOutputAttribute (0x17,
115 FillConsoleOutputCharacter (' ',
120 if (List
->CurrentFileSystem
== FsKeep
)
122 SetInvertedTextXY (List
->Left
,
124 " Keep current file system (no changes) ");
128 SetTextXY (List
->Left
,
130 " Keep current file system (no changes) ");
137 ScrollDownFileSystemList (PFILE_SYSTEM_LIST List
)
139 if ((ULONG
) List
->CurrentFileSystem
< List
->FileSystemCount
- 1)
141 (ULONG
) List
->CurrentFileSystem
++;
142 DrawFileSystemList (List
);
148 ScrollUpFileSystemList (PFILE_SYSTEM_LIST List
)
150 if ((ULONG
) List
->CurrentFileSystem
> 0)
152 (ULONG
) List
->CurrentFileSystem
--;
153 DrawFileSystemList (List
);