Skip to content

Instantly share code, notes, and snippets.

@clausjoergensen
Created June 18, 2012 17:26
Show Gist options
  • Save clausjoergensen/2949529 to your computer and use it in GitHub Desktop.
Save clausjoergensen/2949529 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication8
{
class Program
{
static void Main(string[] args)
{
var container = new Container<CActorCommonData>();
}
}
[StructLayout(LayoutKind.Sequential)]
struct Container<T>
where T : struct
{
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 256)]
public string Name;
public uint Limit;
public uint SizeOf;
public int Last;
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 60)]
public string Unknown0;
public ContainerArray<T>[] List;
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 64)]
public string Unknown1;
public uint Bits;
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 64)]
public string Unknown2;
}
[StructLayout(LayoutKind.Sequential)]
public struct ContainerArray<T>
{
public T[] List;
}
[StructLayout(LayoutKind.Sequential)]
struct CActorCommonData
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment