- /* Capture each data stream or reparse data stream. */
- while (!ntfs_attr_lookup(type, NULL, 0,
- CASE_SENSITIVE, 0, NULL, 0, actx))
- {
- u64 data_size = ntfs_get_attribute_value_length(actx->attr);
- u64 name_length = actx->attr->name_length;
- u32 stream_id;
-
- if (data_size == 0) {
- /* Empty stream. No lookup table entry is needed. */
- lte = NULL;
- ntfs_loc = NULL;
- } else {
- ntfs_loc = CALLOC(1, sizeof(*ntfs_loc));
- if (!ntfs_loc) {
- ret = WIMLIB_ERR_NOMEM;
- goto out_put_actx;
- }
- ntfs_loc->ntfs_vol = vol;
- ntfs_loc->path = MALLOC(path_len + 1);
- if (!ntfs_loc->path) {
- ret = WIMLIB_ERR_NOMEM;
- goto out_free_ntfs_loc;
- }
- memcpy(ntfs_loc->path, path, path_len + 1);
- if (name_length) {
- ntfs_loc->stream_name = MALLOC(name_length * 2);
- if (!ntfs_loc->stream_name) {
- ret = WIMLIB_ERR_NOMEM;
- goto out_free_ntfs_loc;
- }
- memcpy(ntfs_loc->stream_name,
- attr_record_name(actx->attr),
- actx->attr->name_length * 2);
- ntfs_loc->stream_name_nchars = name_length;
- }