From bbf2f1a12489d9c20789c6c0c4e29b8c1ea9142a Mon Sep 17 00:00:00 2001 From: jess Date: Thu, 23 Apr 2026 07:48:09 -0700 Subject: [PATCH] gagaddji2 --- shell/windows/LayersShell/MainWindow.xaml.cs | 22 ++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/shell/windows/LayersShell/MainWindow.xaml.cs b/shell/windows/LayersShell/MainWindow.xaml.cs index fcfa592..6f34e33 100644 --- a/shell/windows/LayersShell/MainWindow.xaml.cs +++ b/shell/windows/LayersShell/MainWindow.xaml.cs @@ -110,12 +110,30 @@ public sealed partial class MainWindow : Window private void PointToRust() { + App.Log("PointToRust enter"); 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 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); + App.Log("layers_set_plugin_root returned"); } private void CreateNativeHandle()