Skip to content

Commit 73dfa57

Browse files
committed
Fix P/Invoke used in clipboard support
The entrypoint for CopyMemory wasn't correct, for some reason it worked with Desktop CLR but not Core CLR.
1 parent 416ca3e commit 73dfa57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PSReadLine/Clipboard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static void SetRtf(string plainText, string rtfText)
7272
[return: MarshalAs(UnmanagedType.Bool)]
7373
private static extern bool GlobalUnlock(IntPtr hMem);
7474

75-
[DllImport("kernel32.dll", EntryPoint = "CopyMemory", SetLastError = false)]
75+
[DllImport("kernel32.dll", ExactSpelling = true, EntryPoint = "RtlMoveMemory", SetLastError = true)]
7676
private static extern void CopyMemory(IntPtr dest, IntPtr src, uint count);
7777

7878
[DllImport("user32.dll", SetLastError = false)]

0 commit comments

Comments
 (0)