diff options
Diffstat (limited to 'sys/ntfs/ntfs.h')
-rw-r--r-- | sys/ntfs/ntfs.h | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/sys/ntfs/ntfs.h b/sys/ntfs/ntfs.h index e1ddb09d729..dcbaa9f835b 100644 --- a/sys/ntfs/ntfs.h +++ b/sys/ntfs/ntfs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs.h,v 1.5 2007/06/02 01:02:56 deraadt Exp $ */ +/* $OpenBSD: ntfs.h,v 1.6 2008/09/01 17:30:56 deraadt Exp $ */ /* $NetBSD: ntfs.h,v 1.5 2003/04/24 07:50:19 christos Exp $ */ /*- @@ -33,7 +33,6 @@ typedef u_int64_t cn_t; typedef u_int16_t wchar; -#pragma pack(1) #define BBSIZE 1024 #define BBOFF ((off_t)(0)) #define BBLOCK 0 @@ -51,7 +50,7 @@ struct fixuphdr { u_int32_t fh_magic; u_int16_t fh_foff; u_int16_t fh_fnum; -}; +} __packed; #define NTFS_AF_INRUN 0x00000001 struct attrhdr { @@ -64,7 +63,7 @@ struct attrhdr { u_int8_t a_compression; u_int8_t reserved2; u_int16_t a_index; -}; +} __packed; #define NTFS_A_STD 0x10 #define NTFS_A_ATTRLIST 0x20 #define NTFS_A_NAME 0x30 @@ -83,7 +82,7 @@ struct attr { u_int16_t reserved1; u_int16_t a_dataoff; u_int16_t a_indexed; - } a_S_r; + } __packed a_S_r; struct { cn_t a_vcnstart; cn_t a_vcnend; @@ -93,9 +92,9 @@ struct attr { u_int64_t a_allocated; u_int64_t a_datalen; u_int64_t a_initialized; - } a_S_nr; + } __packed a_S_nr; } a_S; -}; +} __packed; #define a_r a_S.a_S_r #define a_nr a_S.a_S_nr @@ -104,7 +103,7 @@ typedef struct { u_int64_t t_write; u_int64_t t_mftwrite; u_int64_t t_access; -} ntfs_times_t; +} __packed ntfs_times_t; #define NTFS_FFLAG_RDONLY 0x01LL #define NTFS_FFLAG_HIDDEN 0x02LL @@ -123,7 +122,7 @@ struct attr_name { u_int8_t n_namelen; u_int8_t n_nametype; u_int16_t n_name[1]; -}; +} __packed; #define NTFS_IRFLAG_INDXALLOC 0x00000001 struct attr_indexroot { @@ -136,7 +135,7 @@ struct attr_indexroot { u_int32_t ir_allocated; /* same as above */ u_int16_t ir_flag;/* ?? always 1 */ u_int16_t ir_unkn7; -}; +} __packed; struct attr_attrlist { u_int32_t al_type; /* Attribute type */ @@ -148,7 +147,7 @@ struct attr_attrlist { u_int32_t reserved; u_int16_t al_index; /* Attribute index in MFT record */ u_int16_t al_name[1]; /* Name */ -}; +} __packed; #define NTFS_INDXMAGIC (u_int32_t)(0x58444E49) struct attr_indexalloc { @@ -159,7 +158,7 @@ struct attr_indexalloc { u_int16_t unknown2; u_int32_t ia_inuse; u_int32_t ia_allocated; -}; +} __packed; #define NTFS_IEFLAG_SUBNODE 0x00000001 #define NTFS_IEFLAG_LAST 0x00000002 @@ -180,7 +179,7 @@ struct attr_indexentry { u_int8_t ie_fnametype; wchar ie_fname[NTFS_MAXFILENAME]; /* cn_t ie_bufcn; buffer with subnodes */ -}; +} __packed; #define NTFS_FILEMAGIC (u_int32_t)(0x454C4946) #define NTFS_FRFLAG_DIR 0x0002 @@ -195,7 +194,7 @@ struct filerec { u_int32_t fr_allocated; /* allocated length of record */ u_int64_t fr_mainrec; /* main record */ u_int16_t fr_attrnum; /* maximum attr number + 1 ??? */ -}; +} __packed; #define NTFS_ATTRNAME_MAXLEN 0x40 #define NTFS_ADFLAG_NONRES 0x0080 /* Attrib can be non resident */ @@ -207,13 +206,13 @@ struct attrdef { u_int32_t ad_flag; u_int64_t ad_minlen; u_int64_t ad_maxlen; /* -1 for nonlimited */ -}; +} __packed; struct ntvattrdef { char ad_name[0x40]; int ad_namelen; u_int32_t ad_type; -}; +} __packed; #define NTFS_BBID "NTFS " #define NTFS_BBIDLEN 8 @@ -235,9 +234,7 @@ struct bootfile { /* 0xF6 inducates 1/4 */ u_int32_t bf_ibsz; /* index buffer size */ u_int32_t bf_volsn; /* volume ser. num. */ -}; - -#pragma pack() +} __packed; typedef wchar (ntfs_wget_func_t)(const char **); typedef int (ntfs_wput_func_t)(char *, size_t, wchar); |