Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

LUID (Structures)
 
.
Summary
Summary
A 64-bit value guaranteed to be unique only on the system on which it was generated... until the system is restarted.

C# Definition:

[StructLayout(LayoutKind.Sequential, Pack = 4)]
public struct LUID_AND_ATTRIBUTES {
   public LUID Luid;
   public UInt32 Attributes;
[StructLayout(LayoutKind.Sequential)]
public struct LUID {
   public UInt32 LowPart;
   public Int32 HighPart;
}

VB Definition:

Structure LUID_AND_ATTRIBUTES
   Public Luid As LUID
   Public Attributes As Integer
Structure LUID
   Public LowPart As Integer
   Public HighPart As Integer
End Structure

User-Defined Field Types:

LUID

Notes:

None.

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.

Documentation

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.

Documentation
LUID on MSDN

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.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions