Skip to content

Instantly share code, notes, and snippets.

@ayufan
Created February 14, 2019 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayufan/dca808e3927ddc3a204043348b43f140 to your computer and use it in GitHub Desktop.
Save ayufan/dca808e3927ddc3a204043348b43f140 to your computer and use it in GitHub Desktop.
The MBAPI_x86.dll interface
namespace MSI_LED
{
using System;
using System.Runtime.InteropServices;
internal static class MB
{
internal const string MB_DLL_FileName = @"Lib\MBAPI_x86.dll";
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool CheckBTLED();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool CheckECRAM(out bool data);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool CheckLANLED();
[DllImport(@"Lib\MBAPI_x86.dll", CharSet=CharSet.Auto)]
public static extern bool CheckMBVersion(string _csMB, string _csMBVer, string _csMBMarket, string _csMBSIOInit);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool CloseLEDControl(bool bBackToDefault);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ControlBTLED(int value);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ControlCorsairDRAMLED(int changetime, int darktime, int colornum, int r, int g, int b, int brightN, int brightD);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ControlCorsairProDRAMLED(int style, int colorType, int direction, int r, int g, int b, int bright, int speed);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ControlFANLED(int value);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ControlGALAXDRAMLED(int style, int r, int g, int b);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ControlGALAXDRAMLED_Byte(int data0, int data1, int data2, int data3);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ControlKingStonDRAMLED(int r, int g, int b, int speed, int style);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ControlKingStonDRAMLED_X299(int offset, int data);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ControlLANLED(int value);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ControlMICRONDRAMLED(int style, int r, int g, int b);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool CorsairProDRAMSync();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool GetCPU_GameBoostSec(ref int sec);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool GetCPU_MaxRatio(ref int ratio);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool GetCPUTemp(ref int Temp);
[DllImport(@"Lib\MBAPI_x86.dll", CharSet=CharSet.Unicode)]
public static extern bool GetDRAMInfo(int slot, [MarshalAs(UnmanagedType.BStr)] out string manufac, [MarshalAs(UnmanagedType.BStr)] out string partnum);
[DllImport(@"Lib\MBAPI_x86.dll", CharSet=CharSet.Unicode)]
public static extern bool GetDRAMInfo2(int slot, [MarshalAs(UnmanagedType.BStr)] out string manufac, [MarshalAs(UnmanagedType.BStr)] out string size, [MarshalAs(UnmanagedType.BStr)] out string width);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool GetECSpace(int Page, int Index, out int data);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool GetSIO_DefaultWhite(ref bool defWhite);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool GSKDDR_Change(int iStyle, int iR = 0, int iG = 0, int iB = 0, int iInterval = 0);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool GSKDDR_Initial();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool GSKDDR_MarqueeStop();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool GSKDDR_MeteorStop();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool GSKDDR_ONOFF(int ledmode);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool GSKDDR_RainbowStop();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool InitialDDRTIMING();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool IT8295QFN_OP(int mode, int r, int g, int b, int addr);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool KeepRenesasLED();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool LEDAudioControl(int ledmode);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool LEDBOTControl(int ledmode);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool LEDControl(int ledmode);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool LEDMysticControl(int ledmode);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ReleaseDll();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool RenesasLEDControlV3(int index70, int index71, int index80, int index81, int index82, int index83, int cmd, int data, int r, int g, int b, int e0, int e1, int e2, int e3, int e5);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool ResetLED();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetAudioBreathingMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetAudioDualBlinkingMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetAudioFlashingMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetBreathingMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetColorMode(int R, int G, int B);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetCorsairDRAMLED(int mode);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetDualBlinkingMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetECRAM_Color(byte r, byte g, byte b);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetECRAM_Mode(int mode);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetECSpace(int Page, int Index, int Data);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetExtendSequence(int mode);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetFlashingMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetLEDModelName(int model);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetMusicLED(bool mystic, bool on, int mode);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetMusicVolumeV2(int left, int right);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetMysticBreathingMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetMysticDualBlinkingMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetMysticFlashingMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetMysticLEDColor(int R, int G, int B);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetMysticLightningMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetMysticMarqueeMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetMysticMeteorMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetMysticRainbowMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetMysticSequenceMode(int mode);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetRainbowBreathingMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetRainbowFlashingMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SetRainbowMode();
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SMBusControl(int addr, int offset, int data);
[DllImport(@"Lib\MBAPI_x86.dll")]
public static extern bool SupportLED();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment