3 * Copyright (C) 2002, 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/partlist.h
23 * PURPOSE: Partition list functions
24 * PROGRAMMER: Eric Kohl
27 #ifndef __PARTLIST_H__
28 #define __PARTLIST_H__
30 typedef enum _FORMATSTATE
37 } FORMATSTATE
, *PFORMATSTATE
;
40 typedef struct _PARTENTRY
46 CHAR FileSystemName
[9];
48 /* Partition is unused disk space */
49 BOOLEAN Unpartitioned
;
51 /* Partition is new. Table does not exist on disk yet */
54 /* Partition was created automatically. */
57 FORMATSTATE FormatState
;
60 * Raw offset and length of the unpartitioned disk space.
61 * Includes the leading, not yet existing, partition table.
63 ULONGLONG UnpartitionedOffset
;
64 ULONGLONG UnpartitionedLength
;
66 PARTITION_INFORMATION PartInfo
[4];
68 } PARTENTRY
, *PPARTENTRY
;
71 typedef struct _BIOSDISKENTRY
78 CM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry
;
79 CM_INT13_DRIVE_PARAMETER Int13DiskData
;
80 } BIOSDISKENTRY
, *PBIOSDISKENTRY
;
83 typedef struct _DISKENTRY
88 ULONGLONG TracksPerCylinder
;
89 ULONGLONG SectorsPerTrack
;
90 ULONGLONG BytesPerSector
;
93 ULONGLONG CylinderSize
;
106 /* Has the partition list been modified? */
111 UNICODE_STRING DriverName
;
113 LIST_ENTRY PartListHead
;
115 } DISKENTRY
, *PDISKENTRY
;
118 typedef struct _PARTLIST
131 PDISKENTRY CurrentDisk
;
132 PPARTENTRY CurrentPartition
;
134 PDISKENTRY ActiveBootDisk
;
135 PPARTENTRY ActiveBootPartition
;
137 LIST_ENTRY DiskListHead
;
138 LIST_ENTRY BiosDiskListHead
;
140 } PARTLIST
, *PPARTLIST
;
142 #define PARTITION_TBL_SIZE 4
144 #include <pshpack1.h>
146 typedef struct _PARTITION
148 unsigned char BootFlags
; /* bootable? 0=no, 128=yes */
149 unsigned char StartingHead
; /* beginning head number */
150 unsigned char StartingSector
; /* beginning sector number */
151 unsigned char StartingCylinder
; /* 10 bit nmbr, with high 2 bits put in begsect */
152 unsigned char PartitionType
; /* Operating System type indicator code */
153 unsigned char EndingHead
; /* ending head number */
154 unsigned char EndingSector
; /* ending sector number */
155 unsigned char EndingCylinder
; /* also a 10 bit nmbr, with same high 2 bit trick */
156 unsigned int StartingBlock
; /* first sector relative to start of disk */
157 unsigned int SectorCount
; /* number of sectors in partition */
158 } PARTITION
, *PPARTITION
;
160 typedef struct _PARTITION_SECTOR
162 UCHAR BootCode
[440]; /* 0x000 */
163 ULONG Signature
; /* 0x1B8 */
164 UCHAR Reserved
[2]; /* 0x1BC */
165 PARTITION Partition
[PARTITION_TBL_SIZE
]; /* 0x1BE */
166 USHORT Magic
; /* 0x1FE */
167 } PARTITION_SECTOR
, *PPARTITION_SECTOR
;
173 LIST_ENTRY ListEntry
;
177 } BIOS_DISK
, *PBIOS_DISK
;
180 CreatePartitionList (SHORT Left
,
186 DestroyPartitionList (PPARTLIST List
);
189 DrawPartitionList (PPARTLIST List
);
192 SelectPartition(PPARTLIST List
, ULONG DiskNumber
, ULONG PartitionNumber
);
195 SetMountedDeviceValues(PPARTLIST List
);
198 ScrollDownPartitionList (PPARTLIST List
);
201 ScrollUpPartitionList (PPARTLIST List
);
204 CreateNewPartition (PPARTLIST List
,
205 ULONGLONG PartitionSize
,
209 DeleteCurrentPartition (PPARTLIST List
);
212 CheckActiveBootPartition (PPARTLIST List
);
215 CheckForLinuxFdiskPartitions (PPARTLIST List
);
218 WritePartitionsToDisk (PPARTLIST List
);
220 #endif /* __PARTLIST_H__ */