GetUserDefaultLocaleName

Retrieves the system’s default locale name.

Syntax

int GetUserDefaultLocaleName(
         _Out_writes_(cchLocaleName)LPWSTR lpLocaleName,
         int cchLocaleName
)  

Parameters

lpLocaleName
Type: Out_writes(cchLocaleName)LPWSTR 

Pointer to a buffer in which this function retrieves the locale name.

cchLocaleName
Type: int 

Size, in characters, of the buffer indicated by lpLocaleName. The maximum possible length of a locale name, including a terminating null character, is LOCALE_NAME_MAX_LENGTH. This is the recommended size to supply in this parameter.

Return value

Type: int 

Returns the size of the buffer containing the locale name, including the terminating null character, if successful.

The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one of the following error codes:

Requirements

Header: Declared in winnls.h.

Library: Use kernelx.lib.