- Timestamp:
- 01/19/07 09:52:25 (18 years ago)
- Location:
- trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/regfi.c
r82 r84 1 1 /* 2 2 * Branched from Samba project Subversion repository, version #7470: 3 * http:// websvn.samba.org/cgi-bin/viewcvs.cgi/trunk/source/registry/regfio.c3 * http://viewcvs.samba.org/cgi-bin/viewcvs.cgi/trunk/source/registry/regfio.c?rev=7470&view=auto 4 4 * 5 5 * Unix SMB/CIFS implementation. … … 437 437 depth++; 438 438 439 if(!prs_uint8s( true,"header", ps, depth, file->header, sizeof(file->header)))439 if(!prs_uint8s("header", ps, depth, file->header, sizeof(file->header))) 440 440 return false; 441 441 … … 499 499 depth++; 500 500 501 if(!prs_uint8s( true,"header", ps, depth, hbin->header, sizeof(hbin->header)))501 if(!prs_uint8s("header", ps, depth, hbin->header, sizeof(hbin->header))) 502 502 return false; 503 503 … … 547 547 return false; 548 548 549 if (!prs_uint8s( true,"header", ps, depth, nk->header, sizeof(nk->header)))549 if (!prs_uint8s("header", ps, depth, nk->header, sizeof(nk->header))) 550 550 return false; 551 551 … … 610 610 return false; 611 611 612 if(!prs_uint8s( true,"name", ps, depth, (uint8*)nk->keyname, name_length))612 if(!prs_uint8s("name", ps, depth, (uint8*)nk->keyname, name_length)) 613 613 return false; 614 614 … … 848 848 if ( !prs_uint32( "nk_off", ps, depth, &hash->nk_off )) 849 849 return false; 850 if ( !prs_uint8s( true,"keycheck", ps, depth, hash->keycheck, sizeof( hash->keycheck )) )850 if ( !prs_uint8s("keycheck", ps, depth, hash->keycheck, sizeof( hash->keycheck )) ) 851 851 return false; 852 852 … … 884 884 return false; 885 885 886 if(!prs_uint8s( true,"header", &hbin->ps, depth,886 if(!prs_uint8s("header", &hbin->ps, depth, 887 887 lf->header, sizeof(lf->header))) 888 888 return false; … … 938 938 return false; 939 939 940 if (!prs_uint8s( true,"header", ps, depth, sk->header, sizeof(sk->header)))940 if (!prs_uint8s("header", ps, depth, sk->header, sizeof(sk->header))) 941 941 return false; 942 942 if ( !prs_uint16( "tag", ps, depth, &tag)) … … 990 990 return false; 991 991 992 if ( !prs_uint8s( true,"header", ps, depth, vk->header, sizeof( vk->header )) )992 if ( !prs_uint8s("header", ps, depth, vk->header, sizeof( vk->header )) ) 993 993 return false; 994 994 … … 1019 1019 return false; 1020 1020 } 1021 if ( !prs_uint8s( true,"name", ps, depth,1021 if ( !prs_uint8s("name", ps, depth, 1022 1022 (uint8*)vk->valuename, name_length) ) 1023 1023 return false; … … 1030 1030 if ( vk->data_size != 0 ) 1031 1031 { 1032 bool charmode = false;1033 1034 if ( (vk->type == REG_SZ) || (vk->type == REG_MULTI_SZ) )1035 charmode = true;1036 1037 1032 /* the data is stored in the offset if the size <= 4 */ 1038 1033 if ( !(vk->data_size & VK_DATA_IN_OFFSET) ) … … 1067 1062 if ( !prs_uint32( "data_rec_size", &hblock->ps, depth, &data_rec_size )) 1068 1063 return false; 1069 if(!prs_uint8s( charmode,"data", &hblock->ps, depth,1064 if(!prs_uint8s("data", &hblock->ps, depth, 1070 1065 vk->data, vk->data_size)) 1071 1066 return false; … … 1323 1318 if ( !prs_uint32( "record_size", ps, 0, &record_size ) ) 1324 1319 return false; 1325 if ( !prs_uint8s( true,"header", ps, 0, header, REC_HDR_SIZE ) )1320 if ( !prs_uint8s("header", ps, 0, header, REC_HDR_SIZE ) ) 1326 1321 return false; 1327 1322 … … 1600 1595 return false; 1601 1596 1602 subkey = regfi_iterator_cur_subkey(i);1597 subkey = (REGF_NK_REC*)regfi_iterator_cur_subkey(i); 1603 1598 if(subkey == NULL) 1604 1599 { … … 1667 1662 1668 1663 /* XXX: this alloc/free of each sub key might be a bit excessive */ 1669 subkey = regfi_iterator_first_subkey(i);1664 subkey = (REGF_NK_REC*)regfi_iterator_first_subkey(i); 1670 1665 while((subkey != NULL) && (found == false)) 1671 1666 { … … 1676 1671 { 1677 1672 regfi_key_free(subkey); 1678 subkey = regfi_iterator_next_subkey(i);1673 subkey = (REGF_NK_REC*)regfi_iterator_next_subkey(i); 1679 1674 } 1680 1675 } … … 1718 1713 /****************************************************************************** 1719 1714 *****************************************************************************/ 1720 REGF_NK_REC* regfi_iterator_cur_key(REGFI_ITERATOR* i)1715 const REGF_NK_REC* regfi_iterator_cur_key(REGFI_ITERATOR* i) 1721 1716 { 1722 1717 return i->cur_key; … … 1726 1721 /****************************************************************************** 1727 1722 *****************************************************************************/ 1728 REGF_NK_REC* regfi_iterator_first_subkey(REGFI_ITERATOR* i)1723 const REGF_NK_REC* regfi_iterator_first_subkey(REGFI_ITERATOR* i) 1729 1724 { 1730 1725 i->cur_subkey = 0; … … 1735 1730 /****************************************************************************** 1736 1731 *****************************************************************************/ 1737 REGF_NK_REC* regfi_iterator_cur_subkey(REGFI_ITERATOR* i)1732 const REGF_NK_REC* regfi_iterator_cur_subkey(REGFI_ITERATOR* i) 1738 1733 { 1739 1734 REGF_NK_REC* subkey; … … 1778 1773 *****************************************************************************/ 1779 1774 /* XXX: some way of indicating reason for failure should be added. */ 1780 REGF_NK_REC* regfi_iterator_next_subkey(REGFI_ITERATOR* i)1781 { 1782 REGF_NK_REC* subkey;1775 const REGF_NK_REC* regfi_iterator_next_subkey(REGFI_ITERATOR* i) 1776 { 1777 const REGF_NK_REC* subkey; 1783 1778 1784 1779 i->cur_subkey++; … … 1796 1791 bool regfi_iterator_find_value(REGFI_ITERATOR* i, const char* value_name) 1797 1792 { 1798 REGF_VK_REC* cur;1793 const REGF_VK_REC* cur; 1799 1794 bool found = false; 1800 1795 … … 1823 1818 /****************************************************************************** 1824 1819 *****************************************************************************/ 1825 REGF_VK_REC* regfi_iterator_first_value(REGFI_ITERATOR* i)1820 const REGF_VK_REC* regfi_iterator_first_value(REGFI_ITERATOR* i) 1826 1821 { 1827 1822 i->cur_value = 0; … … 1832 1827 /****************************************************************************** 1833 1828 *****************************************************************************/ 1834 REGF_VK_REC* regfi_iterator_cur_value(REGFI_ITERATOR* i)1829 const REGF_VK_REC* regfi_iterator_cur_value(REGFI_ITERATOR* i) 1835 1830 { 1836 1831 REGF_VK_REC* ret_val = NULL; … … 1844 1839 /****************************************************************************** 1845 1840 *****************************************************************************/ 1846 REGF_VK_REC* regfi_iterator_next_value(REGFI_ITERATOR* i)1847 { 1848 REGF_VK_REC* ret_val;1841 const REGF_VK_REC* regfi_iterator_next_value(REGFI_ITERATOR* i) 1842 { 1843 const REGF_VK_REC* ret_val; 1849 1844 1850 1845 i->cur_value++; -
trunk/lib/smb_deps.c
r65 r84 101 101 converts this to real GMT. 102 102 ****************************************************************************/ 103 time_t nt_time_to_unix( NTTIME *nt)103 time_t nt_time_to_unix(const NTTIME* nt) 104 104 { 105 105 double d; … … 316 316 Stream an array of uint32s. Length is number of uint32s. 317 317 ********************************************************************/ 318 bool prs_uint32s( bool charmode,const char *name, prs_struct *ps,318 bool prs_uint32s(const char *name, prs_struct *ps, 319 319 int depth, uint32 *data32s, int len) 320 320 { … … 462 462 Stream an array of uint8s. Length is number of uint8s. 463 463 ********************************************************************/ 464 bool prs_uint8s( bool charmode,const char *name, prs_struct *ps, int depth,464 bool prs_uint8s(const char *name, prs_struct *ps, int depth, 465 465 uint8* data8s, int len) 466 466 { … … 526 526 return false; 527 527 528 if(!prs_uint8s ( false,"data ", ps, depth,528 if(!prs_uint8s ("data ", ps, depth, 529 529 uuid->clock_seq, sizeof(uuid->clock_seq))) 530 530 return false; 531 531 532 if(!prs_uint8s ( false,"data ", ps, depth, uuid->node, sizeof(uuid->node)))532 if(!prs_uint8s ("data ", ps, depth, uuid->node, sizeof(uuid->node))) 533 533 return false; 534 534 … … 587 587 sid->num_auths = MAXSUBAUTHS; 588 588 589 if(!prs_uint32s( false,"sub_auths ", ps, depth,589 if(!prs_uint32s("sub_auths ", ps, depth, 590 590 sid->sub_auths, sid->num_auths)) 591 591 { return false; }
Note: See TracChangeset
for help on using the changeset viewer.