65b6381c94e500bcef4132011c69561650f02f9e
[reactos.git] / reactos / subsys / system / usetup / partlist.h
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2002, 2003 ReactOS Team
4 *
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.
9 *
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.
14 *
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.
18 */
19 /* $Id$
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS text-mode setup
22 * FILE: subsys/system/usetup/partlist.h
23 * PURPOSE: Partition list functions
24 * PROGRAMMER: Eric Kohl
25 */
26
27 #ifndef __PARTLIST_H__
28 #define __PARTLIST_H__
29
30 typedef enum _FORMATSTATE
31 {
32 Unformatted,
33 UnformattedOrDamaged,
34 UnknownFormat,
35 Preformatted,
36 Formatted
37 } FORMATSTATE, *PFORMATSTATE;
38
39
40 typedef struct _PARTENTRY
41 {
42 LIST_ENTRY ListEntry;
43
44 CHAR DriveLetter;
45 CHAR VolumeLabel[17];
46 CHAR FileSystemName[9];
47
48 /* Partition is unused disk space */
49 BOOLEAN Unpartitioned;
50
51 /* Partition is new. Table does not exist on disk yet */
52 BOOLEAN New;
53
54 /* Partition was created automatically. */
55 BOOLEAN AutoCreate;
56
57 FORMATSTATE FormatState;
58
59 /*
60 * Raw offset and length of the unpartitioned disk space.
61 * Includes the leading, not yet existing, partition table.
62 */
63 ULONGLONG UnpartitionedOffset;
64 ULONGLONG UnpartitionedLength;
65
66 PARTITION_INFORMATION PartInfo[4];
67
68 } PARTENTRY, *PPARTENTRY;
69
70
71 typedef struct _DISKENTRY
72 {
73 LIST_ENTRY ListEntry;
74
75 ULONGLONG Cylinders;
76 ULONGLONG TracksPerCylinder;
77 ULONGLONG SectorsPerTrack;
78 ULONGLONG BytesPerSector;
79
80 ULONGLONG DiskSize;
81 ULONGLONG CylinderSize;
82 ULONGLONG TrackSize;
83
84 ULONG DiskNumber;
85 USHORT Port;
86 USHORT Bus;
87 USHORT Id;
88
89 /* Has the partition list been modified? */
90 BOOLEAN Modified;
91
92 BOOLEAN NewDisk;
93
94 UNICODE_STRING DriverName;
95
96 LIST_ENTRY PartListHead;
97
98 } DISKENTRY, *PDISKENTRY;
99
100
101 typedef struct _PARTLIST
102 {
103 SHORT Left;
104 SHORT Top;
105 SHORT Right;
106 SHORT Bottom;
107
108 SHORT Line;
109 SHORT Offset;
110
111 ULONG TopDisk;
112 ULONG TopPartition;
113
114 PDISKENTRY CurrentDisk;
115 PPARTENTRY CurrentPartition;
116
117 PDISKENTRY ActiveBootDisk;
118 PPARTENTRY ActiveBootPartition;
119
120 LIST_ENTRY DiskListHead;
121
122 } PARTLIST, *PPARTLIST;
123
124
125
126 PPARTLIST
127 CreatePartitionList (SHORT Left,
128 SHORT Top,
129 SHORT Right,
130 SHORT Bottom);
131
132 VOID
133 DestroyPartitionList (PPARTLIST List);
134
135 VOID
136 DrawPartitionList (PPARTLIST List);
137
138 VOID
139 SelectPartition(PPARTLIST List, ULONG DiskNumber, ULONG PartitionNumber);
140
141 VOID
142 ScrollDownPartitionList (PPARTLIST List);
143
144 VOID
145 ScrollUpPartitionList (PPARTLIST List);
146
147 VOID
148 CreateNewPartition (PPARTLIST List,
149 ULONGLONG PartitionSize,
150 BOOLEAN AutoCreate);
151
152 VOID
153 DeleteCurrentPartition (PPARTLIST List);
154
155 VOID
156 CheckActiveBootPartition (PPARTLIST List);
157
158 BOOLEAN
159 CheckForLinuxFdiskPartitions (PPARTLIST List);
160
161 BOOLEAN
162 WritePartitionsToDisk (PPARTLIST List);
163
164 #endif /* __PARTLIST_H__ */
165
166 /* EOF */