📄 iso13346.h
字号:
UCHAR Padding[1]; // Padding
// nsr_fid_Paddinghas a variant starting offset due to nsr_fid_ImpUse and
// nsr_fid_FileID
// nsr_fid_Padding has a variant length. Round up to the next ULONG boundary.
} NSR_FID, *PNSR_FID;
#define ISONsrFidConstantSize (ULONG)(FIELD_OFFSET( NSR_FID, ImpUse ))
#define ISONsrFidSize( F ) (LongAlign( ISONsrFidConstantSize + (F)->FileIDLen + (F)->ImpUseLen ))
// NSR_FID_F_... - Definitions for nsr_fid_Flags (Characteristics, 4/14.4.3)
#define NSR_FID_F_HIDDEN (0x01) // Hidden Bit
#define NSR_FID_F_DIRECTORY (0x02) // Directory Bit
#define NSR_FID_F_DELETED (0x04) // Deleted Bit
#define NSR_FID_F_PARENT (0x08) // Parent Directory Bit
#define NSR_FID_OFFSET_FILEID 38 // Field Offset of nsr_fid_FileID[];
/*** nsr_alloc - Allocation Extent Descriptor (4/14.5)
*
* nsr_alloc_destag.destag_Ident = DESTAG_ID_NSR_ALLOC
*
* This descriptor is immediately followed by AllocLen bytes
* of allocation descriptors, which is not part of this
* descriptor (so CRC calculation doesn't include it).
*
*/
typedef struct NSR_ALLOC {
DESTAG Destag; // Descriptor Tag (NSR_ALLOC)
ULONG Prev; // Previous Allocation Descriptor
ULONG AllocLen; // Length of Allocation Descriptors
} NSR_ALLOC, *PNSR_ALLOC;
/*** icbtag - Information Control Block Tag (4/14.6)
*
* An ICBTAG is commonly preceeded by a Descriptor Tag (DESTAG).
*
*/
typedef struct ICBTAG {
ULONG PriorDirectCount;// Prior Direct Entry Count
USHORT StratType; // Strategy Type (ICBTAG_STRAT_...)
USHORT StratParm; // Strategy Parameter (2 bytes)
USHORT MaxEntries; // Maximum Number of Entries in ICB
UCHAR Res10; // Reserved Zero
UCHAR FileType; // File Type (ICBTAG_FILE_T_...)
NSRLBA IcbParent; // Parent ICB Location
USHORT Flags; // ICB Flags (ICBTAG_F_...)
} ICBTAG, *PICBTAG;
// ICBTAG_STRAT_T_... - ICB Strategy Types
// BUGBUG: rickdew 7/31/95. Weird strategies! I'm guessing on names here.
#define ICBTAG_STRAT_NOTSPEC 0 // ICB Strategy Not Specified
#define ICBTAG_STRAT_TREE 1 // Strategy 1 (4/A.2) (Plain Tree)
#define ICBTAG_STRAT_MASTER 2 // Strategy 2 (4/A.3) (Master ICB)
#define ICBTAG_STRAT_BAL_TREE 3 // Strategy 3 (4/A.4) (Balanced Tree)
#define ICBTAG_STRAT_DIRECT 4 // Strategy 4 (4/A.5) (One Direct)
// ICBTAG_FILE_T_... - Values for icbtag_FileType
#define ICBTAG_FILE_T_NOTSPEC 0 // Not Specified
#define ICBTAG_FILE_T_UASE 1 // Unallocated Space Entry
#define ICBTAG_FILE_T_PINTEG 2 // Partition Integrity Entry
#define ICBTAG_FILE_T_INDIRECT 3 // Indirect Entry
#define ICBTAG_FILE_T_DIRECTORY 4 // Directory
#define ICBTAG_FILE_T_FILE 5 // Ordinary File
#define ICBTAG_FILE_T_BLOCK_DEV 6 // Block Special Device
#define ICBTAG_FILE_T_CHAR_DEV 7 // Character Special Device
#define ICBTAG_FILE_T_XA 8 // Extended Attributes
#define ICBTAG_FILE_T_FIFO 9 // FIFO file
#define ICBTAG_FILE_T_C_ISSOCK 10 // Socket
#define ICBTAG_FILE_T_TERMINAL 11 // Terminal Entry
#define ICBTAG_FILE_T_PATHLINK 12 // Symbolic Link with a pathname
// ICBTAG_F_... - Values for icbtag_Flags
#define ICBTAG_F_ALLOC_MASK (0x0007)// Mask for Allocation Descriptor Info
#define ICBTAG_F_ALLOC_SHORT 0 // Short Allocation Descriptors Used
#define ICBTAG_F_ALLOC_LONG 1 // Long Allocation Descriptors Used
#define ICBTAG_F_ALLOC_EXTENDED 2 // Extended Allocation Descriptors Used
#define ICBTAG_F_ALLOC_IMMEDIATE 3 // File Data Recorded Immediately
#define ISOAllocationDescriptorSize(T) ( (T) == ICBTAG_F_ALLOC_SHORT ? sizeof(SHORTAD) : \
(T) == ICBTAG_F_ALLOC_LONG ? sizeof(LONGAD) : \
sizeof(EXTAD) )
#define ICBTAG_F_SORTED (0x0008)// Directory is Sorted (4/8.6.1)
#define ICBTAG_F_NO_RELOCATE (0x0010)// Data is not relocateable
#define ICBTAG_F_ARCHIVE (0x0020)// Archive Bit
#define ICBTAG_F_SETUID (0x0040)// S_ISUID Bit
#define ICBTAG_F_SETGID (0x0080)// S_ISGID Bit
#define ICBTAG_F_STICKY (0x0100)// C_ISVTX Bit
#define ICBTAG_F_CONTIGUOUS (0x0200)// File Data is Contiguous
#define ICBTAG_F_SYSTEM (0x0400)// System Bit
#define ICBTAG_F_TRANSFORMED (0x0800)// Data Transformed
#define ICBTAG_F_MULTIVERSIONS (0x1000)// Multi-version Files in Directory
/*** icbind - Indirect ICB Entry (4/14.7)
*
*/
typedef struct ICBIND {
DESTAG Destag; // Descriptor Tag (ID_NSR_ICBIND)
ICBTAG Icbtag; // ICB Tag (ICBTAG_FILE_T_INDIRECT)
LONGAD Icb; // ICB Address
} ICBIND, *PICBIND;
/*** icbtrm - Terminal ICB Entry (4/14.8)
*
*/
typedef struct ICBTRM {
DESTAG Destag; // Descriptor Tag (ID_NSR_ICBTRM)
ICBTAG Icbtag; // ICB Tag (ICBTAG_FILE_T_TERMINAL)
} ICBTRM, *PICBTRM;
/*** icbfile - File ICB Entry (4/14.9)
*
* WARNING: WARNING: WARNING: icbfile is a multi-variant structure!
*
* The starting address of icbfile_Allocs is not acurrate.
* Compensate for this icbfile_Allocs problem by adding the value of
* (icbfile_XALength-1) to the UCHAR ARRAY INDEX.
*
* icbfile_XALength is a multiple of 4.
*
*/
typedef struct ICBFILE {
DESTAG Destag; // Descriptor Tag (ID_NSR_FILE)
ICBTAG Icbtag; // ICB Tag (ICBTAG_FILE_T_FILE)
ULONG UID; // User ID of file's owner
ULONG GID; // Group ID of file's owner
ULONG Permissions; // File Permissions
USHORT LinkCount; // File hard-link count
UCHAR RecordFormat; // Record Format
UCHAR RecordDisplay; // Record Display Attributes
ULONG RecordLength; // Record Length
ULONGLONG InfoLength; // Information Length (file size)
ULONGLONG BlocksRecorded; // Logical Blocks Recorded
TIMESTAMP AccessTime; // Last-Accessed Time
TIMESTAMP ModifyTime; // Last-Modification Time
TIMESTAMP AttributeTime; // Last-Attribute-Change Time
ULONG Checkpoint; // File Checkpoint
LONGAD IcbEA; // Extended Attribute ICB
REGID ImpUseID; // Implementation Use Identifier
ULONGLONG UniqueID; // Unique ID
ULONG EALength; // Length of Extended Attributes
ULONG AllocLength; // Length of Allocation Descriptors
UCHAR EAs[1]; // Extended Attributes
// icbfile_EAs has a variant length = icbfile_EALength
UCHAR Allocs[0]; // Allocation Descriptors.
// icbfile_Allocs has a variant starting offset due to icbfile_EAs.
// icbfile_Allocs has a variant length = icbfile_AllocLen.
} ICBFILE, *PICBFILE;
// Definitions for icbfile_Permissions (4/14.9.6)
#define ICBFILE_PERM_OTH_X (0x00000001) // Other: Execute OK
#define ICBFILE_PERM_OTH_W (0x00000002) // Other: Write OK
#define ICBFILE_PERM_OTH_R (0x00000004) // Other: Read OK
#define ICBFILE_PERM_OTH_A (0x00000008) // Other: Set Attributes OK
#define ICBFILE_PERM_OTH_D (0x00000010) // Other: Delete OK
#define ICBFILE_PERM_GRP_X (0x00000020) // Group: Execute OK
#define ICBFILE_PERM_GRP_W (0x00000040) // Group: Write OK
#define ICBFILE_PERM_GRP_R (0x00000080) // Group: Read OK
#define ICBFILE_PERM_GRP_A (0x00000100) // Group: Set Attributes OK
#define ICBFILE_PERM_GRP_D (0x00000200) // Group: Delete OK
#define ICBFILE_PERM_OWN_X (0x00000400) // Owner: Execute OK
#define ICBFILE_PERM_OWN_W (0x00000800) // Owner: Write OK
#define ICBFILE_PERM_OWN_R (0x00001000) // Owner: Read OK
#define ICBFILE_PERM_OWN_A (0x00002000) // Owner: Set Attributes OK
#define ICBFILE_PERM_OWN_D (0x00004000) // Owner: Delete OK
// (4/14.9.7) Record Format
// Skipped
// (4/14.9.8) Record Display Attributes
// Skipped
/*** nsr_eah - Extended Attributes Header Descriptor (4/14.10.1)
*
*/
typedef struct NSR_EAH {
DESTAG Destag; // Descriptor Tag (ID_NSR_XA)
ULONG EAImp; // Implementation Attributes Location
ULONG EAApp; // Application Attributes Location
} NSR_EAH, *PNSR_EAH;
/*** nsr_ea_g - Generic Extended Attributes Format (4/14.10.2)
*
*/
typedef struct NSR_EA_GENERIC {
ULONG EAType; // Extended Attribute Type
UCHAR EASubType; // Extended Attribute Sub Type
UCHAR Res5[3]; // Reserved Zeros
ULONG EALength; // Extended Attribute Length
UCHAR EAData[0]; // Extended Attribute Data (variant!)
} NSR_EA_GENERIC, *PNSR_EA_GENERIC;
//
// Extended Attribute Types (14.4.10)
//
#define EA_TYPE_CHARSET 1
#define EA_TYPE_ALTPERM 3
#define EA_TYPE_FILETIMES 5
#define EA_TYPE_INFOTIMES 6
#define EA_TYPE_DEVICESPEC 12
#define EA_TYPE_IMPUSE 2048
#define EA_TYPE_APPUSE 65536
#define EA_SUBTYPE_BASE 1
// (4/14.10.3) Character Set Information Extended Attribute Format
// Skipped
// (4/14.10.4) Alternate Permissions Extended Attribute Format
// Skipped
// (4/14.10.5) File Times Extended Attribute Format
typedef struct NSR_EA_FILETIMES {
ULONG EAType; // Extended Attribute Type
UCHAR EASubType; // Extended Attribute Sub Type
UCHAR Res5[3]; // Reserved Zeros
ULONG EALength; // Extended Attribute Length
ULONG DataLength; // EAData Length
ULONG Existence; // Specifies which times are recorded
TIMESTAMP Stamps[0]; // Timestamps (variant!)
} NSR_EA_FILETIMES, *PNSR_EA_FILETIMES;
// Definitions for nsr_ea_filetimes_Existence (4/14.10.5.6)
#define EA_FILETIMES_E_CREATION (0x00000001)
#define EA_FILETIMES_E_DELETION (0x00000004)
#define EA_FILETIMES_E_EFFECTIVE (0x00000008)
#define EA_FILETIMES_E_LASTBACKUP (0x00000020)
// (4/14.10.6) Information Times Extended Attribute Format
//
// Exactly the same as an NSR_EA_FILETIMES
// Definitions for nsr_ea_infotimes_Existence (4/14.10.6.6)
#define EA_INFOTIMES_E_CREATION (0x00000001)
#define EA_INFOTIMES_E_MODIFICATION (0x00000002)
#define EA_INFOTIMES_E_EXPIRATION (0x00000004)
#define EA_INFOTIMES_E_EFFECTIVE (0x00000008)
// (4/14.10.7) Device Specification Extended Attribute Format
// Skipped
// (4/14.10.8) Implementation Use Extended Attribute Format
// Skipped
// (4/14.10.9) Application Use Extended Attribute Format
// Skipped
/*** icbuase - Unallocated Space Entry (4/14.11)
*
* icbuase_destag.destag_Ident = DESTAG_ID_NSR_UASE
* icbuase_icbtag.icbtag_FileType = ICBTAG_FILE_T_UASE
*
*/
typedef struct ICBUASE {
DESTAG Destag; // Descriptor Tag (ID_NSR_ICBUASE)
ICBTAG Icbtag; // ICB Tag (ICBTAG_FILE_T_UASE)
ULONG AllocLen; // Allocation Descriptors Length
UCHAR Allocs[0]; // Allocation Descriptors (variant!)
// The true length of this structure may vary!
// icbuase_Allocs has a variant length = icbuase_AllocLen;
} ICBUASE, *PICBUASE;
/*** nsr_sbd - Space Bitmap Descriptor (4/14.12)
*
* nsr_sbd_destag.destag_Ident = DESTAG_ID_NSR_SBD
*
*/
typedef struct NSR_SBD {
DESTAG Destag; // Descriptor Tag (DESTAG_ID_NSR_SBD)
ULONG BitCount; // Number of bits in Space Bitmap
ULONG ByteCount; // Number of bytes in Space Bitmap
UCHAR Bits[0]; // Space Bitmap (variant!)
// The true length of this structure may vary!
// nsr_sbd_Bits has a variant length = nsr_sbd_ByteCount;
} NSR_SBD, *PNSR_SBD;
/*** icbpinteg - Partition Integrity ICB Entry (4/14.13)
*
*/
typedef struct ICBPINTEG {
DESTAG Destag; // Descriptor Tag (ID_NSR_PINTEG)
ICBTAG Icbtag; // ICB Tag (ICBTAG_FILE_T_PINTEG)
TIMESTAMP Recording; // Recording Time
UCHAR IntegType; // Integrity Type (ICBPINTEG_T_...)
UCHAR Res49[175]; // Reserved Zeros
REGID ImpUseID; // Implemetation Use Identifier
UCHAR ImpUse[256]; // Implemetation Use Area
} ICBPINTEG, *PICBPINTEG;
// ICBPINTEG_T_... - Values for icbpinteg_IntegType
#define ICBPINTEG_T_OPEN 0 // Open Partition Integrity Entry
#define ICBPINTEG_T_CLOSE 1 // Close Partition Integrity Entry
#define ICBPINTEG_T_STABLE 2 // Stable Partition Integrity Entry
/*** (4/14.14.1) Short Allocation Descriptor
*** (4/14.14.2) Long Allocation Descriptor
*** (4/14.14.3) Extended Allocation Descriptor
*
* See SHORTAD, LONGAD, EXTAD, already defined above.
*
*/
/*** nsr_lvhd - Logical Volume Header Descriptor (4/14.15)
*
* The definition is moved to before Logical Volume Integrity
* Descriptor.
*
*/
/*** nsr_path - Path Component (4/14.16)
*
*/
typedef struct NSR_PATH {
UCHAR Type; // Path Component Type (NSR_PATH_T_...)
UCHAR CompLen; // Path Component Length
UCHAR CompVer; // Path Component Version
UCHAR Comp[0]; // Path Component Identifier (variant!)
// nsr_path_Comp has a variant length = nsr_path_CompLen
} NSR_PATH, *PNSR_PATH;
// NSR_PATH_T_... - Values for nsr_path_Type
#define NSR_PATH_T_RESERVED 0 // Reserved Value
#define NSR_PATH_T_OTHER_ROOT 1 // Another root directory, by agreement
#define NSR_PATH_T_ROOTDIR 2 // Root Directory ('\')
#define NSR_PATH_T_PARENTDIR 3 // Parent Directory ('..')
#define NSR_PATH_T_CURDIR 4 // Current Directory ('.')
#define NSR_PATH_T_FILE 5 // File
/*** ISO 13346 Part 5: Record Structure
*
* Skipped
*
*/
//
// Restore the standard structure packing.
//
#pragma pack()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -