diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-16 12:17:10 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-16 12:17:10 +0200 |
| commit | 0fda2ba3ff49bdc1ffc6833f658e2164af187008 (patch) | |
| tree | 6f3a24d0671ebda50debb8511ab40e0bda0a0df0 /Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/NativeMethods.cs | |
| parent | 28103646681686bf1b58275d5dbccb92d2b26f9f (diff) | |
| download | Tango-0fda2ba3ff49bdc1ffc6833f658e2164af187008.tar.gz Tango-0fda2ba3ff49bdc1ffc6833f658e2164af187008.zip | |
Embedded RealTimeGraphEx library to solution.
Added graphs to technician view.
Implemented simple sensors data test using Machine Emulator.
Diffstat (limited to 'Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/NativeMethods.cs')
| -rw-r--r-- | Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/NativeMethods.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/NativeMethods.cs b/Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/NativeMethods.cs new file mode 100644 index 000000000..59b2b7bcc --- /dev/null +++ b/Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/NativeMethods.cs @@ -0,0 +1,41 @@ +using System; +using System.Runtime; +using System.Runtime.InteropServices; + +namespace System.Windows.Media.Imaging +{ + internal static class NativeMethods + { + [TargetedPatchingOptOut("Internal method only, inlined across NGen boundaries for performance reasons")] + internal static unsafe void CopyUnmanagedMemory(byte* srcPtr, int srcOffset, byte* dstPtr, int dstOffset, int count) + { + srcPtr += srcOffset; + dstPtr += dstOffset; + + memcpy(dstPtr, srcPtr, count); + } + + [TargetedPatchingOptOut("Internal method only, inlined across NGen boundaries for performance reasons")] + internal static void SetUnmanagedMemory(IntPtr dst, int filler, int count) + { + memset(dst, filler, count); + } + + // Win32 memory copy function + //[DllImport("ntdll.dll")] + [DllImport("msvcrt.dll", EntryPoint = "memcpy", CallingConvention = CallingConvention.Cdecl, SetLastError = false)] + private static extern unsafe byte* memcpy( + byte* dst, + byte* src, + int count); + + // Win32 memory set function + //[DllImport("ntdll.dll")] + //[DllImport("coredll.dll", EntryPoint = "memset", SetLastError = false)] + [DllImport("msvcrt.dll", EntryPoint = "memset", CallingConvention = CallingConvention.Cdecl, SetLastError = false)] + private static extern void memset( + IntPtr dst, + int filler, + int count); + } +} |
