gagaddji2

This commit is contained in:
jess 2026-04-23 07:48:09 -07:00
parent a92046eff0
commit bbf2f1a124
1 changed files with 20 additions and 2 deletions

View File

@ -110,12 +110,30 @@ public sealed partial class MainWindow : Window
private void PointToRust() private void PointToRust()
{ {
App.Log("PointToRust enter");
var exe = System.Reflection.Assembly.GetEntryAssembly()?.Location; var exe = System.Reflection.Assembly.GetEntryAssembly()?.Location;
if (string.IsNullOrEmpty(exe)) return; App.Log($"exe = {exe}");
if (string.IsNullOrEmpty(exe)) { App.Log("PointToRust: empty exe path"); return; }
var binDir = Path.GetDirectoryName(exe) ?? string.Empty; var binDir = Path.GetDirectoryName(exe) ?? string.Empty;
var pluginRoot = Path.GetDirectoryName(binDir) ?? string.Empty; var pluginRoot = Path.GetDirectoryName(binDir) ?? string.Empty;
if (string.IsNullOrEmpty(pluginRoot)) return; App.Log($"pluginRoot = {pluginRoot}");
var dllPath = Path.Combine(binDir, "layers_native.dll");
App.Log($"layers_native.dll present: {File.Exists(dllPath)}; path: {dllPath}");
try
{
var h = System.Runtime.InteropServices.NativeLibrary.Load(dllPath);
App.Log($"NativeLibrary.Load ok -> 0x{h.ToInt64():X}");
}
catch (Exception e)
{
App.Log($"NativeLibrary.Load FAILED: {e.GetType().Name}: {e.Message}");
throw;
}
App.Log("calling layers_set_plugin_root…");
LayersNative.layers_set_plugin_root(pluginRoot); LayersNative.layers_set_plugin_root(pluginRoot);
App.Log("layers_set_plugin_root returned");
} }
private void CreateNativeHandle() private void CreateNativeHandle()