I need an array of structs (which ARE all unmanaged structs with a fixed size) but apparently visual studio does not like my code.
Basically I NEED something like
fixed page_table tables[1024]; in my struct.
This is the code that makes visual studio throw a fit, is there anyway I can achieve this (and I need it all pre-initialized)
[StructLayout(LayoutKind.Explicit, Pack = 1)]
public unsafe struct page_directory
{
[FieldOffset(0)]
public fixed page_table tables[1024];
[FieldOffset(0x8000)]
public fixed uint tablesPhysical[1024];
[FieldOffset(0x9000)]
public uint physicalAddr;
}
[StructLayout(LayoutKind.Explicit, Pack = 1)]
public unsafe struct page_table
{
[FieldOffset(0)]
public fixed page pages[1024];
}
page*that "just happens" to point to memory big enough for 1024 pages?