//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// NativeLib DLL (for DotNetHelpers) | C+- (SysRoutine) | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace CommonHelpers {

//**************************************************************************************************
/// <summary>
/// PAccess-code-package native support API (NativeLib.dll)
/// </summary>
static class PAccessNL {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[DllImport( "NativeLib.dll", EntryPoint="PAccess_InterlockedExchangePtr",
            ExactSpelling=true, CharSet=CharSet.Unicode )]
public static extern IntPtr InterlockedExchangePtr( string ciTag,
   [HIn][HOut][HInterlockedAccess] IntPtr pPointerOperand,
   IntPtr substutionPointerValue );

//--------------------------------------------------------------------------------------------------

[DllImport( "NativeLib.dll", EntryPoint="PAccess_ClearMemoryBlock",
            ExactSpelling=true, CharSet=CharSet.Unicode )]
public static extern IntPtr ClearMemoryBlock( string ciTag,
   [HOut] IntPtr pDestinationBlock,
   UIntPtr length );

[DllImport( "NativeLib.dll", EntryPoint="PAccess_CopyMemoryBlock",
            ExactSpelling=true, CharSet=CharSet.Unicode )]
public static extern IntPtr CopyMemoryBlock( string ciTag,
   [HIn] IntPtr pSourceBlock,
   [HOut] IntPtr pDestinationBlock,
   UIntPtr length );

//--------------------------------------------------------------------------------------------------

[DllImport( "NativeLib.dll", EntryPoint="PAccess_ReleaseIUnknown",
            ExactSpelling=true, CharSet=CharSet.Unicode )]
public static extern void ReleaseIUnknown( string ciTag,
   [HIn][HOut] IntPtr pIUnknown);

//==================================================================================================
/*
[DllImport( "NativeLib.dll", EntryPoint="NLib_",
            ExactSpelling=true, CharSet=CharSet.Unicode )]
[HNLibLastError]
public static extern ( string ciTag,
);
*/
//==================================================================================================

static PAccessNL()
{
   HNativeLib.VerifyInitialized();
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // PAccessNL
//**************************************************************************************************

} // CommonHelpers
