initial commit

This commit is contained in:
Christian Resma Helle
2012-11-06 23:37:40 +01:00
commit 79fe714b5b
14 changed files with 462 additions and 0 deletions
@@ -0,0 +1,24 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ReswCodeGen.Tests
{
[TestClass]
public class Spikes
{
[TestMethod]
public void MarshalToIntPtrArray()
{
const string text = "test";
var data = Encoding.UTF8.GetBytes(text);
var pData = Marshal.AllocCoTaskMem(data.Length);
Marshal.Copy(data, 0, pData, data.Length);
var pDataArray = new IntPtr[data.Length];
Marshal.Copy(pData, pDataArray, 0, data.Length);
Marshal.FreeCoTaskMem(pData);
}
}
}