Changeset 127 for trunk/include/regfi.h


Ignore:
Timestamp:
09/01/08 19:20:50 (16 years ago)
Author:
tim
Message:

added preliminary support for 'ri' subkey lists.
cleaned up regfi API a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/regfi.h

    r126 r127  
    8686#define REGFI_VK_MIN_LENGTH        0x14
    8787#define REGFI_SK_MIN_LENGTH        0x14
    88 #define REGFI_HASH_LIST_MIN_LENGTH 0x4
     88#define REGFI_SUBKEY_LIST_MIN_LEN 0x4
    8989
    9090/* Constants used for validation */
     
    138138
    139139
    140 /* Hash List -- list of key offsets and hashed names for consistency */
     140/* Subkey List -- list of key offsets and hashed names for consistency */
    141141typedef struct
    142142{
    143143  uint32 nk_off;
    144144  uint32 hash;
    145 } REGF_HASH_LIST_ELEM;
     145} REGF_SUBKEY_LIST_ELEM;
    146146
    147147
     
    150150  uint32 offset;        /* Real offset of this record's cell in the file */
    151151  uint32 cell_size;      /* ((start_offset - end_offset) & 0xfffffff8) */
    152   REGF_HBIN* hbin;       /* pointer to HBIN record (in memory) containing
    153                           * this nk record
    154                           */
    155   uint32 hbin_off;       /* offset from beginning of this hbin block */
    156   REGF_HASH_LIST_ELEM* hashes;
     152  uint32 num_keys;
     153  REGF_SUBKEY_LIST_ELEM* elements;
    157154 
    158155  uint8 magic[REC_HDR_SIZE];
    159   uint16 num_keys;
    160 } REGF_HASH_LIST;
     156} REGF_SUBKEY_LIST;
    161157
    162158
     
    219215  /* link in the other records here */
    220216  REGF_VK_REC** values;
    221   REGF_HASH_LIST* subkeys;
     217  REGF_SUBKEY_LIST* subkeys;
    222218 
    223219  /* header information */
     
    246242  /* children */
    247243  uint32 num_subkeys;
    248   uint32 subkeys_off;   /* hash records that point to NK records */     
     244  uint32 subkeys_off;   /* offset of subkey list that points to NK records */
    249245  uint32 num_values;
    250246  uint32 values_off;    /* value lists which point to VK records */
    251   uint32 sk_off;        /* offset to SK record */ 
     247  uint32 sk_off;        /* offset to SK record */
    252248} REGF_NK_REC;
    253249
     
    347343const REGF_VK_REC*    regfi_iterator_cur_value(REGFI_ITERATOR* i);
    348344const REGF_VK_REC*    regfi_iterator_next_value(REGFI_ITERATOR* i);
     345
     346
     347/********************************************************/
     348/* Middle-layer structure caching, loading, and linking */
     349/********************************************************/
     350REGF_HBIN* regfi_lookup_hbin(REGF_FILE* file, uint32 offset);
     351
     352REGF_NK_REC* regfi_load_key(REGF_FILE* file, uint32 offset, bool strict);
     353
     354REGF_SUBKEY_LIST* regfi_load_subkeylist(REGF_FILE* file, uint32 offset,
     355                                        uint32 num_keys, uint32 max_size,
     356                                        bool strict);
     357
     358REGF_VK_REC** regfi_load_valuelist(REGF_FILE* file, uint32 offset,
     359                                   uint32 num_values, uint32 max_size,
     360                                   bool strict);
     361
     362REGF_SUBKEY_LIST* regfi_merge_subkeylists(uint16 num_lists,
     363                                          REGF_SUBKEY_LIST** lists,
     364                                          bool strict);
    349365
    350366/************************************/
     
    370386                                     uint32 max_size, bool strict);
    371387
     388REGF_VK_REC* regfi_parse_vk(REGF_FILE* file, uint32 offset,
     389                            uint32 max_size, bool strict);
     390
     391uint8* regfi_parse_data(REGF_FILE* file, uint32 offset,
     392                        uint32 length, bool strict);
     393
     394REGF_SK_REC* regfi_parse_sk(REGF_FILE* file, uint32 offset, uint32 max_size, bool strict);
     395
     396range_list* regfi_parse_unalloc_cells(REGF_FILE* file);
     397
     398bool regfi_parse_cell(int fd, uint32 offset, uint8* hdr, uint32 hdr_len,
     399                      uint32* cell_length, bool* unalloc);
     400
     401char* regfi_parse_classname(REGF_FILE* file, uint32 offset,
     402                            uint16* name_length, bool strict);
     403
    372404
    373405/* Private Functions */
    374406REGF_NK_REC*          regfi_rootkey(REGF_FILE* file);
    375407void                  regfi_key_free(REGF_NK_REC* nk);
     408void                  regfi_subkeylist_free(REGF_SUBKEY_LIST* list);
    376409uint32                regfi_read(int fd, uint8* buf, uint32* length);
    377410
    378411
    379 
    380 /****************/
    381 /* Experimental */
    382 /****************/
    383 REGF_NK_REC* regfi_load_key(REGF_FILE* file, uint32 offset, bool strict);
    384 
    385 REGF_HASH_LIST* regfi_load_hashlist(REGF_FILE* file, uint32 offset,
    386                                     uint32 num_keys, uint32 max_size,
    387                                     bool strict);
    388 
    389 REGF_VK_REC** regfi_load_valuelist(REGF_FILE* file, uint32 offset,
    390                                    uint32 num_values, uint32 max_size,
    391                                    bool strict);
    392 
    393 REGF_VK_REC* regfi_parse_vk(REGF_FILE* file, uint32 offset,
    394                             uint32 max_size, bool strict);
    395 
    396 uint8* regfi_parse_data(REGF_FILE* file, uint32 offset,
    397                         uint32 length, bool strict);
    398 
    399 REGF_SK_REC* regfi_parse_sk(REGF_FILE* file, uint32 offset, uint32 max_size, bool strict);
    400 
    401 range_list* regfi_parse_unalloc_cells(REGF_FILE* file);
    402 
    403 REGF_HBIN* regfi_lookup_hbin(REGF_FILE* file, uint32 offset);
    404 
    405 bool regfi_parse_cell(int fd, uint32 offset, uint8* hdr, uint32 hdr_len,
    406                       uint32* cell_length, bool* unalloc);
    407 
    408 char* regfi_parse_classname(REGF_FILE* file, uint32 offset,
    409                             uint16* name_length, bool strict);
    410 
    411412#endif  /* _REGFI_H */
Note: See TracChangeset for help on using the changeset viewer.