This topic has not yet been rated - Rate this topic

LookupPrivilegeName function

Applies to: desktop apps only

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 WINAPI LookupPrivilegeName(
  __in_opt   LPCTSTR lpSystemName,
  __in       PLUID lpLuid,
  __out_opt  LPTSTR lpName,
  __inout    LPDWORD cchName
);

Parameters

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.

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

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Winbase.h (include Windows.h)

Library

Advapi32.lib

DLL

Advapi32.dll

Unicode and ANSI names

LookupPrivilegeNameW (Unicode) and LookupPrivilegeNameA (ANSI)

See also

Access Control
Basic Access Control Functions
LookupPrivilegeDisplayName
LookupPrivilegeValue

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ