Changeset 84 for trunk/include
- Timestamp:
- 01/19/07 09:52:25 (18 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/regfi.h
r81 r84 1 1 /* 2 2 * Branched from Samba project, Subversion repository version #6903: 3 * http:// websvn.samba.org/cgi-bin/viewcvs.cgi/trunk/source/include/regfio.h3 * http://viewcvs.samba.org/cgi-bin/viewcvs.cgi/trunk/source/include/regfio.h?rev=6903&view=auto 4 4 * 5 5 * Unix SMB/CIFS implementation. … … 109 109 uint32 free_off; /* offset to free space within the hbin record */ 110 110 uint32 free_size; /* amount of data left in the block */ 111 intref_count; /* how many active records are pointing to this111 uint32 ref_count; /* how many active records are pointing to this 112 112 * block (not used currently) 113 113 */ 114 115 uint8 header[HBIN_HDR_SIZE]; /* "hbin" */ 114 116 115 uint32 first_hbin_off; /* offset from first hbin block */ 117 116 uint32 block_size; /* block size of this block is 118 117 * usually a multiple of 4096Kb 119 118 */ 119 uint8 header[HBIN_HDR_SIZE]; /* "hbin" */ 120 120 prs_struct ps; /* data */ 121 121 bool dirty; /* has this hbin block been modified? */ … … 129 129 130 130 typedef struct { 131 REGF_HBIN *hbin; /* pointer to HBIN record (in memory) containing131 REGF_HBIN* hbin; /* pointer to HBIN record (in memory) containing 132 132 * this nk record 133 133 */ 134 REGF_HASH_REC* hashes; 134 135 uint32 hbin_off; /* offset from beginning of this hbin block */ 135 136 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ … … 137 138 uint8 header[REC_HDR_SIZE]; 138 139 uint16 num_keys; 139 REGF_HASH_REC *hashes;140 140 } REGF_LF_REC; 141 141 … … 143 143 144 144 typedef struct { 145 REGF_HBIN *hbin; /* pointer to HBIN record (in memory) containing145 REGF_HBIN* hbin; /* pointer to HBIN record (in memory) containing 146 146 * this nk record 147 147 */ 148 char* valuename; 149 uint8* data; 148 150 uint32 hbin_off; /* offset from beginning of this hbin block */ 149 151 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ 150 152 uint32 rec_off; /* offset stored in the value list */ 151 153 152 uint8 header[REC_HDR_SIZE];153 char* valuename;154 154 uint32 data_size; 155 155 uint32 data_off; 156 uint8* data;157 156 uint32 type; 157 uint8 header[REC_HDR_SIZE]; 158 158 uint16 flag; 159 159 } REGF_VK_REC; … … 164 164 165 165 typedef struct _regf_sk_rec { 166 struct _regf_sk_rec *next, *prev; 167 REGF_HBIN *hbin; /* pointer to HBIN record (in memory) containing 166 struct _regf_sk_rec* next; 167 struct _regf_sk_rec* prev; 168 REGF_HBIN* hbin; /* pointer to HBIN record (in memory) containing 168 169 * this nk record 169 170 */ 171 SEC_DESC* sec_desc; 170 172 uint32 hbin_off; /* offset from beginning of this hbin block */ 171 173 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ … … 175 177 */ 176 178 177 uint8 header[REC_HDR_SIZE];178 179 uint32 prev_sk_off; 179 180 uint32 next_sk_off; 180 181 uint32 ref_count; 181 182 uint32 size; 182 SEC_DESC *sec_desc;183 uint8 header[REC_HDR_SIZE]; 183 184 } REGF_SK_REC; 184 185 … … 186 187 /* Key Name */ 187 188 typedef struct { 189 uint32 hbin_off; /* offset from beginning of this hbin block */ 190 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ 188 191 REGF_HBIN *hbin; /* pointer to HBIN record (in memory) containing 189 * this nk record 190 */ 191 uint32 hbin_off; /* offset from beginning of this hbin block */ 192 /*uint32 subkey_index;*/ /* index to next subkey record to return */ 193 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ 192 * this nk record */ 193 194 /* link in the other records here */ 195 REGF_VK_REC* values; 196 REGF_SK_REC* sec_desc; 197 REGF_LF_REC subkeys; 194 198 195 199 /* header information */ 200 /* XXX: should we be looking for types other than the root key type? */ 201 uint16 key_type; 196 202 uint8 header[REC_HDR_SIZE]; 197 uint16 key_type;198 203 NTTIME mtime; 204 char* classname; 205 char* keyname; 199 206 uint32 parent_off; /* back pointer in registry hive */ 200 207 uint32 classname_off; 201 char *classname;202 char *keyname;203 208 204 209 /* max lengths */ … … 218 223 uint32 sk_off; /* offset to SK record */ 219 224 220 /* link in the other records here */221 REGF_LF_REC subkeys;222 REGF_VK_REC* values;223 REGF_SK_REC* sec_desc;224 225 225 } REGF_NK_REC; 226 226 … … 231 231 int fd; /* file descriptor */ 232 232 int open_flags; /* flags passed to the open() call */ 233 void *mem_ctx; /* memory context for run-time file access information */234 REGF_HBIN *block_list; /* list of open hbin blocks */233 void* mem_ctx; /* memory context for run-time file access information */ 234 REGF_HBIN* block_list; /* list of open hbin blocks */ 235 235 236 236 /* file format information */ 237 REGF_SK_REC* sec_desc_list; /* list of security descriptors referenced 238 * by NK records 239 */ 237 240 238 241 uint8 header[REGF_HDR_SIZE]; /* "regf" */ 242 NTTIME mtime; 239 243 uint32 data_offset; /* offset to record in the first (or any?) 240 244 * hbin block … … 242 246 uint32 last_block; /* offset to last hbin block in file */ 243 247 uint32 checksum; /* XOR of bytes 0x0000 - 0x01FB */ 244 NTTIME mtime;245 246 REGF_SK_REC *sec_desc_list; /* list of security descriptors referenced247 * by NK records248 */249 248 250 249 /* unknowns */ … … 279 278 /* Function Declarations */ 280 279 281 const char* regfi_type_val2str(unsigned int val); 282 int regfi_type_str2val(const char* str); 283 284 char* regfi_get_sacl(SEC_DESC* sec_desc); 285 char* regfi_get_dacl(SEC_DESC* sec_desc); 286 char* regfi_get_owner(SEC_DESC* sec_desc); 287 char* regfi_get_group(SEC_DESC* sec_desc); 288 289 REGF_FILE* regfi_open(const char* filename); 290 int regfi_close(REGF_FILE* r); 291 292 REGF_NK_REC* regfi_rootkey(REGF_FILE* file); 293 /* REGF_NK_REC* regfi_fetch_subkey( REGF_FILE* file, REGF_NK_REC* nk ); */ 294 295 void regfi_key_free(REGF_NK_REC* nk); 296 297 REGFI_ITERATOR* regfi_iterator_new(REGF_FILE* fh); 298 void regfi_iterator_free(REGFI_ITERATOR* i); 299 bool regfi_iterator_down(REGFI_ITERATOR* i); 300 bool regfi_iterator_up(REGFI_ITERATOR* i); 301 bool regfi_iterator_to_root(REGFI_ITERATOR* i); 302 303 bool regfi_iterator_find_subkey(REGFI_ITERATOR* i, const char* subkey_name); 304 bool regfi_iterator_walk_path(REGFI_ITERATOR* i, const char** path); 305 /* XXX: these which return NK and VK records should return them as consts */ 306 REGF_NK_REC* regfi_iterator_cur_key(REGFI_ITERATOR* i); 307 REGF_NK_REC* regfi_iterator_first_subkey(REGFI_ITERATOR* i); 308 REGF_NK_REC* regfi_iterator_cur_subkey(REGFI_ITERATOR* i); 309 REGF_NK_REC* regfi_iterator_next_subkey(REGFI_ITERATOR* i); 310 311 bool regfi_iterator_find_value(REGFI_ITERATOR* i, const char* value_name); 312 REGF_VK_REC* regfi_iterator_first_value(REGFI_ITERATOR* i); 313 REGF_VK_REC* regfi_iterator_cur_value(REGFI_ITERATOR* i); 314 REGF_VK_REC* regfi_iterator_next_value(REGFI_ITERATOR* i); 280 const char* regfi_type_val2str(unsigned int val); 281 int regfi_type_str2val(const char* str); 282 283 char* regfi_get_sacl(SEC_DESC* sec_desc); 284 char* regfi_get_dacl(SEC_DESC* sec_desc); 285 char* regfi_get_owner(SEC_DESC* sec_desc); 286 char* regfi_get_group(SEC_DESC* sec_desc); 287 288 REGF_FILE* regfi_open(const char* filename); 289 int regfi_close(REGF_FILE* r); 290 291 REGFI_ITERATOR* regfi_iterator_new(REGF_FILE* fh); 292 void regfi_iterator_free(REGFI_ITERATOR* i); 293 bool regfi_iterator_down(REGFI_ITERATOR* i); 294 bool regfi_iterator_up(REGFI_ITERATOR* i); 295 bool regfi_iterator_to_root(REGFI_ITERATOR* i); 296 297 bool regfi_iterator_find_subkey(REGFI_ITERATOR* i, 298 const char* subkey_name); 299 bool regfi_iterator_walk_path(REGFI_ITERATOR* i, 300 const char** path); 301 const REGF_NK_REC* regfi_iterator_cur_key(REGFI_ITERATOR* i); 302 const REGF_NK_REC* regfi_iterator_first_subkey(REGFI_ITERATOR* i); 303 const REGF_NK_REC* regfi_iterator_cur_subkey(REGFI_ITERATOR* i); 304 const REGF_NK_REC* regfi_iterator_next_subkey(REGFI_ITERATOR* i); 305 306 bool regfi_iterator_find_value(REGFI_ITERATOR* i, 307 const char* value_name); 308 const REGF_VK_REC* regfi_iterator_first_value(REGFI_ITERATOR* i); 309 const REGF_VK_REC* regfi_iterator_cur_value(REGFI_ITERATOR* i); 310 const REGF_VK_REC* regfi_iterator_next_value(REGFI_ITERATOR* i); 311 312 313 /* Private Functions */ 314 REGF_NK_REC* regfi_rootkey(REGF_FILE* file); 315 void regfi_key_free(REGF_NK_REC* nk); 316 315 317 316 318 #endif /* _REGFI_H */ -
trunk/include/smb_deps.h
r68 r84 151 151 #define TIME_FIXUP_CONSTANT (369.0*365.25*24*60*60-(3.0*24*60*60+6.0*60*60)) 152 152 153 void unix_to_nt_time(NTTIME *nt, time_t t);154 time_t nt_time_to_unix( NTTIME *nt);153 void unix_to_nt_time(NTTIME* nt, time_t t); 154 time_t nt_time_to_unix(const NTTIME* nt); 155 155 156 156 /* End of stuff from lib/time.c */ … … 169 169 char *prs_mem_get(prs_struct *ps, uint32 extra_size); 170 170 bool prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32); 171 bool prs_uint32s( bool charmode,const char *name, prs_struct *ps,171 bool prs_uint32s(const char *name, prs_struct *ps, 172 172 int depth, uint32 *data32s, int len); 173 173 bool prs_uint16(const char *name, prs_struct *ps, int depth, uint16 *data16); … … 177 177 uint16 *data16, uint32 ptr_uint16, uint32 start_offset); 178 178 bool prs_uint8(const char *name, prs_struct *ps, int depth, uint8 *data8); 179 bool prs_uint8s( bool charmode,const char *name, prs_struct *ps, int depth,179 bool prs_uint8s(const char *name, prs_struct *ps, int depth, 180 180 uint8* data8s, int len); 181 181 bool prs_set_offset(prs_struct *ps, uint32 offset);
Note: See TracChangeset
for help on using the changeset viewer.