Skip to content

Commit d4afc64

Browse files
Fix entrypoint for CopyMemory
1 parent d6f2a52 commit d4afc64

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Common/Common/FastImage.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,12 @@ public override bool Equals( object Object )
174174
static extern bool InvalidateRect( IntPtr hWnd, IntPtr lpRect, bool bErase );
175175
[DllImport( "user32.dll" )]
176176
static extern bool ValidateRect( IntPtr hWnd, ref GR.Image.FastImage.RECT lpRect );
177+
177178
#if NET5_0_OR_GREATER
178179
[DllImport( "Kernel32.dll", EntryPoint = "RtlCopyMemory" )]
179180
#else
180181
[DllImport( "Kernel32.dll", EntryPoint = "CopyMemory" )]
181-
#endif
182+
#endif
182183
static extern void CopyMemory( IntPtr dest, IntPtr src, uint length );
183184

184185
[DllImport( "user32.dll" )]

Common/Common/MemoryImage.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,13 @@ static int PaletteSize( BITMAPINFOHEADER InfoHeader )
235235
return DIBNumColors( InfoHeader ) * System.Runtime.InteropServices.Marshal.SizeOf( typeof( RGBQUAD ) );
236236
}
237237

238+
#if NET5_0_OR_GREATER
238239
[DllImport( "Kernel32.dll", EntryPoint = "RtlCopyMemory" )]
240+
#else
241+
[DllImport( "Kernel32.dll", EntryPoint = "CopyMemory" )]
242+
#endif
239243
static extern void CopyMemory( IntPtr dest, IntPtr src, uint length );
244+
240245
[DllImport( "kernel32.dll" )]
241246
static extern IntPtr GlobalLock( IntPtr hMem );
242247
[DllImport( "kernel32.dll" )]

0 commit comments

Comments
 (0)