diff --git a/LibreHardwareMonitorLib/Hardware/Storage/NVMeIntel.cs b/LibreHardwareMonitorLib/Hardware/Storage/NVMeIntel.cs index 8fbd776..59cce27 100644 --- a/LibreHardwareMonitorLib/Hardware/Storage/NVMeIntel.cs +++ b/LibreHardwareMonitorLib/Hardware/Storage/NVMeIntel.cs @@ -56,7 +56,7 @@ namespace LibreHardwareMonitor.Hardware.Storage IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf()); Kernel32.RtlZeroMemory(ptr, finalSize); int len = Math.Min(finalSize, passThrough.DataBuffer.Length); - Kernel32.CopyMemory(ptr, newPtr, (uint)len); + Kernel32.RtlCopyMemory(ptr, newPtr, (uint)len); Marshal.FreeHGlobal(buffer); Kernel32.NVME_IDENTIFY_CONTROLLER_DATA item = Marshal.PtrToStructure(ptr); diff --git a/LibreHardwareMonitorLib/Hardware/Storage/NVMeIntelRst.cs b/LibreHardwareMonitorLib/Hardware/Storage/NVMeIntelRst.cs index 3faaf10..e02cbf1 100644 --- a/LibreHardwareMonitorLib/Hardware/Storage/NVMeIntelRst.cs +++ b/LibreHardwareMonitorLib/Hardware/Storage/NVMeIntelRst.cs @@ -56,7 +56,7 @@ namespace LibreHardwareMonitor.Hardware.Storage IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf()); Kernel32.RtlZeroMemory(ptr, finalSize); int len = Math.Min(finalSize, passThrough.DataBuffer.Length); - Kernel32.CopyMemory(ptr, newPtr, (uint)len); + Kernel32.RtlCopyMemory(ptr, newPtr, (uint)len); Marshal.FreeHGlobal(buffer); Kernel32.NVME_IDENTIFY_CONTROLLER_DATA item = Marshal.PtrToStructure(ptr); diff --git a/LibreHardwareMonitorLib/Interop/Kernel32.cs b/LibreHardwareMonitorLib/Interop/Kernel32.cs index 5f37e5b..54b1048 100644 --- a/LibreHardwareMonitorLib/Interop/Kernel32.cs +++ b/LibreHardwareMonitorLib/Interop/Kernel32.cs @@ -206,8 +206,8 @@ namespace LibreHardwareMonitor.Interop [DllImport(DllName, SetLastError = true)] internal static extern void RtlZeroMemory(IntPtr Destination, int Length); - [DllImport(DllName, EntryPoint = "CopyMemory", SetLastError = false)] - internal static extern void CopyMemory(IntPtr Destination, IntPtr Source, uint Length); + [DllImport(DllName, SetLastError = false)] + internal static extern void RtlCopyMemory(IntPtr Destination, IntPtr Source, uint Length); [DllImport(DllName, SetLastError = true)] internal static extern IntPtr LoadLibrary(string lpFileName);