From 5bacd9144383ac6c43226b974f9bbeea16c6b51d Mon Sep 17 00:00:00 2001 From: Kevin Ivarsen Date: Tue, 19 Apr 2022 22:16:38 -0700 Subject: [PATCH] Fix #6603: PInvokeStackImbalance error caused by incorrect signature for WindowsDeleteString function. When PreserveSig=false, a function that natively returns an HRESULT and has no final [out] parameter should instead be marked as void. --- src/Windows/Avalonia.Win32/WinRT/NativeWinRTMethods.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Windows/Avalonia.Win32/WinRT/NativeWinRTMethods.cs b/src/Windows/Avalonia.Win32/WinRT/NativeWinRTMethods.cs index 5026fbaaba..89cde01ff4 100644 --- a/src/Windows/Avalonia.Win32/WinRT/NativeWinRTMethods.cs +++ b/src/Windows/Avalonia.Win32/WinRT/NativeWinRTMethods.cs @@ -23,7 +23,7 @@ namespace Avalonia.Win32.WinRT [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = CallingConvention.StdCall, PreserveSig = false)] - internal static extern unsafe IntPtr WindowsDeleteString(IntPtr hString); + internal static extern unsafe void WindowsDeleteString(IntPtr hString); [DllImport("Windows.UI.Composition", EntryPoint = "DllGetActivationFactory", CallingConvention = CallingConvention.StdCall, PreserveSig = false)]