SHGetUserDisplayName

Go to Home Page

Gets the full name of the current user.

Syntax

HRESULT WINAPI SHGetUserDisplayName (
    LPWSTR pwszName,
    UINT* pBufLen
)

Parameters

pwszName
A pointer to the buffer used to store the name
pBufLen
On input, the size of the buffer in pwszName in characters. On output, the number of chars written to pwszName including the terminating null.

Return Value

Standard COM return value. S_OK for success, E_INVALIDARG, E_FAIL, etc on failure.

Remarks

The function returns the name from GetUserInfoEx(NameDisplay), or failing that, the name from USER_INFO_2->full_name returned from NetUserGetInfo.

If a system upgrade is in progress, the function returns S_OK without retrieving the name.

This function is also known as _SHGetUserDisplayName@8.