MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / index_get_size

Function index_get_size

src/ntfs_dir.c:127–139  ·  view source on GitHub ↗

* index_get_size - Find the INDX block size from the index root * @inode: Inode of the directory to be checked * * Find the size of a directory's INDX block from the INDEX_ROOT attribute. * * Return: n Success, the INDX blocks are n bytes in size * 0 Error, not a directory */

Source from the content-addressed store, hash-verified

125 * 0 Error, not a directory
126 */
127static int index_get_size(ntfs_inode *inode)
128{
129 ATTR_RECORD *attr90;
130 INDEX_ROOT *iroot;
131
132 attr90 = find_first_attribute(AT_INDEX_ROOT, inode->mrec);
133 if (!attr90)
134 return 0; // not a directory
135
136 iroot = (INDEX_ROOT*)((u8*)attr90 + le16_to_cpu(attr90->value_offset));
137
138 return iroot->index_block_size;
139}
140
141#ifdef HAVE_ICONV
142static int ntfs_ucstoutf8(iconv_t cd, const ntfschar *ins, const int ins_len, char **outs, const int outs_len)

Callers 1

ntfs_copyFunction · 0.85

Calls 1

find_first_attributeFunction · 0.85

Tested by

no test coverage detected