LookupPrivilegeDisplayNameA function (winbase.h)

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

Syntax

BOOL LookupPrivilegeDisplayNameA(
  [in, optional]  LPCSTR  lpSystemName,
  [in]            LPCSTR  lpName,
  [out, optional] LPSTR   lpDisplayName,
  [in, out]       LPDWORD cchDisplayName,
  [out]           LPDWORD lpLanguageId
);

Parameters

[in, optional] 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.

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

[out, optional] 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."

[in, out] 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.

[out] 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.

Note

The winbase.h header defines LookupPrivilegeDisplayName as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
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