Fix issues with missing samsung nvme data. (#1818)

Reorder read out order in the same way as CrystalDiskInfo
This commit is contained in:
sebastian-dev
2025-08-29 10:34:45 +02:00
committed by GitHub
parent 8036ea21cb
commit 78829b97e1
2 changed files with 11 additions and 13 deletions
@@ -36,7 +36,6 @@ internal class NVMeSamsung : INVMeDrive
buffers.Spt.TargetId = 0;
buffers.Spt.Lun = 0;
buffers.Spt.SenseInfoLength = 24;
buffers.Spt.DataIn = 1;
buffers.Spt.DataTransferLength = (uint)buffers.DataBuf.Length;
buffers.Spt.TimeOutValue = 2;
buffers.Spt.DataBufferOffset = Marshal.OffsetOf(typeof(Kernel32.SCSI_PASS_THROUGH_WITH_BUFFERS), nameof(Kernel32.SCSI_PASS_THROUGH_WITH_BUFFERS.DataBuf));
@@ -67,7 +66,6 @@ internal class NVMeSamsung : INVMeDrive
buffers.Spt.Lun = 0;
buffers.Spt.SenseInfoLength = 24;
buffers.Spt.DataTransferLength = (uint)buffers.DataBuf.Length;
buffers.Spt.DataIn = 1;
buffers.Spt.TimeOutValue = 2;
buffers.Spt.DataBufferOffset = Marshal.OffsetOf<Kernel32.SCSI_PASS_THROUGH_WITH_BUFFERS>(nameof(Kernel32.SCSI_PASS_THROUGH_WITH_BUFFERS.DataBuf));
buffers.Spt.SenseInfoOffset = (uint)Marshal.OffsetOf<Kernel32.SCSI_PASS_THROUGH_WITH_BUFFERS>(nameof(Kernel32.SCSI_PASS_THROUGH_WITH_BUFFERS.SenseBuf));
@@ -21,6 +21,16 @@ public class NVMeSmart : IDisposable
NVMeDrive = null;
string name = storageInfo.Name;
// Test Windows generic driver protocol.
if (NVMeDrive == null)
{
_handle = NVMeWindows.IdentifyDevice(storageInfo);
if (_handle != null)
{
NVMeDrive = new NVMeWindows();
}
}
// Test Samsung protocol.
if (NVMeDrive == null && name.IndexOf("Samsung", StringComparison.OrdinalIgnoreCase) > -1)
{
@@ -54,16 +64,6 @@ public class NVMeSmart : IDisposable
NVMeDrive = new NVMeIntelRst();
}
}
// Test Windows generic driver protocol.
if (NVMeDrive == null)
{
_handle = NVMeWindows.IdentifyDevice(storageInfo);
if (_handle != null)
{
NVMeDrive = new NVMeWindows();
}
}
}
public bool IsValid
@@ -187,4 +187,4 @@ public class NVMeSmart : IDisposable
TemperatureSensors[i] = KelvinToCelsius(log.TemperatureSensor[i]);
}
}
}
}