LookupPrivilegeDisplayNameA function

The LookupPrivilegeDisplayName function retrieves the display name that represents a specified privilege.

Syntax

BOOL LookupPrivilegeDisplayNameA(
  LPCSTR  lpSystemName,
  LPCSTR  lpName,
  LPSTR   lpDisplayName,
  LPDWORD cchDisplayName,
  LPDWORD lpLanguageId
);

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 display name on the local system.

lpName

A pointer to a null-terminated string that specifies the name of the privilege, as defined in Winnt.h. For example, this parameter could specify the constant, SE_REMOTE_SHUTDOWN_NAME, or its corresponding string, "SeRemoteShutdownPrivilege". For a list of values, see Privilege Constants.

lpDisplayName

A pointer to a buffer that receives a null-terminated string that specifies the privilege display name. For example, if the lpName parameter is SE_REMOTE_SHUTDOWN_NAME, the privilege display name is "Force shutdown from a remote system."

cchDisplayName

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

lpLanguageId

A pointer to a variable that receives the language identifier for the returned display name.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The LookupPrivilegeDisplayName function retrieves display names only for the privileges specified in the Defined Privileges section of Winnt.h.

Requirements

   
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server 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 Overview

Basic Access Control Functions

LookupPrivilegeName

LookupPrivilegeValue