Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8098,7 +8098,10 @@ internal static List<AlternateStreamData> GetStreams(string path)

// Directories don't normally have alternate streams, so this is not an exceptional state.
// If a directory has no alternate data streams, FindFirstStreamW returns ERROR_HANDLE_EOF.
if (error == NativeMethods.ERROR_HANDLE_EOF)
// If the file system (such as FAT32) does not support alternate streams, then
// ERROR_INVALID_PARAMETER is returned by FindFirstStreamW. See documentation:
// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findfirststreamw
if (error == NativeMethods.ERROR_HANDLE_EOF || error == NativeMethods.ERROR_INVALID_PARAMETER)
{
return alternateStreams;
}
Expand Down Expand Up @@ -8135,7 +8138,9 @@ internal static List<AlternateStreamData> GetStreams(string path)

int lastError = Marshal.GetLastWin32Error();
if (lastError != NativeMethods.ERROR_HANDLE_EOF)
{
throw new Win32Exception(lastError);
}
}
finally { handle.Dispose(); }

Expand Down