//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// "PAccess"-CODE-PACKAGE NATIVE SUPPORT (API) EXPORTED FROM "NativeLib.dll":
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// NativeLib DLL (for DotNetHelpers) | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#include "Precompiled.h"
#include "SharedIncludes.h"
//==================================================================================================
NL_API
PVOID WINAPI PAccess_InterlockedExchangePtr($CI_TAG, PVOID volatile* pPointerOperand,
                                                     PVOID substutionPointerValue ) $ret_previous
{
   NL_API_ENTRY_VERIFY_0();
   $TCI_VERIFY_POINTER_ARG( pPointerOperand );
   return $Interlocked::ExchangePointer($TCI, pPointerOperand, substutionPointerValue );
}

//--------------------------------------------------------------------------------------------------
NL_API
PVOID WINAPI PAccess_ClearMemoryBlock($CI_TAG, PVOID pDestinationBlock $out,
                                               SIZE_T length $not_zero ) $ret_target
{
   NL_API_ENTRY_VERIFY_0();
   $TCI_VERIFY_POINTER_ARG( pDestinationBlock );
   $TCI_VERIFY_NOT_ZERO_SIZE_ARG( length );
   return $Memory::Clear($TCI, pDestinationBlock, length );
}
NL_API
PVOID WINAPI PAccess_CopyMemoryBlock($CI_TAG, PVOID pSourceBlock,
                                              $PPVoid pDestinationBlock $out,
                                              SIZE_T length $not_zero )
{
   NL_API_ENTRY_VERIFY_0();
   $TCI_VERIFY_POINTER_ARG( pSourceBlock );
   $TCI_VERIFY_POINTER_ARG( pDestinationBlock );
   $TCI_VERIFY_NOT_ZERO_SIZE_ARG( length );
   return $Memory::Copy($TCI, pSourceBlock, pDestinationBlock, length );
}

//--------------------------------------------------------------------------------------------------
NL_API
VOID WINAPI PAccess_ReleaseIUnknown($CI_TAG, PVOID pIUnknown )
{
   NL_API_ENTRY_VERIFY_0();
   $TCI_VERIFY_POINTER_ARG( pIUnknown );
   ((IUnknown*)pIUnknown) -> Release();
}

//==================================================================================================
