LookupPrivilegeNameA function

The LookupPrivilegeName function retrieves the name that corresponds to the privilege represented on a specific system by a specified locally unique identifier (LUID).

Syntax

BOOL LookupPrivilegeNameA(
  LPCSTR  lpSystemName,
  PLUID   lpLuid,
  LPSTR   lpName,
  LPDWORD cchName
);

Parameters

lpSystemName

A pointer to a null-terminated string that specifies the name of the system on which the privilege name is retrieved. If a null string is specified, the function attempts to find the privilege name on the local system.

lpLuid

A pointer to the LUID by which the privilege is known on the target system.

lpName

A pointer to a buffer that receives a null-terminated string that represents the privilege name. For example, this string could be "SeSecurityPrivilege".

cchName

A pointer to a variable that specifies the size, in a TCHAR value, of the lpName buffer. When the function returns, this parameter contains the length of the privilege name, not including the terminating null character. If the buffer pointed to by the lpName parameter is too small, this variable contains the required size.

Return Value

If the function succeeds, the function returns nonzero.

If the function fails, it returns zero. To get extended error information, call GetLastError.

Remarks

The LookupPrivilegeName function supports only the privileges specified in the Defined Privileges section of Winnt.h. For a list of values, see Privilege Constants.

Requirements

   
Windows version Windows XP [desktop apps | UWP apps] Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Advapi32.lib
DLL Advapi32.dll

See Also

Access Control

Basic Access Control Functions

LookupPrivilegeDisplayName

LookupPrivilegeValue