ZwAllocateLocallyUniqueId function (ntddk.h)
The ZwAllocateLocallyUniqueId routine allocates a locally unique identifier (LUID).
Syntax
NTSYSAPI NTSTATUS ZwAllocateLocallyUniqueId(
PLUID Luid
);
Parameters
Luid
Pointer to a caller-allocated buffer to receive a copy of the source LUID structure. The buffer must be at least sizeof(LUID).
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.
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
Requirement | Value |
---|---|
Target Platform | Universal |
Header | ntddk.h (include Ntddk.h) |
Library | NtosKrnl.lib |
DLL | NtosKrnl.exe |
IRQL | PASSIVE_LEVEL |
DDI compliance rules | HwStorPortProhibitedDDIs(storport), PowerIrpDDis(wdm), SpNoWait(storport), StorPortStartIo(storport) |
See also
Using Nt and Zw Versions of the Native System Services Routines