Skip to content

Commit 0557516

Browse files
committed
Revise Unsafe Calling Convention
1 parent 21c19b4 commit 0557516

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Flow.Launcher.Infrastructure/Hotkey/GlobalHotkey.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static SpecialKeyState CheckModifiers()
5757
return state;
5858
}
5959

60-
[MethodImpl(MethodImplOptions.NoInlining)]
60+
[UnmanagedCallersOnly]
6161
private static IntPtr LowLevelKeyboardProc(int nCode, UIntPtr wParam, IntPtr lParam)
6262
{
6363
bool continues = true;

Flow.Launcher.Infrastructure/Hotkey/InterceptKeys.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal static unsafe class InterceptKeys
1010

1111
private const int WH_KEYBOARD_LL = 13;
1212

13-
public static IntPtr SetHook(delegate*<int, UIntPtr, IntPtr, IntPtr> proc)
13+
public static IntPtr SetHook(delegate* unmanaged<int, UIntPtr, IntPtr, IntPtr> proc)
1414
{
1515
using (Process curProcess = Process.GetCurrentProcess())
1616
using (ProcessModule curModule = curProcess.MainModule)
@@ -20,7 +20,7 @@ public static IntPtr SetHook(delegate*<int, UIntPtr, IntPtr, IntPtr> proc)
2020
}
2121

2222
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
23-
public static extern IntPtr SetWindowsHookEx(int idHook, delegate*<int, UIntPtr, IntPtr, IntPtr> lpfn, IntPtr hMod, uint dwThreadId);
23+
public static extern IntPtr SetWindowsHookEx(int idHook, delegate* unmanaged<int, UIntPtr, IntPtr, IntPtr> lpfn, IntPtr hMod, uint dwThreadId);
2424

2525
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
2626
[return: MarshalAs(UnmanagedType.Bool)]

0 commit comments

Comments
 (0)