Well, I am relatively new in C#, and I have a 2 classes. The first class has a public struct and the second one is trying to declare the struct. I am not good enough in english, but this is the code so that you may understand :
First Class :
class PE{
#region NT Headers
[StructLayout(LayoutKind.Explicit)]
public struct IMAGE_NT_HEADERS32
{
[FieldOffset(0)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public char[] Signature;
[FieldOffset(4)]
public IMAGE_FILE_HEADER FileHeader;
[FieldOffset(24)]
public IMAGE_OPTIONAL_HEADER32 OptionalHeader;
}
[StructLayout(LayoutKind.Explicit)]
public struct IMAGE_NT_HEADERS64
{
[FieldOffset(0)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public char[] Signature;
[FieldOffset(4)]
public IMAGE_FILE_HEADER FileHeader;
[FieldOffset(24)]
public IMAGE_OPTIONAL_HEADER64 OptionalHeader;
}
#endregion
}
Second Class :
class Main
{
struct NT_Header
{
Namespace.PE.IMAGE_NT_HEADERS32 INTSIGN = new Namespace.PE.IMAGE_NT_HEADERS32(); //HERE IS THE ERROR!
}
}
It always raises the error... Thanks for helps!