From 23dc6ce765ff847df89a6ca1c43cf9954abd6c3d Mon Sep 17 00:00:00 2001
From: LTRData
Date: Mon, 29 Apr 2024 22:52:30 +0200
Subject: [PATCH] Wof fix
* Fixed issue with opening other attributes than default $DATA attribute
---
Library/DiscUtils.Ntfs/Internals/Wof.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Library/DiscUtils.Ntfs/Internals/Wof.cs b/Library/DiscUtils.Ntfs/Internals/Wof.cs
index c08565b7f..862e9dde3 100644
--- a/Library/DiscUtils.Ntfs/Internals/Wof.cs
+++ b/Library/DiscUtils.Ntfs/Internals/Wof.cs
@@ -69,7 +69,9 @@ public static SparseStream OpenWofReparsePoint(File file,
NtfsStream ntfsStream,
ReparsePointRecord reparsePoint)
{
- if (!info.FileAttributes.HasFlag(NtfsFileAttributes.SparseFile)
+ if (attr.PrimaryRecord.AttributeType != AttributeType.Data
+ || !string.IsNullOrWhiteSpace(attr.PrimaryRecord.Name)
+ || !info.FileAttributes.HasFlag(NtfsFileAttributes.SparseFile)
|| file.GetStream(AttributeType.Data, "WofCompressedData") is not { } compressedStream)
{
return null;