Changeset 146 for trunk/include


Ignore:
Timestamp:
02/18/09 23:46:37 (15 years ago)
Author:
tim
Message:

reorganized SK caching
refined interface to HBIN functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/regfi.h

    r145 r146  
    158158
    159159
    160 
    161160/* HBIN block */
    162161typedef struct _regfi_hbin
     
    258257  WINSEC_DESC* sec_desc;
    259258  uint32 hbin_off;      /* offset from beginning of this hbin block */
    260  
    261   uint32 sk_off;        /* offset parsed from NK record used as a key
    262                          * to lookup reference to this SK record
    263                          */
    264259 
    265260  uint32 prev_sk_off;
     
    330325  /* Metadata about hbins */
    331326  range_list* hbins;
     327
     328  /* SK record cached since they're repeatedly reused */
     329  lru_cache* sk_cache;
    332330
    333331  /* Error/warning/info messages returned by lower layer functions */
     
    375373  REGFI_FILE* f;
    376374  void_stack* key_positions;
    377   lru_cache* sk_recs;
    378375  REGFI_NK_REC* cur_key;
    379376  uint32 cur_subkey;
     
    384381typedef struct
    385382{
    386   /* XXX: Should probably eliminate the storage of keys here
    387    *      once key caching is implemented.
    388    */
    389383  REGFI_NK_REC* nk;
    390384  uint32 cur_subkey;
     
    437431
    438432/********************************************************/
    439 /* Middle-layer structure caching, loading, and linking */
     433/* Middle-layer structure loading, linking, and caching */
    440434/********************************************************/
    441 REGFI_HBIN*           regfi_lookup_hbin(REGFI_FILE* file, uint32 voffset);
    442435REGFI_NK_REC*         regfi_load_key(REGFI_FILE* file, uint32 offset,
    443436                                     bool strict);
    444 REGFI_SUBKEY_LIST*    regfi_load_subkeylist(REGFI_FILE* file, uint32 offset,
    445                                             uint32 num_keys, uint32 max_size,
    446                                             bool strict);
    447437REGFI_VK_REC*         regfi_load_value(REGFI_FILE* file, uint32 offset,
    448438                                       bool strict);
     439REGFI_SUBKEY_LIST*    regfi_load_subkeylist(REGFI_FILE* file, uint32 offset,
     440                                            uint32 num_keys, uint32 max_size,
     441                                            bool strict);
    449442REGFI_VALUE_LIST*     regfi_load_valuelist(REGFI_FILE* file, uint32 offset,
    450                                            uint32 num_values, uint32 max_size, 
     443                                           uint32 num_values, uint32 max_size,
    451444                                           bool strict);
     445
     446/* These are cached so return values don't need to be freed. */
     447const REGFI_SK_REC*   regfi_load_sk(REGFI_FILE* file, uint32 offset,
     448                                    bool strict);
     449const REGFI_HBIN*     regfi_lookup_hbin(REGFI_FILE* file, uint32 voffset);
     450
     451
    452452
    453453/************************************/
     
    522522void                  regfi_add_message(REGFI_FILE* file, uint16 msg_type,
    523523                                        const char* fmt, ...);
     524REGFI_NK_REC*         regfi_copy_nk(const REGFI_NK_REC* nk);
     525REGFI_VK_REC*         regfi_copy_vk(const REGFI_VK_REC* vk);
     526
    524527#endif  /* _REGFI_H */
Note: See TracChangeset for help on using the changeset viewer.