Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenext2metadata.h
Go to the documentation of this file.
00001 /************************************************************************* 00002 * 00003 * File: ext2metadata.h 00004 * 00005 * Module: Ext2 File System Driver (Kernel mode execution only) 00006 * 00007 * Description: 00008 * Contains the definitions for the Ext2 Metadata structures. 00009 * 00010 * Author: Manoj Paul Joseph 00011 * 00012 * 00013 *************************************************************************/ 00014 00015 #ifndef EXT2_METADATA_STRUCTURES 00016 #define EXT2_METADATA_STRUCTURES 00017 00018 // 00019 // Some type definitions... 00020 // These are used in the ext2_fs.h header file 00021 // 00022 typedef unsigned int __u32 ; 00023 typedef signed int __s32 ; 00024 typedef unsigned short int __u16 ; 00025 typedef signed short int __s16 ; 00026 typedef unsigned char __u8 ; 00027 00028 // 00029 //****************************************************** 00030 // 00031 // Using Remy Card's (slightly modified) Ext2 header... 00032 // 00033 #include "ext2_fs.h" 00034 // 00035 //****************************************************** 00036 // 00037 00038 typedef struct ext2_super_block EXT2_SUPER_BLOCK; 00039 typedef EXT2_SUPER_BLOCK * PEXT2_SUPER_BLOCK; 00040 00041 typedef struct ext2_inode EXT2_INODE; 00042 typedef EXT2_INODE * PEXT2_INODE; 00043 00044 typedef struct ext2_group_desc EXT2_GROUP_DESCRIPTOR; 00045 typedef EXT2_GROUP_DESCRIPTOR * PEXT2_GROUP_DESCRIPTOR; 00046 00047 typedef struct ext2_dir_entry_2 EXT2_DIR_ENTRY; 00048 typedef EXT2_DIR_ENTRY * PEXT2_DIR_ENTRY; 00049 00050 // 00051 // Ext2 Supported File Types... 00052 // 00053 #define IMODE_FIFO 0x01 00054 #define IMODE_CHARDEV 0x02 00055 #define IMODE_DIR 0x04 00056 #define IMODE_BLOCKDEV 0x06 00057 #define IMODE_FILE 0x08 00058 #define IMODE_SLINK 0x0A 00059 #define IMODE_SOCKET 0x0C 00060 00061 #define _MKMODE(m) ( ( (m) >> 12 ) & 0x000F) 00062 #define Ext2IsModeRegularFile(m) ( _MKMODE(m) == IMODE_FILE ) 00063 #define Ext2IsModeDirectory(m) ( _MKMODE(m) == IMODE_DIR ) 00064 #define Ext2IsModeSymbolicLink(m) ( _MKMODE(m) == IMODE_SLINK ) 00065 #define Ext2IsModePipe(m) ( _MKMODE(m) == IMODE_FIFO ) 00066 #define Ext2IsModeCharacterDevice(m) ( _MKMODE(m) == IMODE_CHARDEV ) 00067 #define Ext2IsModeBlockDevice(m) ( _MKMODE(m) == IMODE_BLOCKDEV ) 00068 #define Ext2IsModeSocket(m) ( _MKMODE(m) == IMODE_SOCKET ) 00069 00070 #define Ext2IsModeHidden(m) ( (m & 0x124) == 0) // No Read Permission 00071 #define Ext2IsModeReadOnly(m) ( (m & 0x92) == 0) // No write Permission 00072 00073 #define Ext2SetModeHidden(m) m = (m & (~0x124)); // Turn off Read Permission 00074 #define Ext2SetModeReadOnly(m) m = (m & (~0x92)); // Turn off write Permission 00075 #define Ext2SetModeReadWrite(m) m = (m & 0x1ff); // Set read/write Permission 00076 00077 00078 // 00079 // Define the Packed and Unpacked BIOS Parameter Block 00080 // 00081 typedef struct _PACKED_BIOS_PARAMETER_BLOCK { 00082 UCHAR BytesPerSector[2]; // offset = 0x000 0 00083 UCHAR SectorsPerCluster[1]; // offset = 0x002 2 00084 UCHAR ReservedSectors[2]; // offset = 0x003 3 00085 UCHAR Fats[1]; // offset = 0x005 5 00086 UCHAR RootEntries[2]; // offset = 0x006 6 00087 UCHAR Sectors[2]; // offset = 0x008 8 00088 UCHAR Media[1]; // offset = 0x00A 10 00089 UCHAR SectorsPerFat[2]; // offset = 0x00B 11 00090 UCHAR SectorsPerTrack[2]; // offset = 0x00D 13 00091 UCHAR Heads[2]; // offset = 0x00F 15 00092 UCHAR HiddenSectors[4]; // offset = 0x011 17 00093 UCHAR LargeSectors[4]; // offset = 0x015 21 00094 } PACKED_BIOS_PARAMETER_BLOCK; // sizeof = 0x019 25 00095 typedef PACKED_BIOS_PARAMETER_BLOCK *PPACKED_BIOS_PARAMETER_BLOCK; 00096 00097 // 00098 // Define the boot sector 00099 // 00100 typedef struct _PACKED_BOOT_SECTOR { 00101 UCHAR Jump[3]; // offset = 0x000 0 00102 UCHAR Oem[8]; // offset = 0x003 3 00103 PACKED_BIOS_PARAMETER_BLOCK PackedBpb; // offset = 0x00B 11 00104 UCHAR PhysicalDriveNumber; // offset = 0x024 36 00105 UCHAR CurrentHead; // offset = 0x025 37 00106 UCHAR Signature; // offset = 0x026 38 00107 UCHAR Id[4]; // offset = 0x027 39 00108 UCHAR VolumeLabel[11]; // offset = 0x02B 43 00109 UCHAR SystemId[8]; // offset = 0x036 54 00110 } PACKED_BOOT_SECTOR; // sizeof = 0x03E 62 00111 00112 typedef PACKED_BOOT_SECTOR *PPACKED_BOOT_SECTOR; 00113 00114 00115 #endif Generated on Sun May 27 2012 04:27:38 for ReactOS by
1.7.6.1
|