Upload FastSeekWpf/Core/MftReader.cs
Browse files
FastSeekWpf/Core/MftReader.cs
CHANGED
|
@@ -38,14 +38,21 @@ public class MftReader : IDisposable
|
|
| 38 |
}
|
| 39 |
|
| 40 |
// ------------------------------------------------------------------
|
| 41 |
-
//
|
| 42 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
// ------------------------------------------------------------------
|
| 44 |
|
| 45 |
-
/// <summary>
|
| 46 |
-
/// Try direct sequential read of $MFT for maximum speed.
|
| 47 |
-
/// Returns None if direct access is unavailable (matches Rust Option<ScanResult>).
|
| 48 |
-
/// </summary>
|
| 49 |
public ScanResult? ScanDirect()
|
| 50 |
{
|
| 51 |
int? recordSize = ReadMftRecordSize();
|
|
|
|
| 38 |
}
|
| 39 |
|
| 40 |
// ------------------------------------------------------------------
|
| 41 |
+
// Try direct first, fall back to FSCTL (matches Rust main.rs exactly)
|
| 42 |
+
// ------------------------------------------------------------------
|
| 43 |
+
|
| 44 |
+
public (ScanResult scan, string method) ScanAny()
|
| 45 |
+
{
|
| 46 |
+
var direct = ScanDirect();
|
| 47 |
+
if (direct != null)
|
| 48 |
+
return (direct, "direct");
|
| 49 |
+
return (Scan(), "ioctl");
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
// ------------------------------------------------------------------
|
| 53 |
+
// Primary: direct $MFT file read (matches Rust scan_direct())
|
| 54 |
// ------------------------------------------------------------------
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
public ScanResult? ScanDirect()
|
| 57 |
{
|
| 58 |
int? recordSize = ReadMftRecordSize();
|