ReactOS 0.4.16-dev-2610-ge2c92c0
part_mbr.h
Go to the documentation of this file.
1/*
2 * PROJECT: FreeLoader
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: MBR partitioning scheme support
5 * COPYRIGHT: Copyright 2002-2003 Brian Palmer <brianp@sginet.com>
6 */
7
8#pragma once
9
10#include <pshpack1.h>
11
12/*
13 * Define the structure of a partition table entry
14 */
16{
17 UCHAR BootIndicator; // 0x00 - non-bootable partition,
18 // 0x80 - bootable partition (one partition only)
19 UCHAR StartHead; // Beginning head number
20 UCHAR StartSector; // Beginning sector (2 high bits of cylinder #)
21 UCHAR StartCylinder; // Beginning cylinder# (low order bits of cylinder #)
22 UCHAR SystemIndicator; // System indicator
23 UCHAR EndHead; // Ending head number
24 UCHAR EndSector; // Ending sector (2 high bits of cylinder #)
25 UCHAR EndCylinder; // Ending cylinder# (low order bits of cylinder #)
26 ULONG SectorCountBeforePartition; // Number of sectors preceding the partition
27 ULONG PartitionSectorCount; // Number of sectors in the partition
30
31/*
32 * Define the structure of the master boot record
33 */
34typedef struct _MASTER_BOOT_RECORD
35{
37 ULONG Signature; /* 0x1B8 */
38 USHORT Reserved; /* 0x1BC */
43
44#include <poppack.h>
45
46/*
47 * Partition type defines (of PSDK)
48 */
49#include <reactos/rosioctl.h>
50#define PARTITION_ENTRY_UNUSED 0x00 // Entry unused
51#define PARTITION_FAT_12 0x01 // 12-bit FAT entries
52#define PARTITION_XENIX_1 0x02 // Xenix
53#define PARTITION_XENIX_2 0x03 // Xenix
54#define PARTITION_FAT_16 0x04 // 16-bit FAT entries
55#define PARTITION_EXTENDED 0x05 // Extended partition entry
56#define PARTITION_HUGE 0x06 // Huge partition MS-DOS V4
57#define PARTITION_IFS 0x07 // IFS Partition
58#define PARTITION_OS2BOOTMGR 0x0A // OS/2 Boot Manager/OPUS/Coherent swap
59#define PARTITION_FAT32 0x0B // FAT32
60#define PARTITION_FAT32_XINT13 0x0C // FAT32 using extended int13 services
61#define PARTITION_XINT13 0x0E // Win95 partition using extended int13 services
62#define PARTITION_XINT13_EXTENDED 0x0F // Same as type 5 but uses extended int13 services
63#define PARTITION_NTFS 0x17 // NTFS
64#define PARTITION_PREP 0x41 // PowerPC Reference Platform (PReP) Boot Partition
65#define PARTITION_LDM 0x42 // Logical Disk Manager partition
66#define PARTITION_UNIX 0x63 // Unix
67#define VALID_NTFT 0xC0 // NTFT uses high order bits
68#define PARTITION_NTFT 0x80 // NTFT partition
69#define PARTITION_GPT 0xEE // GPT protective partition
70#ifdef __REACTOS__
71#define PARTITION_OLD_LINUX 0x43
72#define PARTITION_LINUX 0x83
73#endif
#define C_ASSERT(e)
Definition: intsafe.h:73
struct _PARTITION_TABLE_ENTRY PARTITION_TABLE_ENTRY
struct _PARTITION_TABLE_ENTRY * PPARTITION_TABLE_ENTRY
struct _MASTER_BOOT_RECORD * PMASTER_BOOT_RECORD
struct _MASTER_BOOT_RECORD MASTER_BOOT_RECORD
unsigned short USHORT
Definition: pedump.c:61
Definition: parttest.c:75
UCHAR MasterBootRecordCodeAndData[0x1b8]
Definition: part_mbr.h:36
USHORT MasterBootRecordMagic
Definition: part_mbr.h:40
PARTITION_TABLE_ENTRY PartitionTable[4]
Definition: part_mbr.h:39
Definition: part_mbr.h:16
ULONG SectorCountBeforePartition
Definition: part_mbr.h:26
ULONG PartitionSectorCount
Definition: part_mbr.h:27
UCHAR BootIndicator
Definition: part_mbr.h:17
UCHAR StartCylinder
Definition: part_mbr.h:21
UCHAR StartSector
Definition: part_mbr.h:20
UCHAR SystemIndicator
Definition: part_mbr.h:22
UCHAR EndHead
Definition: part_mbr.h:23
UCHAR EndSector
Definition: part_mbr.h:24
UCHAR EndCylinder
Definition: part_mbr.h:25
UCHAR StartHead
Definition: part_mbr.h:19
unsigned char UCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59