using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
    
class DFUfuncs
{
    public const uint DEVICE_HAS_BEEN_IN_ISP = 0xE0000100;
    public const uint ANOTHER_DOWNLOAD_IS_RUNNING = 0xE0000101;

    [DllImport("DFU.dll", CallingConvention = CallingConvention.StdCall)]
    unsafe public static extern int DFU_Reset_To_ISP(uint VID, uint PID);

    [DllImport("DFU.dll", CallingConvention = CallingConvention.StdCall)]
    unsafe public static extern int DFU_Reset_To_AP();

    [DllImport("DFU.dll", CallingConvention = CallingConvention.StdCall)]
    unsafe public static extern int DFU_Download(byte[] FW, uint Addr, uint Size, uint CheckSum);

    [DllImport("DFU.dll", CallingConvention = CallingConvention.StdCall)]
    unsafe public static extern int DFU_Get_ProcessCount();
}