8faef8d40428e817660d699faf9b9cd643dda883
[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: partlist.h,v 1.21 2003/08/25 11:56:07 ekohl Exp $
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
110 ULONG TopDisk;
111 ULONG TopPartition;
112
113 PDISKENTRY CurrentDisk;
114 PPARTENTRY CurrentPartition;
115
116 PDISKENTRY ActiveBootDisk;
117 PPARTENTRY ActiveBootPartition;
118
119 LIST_ENTRY DiskListHead;
120
121 } PARTLIST, *PPARTLIST;
122
123
124
125 PPARTLIST
126 CreatePartitionList (SHORT Left,
127 SHORT Top,
128 SHORT Right,
129 SHORT Bottom);
130
131 VOID
132 DestroyPartitionList (PPARTLIST List);
133
134 VOID
135 DrawPartitionList (PPARTLIST List);
136
137 VOID
138 ScrollDownPartitionList (PPARTLIST List);
139
140 VOID
141 ScrollUpPartitionList (PPARTLIST List);
142
143 VOID
144 CreateNewPartition (PPARTLIST List,
145 ULONGLONG PartitionSize,
146 BOOLEAN AutoCreate);
147
148 VOID
149 DeleteCurrentPartition (PPARTLIST List);
150
151 VOID
152 CheckActiveBootPartition (PPARTLIST List);
153
154 BOOLEAN
155 CheckForLinuxFdiskPartitions (PPARTLIST List);
156
157 BOOLEAN
158 WritePartitionsToDisk (PPARTLIST List);
159
160 #endif /* __PARTLIST_H__ */
161
162 /* EOF */