NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

FieldOffsetAttribute Class

Used along with the System.Runtime.InteropServices.StructLayoutAttribute.LayoutKind set to Explicit to indicate he physical position of each field within a class.

Object
   Attribute
      FieldOffsetAttribute

[Visual Basic]
Public Class FieldOffsetAttribute
   Inherits Attribute
[C#]
public class FieldOffsetAttribute : Attribute
[C++]
public __gc class FieldOffsetAttribute : public Attribute
[JScript]
public class FieldOffsetAttribute extends Attribute

Remarks

[To be supplied.]

Requirements

Namespace: System.Runtime.InteropServices

Assembly: mscorlib.dll

Example [C#]

[C#]

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode), Pack=4]
public struct TypeDesc {
    public int lpValue;
    public WORD vt;
}


[StructLayout(Layout.Explicit)]
public class SYSTEM_INFO
{
[FieldOffset(0)] ulong OemId;
[FieldOffset(4)] ulong PageSize;
[FieldOffset(16)] ulong ActiveProcessorMask;
[FieldOffset(20)] ulong NumberOfProcessors;
[FieldOffset(24)] ulong ProcessorType;
}

See Also

FieldOffsetAttribute Members | System.Runtime.InteropServices Namespace