#include "StdAfx.h"
#include "Utils.h"
#include <stdio.h>
#include <string.h>
using namespace System;
CUtils::CUtils(void)
{
}
CUtils::~CUtils(void)
{
}
void CUtils::FromManagedToNative(cli::array<System::Byte> ^manstr, unsigned char* natstr, int count)
{
cli::pin_ptr<unsigned char> pman = &manstr[0];
memcpy(natstr, pman, count);
}
void CUtils::FromNativeToManaged(cli::array<System::Byte> ^manstr, unsigned char* natstr, int count)
{
IntPtr ptrnatstr((int)natstr);
Runtime::InteropServices::Marshal::Copy(ptrnatstr, manstr, 0, count);
}