Skip to content

Commit 050d354

Browse files
committed
WPF - **UPDATED** CopyMemory PInvoke signature to work with .Net Core
RtlCopyMemory was only working for 64bit, falling back to RtlMoveMemory for now. Details in #2885 (comment) Follow up to c11157f
1 parent 99c7984 commit 050d354

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CefSharp.Wpf/Rendering/AbstractRenderHandler.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ namespace CefSharp.Wpf.Rendering
2020
/// <seealso cref="CefSharp.Wpf.IRenderHandler" />
2121
public abstract class AbstractRenderHandler : IDisposable, IRenderHandler
2222
{
23-
[DllImport("kernel32.dll", EntryPoint = "RtlCopyMemory", SetLastError = false)]
23+
//RtlCopyMemory doesn't actually exist as a function,it's an alias and only exists
24+
//when running as a 64bit process. According to https://stackoverflow.com/a/47016390/4583726
25+
//EntryPoint = "CopyMemory" was being mapped to RtlMoveMemory on Windows 10 at least
26+
//Will update to the faster RtlCopyMemory later.
27+
[DllImport("kernel32.dll", EntryPoint = "RtlMoveMemory", SetLastError = false)]
2428
protected static extern void CopyMemory(IntPtr dest, IntPtr src, uint count);
2529

2630
internal static readonly PixelFormat PixelFormat = PixelFormats.Pbgra32;

0 commit comments

Comments
 (0)