GUID class base struct

A native representation of a Windows GUID (Globally Unique Identifier).

A GUID is a 128-bit value used pervasively by Windows to identify COM interfaces, COM classes (CLSIDs), WinRT types, and various system-defined entities.

This type maps exactly to the Win32 GUID / IID / CLSID structure and is ABI-compatible with all Windows APIs that expect a GUID pointer.

A GUID is composed of:

  • Data1: 32 bits
  • Data2: 16 bits
  • Data3: 16 bits
  • Data4: 8 bytes

These fields together correspond to the canonical textual form: dddddddd-dddd-dddd-dddd-dddddddddddd

When passing GUIDs to Win32 or COM APIs, use toNative to obtain a pointer with the appropriate lifetime.

To learn more, see: https://learn.microsoft.com/windows/win32/api/guiddef/ns-guiddef-guid

Inheritance
Implemented types
Available extensions
Annotations

Constructors

GUID(String guid)
Creates a GUID from its canonical string representation.
factory
GUID.fromComponents(int data1, int data2, int data3, Uint8List data4)
Creates a GUID from its individual component values.
factory
GUID.zero()
Creates a "nil" GUID (all fields set to zero).
factory

Properties

address Pointer<T>

Available on T, provided by the StructAddress extension

The memory address of the underlying data.
no setter
Data1 int
The first 32 bits of the GUID.
getter/setter pair
Data2 int
The next 16 bits of the GUID.
getter/setter pair
Data3 int
The next 16 bits of the GUID.
getter/setter pair
Data4 Array<Uint8>
The final 8 bytes of the GUID.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setGUID(String guid) → void
Sets this GUID from a canonical string representation.
setGUIDFromComponents(int data1, int data2, int data3, Uint8List data4) → void
Sets this GUID from its individual component values.
toNative({Allocator allocator = adaptiveCalloc}) Pointer<GUID>
Allocates native memory and copies the contents of this struct into it.
toString() String
Returns the canonical string representation of this GUID.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited