parent
d7ee6ba579
commit
77bbc41286
|
@ -49,7 +49,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
};
|
||||
var box = new BizHawk.Client.EmuHawk.CustomControls.PrereqsAlert(!fail)
|
||||
{
|
||||
textBox1 = { Text = string.Concat("\n", alertLines) }
|
||||
textBox1 = { Text = string.Join(Environment.NewLine, alertLines) }
|
||||
};
|
||||
box.ShowDialog();
|
||||
if (fail) System.Diagnostics.Process.GetCurrentProcess().Kill();
|
||||
|
|
|
@ -75,12 +75,7 @@ namespace BizHawk.Common
|
|||
[DllImport("kernel32.dll")]
|
||||
private static extern bool FreeLibrary(IntPtr hModule); // return type was annotated MarshalAs(UnmanagedType.Bool)
|
||||
|
||||
public IntPtr LoadPlatformSpecific(string dllToLoad)
|
||||
{
|
||||
var p = LoadLibrary(dllToLoad);
|
||||
if (p == IntPtr.Zero) throw new InvalidOperationException($"got null pointer, error code {GetLastError()}");
|
||||
return p;
|
||||
}
|
||||
public IntPtr LoadPlatformSpecific(string dllToLoad) => LoadLibrary(dllToLoad);
|
||||
public IntPtr GetProcAddr(IntPtr hModule, string procName) => GetProcAddress(hModule, procName);
|
||||
public int FreePlatformSpecific(IntPtr hModule) => FreeLibrary(hModule) ? 1 : 0;
|
||||
}
|
||||
|
|
|
@ -935,6 +935,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
|||
|
||||
AttachedPlugin plugin;
|
||||
plugin.dllHandle = libLoader.LoadPlatformSpecific(PluginName);
|
||||
if (plugin.dllHandle == IntPtr.Zero)
|
||||
throw new InvalidOperationException($"Failed to load plugin {PluginName}");
|
||||
|
||||
plugin.dllStartup = (PluginStartup)Marshal.GetDelegateForFunctionPointer(libLoader.GetProcAddr(plugin.dllHandle, "PluginStartup"), typeof(PluginStartup));
|
||||
plugin.dllShutdown = (PluginShutdown)Marshal.GetDelegateForFunctionPointer(libLoader.GetProcAddr(plugin.dllHandle, "PluginShutdown"), typeof(PluginShutdown));
|
||||
|
|
Loading…
Reference in New Issue