ZwAllocateLocallyUniqueId function

The ZwAllocateLocallyUniqueId routine allocates a locally unique identifier (LUID).

Syntax

NTSYSAPI NTSTATUS ZwAllocateLocallyUniqueId(
  PLUID Luid
);

Parameters

Luid

TBD

Return Value

ZwAllocateLocallyUniqueId returns STATUS_SUCCESS if the operation succeeds or the appropriate NTSTATUS value if the operation fails. If the output parameter cannot be written to, the routine returns STATUS_ACCESS_VIOLATION.

Remarks

The allocated LUID is unique to the local system only, and uniqueness is guaranteed only until the system is next restarted.

Note If the call to the ZwAllocateLocallyUniqueId function occurs in user mode, you should use the name "NtAllocateLocallyUniqueId" instead of "ZwAllocateLocallyUniqueId".
For calls from kernel-mode drivers, the NtXxx and ZwXxx versions of a Windows Native System Services routine can behave differently in the way that they handle and interpret input parameters. For more information about the relationship between the NtXxx and ZwXxx versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.

Requirements

   
Windows version Available in Windows Vista and later versions of Windows.
Target Platform Universal
Header ntddk.h (include Ntddk.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL
DDI compliance rules PowerIrpDDis, HwStorPortProhibitedDDIs, SpNoWait, StorPortStartIo

See Also

LUID

Using Nt and Zw Versions of the Native System Services Routines