update for HEAD-2003091401
[reactos.git] / subsys / system / usetup / partlist.h
index 851a96c..a81dfce 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ReactOS kernel
- *  Copyright (C) 2002 ReactOS Team
+ *  Copyright (C) 2002, 2003 ReactOS Team
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
 #ifndef __PARTLIST_H__
 #define __PARTLIST_H__
 
-typedef struct _PARTDATA
+typedef enum _FORMATSTATE
 {
-  ULONGLONG DiskSize;
-  ULONG DiskNumber;
-  USHORT Port;
-  USHORT Bus;
-  USHORT Id;
-
-  BOOLEAN CreatePartition;
-  ULONGLONG PartSize;
-  ULONGLONG NewPartSize;
-  ULONG PartNumber;
-  ULONG PartType;
-
-  CHAR DriveLetter;
-
-  UNICODE_STRING DriverName;
-} PARTDATA, *PPARTDATA;
+  Unformatted,
+  UnformattedOrDamaged,
+  UnknownFormat,
+  Preformatted,
+  Formatted
+} FORMATSTATE, *PFORMATSTATE;
 
 
 typedef struct _PARTENTRY
 {
-  ULONGLONG StartingOffset;
-  ULONGLONG PartSize;
-  ULONG PartNumber;
-  ULONG PartType;
-  BOOLEAN Active;
+  LIST_ENTRY ListEntry;
 
   CHAR DriveLetter;
   CHAR VolumeLabel[17];
   CHAR FileSystemName[9];
 
-  BOOL Unpartitioned;
+  /* Partition is unused disk space */
+  BOOLEAN Unpartitioned;
+
+  /* Partition is new. Table does not exist on disk yet */
+  BOOLEAN New;
+
+  /* Partition was created automatically. */
+  BOOLEAN AutoCreate;
 
-  BOOL Used;
+  FORMATSTATE FormatState;
+
+  /*
+   * Raw offset and length of the unpartitioned disk space.
+   * Includes the leading, not yet existing, partition table.
+   */
+  ULONGLONG UnpartitionedOffset;
+  ULONGLONG UnpartitionedLength;
+
+  PARTITION_INFORMATION PartInfo[4];
 
-  BOOLEAN HidePartEntry;
 } PARTENTRY, *PPARTENTRY;
 
+
 typedef struct _DISKENTRY
 {
-  ULONGLONG DiskSize;
+  LIST_ENTRY ListEntry;
+
   ULONGLONG Cylinders;
   ULONGLONG TracksPerCylinder;
   ULONGLONG SectorsPerTrack;
   ULONGLONG BytesPerSector;
+
+  ULONGLONG DiskSize;
+  ULONGLONG CylinderSize;
+  ULONGLONG TrackSize;
+
   ULONG DiskNumber;
   USHORT Port;
   USHORT Bus;
   USHORT Id;
-  BOOL FixedDisk;
+
+  /* Has the partition list been modified? */
+  BOOLEAN Modified;
+
+  BOOLEAN NewDisk;
 
   UNICODE_STRING DriverName;
 
-  ULONG PartCount;
-  PPARTENTRY PartArray;
+  LIST_ENTRY PartListHead;
 
 } DISKENTRY, *PDISKENTRY;
 
@@ -99,55 +110,52 @@ typedef struct _PARTLIST
   ULONG TopDisk;
   ULONG TopPartition;
 
-  ULONG CurrentDisk;
-  ULONG CurrentPartition;
+  PDISKENTRY CurrentDisk;
+  PPARTENTRY CurrentPartition;
 
-  ULONG DiskCount;
-  PDISKENTRY DiskArray;
+  PDISKENTRY ActiveBootDisk;
+  PPARTENTRY ActiveBootPartition;
 
-} PARTLIST, *PPARTLIST;
+  LIST_ENTRY DiskListHead;
 
+} PARTLIST, *PPARTLIST;
 
 
 
 PPARTLIST
-CreatePartitionList(SHORT Left,
-                   SHORT Top,
-                   SHORT Right,
-                   SHORT Bottom);
+CreatePartitionList (SHORT Left,
+                    SHORT Top,
+                    SHORT Right,
+                    SHORT Bottom);
 
-BOOLEAN
-MarkPartitionActive(ULONG DiskNumber,
-                       ULONG PartitionNumber,
-                       PPARTDATA ActivePartition);
+VOID
+DestroyPartitionList (PPARTLIST List);
 
 VOID
-DestroyPartitionList(PPARTLIST List);
+DrawPartitionList (PPARTLIST List);
 
 VOID
-DrawPartitionList(PPARTLIST List);
+ScrollDownPartitionList (PPARTLIST List);
 
 VOID
-ScrollDownPartitionList(PPARTLIST List);
+ScrollUpPartitionList (PPARTLIST List);
 
 VOID
-ScrollUpPartitionList(PPARTLIST List);
+CreateNewPartition (PPARTLIST List,
+                   ULONGLONG PartitionSize,
+                   BOOLEAN AutoCreate);
 
-BOOL
-GetSelectedPartition(PPARTLIST List,
-                    PPARTDATA Data);
+VOID
+DeleteCurrentPartition (PPARTLIST List);
 
-BOOL
-GetActiveBootPartition(PPARTLIST List,
-                      PPARTDATA Data);
+VOID
+CheckActiveBootPartition (PPARTLIST List);
 
-BOOL
-CreateSelectedPartition(PPARTLIST List,
-  ULONG PartType,
-  ULONGLONG NewPartSize);
+BOOLEAN
+CheckForLinuxFdiskPartitions (PPARTLIST List);
 
-BOOL
-DeleteSelectedPartition(PPARTLIST List);
+BOOLEAN
+WritePartitionsToDisk (PPARTLIST List);
 
 #endif /* __PARTLIST_H__ */