[StructLayout(LayoutKind.Sequential)]
public struct LUID {
public uint LowPart;
public int HighPart;
}
Structure LUID
Public LowPart As UInt32
Public HighPart As Integer
End Structure
Why is this defined as two ints instead of a long? As far as I can see there's no need to treat it as anything other than an opaque 64 bit field.
Answer:
This more closely matches the SDK definition of the structure. The LowPart is a DWORD (unsigned), and the HighPart is a LONG (signed).
Additionally you will fall into trouble with memory alignment when you define UInt64 instead of LUID structure.