Changeset 54 for trunk/include
- Timestamp:
- 09/04/05 21:19:05 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/regfio.h
r53 r54 57 57 #define REG_BINARY 3 58 58 #define REG_DWORD 4 59 #define REG_DWORD_LE 4 60 #define REG_DWORD_BE 5 59 #define REG_DWORD_LE 4 /* DWORD, little endian */ 60 #define REG_DWORD_BE 5 /* DWORD, big endian */ 61 61 #define REG_LINK 6 62 62 #define REG_MULTI_SZ 7 … … 95 95 #define NK_TYPE_ROOTKEY 0x002c 96 96 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-- }; 99 100 100 101 … … 107 108 uint32 free_off; /* offset to free space within the hbin record */ 108 109 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 */ 110 113 111 114 uint8 header[HBIN_HDR_SIZE]; /* "hbin" */ 112 115 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 */ 115 120 bool dirty; /* has this hbin block been modified? */ 116 121 } REGF_HBIN; 117 122 118 123 /* ??? List -- list of key offsets and hashed names for consistency */ 119 120 124 typedef struct { 121 125 uint32 nk_off; … … 124 128 125 129 typedef 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) */ 129 135 130 136 uint8 header[REC_HDR_SIZE]; … … 136 142 137 143 typedef 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 */ 139 147 uint32 hbin_off; /* offset from beginning of this hbin block */ 140 148 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ 141 uint32 rec_off; 149 uint32 rec_off; /* offset stored in the value list */ 142 150 143 151 uint8 header[REC_HDR_SIZE]; … … 156 164 typedef struct _regf_sk_rec { 157 165 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 */ 159 169 uint32 hbin_off; /* offset from beginning of this hbin block */ 160 170 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ 161 171 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 */ 164 175 165 176 uint8 header[REC_HDR_SIZE]; … … 174 185 175 186 typedef 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 */ 177 190 uint32 hbin_off; /* offset from beginning of this hbin block */ 178 191 uint32 subkey_index; /* index to next subkey record to return */ … … 180 193 181 194 /* header information */ 182 183 195 uint8 header[REC_HDR_SIZE]; 184 196 uint16 key_type; … … 190 202 191 203 /* 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 */ 197 208 198 209 /* unknowns */ 199 200 uint32 unk_index; /* nigel says run time index ? */ 210 uint32 unk_index; /* nigel says run time index ? */ 201 211 202 212 /* children */ 203 204 213 uint32 num_subkeys; 205 214 uint32 subkeys_off; /* hash records that point to NK records */ 206 215 uint32 num_values; 207 216 uint32 values_off; /* value lists which point to VK records */ 208 uint32 sk_off; 217 uint32 sk_off; /* offset to SK record */ 209 218 210 219 /* link in the other records here */ 211 212 220 REGF_LF_REC subkeys; 213 221 REGF_VK_REC *values; … … 220 228 typedef struct { 221 229 /* 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 */ 227 234 228 235 /* file format information */ 229 236 230 237 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 */ 232 241 uint32 last_block; /* offset to last hbin block in file */ 233 242 uint32 checksum; /* XOR of bytes 0x0000 - 0x01FB */ 234 243 NTTIME mtime; 235 244 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 */ 237 248 238 249 /* unknowns used to simply writing */ 239 240 250 uint32 unknown1; 241 251 uint32 unknown2; … … 247 257 248 258 259 /******************************************************************************/ 249 260 /* Function Declarations */ 250 261 251 262 const char* regfio_type_val2str(unsigned int val); 252 263 int regfio_type_str2val(const char* str);
Note: See TracChangeset
for help on using the changeset viewer.