12using System.Collections.Generic;
14using System.Runtime.InteropServices;
16using System.Threading.Tasks;
68 private const string dll =
"Adapter_BackEnd";
80 [DllImport(
dll, CallingConvention = CallingConvention.Cdecl,
81 ExactSpelling =
true, CharSet = CharSet.Ansi)]
82 internal static extern
93 [DllImport(
dll, CallingConvention = CallingConvention.Cdecl,
94 ExactSpelling =
true, CharSet = CharSet.Ansi)]
95 internal static extern
109 [DllImport(
dll, CallingConvention = CallingConvention.Cdecl,
110 ExactSpelling =
true, CharSet = CharSet.Ansi)]
111 internal static extern
125 [DllImport(
dll, CallingConvention = CallingConvention.Cdecl,
126 ExactSpelling =
true, CharSet = CharSet.Ansi)]
127 internal static extern
141 [DllImport(
dll, CallingConvention = CallingConvention.Cdecl,
142 ExactSpelling =
true, CharSet = CharSet.Ansi)]
143 internal static extern
Represents some P/Invoke functions for accessing a named blocks of memory to read/write data in the A...
const string BLOCK_NAME_0
Define the name of BLOCK 0 that can be accessed in the Adapter_BackEnd.dll. In C#'s P/Invoke,...
DDR_ErrorCode
Represents the possible errors that can be returned from the memory block access functions....
@ DDR_ErrorCode_Invalid_Offset
The given offset is out of bounds.
@ DDR_ErrorCode_Success
Operation succeeded.
@ DDR_ErrorCode_Invalid_Block_Name
The given name is not a recognized memory block name.
@ DDR_ErrorCode_Null_Argument
The block name pointer or return handle pointer argument is NULL.
@ DDR_ErrorCode_Invalid_Handle
The handle argument does not correspond to a valid open memory block.
@ DDR_ErrorCode_Block_Already_Opened
Memory block is already open and cannot be opened again.
@ DDR_ErrorCode_Block_Not_Opened
Memory block is closed and cannot be accessed.
static DDR_ErrorCode DDR_GetMemorySize(Int32 dataHandle, out Int32 memorySizeInChunks)
P/Invoke wrapper that retrieves the number of chunks in the memory block indicated by the handle to t...
static DDR_ErrorCode DDR_OpenMemoryBlock(string blockName, out Int32 dataHandle)
P/Invoke wrapper that opens access to a memory block for exclusive use, given the name of the memory ...
const int DDR_MAX_OFFSET
All offsets must from 0 to 1 less than this value.
const string BLOCK_NAME_2
Define the name of BLOCK 2 that can be accessed in the Adapter_BackEnd.dll. In C#'s P/Invoke,...
static DDR_ErrorCode DDR_SetDataChunk(Int32 dataHandle, Int32 chunkOffset, UInt32 value)
P/Invoke wrapper that writes a single 32-bit value to the given offset in the memory block indicated ...
const string BLOCK_NAME_1
Define the name of BLOCK 1 that can be accessed in the Adapter_BackEnd.dll. In C#'s P/Invoke,...
static DDR_ErrorCode DDR_GetDataChunk(Int32 dataHandle, Int32 chunkOffset, out UInt32 value)
P/Invoke wrapper that reads a single 32-bit value at the given offset in the memory block indicated b...
static DDR_ErrorCode DDR_CloseMemoryBlock(Int32 dataHandle)
P/Invoke wrapper that closes access to a previously opened memory block, thus releasing it for others...
The namespace containing all Design Pattern Examples implemented in C#.