Changeset 54 for trunk/include


Ignore:
Timestamp:
09/04/05 21:19:05 (19 years ago)
Author:
tim
Message:

Added some verbose output

code cleanup and minor bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/regfio.h

    r53 r54  
    5757#define REG_BINARY                     3
    5858#define REG_DWORD                      4
    59 #define REG_DWORD_LE                   4        /* DWORD, little endian */
    60 #define REG_DWORD_BE                   5        /* DWORD, big endian */
     59#define REG_DWORD_LE                   4  /* DWORD, little endian */
     60#define REG_DWORD_BE                   5  /* DWORD, big endian */
    6161#define REG_LINK                       6
    6262#define REG_MULTI_SZ                   7
     
    9595#define NK_TYPE_ROOTKEY         0x002c
    9696
    97 #define HBIN_STORE_REF(x, y)    { x->hbin = y; y->ref_count++ };
    98 #define HBIN_REMOVE_REF(x, y)   { x->hbin = NULL; y->ref_count-- /* if the count == 0; we can clean up */ };
     97#define HBIN_STORE_REF(x, y) { x->hbin = y; y->ref_count++ };
     98/* if the count == 0; we can clean up */
     99#define HBIN_REMOVE_REF(x, y){ x->hbin = NULL; y->ref_count-- };
    99100
    100101
     
    107108  uint32 free_off;       /* offset to free space within the hbin record */
    108109  uint32 free_size;      /* amount of data left in the block */
    109   int    ref_count;      /* how many active records are pointing to this block (not used currently) */
     110  int    ref_count;      /* how many active records are pointing to this
     111                          * block (not used currently)
     112                          */
    110113       
    111114  uint8  header[HBIN_HDR_SIZE]; /* "hbin" */
    112115  uint32 first_hbin_off; /* offset from first hbin block */
    113   uint32 block_size;     /* block size of this blockually a multiple of 4096Kb) */
    114   prs_struct ps;               /* data */
     116  uint32 block_size;     /* block size of this block is
     117                          * usually a multiple of 4096Kb
     118                          */
     119  prs_struct ps;         /* data */
    115120  bool dirty;            /* has this hbin block been modified? */
    116121} REGF_HBIN;
    117122
    118123/* ??? List -- list of key offsets and hashed names for consistency */
    119 
    120124typedef struct {
    121125  uint32 nk_off;
     
    124128
    125129typedef struct {
    126   REGF_HBIN *hbin;      /* pointer to HBIN record (in memory) containing this nk record */
    127   uint32 hbin_off;      /* offset from beginning of this hbin block */
    128   uint32 rec_size;      /* ((start_offset - end_offset) & 0xfffffff8) */
     130  REGF_HBIN *hbin;       /* pointer to HBIN record (in memory) containing
     131                          * this nk record
     132                          */
     133  uint32 hbin_off;       /* offset from beginning of this hbin block */
     134  uint32 rec_size;       /* ((start_offset - end_offset) & 0xfffffff8) */
    129135 
    130136  uint8 header[REC_HDR_SIZE];
     
    136142
    137143typedef struct {
    138   REGF_HBIN *hbin;      /* pointer to HBIN record (in memory) containing this nk record */
     144  REGF_HBIN *hbin;      /* pointer to HBIN record (in memory) containing
     145                         * this nk record
     146                         */
    139147  uint32 hbin_off;      /* offset from beginning of this hbin block */
    140148  uint32 rec_size;      /* ((start_offset - end_offset) & 0xfffffff8) */
    141   uint32 rec_off;               /* offset stored in the value list */
     149  uint32 rec_off;       /* offset stored in the value list */
    142150 
    143151  uint8  header[REC_HDR_SIZE];
     
    156164typedef struct _regf_sk_rec {
    157165  struct _regf_sk_rec *next, *prev;
    158   REGF_HBIN *hbin;      /* pointer to HBIN record (in memory) containing this nk record */
     166  REGF_HBIN *hbin;      /* pointer to HBIN record (in memory) containing
     167                         * this nk record
     168                         */
    159169  uint32 hbin_off;      /* offset from beginning of this hbin block */
    160170  uint32 rec_size;      /* ((start_offset - end_offset) & 0xfffffff8) */
    161171 
    162   uint32 sk_off;                /* offset parsed from NK record used as a key
    163                                    to lookup reference to this SK record */
     172  uint32 sk_off;        /* offset parsed from NK record used as a key
     173                         * to lookup reference to this SK record
     174                         */
    164175 
    165176  uint8  header[REC_HDR_SIZE];
     
    174185
    175186typedef struct {
    176   REGF_HBIN *hbin;      /* pointer to HBIN record (in memory) containing this nk record */
     187  REGF_HBIN *hbin;      /* pointer to HBIN record (in memory) containing
     188                         * this nk record
     189                         */
    177190  uint32 hbin_off;      /* offset from beginning of this hbin block */
    178191  uint32 subkey_index;  /* index to next subkey record to return */
     
    180193 
    181194  /* header information */
    182  
    183195  uint8  header[REC_HDR_SIZE];
    184196  uint16 key_type;
     
    190202 
    191203  /* max lengths */
    192  
    193   uint32 max_bytes_subkeyname;          /* max subkey name * 2 */
    194   uint32 max_bytes_subkeyclassname;     /* max subkey classname length (as if) */
    195   uint32 max_bytes_valuename;           /* max valuename * 2 */
    196   uint32 max_bytes_value;                       /* max value data size */
     204  uint32 max_bytes_subkeyname;      /* max subkey name * 2 */
     205  uint32 max_bytes_subkeyclassname; /* max subkey classname length (as if) */
     206  uint32 max_bytes_valuename;       /* max valuename * 2 */
     207  uint32 max_bytes_value;           /* max value data size */
    197208 
    198209  /* unknowns */
    199  
    200   uint32 unk_index;                     /* nigel says run time index ? */
     210  uint32 unk_index;                 /* nigel says run time index ? */
    201211 
    202212  /* children */
    203  
    204213  uint32 num_subkeys;
    205214  uint32 subkeys_off;   /* hash records that point to NK records */     
    206215  uint32 num_values;
    207216  uint32 values_off;    /* value lists which point to VK records */
    208   uint32 sk_off;                /* offset to SK record */
     217  uint32 sk_off;        /* offset to SK record */
    209218 
    210219  /* link in the other records here */
    211  
    212220  REGF_LF_REC subkeys;
    213221  REGF_VK_REC *values;
     
    220228typedef struct {
    221229  /* run time information */
    222  
    223   int fd;                               /* file descriptor */
    224   int open_flags;                       /* flags passed to the open() call */
    225   void *mem_ctx;                /* memory context for run-time file access information */
    226   REGF_HBIN *block_list;                /* list of open hbin blocks */
     230  int fd;         /* file descriptor */
     231  int open_flags; /* flags passed to the open() call */
     232  void *mem_ctx;  /* memory context for run-time file access information */
     233  REGF_HBIN *block_list; /* list of open hbin blocks */
    227234 
    228235  /* file format information */
    229236 
    230237  uint8  header[REGF_HDR_SIZE]; /* "regf" */
    231   uint32 data_offset;           /* offset to record in the first (or any?) hbin block */
     238  uint32 data_offset;           /* offset to record in the first (or any?)
     239                                 * hbin block
     240                                 */
    232241  uint32 last_block;            /* offset to last hbin block in file */
    233242  uint32 checksum;              /* XOR of bytes 0x0000 - 0x01FB */
    234243  NTTIME mtime;
    235244 
    236   REGF_SK_REC *sec_desc_list;   /* list of security descriptors referenced by NK records */
     245  REGF_SK_REC *sec_desc_list;   /* list of security descriptors referenced
     246                                 * by NK records
     247                                 */
    237248 
    238249  /* unknowns used to simply writing */
    239  
    240250  uint32 unknown1;
    241251  uint32 unknown2;
     
    247257
    248258
     259/******************************************************************************/
    249260/* Function Declarations */
    250  
     261
    251262const char*   regfio_type_val2str(unsigned int val);
    252263int           regfio_type_str2val(const char* str);
Note: See TracChangeset for help on using the changeset viewer.