LookupPrivilegeName function

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


BOOL WINAPI LookupPrivilegeName(
  _In_opt_  LPCTSTR lpSystemName,
  _In_      PLUID   lpLuid,
  _Out_opt_ LPTSTR  lpName,
  _Inout_   LPDWORD cchName


lpSystemName [in, optional]

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 [in]

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

lpName [out, optional]

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

cchName [in, out]

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.


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


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]


Winbase.h (include Windows.h)





Unicode and ANSI names

LookupPrivilegeNameW (Unicode) and LookupPrivilegeNameA (ANSI)

See also

Access Control
Basic Access Control Functions