ReactOS 0.4.16-dev-927-g467dec4
ext.h File Reference
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for ext.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ExtSuperBlock
 
struct  _ExtGroupDescriptor
 
struct  _Ext4ExtentHeader
 
struct  _Ext4ExtentIdx
 
struct  _Ext4Extent
 
struct  _ExtInode
 
struct  _ExtDirEntry
 
struct  _EXT_FILE_INFO
 

Macros

#define EXT_SUPERBLOCK_MAGIC   0xEF53
 
#define EXT_DYNAMIC_REVISION   1
 
#define EXT_DEFAULT_INODE_SIZE   128
 
#define EXT_DEFAULT_GROUP_DESC_SIZE   32
 
#define EXT_DIR_ENTRY_MAX_NAME_LENGTH   255
 
#define EXT_ROOT_INODE   2
 
#define EXT_REVISION(sb)   (sb->RevisionLevel)
 
#define EXT_INODE_SIZE(sb)    (EXT_REVISION(sb) < EXT_DYNAMIC_REVISION ? EXT_DEFAULT_INODE_SIZE : sb->InodeSize)
 
#define EXT_GROUP_DESC_SIZE(sb)    ((EXT_REVISION(sb) >= EXT_DYNAMIC_REVISION && sb->GroupDescSize) ? sb->GroupDescSize : EXT_DEFAULT_GROUP_DESC_SIZE)
 
#define EXT4_INODE_FLAG_EXTENTS   0x80000
 
#define EXT4_EXTENT_HEADER_MAGIC   0xF30A
 
#define EXT4_EXTENT_MAX_LEVEL   5
 
#define EXT4_EXTENT_MAX_LENGTH   32768
 
#define EXT_S_IRWXO   0x0007
 
#define EXT_S_IXOTH   0x0001
 
#define EXT_S_IWOTH   0x0002
 
#define EXT_S_IROTH   0x0004
 
#define EXT_S_IRWXG   0x0038
 
#define EXT_S_IXGRP   0x0008
 
#define EXT_S_IWGRP   0x0010
 
#define EXT_S_IRGRP   0x0020
 
#define EXT_S_IRWXU   0x01C0
 
#define EXT_S_IXUSR   0x0040
 
#define EXT_S_IWUSR   0x0080
 
#define EXT_S_IRUSR   0x0100
 
#define EXT_S_ISVTX   0x0200
 
#define EXT_S_ISGID   0x0400
 
#define EXT_S_ISUID   0x0800
 
#define EXT_S_IFMT   0xF000
 
#define EXT_S_IFIFO   0x1000
 
#define EXT_S_IFCHR   0x2000
 
#define EXT_S_IFDIR   0x4000
 
#define EXT_S_IFBLK   0x6000
 
#define EXT_S_IFREG   0x8000
 
#define EXT_S_IFLNK   0xA000
 
#define EXT_S_IFSOCK   0xC000
 
#define FAST_SYMLINK_MAX_NAME_SIZE   60
 

Typedefs

typedef struct _ExtSuperBlock EXT_SUPER_BLOCK
 
typedef struct _ExtSuperBlockPEXT_SUPER_BLOCK
 
typedef struct _ExtGroupDescriptor EXT_GROUP_DESC
 
typedef struct _ExtGroupDescriptorPEXT_GROUP_DESC
 
typedef struct _Ext4ExtentHeader EXT4_EXTENT_HEADER
 
typedef struct _Ext4ExtentHeaderPEXT4_EXTENT_HEADER
 
typedef struct _Ext4ExtentIdx EXT4_EXTENT_IDX
 
typedef struct _Ext4ExtentIdxPEXT4_EXTENT_IDX
 
typedef struct _Ext4Extent EXT4_EXTENT
 
typedef struct _Ext4ExtentPEXT4_EXTENT
 
typedef struct _ExtInode EXT_INODE
 
typedef struct _ExtInodePEXT_INODE
 
typedef struct _ExtDirEntry EXT_DIR_ENTRY
 
typedef struct _ExtDirEntryPEXT_DIR_ENTRY
 
typedef struct _EXT_VOLUME_INFOPEXT_VOLUME_INFO
 
typedef struct _EXT_FILE_INFO EXT_FILE_INFO
 
typedef struct _EXT_FILE_INFOPEXT_FILE_INFO
 

Functions

const DEVVTBLExtMount (ULONG DeviceId)
 

Macro Definition Documentation

◆ EXT4_EXTENT_HEADER_MAGIC

#define EXT4_EXTENT_HEADER_MAGIC   0xF30A

Definition at line 203 of file ext.h.

◆ EXT4_EXTENT_MAX_LENGTH

#define EXT4_EXTENT_MAX_LENGTH   32768

Definition at line 209 of file ext.h.

◆ EXT4_EXTENT_MAX_LEVEL

#define EXT4_EXTENT_MAX_LEVEL   5

Definition at line 206 of file ext.h.

◆ EXT4_INODE_FLAG_EXTENTS

#define EXT4_INODE_FLAG_EXTENTS   0x80000

Definition at line 200 of file ext.h.

◆ EXT_DEFAULT_GROUP_DESC_SIZE

#define EXT_DEFAULT_GROUP_DESC_SIZE   32

Definition at line 48 of file ext.h.

◆ EXT_DEFAULT_INODE_SIZE

#define EXT_DEFAULT_INODE_SIZE   128

Definition at line 47 of file ext.h.

◆ EXT_DIR_ENTRY_MAX_NAME_LENGTH

#define EXT_DIR_ENTRY_MAX_NAME_LENGTH   255

Definition at line 50 of file ext.h.

◆ EXT_DYNAMIC_REVISION

#define EXT_DYNAMIC_REVISION   1

Definition at line 46 of file ext.h.

◆ EXT_GROUP_DESC_SIZE

#define EXT_GROUP_DESC_SIZE (   sb)     ((EXT_REVISION(sb) >= EXT_DYNAMIC_REVISION && sb->GroupDescSize) ? sb->GroupDescSize : EXT_DEFAULT_GROUP_DESC_SIZE)

Definition at line 196 of file ext.h.

◆ EXT_INODE_SIZE

#define EXT_INODE_SIZE (   sb)     (EXT_REVISION(sb) < EXT_DYNAMIC_REVISION ? EXT_DEFAULT_INODE_SIZE : sb->InodeSize)

Definition at line 192 of file ext.h.

◆ EXT_REVISION

#define EXT_REVISION (   sb)    (sb->RevisionLevel)

Definition at line 189 of file ext.h.

◆ EXT_ROOT_INODE

#define EXT_ROOT_INODE   2

Definition at line 186 of file ext.h.

◆ EXT_S_IFBLK

#define EXT_S_IFBLK   0x6000

Definition at line 235 of file ext.h.

◆ EXT_S_IFCHR

#define EXT_S_IFCHR   0x2000

Definition at line 233 of file ext.h.

◆ EXT_S_IFDIR

#define EXT_S_IFDIR   0x4000

Definition at line 234 of file ext.h.

◆ EXT_S_IFIFO

#define EXT_S_IFIFO   0x1000

Definition at line 232 of file ext.h.

◆ EXT_S_IFLNK

#define EXT_S_IFLNK   0xA000

Definition at line 237 of file ext.h.

◆ EXT_S_IFMT

#define EXT_S_IFMT   0xF000

Definition at line 231 of file ext.h.

◆ EXT_S_IFREG

#define EXT_S_IFREG   0x8000

Definition at line 236 of file ext.h.

◆ EXT_S_IFSOCK

#define EXT_S_IFSOCK   0xC000

Definition at line 238 of file ext.h.

◆ EXT_S_IRGRP

#define EXT_S_IRGRP   0x0020

Definition at line 220 of file ext.h.

◆ EXT_S_IROTH

#define EXT_S_IROTH   0x0004

Definition at line 215 of file ext.h.

◆ EXT_S_IRUSR

#define EXT_S_IRUSR   0x0100

Definition at line 225 of file ext.h.

◆ EXT_S_IRWXG

#define EXT_S_IRWXG   0x0038

Definition at line 217 of file ext.h.

◆ EXT_S_IRWXO

#define EXT_S_IRWXO   0x0007

Definition at line 212 of file ext.h.

◆ EXT_S_IRWXU

#define EXT_S_IRWXU   0x01C0

Definition at line 222 of file ext.h.

◆ EXT_S_ISGID

#define EXT_S_ISGID   0x0400

Definition at line 228 of file ext.h.

◆ EXT_S_ISUID

#define EXT_S_ISUID   0x0800

Definition at line 229 of file ext.h.

◆ EXT_S_ISVTX

#define EXT_S_ISVTX   0x0200

Definition at line 227 of file ext.h.

◆ EXT_S_IWGRP

#define EXT_S_IWGRP   0x0010

Definition at line 219 of file ext.h.

◆ EXT_S_IWOTH

#define EXT_S_IWOTH   0x0002

Definition at line 214 of file ext.h.

◆ EXT_S_IWUSR

#define EXT_S_IWUSR   0x0080

Definition at line 224 of file ext.h.

◆ EXT_S_IXGRP

#define EXT_S_IXGRP   0x0008

Definition at line 218 of file ext.h.

◆ EXT_S_IXOTH

#define EXT_S_IXOTH   0x0001

Definition at line 213 of file ext.h.

◆ EXT_S_IXUSR

#define EXT_S_IXUSR   0x0040

Definition at line 223 of file ext.h.

◆ EXT_SUPERBLOCK_MAGIC

#define EXT_SUPERBLOCK_MAGIC   0xEF53

Definition at line 45 of file ext.h.

◆ FAST_SYMLINK_MAX_NAME_SIZE

#define FAST_SYMLINK_MAX_NAME_SIZE   60

Definition at line 240 of file ext.h.

Typedef Documentation

◆ EXT4_EXTENT

◆ EXT4_EXTENT_HEADER

◆ EXT4_EXTENT_IDX

◆ EXT_DIR_ENTRY

◆ EXT_FILE_INFO

◆ EXT_GROUP_DESC

◆ EXT_INODE

◆ EXT_SUPER_BLOCK

◆ PEXT4_EXTENT

◆ PEXT4_EXTENT_HEADER

◆ PEXT4_EXTENT_IDX

◆ PEXT_DIR_ENTRY

◆ PEXT_FILE_INFO

◆ PEXT_GROUP_DESC

◆ PEXT_INODE

◆ PEXT_SUPER_BLOCK

◆ PEXT_VOLUME_INFO

Definition at line 242 of file ext.h.

Function Documentation

◆ ExtMount()

const DEVVTBL * ExtMount ( ULONG  DeviceId)

Definition at line 1380 of file ext.c.

1381{
1383 EXT_SUPER_BLOCK SuperBlock;
1385 ULONG Count;
1387
1388 TRACE("Enter ExtMount(%lu)\n", DeviceId);
1389
1390 /* Allocate data for volume information */
1392 if (!Volume)
1393 return NULL;
1395
1396 /* Read the SuperBlock */
1397 Position.QuadPart = 2 * 512;
1398 Status = ArcSeek(DeviceId, &Position, SeekAbsolute);
1399 if (Status != ESUCCESS)
1400 {
1402 return NULL;
1403 }
1404 Status = ArcRead(DeviceId, &SuperBlock, sizeof(SuperBlock), &Count);
1405 if (Status != ESUCCESS || Count != sizeof(SuperBlock))
1406 {
1408 return NULL;
1409 }
1410
1411 /* Check if SuperBlock is valid. If yes, return Ext function table. */
1412 if (SuperBlock.Magic != EXT_SUPERBLOCK_MAGIC)
1413 {
1415 return NULL;
1416 }
1417
1418 Volume->DeviceId = DeviceId;
1419
1420 /* Really open the volume */
1421 if (!ExtOpenVolume(Volume))
1422 {
1424 return NULL;
1425 }
1426
1427 /* Remember EXT volume information */
1428 ExtVolumes[DeviceId] = Volume;
1429
1430 /* Return success */
1431 TRACE("ExtMount(%lu) success\n", DeviceId);
1432 return &ExtFuncTable;
1433}
#define EXT_SUPERBLOCK_MAGIC
Definition: ext.h:45
ARC_STATUS ArcSeek(ULONG FileId, LARGE_INTEGER *Position, SEEKMODE SeekMode)
Definition: fs.c:455
ARC_STATUS ArcRead(ULONG FileId, VOID *Buffer, ULONG N, ULONG *Count)
Definition: fs.c:448
VOID FrLdrTempFree(PVOID Allocation, ULONG Tag)
Definition: heap.c:553
PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
Definition: heap.c:545
#define TAG_EXT_VOLUME
Definition: ext.c:76
const DEVVTBL ExtFuncTable
Definition: ext.c:1370
BOOLEAN ExtOpenVolume(PEXT_VOLUME_INFO Volume)
Definition: ext.c:78
PEXT_VOLUME_INFO ExtVolumes[MAX_FDS]
Definition: ext.c:69
#define NULL
Definition: types.h:112
Status
Definition: gdiplustypes.h:25
UNICODE_STRING Volume
Definition: fltkernel.h:1172
int Count
Definition: noreturn.cpp:7
@ ESUCCESS
Definition: arc.h:32
ULONG ARC_STATUS
Definition: arc.h:4
@ SeekAbsolute
Definition: arc.h:59
#define TRACE(s)
Definition: solgame.cpp:4
USHORT Magic
Definition: ext.h:70
static COORD Position
Definition: mouse.c:34
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59