Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
LUID (Structures)
.
C# Definition:
[StructLayout(LayoutKind.Sequential)]
struct LUID {
public uint LowPart;
public uint HighPart;
public struct LUID {
public UInt32 LowPart;
public Int32 HighPart;
}
VB Definition:
Structure LUID
Public LowPart As Integer
Public HighPart As Integer
End Structure
Notes:
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
Q: 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.
A: Short answer: quirky structure-packing and array-alignment. Long answer: LUID is a member of LUID_AND_ATTRIBUTES struct, which is a variable-size embedded array member of TOKEN_PRIVILEGES struct, occurring after a 4-byte dword value..
So, if you model LUID as Int64, the array alignment will be on 8-byte boundary within TOKEN_PRIVILEGES, which is broken.. but if you model LUID as a pair of 4-byte values, the array alignment becomes 4-byte, which is correct. [source: I just made this mistake of using Int64 for LUID and spent hours debugging my failing calls to AdjustTokenPrivileges]
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
alternate definitions?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.