Fix buffer over-read causing AccessViolationException in NVMeSamsung (#160)

This commit is contained in:
MoshiMoshi0
2019-10-27 10:24:23 +01:00
committed by Phyxion
parent aa298de600
commit 14338554da
2 changed files with 7 additions and 8 deletions
+1 -2
View File
@@ -22,7 +22,6 @@ namespace LibreHardwareMonitor.Interop
internal const int MAX_DRIVE_ATTRIBUTES = 512;
internal const uint NVME_PASS_THROUGH_SRB_IO_CODE = 0xe0002000;
internal const int SCSI_PASS_THROUGH_BUFFER_SIZE = 512;
internal const byte SMART_LBA_HI = 0xC2;
internal const byte SMART_LBA_MID = 0x4F;
private const string DllName = "kernel32.dll";
@@ -728,7 +727,7 @@ namespace LibreHardwareMonitor.Interop
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] SenseBuf;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = SCSI_PASS_THROUGH_BUFFER_SIZE)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4096)]
public byte[] DataBuf;
}