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)
28 #include <ddk/ntddk.h>
29 #include <ddk/ntddscsi.h>
31 #include <ntdll/rtl.h>
33 //#include <ntos/minmax.h>
40 /* FUNCTIONS ****************************************************************/
43 CreateFileSystemList (SHORT Left,
46 FILE_SYSTEM ForceFileSystem)
48 PFILE_SYSTEM_LIST List;
50 List = (PFILE_SYSTEM_LIST)RtlAllocateHeap (ProcessHeap, 0, sizeof(FILE_SYSTEM_LIST));
57 List->ForceFormat = ForceFormat;
58 List->FileSystemCount = 1;
61 List->CurrentFileSystem = ForceFileSystem;
65 List->FileSystemCount++;
66 List->CurrentFileSystem = FsKeep;
74 DestroyFileSystemList (PFILE_SYSTEM_LIST List)
76 RtlFreeHeap (ProcessHeap, 0, List);
81 DrawFileSystemList (PFILE_SYSTEM_LIST List)
90 coPos.Y = List->Top + Index;
91 FillConsoleOutputAttribute (0x17,
95 FillConsoleOutputCharacter (' ',
100 if (List->CurrentFileSystem == FsFat)
102 SetInvertedTextXY (List->Left,
104 " Format partition as FAT file system ");
108 SetTextXY (List->Left,
110 " Format partition as FAT file system ");
114 if (List->ForceFormat == FALSE)
116 coPos.X = List->Left;
117 coPos.Y = List->Top + Index;
118 FillConsoleOutputAttribute (0x17,
122 FillConsoleOutputCharacter (' ',
127 if (List->CurrentFileSystem == FsKeep)
129 SetInvertedTextXY (List->Left,
131 " Keep current file system (no changes) ");
135 SetTextXY (List->Left,
137 " Keep current file system (no changes) ");
144 ScrollDownFileSystemList (PFILE_SYSTEM_LIST List)
146 if ((ULONG) List->CurrentFileSystem < List->FileSystemCount - 1)
148 (ULONG) List->CurrentFileSystem++;
149 DrawFileSystemList (List);
155 ScrollUpFileSystemList (PFILE_SYSTEM_LIST List)
157 if ((ULONG) List->CurrentFileSystem > 0)
159 (ULONG) List->CurrentFileSystem--;
160 DrawFileSystemList (List);