* Install MBR boot code if necessary.
[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.19 2003/08/19 15:54:47 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
31 typedef struct _PARTENTRY
32 {
33 LIST_ENTRY ListEntry;
34
35 CHAR DriveLetter;
36 CHAR VolumeLabel[17];
37 CHAR FileSystemName[9];
38
39 /* Partition is unused disk space */
40 BOOLEAN Unpartitioned;
41
42 /* Partition is new. Table does not exist on disk yet */
43 BOOLEAN New;
44
45 /* Partition was created automatically. */
46 BOOLEAN AutoCreate;
47
48 /*
49 * Raw offset and length of the unpartitioned disk space.
50 * Includes the leading, not yet existing, partition table.
51 */
52 ULONGLONG UnpartitionedOffset;
53 ULONGLONG UnpartitionedLength;
54
55 PARTITION_INFORMATION PartInfo[4];
56
57 } PARTENTRY, *PPARTENTRY;
58
59
60 typedef struct _DISKENTRY
61 {
62 LIST_ENTRY ListEntry;
63
64 ULONGLONG Cylinders;
65 ULONGLONG TracksPerCylinder;
66 ULONGLONG SectorsPerTrack;
67 ULONGLONG BytesPerSector;
68
69 ULONGLONG DiskSize;
70 ULONGLONG CylinderSize;
71 ULONGLONG TrackSize;
72
73 ULONG DiskNumber;
74 USHORT Port;
75 USHORT Bus;
76 USHORT Id;
77
78 /* Use LBA or CHS? */
79 BOOLEAN UseLba;
80
81 /* Has the partition list been modified? */
82 BOOLEAN Modified;
83
84 BOOLEAN NewDisk;
85
86 UNICODE_STRING DriverName;
87
88 LIST_ENTRY PartListHead;
89
90 } DISKENTRY, *PDISKENTRY;
91
92
93 typedef struct _PARTLIST
94 {
95 SHORT Left;
96 SHORT Top;
97 SHORT Right;
98 SHORT Bottom;
99
100 SHORT Line;
101
102 ULONG TopDisk;
103 ULONG TopPartition;
104
105 PDISKENTRY CurrentDisk;
106 PPARTENTRY CurrentPartition;
107
108 PDISKENTRY ActiveBootDisk;
109 PPARTENTRY ActiveBootPartition;
110
111 LIST_ENTRY DiskListHead;
112
113 } PARTLIST, *PPARTLIST;
114
115
116
117 PPARTLIST
118 CreatePartitionList (SHORT Left,
119 SHORT Top,
120 SHORT Right,
121 SHORT Bottom);
122
123 VOID
124 DestroyPartitionList (PPARTLIST List);
125
126 VOID
127 DrawPartitionList (PPARTLIST List);
128
129 VOID
130 ScrollDownPartitionList (PPARTLIST List);
131
132 VOID
133 ScrollUpPartitionList (PPARTLIST List);
134
135 VOID
136 CreateNewPartition (PPARTLIST List,
137 ULONGLONG PartitionSize,
138 BOOLEAN AutoCreate);
139
140 VOID
141 DeleteCurrentPartition (PPARTLIST List);
142
143 VOID
144 CheckActiveBootPartition (PPARTLIST List);
145
146 BOOLEAN
147 WritePartitionsToDisk (PPARTLIST List);
148
149 #endif /* __PARTLIST_H__ */
150
151 /* EOF */