- Timestamp:
- 08/21/10 12:53:19 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/regfi.c
r202 r203 833 833 } 834 834 else if(buf[0] == 'l' && buf[1] == 'i') 835 { 835 836 elem_size = sizeof(uint32_t); 837 } 836 838 else if((buf[0] == 'l') && (buf[1] == 'f' || buf[1] == 'h')) 837 839 elem_size = sizeof(REGFI_SUBKEY_LIST_ELEM); … … 973 975 * 974 976 ******************************************************************************/ 975 REGFI_SK _REC* regfi_parse_sk(REGFI_FILE* file, uint32_t offset, uint32_t max_size,977 REGFI_SK* regfi_parse_sk(REGFI_FILE* file, uint32_t offset, uint32_t max_size, 976 978 bool strict) 977 979 { 978 REGFI_SK _REC* ret_val = NULL;980 REGFI_SK* ret_val = NULL; 979 981 uint8_t* sec_desc_buf = NULL; 980 982 uint32_t cell_length, length; … … 1000 1002 } 1001 1003 1002 ret_val = talloc(NULL, REGFI_SK _REC);1004 ret_val = talloc(NULL, REGFI_SK); 1003 1005 if(ret_val == NULL) 1004 1006 goto fail_locked; … … 1174 1176 1175 1177 1176 void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK _REC* vk,1178 void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK* vk, 1177 1179 REGFI_ENCODING output_encoding, bool strict) 1178 1180 { … … 1224 1226 /****************************************************************************** 1225 1227 ******************************************************************************/ 1226 REGFI_VK _REC* regfi_load_value(REGFI_FILE* file, uint32_t offset,1228 REGFI_VK* regfi_load_value(REGFI_FILE* file, uint32_t offset, 1227 1229 REGFI_ENCODING output_encoding, bool strict) 1228 1230 { 1229 REGFI_VK _REC* ret_val = NULL;1231 REGFI_VK* ret_val = NULL; 1230 1232 int32_t max_size; 1231 1233 … … 1270 1272 1271 1273 1272 void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK _REC* nk,1274 void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK* nk, 1273 1275 REGFI_ENCODING output_encoding, bool strict) 1274 1276 { … … 1319 1321 * 1320 1322 ******************************************************************************/ 1321 REGFI_NK _REC* regfi_load_key(REGFI_FILE* file, uint32_t offset,1323 REGFI_NK* regfi_load_key(REGFI_FILE* file, uint32_t offset, 1322 1324 REGFI_ENCODING output_encoding, bool strict) 1323 1325 { 1324 REGFI_NK _REC* nk;1326 REGFI_NK* nk; 1325 1327 uint32_t off; 1326 1328 int32_t max_size; … … 1410 1412 /****************************************************************************** 1411 1413 ******************************************************************************/ 1412 const REGFI_SK _REC* regfi_load_sk(REGFI_FILE* file, uint32_t offset, bool strict)1413 { 1414 REGFI_SK _REC* ret_val = NULL;1414 const REGFI_SK* regfi_load_sk(REGFI_FILE* file, uint32_t offset, bool strict) 1415 { 1416 REGFI_SK* ret_val = NULL; 1415 1417 int32_t max_size; 1416 1418 void* failure_ptr = NULL; … … 1427 1429 1428 1430 /* First look if we have already parsed it */ 1429 ret_val = (REGFI_SK _REC*)lru_cache_find(file->sk_cache, &offset, 4);1431 ret_val = (REGFI_SK*)lru_cache_find(file->sk_cache, &offset, 4); 1430 1432 1431 1433 /* Bail out if we have previously cached a parse failure at this offset. */ … … 1463 1465 /****************************************************************************** 1464 1466 ******************************************************************************/ 1465 REGFI_NK _REC* regfi_find_root_nk(REGFI_FILE* file, const REGFI_HBIN* hbin,1467 REGFI_NK* regfi_find_root_nk(REGFI_FILE* file, const REGFI_HBIN* hbin, 1466 1468 REGFI_ENCODING output_encoding) 1467 1469 { 1468 REGFI_NK _REC* nk = NULL;1470 REGFI_NK* nk = NULL; 1469 1471 uint32_t cell_length; 1470 1472 uint32_t cur_offset = hbin->file_off+REGFI_HBIN_HEADER_SIZE; … … 1576 1578 1577 1579 /* Read file header */ 1578 if ((rb = regfi_parse_regf(file_cb, false)) == NULL) 1580 if ((rb = regfi_parse_regf(file_cb, false)) == NULL) 1579 1581 { 1580 1582 regfi_log_add(REGFI_LOG_ERROR, "Failed to read REGF block."); 1581 1583 return NULL; 1582 1584 } 1583 rb->file_length = file_length; 1585 rb->file_length = file_length; 1584 1586 rb->cb = file_cb; 1585 1587 … … 1662 1664 * rest of the file if that fails. 1663 1665 ******************************************************************************/ 1664 REGFI_NK _REC* regfi_rootkey(REGFI_FILE* file, REGFI_ENCODING output_encoding)1665 { 1666 REGFI_NK _REC* nk = NULL;1666 REGFI_NK* regfi_rootkey(REGFI_FILE* file, REGFI_ENCODING output_encoding) 1667 { 1668 REGFI_NK* nk = NULL; 1667 1669 REGFI_HBIN* hbin; 1668 1670 uint32_t root_offset, i, num_hbins; … … 1718 1720 REGFI_ENCODING output_encoding) 1719 1721 { 1720 REGFI_NK _REC* root;1722 REGFI_NK* root; 1721 1723 REGFI_ITERATOR* ret_val; 1722 1724 … … 1773 1775 bool regfi_iterator_down(REGFI_ITERATOR* i) 1774 1776 { 1775 REGFI_NK _REC* subkey;1777 REGFI_NK* subkey; 1776 1778 REGFI_ITER_POSITION* pos; 1777 1779 … … 1780 1782 return false; 1781 1783 1782 subkey = (REGFI_NK _REC*)regfi_iterator_cur_subkey(i);1784 subkey = (REGFI_NK*)regfi_iterator_cur_subkey(i); 1783 1785 if(subkey == NULL) 1784 1786 { … … 1840 1842 bool regfi_iterator_find_subkey(REGFI_ITERATOR* i, const char* subkey_name) 1841 1843 { 1842 REGFI_NK _REC* subkey;1844 REGFI_NK* subkey; 1843 1845 bool found = false; 1844 1846 uint32_t old_subkey = i->cur_subkey; … … 1899 1901 /****************************************************************************** 1900 1902 *****************************************************************************/ 1901 const REGFI_NK _REC* regfi_iterator_cur_key(REGFI_ITERATOR* i)1903 const REGFI_NK* regfi_iterator_cur_key(REGFI_ITERATOR* i) 1902 1904 { 1903 1905 return i->cur_key; … … 1907 1909 /****************************************************************************** 1908 1910 *****************************************************************************/ 1909 const REGFI_SK _REC* regfi_iterator_cur_sk(REGFI_ITERATOR* i)1911 const REGFI_SK* regfi_iterator_cur_sk(REGFI_ITERATOR* i) 1910 1912 { 1911 1913 if(i->cur_key == NULL || i->cur_key->sk_off == REGFI_OFFSET_NONE) … … 1929 1931 /****************************************************************************** 1930 1932 *****************************************************************************/ 1931 const REGFI_NK _REC* regfi_iterator_cur_subkey(REGFI_ITERATOR* i)1933 const REGFI_NK* regfi_iterator_cur_subkey(REGFI_ITERATOR* i) 1932 1934 { 1933 1935 uint32_t nk_offset; … … 1961 1963 bool regfi_iterator_find_value(REGFI_ITERATOR* i, const char* value_name) 1962 1964 { 1963 const REGFI_VK _REC* cur;1965 const REGFI_VK* cur; 1964 1966 bool found = false; 1965 1967 uint32_t old_value = i->cur_value; … … 2007 2009 /****************************************************************************** 2008 2010 *****************************************************************************/ 2009 const REGFI_VK _REC* regfi_iterator_cur_value(REGFI_ITERATOR* i)2010 { 2011 REGFI_VK _REC* ret_val = NULL;2011 const REGFI_VK* regfi_iterator_cur_value(REGFI_ITERATOR* i) 2012 { 2013 REGFI_VK* ret_val = NULL; 2012 2014 uint32_t voffset; 2013 2015 … … 2037 2039 *****************************************************************************/ 2038 2040 const REGFI_CLASSNAME* regfi_iterator_fetch_classname(REGFI_ITERATOR* i, 2039 const REGFI_NK _REC* key)2041 const REGFI_NK* key) 2040 2042 { 2041 2043 REGFI_CLASSNAME* ret_val; … … 2101 2103 *****************************************************************************/ 2102 2104 const REGFI_DATA* regfi_iterator_fetch_data(REGFI_ITERATOR* i, 2103 const REGFI_VK _REC* value)2105 const REGFI_VK* value) 2104 2106 { 2105 2107 REGFI_DATA* ret_val = NULL; … … 2565 2567 /******************************************************************* 2566 2568 *******************************************************************/ 2567 REGFI_NK _REC* regfi_parse_nk(REGFI_FILE* file, uint32_t offset,2568 2569 REGFI_NK* regfi_parse_nk(REGFI_FILE* file, uint32_t offset, 2570 uint32_t max_size, bool strict) 2569 2571 { 2570 2572 uint8_t nk_header[REGFI_NK_MIN_LENGTH]; 2571 REGFI_NK _REC* ret_val;2573 REGFI_NK* ret_val; 2572 2574 uint32_t length,cell_length; 2573 2575 bool unalloc = false; 2574 2576 2575 ret_val = talloc(NULL, REGFI_NK _REC);2577 ret_val = talloc(NULL, REGFI_NK); 2576 2578 if(ret_val == NULL) 2577 2579 { … … 2784 2786 /****************************************************************************** 2785 2787 *******************************************************************************/ 2786 REGFI_VK _REC* regfi_parse_vk(REGFI_FILE* file, uint32_t offset,2788 REGFI_VK* regfi_parse_vk(REGFI_FILE* file, uint32_t offset, 2787 2789 uint32_t max_size, bool strict) 2788 2790 { 2789 REGFI_VK _REC* ret_val;2791 REGFI_VK* ret_val; 2790 2792 uint8_t vk_header[REGFI_VK_MIN_LENGTH]; 2791 2793 uint32_t raw_data_size, length, cell_length; 2792 2794 bool unalloc = false; 2793 2795 2794 ret_val = talloc(NULL, REGFI_VK _REC);2796 ret_val = talloc(NULL, REGFI_VK); 2795 2797 if(ret_val == NULL) 2796 2798 goto fail;
Note: See TracChangeset
for help on using the changeset viewer.