- /* Parse one or more stream information structures. */
- info = (const FILE_STREAM_INFORMATION*)buf;
- for (;;) {
- if (info->StreamNameLength <= sizeof(dat.cStreamName) - 2) {
- dat.StreamSize = info->StreamSize;
- memcpy(dat.cStreamName, info->StreamName, info->StreamNameLength);
- dat.cStreamName[info->StreamNameLength / 2] = L'\0';
-
- /* Capture the stream. */
- ret = win32_capture_stream(path, path_num_chars, inode,
- lookup_table, &dat);
- if (ret)
- goto out_free_buf;
- }
- if (info->NextEntryOffset == 0) {
- /* No more stream information. */
- ret = 0;
- break;
- }
- /* Advance to next stream information. */
- info = (const FILE_STREAM_INFORMATION*)
- ((const u8*)info + info->NextEntryOffset);
+ if (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) {
+ /* OpenEncryptedFileRaw() seems to fail with
+ * ERROR_SHARING_VIOLATION if there are any handles opened to
+ * the file. */
+ CloseHandle(*hFile_p);
+ *hFile_p = INVALID_HANDLE_VALUE;
+ }
+
+ /* Parse one or more stream information structures. */
+ info = (const FILE_STREAM_INFORMATION*)buf;
+ for (;;) {
+ if (info->StreamNameLength <= sizeof(dat.cStreamName) - 2) {
+ dat.StreamSize = info->StreamSize;
+ memcpy(dat.cStreamName, info->StreamName, info->StreamNameLength);
+ dat.cStreamName[info->StreamNameLength / 2] = L'\0';
+
+ /* Capture the stream. */
+ ret = win32_capture_stream(path, path_num_chars, inode,
+ lookup_table, &dat);
+ if (ret)
+ goto out_free_buf;