Skip to content
Snippets Groups Projects
Commit 5b9f97fc authored by John Hodge's avatar John Hodge
Browse files

NTFS Driver work (index headers)

parent e89bb46e
Branches
Tags
No related merge requests found
/*
* Acess2 - NTFS Driver
* By John Hodge (thePowersGang)
* This file is published under the terms of the Acess licence. See the
* file COPYING for details.
*
* attributes.h - MFT Attribute Types
*/
#ifndef _ATTRIBUTES_H_
#define _ATTRIBUTES_H_
typedef struct
{
Uint64 ParentDirectory; //!< Parent directory MFT entry
Sint64 CreationTime; //!< Time the file was created
Sint64 LastDataModTime; //!< Last change time for the data
Sint64 LastMtfModTime; //!< Last change time for the MFT entry
Sint64 LastAccessTime; //!< Last Access Time (unreliable on most systems)
Uint64 AllocatedSize; //!< Allocated data size for $DATA unnamed stream
Uint64 DataSize; //!< Actual size of $DATA unnamed stream
Uint32 Flags; //!< File attribute files
union {
struct {
Uint16 PackedSize; //!< Size of buffer needed for extended attributes
Uint16 _reserved;
} PACKED ExtAttrib;
struct {
Uint32 Tag; //!< Type of reparse point
} PACKED ReparsePoint;
} PACKED Type;
Uint8 FilenameType; //!< Filename namespace (DOS, Windows, Unix)
WCHAR Filename[0];
} PACKED tNTFS_Attrib_Filename;
#endif
......@@ -12,6 +12,8 @@
#include <acess.h>
#include <vfs.h>
typedef Uint16 WCHAR;
// === STRUCTURES ===
/**
* In-memory representation of an NTFS Disk
......
......@@ -7,6 +7,7 @@
* dir.c - Directory Handling
*/
#include "common.h"
#include "index.h"
// === PROTOTYPES ===
char *NTFS_ReadDir(tVFS_Node *Node, int Pos);
......
/*
* Acess2 - NTFS Driver
* By John Hodge (thePowersGang)
* This file is published under the terms of the Acess licence. See the
* file COPYING for details.
*
* index.h - Index Types
*/
#ifndef _INDEX_H_
#define _INDEX_H_
#include "attributes.h"
typedef struct
{
Uint32 EntryOffset;
Uint32 IndexLength;
Uint32 AllocateSize;
Uint8 Flags;
Uint8 _reserved[3];
} PACKED tNTFS_IndexHeader;
typedef struct
{
Uint32 Type;
Uint32 CollationRule;
Uint32 IndexBlockSize;
Uint8 ClustersPerIndexBlock;
Uint8 _reserved[3];
tNTFS_IndexHeader Header;
} PACKED tNTFS_IndexRoot;
typedef struct
{
union {
struct {
Uint64 File; // MFT Index of file
} PACKED Dir;
/**
* Views/Indexes
*/
struct {
Uint16 DataOffset;
Uint16 DataLength;
Uint32 _reserved;
} PACKED ViewIndex;
} PACKED Header;
Uint16 Length; //!< Size of the index entry (multiple of 8 bytes)
Uint16 KeyLength; //!< Size of key value
Uint16 Flags; //!< Flags Bitfield
Uint16 _reserved;
/**
* \brief Key Data
* \note Only valid if \a Flags does not have \a INDEX_ENTRY_END set
* \note In NTFS3 only \a Filename is used
*/
union {
tNTFS_Attrib_Filename Filename;
//TODO: more key types
} PACKED Key;
} PACKED tNTFS_IndexEntry;
#endif
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment