2018-08-18 16:55:25 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
namespace Quasar.Common
|
|
|
|
|
{
|
2020-05-27 20:21:40 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Provides access to Win32 API and Microsoft C Runtime Library (msvcrt.dll).
|
|
|
|
|
/// </summary>
|
2018-08-18 16:55:25 +00:00
|
|
|
|
public class NativeMethods
|
|
|
|
|
{
|
|
|
|
|
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
2020-05-27 20:21:40 +00:00
|
|
|
|
public static extern unsafe int memcmp(byte* ptr1, byte* ptr2, uint count);
|
2018-08-18 16:55:25 +00:00
|
|
|
|
|
|
|
|
|
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
2020-05-27 20:21:40 +00:00
|
|
|
|
public static extern int memcmp(IntPtr ptr1, IntPtr ptr2, uint count);
|
2018-08-18 16:55:25 +00:00
|
|
|
|
|
|
|
|
|
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
2020-05-27 20:21:40 +00:00
|
|
|
|
public static extern int memcpy(IntPtr dst, IntPtr src, uint count);
|
2018-08-18 16:55:25 +00:00
|
|
|
|
|
|
|
|
|
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
2020-05-27 20:21:40 +00:00
|
|
|
|
public static extern unsafe int memcpy(void* dst, void* src, uint count);
|
2018-10-05 21:58:09 +00:00
|
|
|
|
|
|
|
|
|
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
|
|
|
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
2020-05-27 20:21:40 +00:00
|
|
|
|
public static extern bool DeleteFile(string name);
|
2018-08-18 16:55:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|