Rediger

Del via


DownlevelGetParentLocaleName function

Retrieves the locale name for the parent of the supplied locale.

Note

This function is used only by applications that run on pre-Windows Vista operating systems. Its use requires the download package. Applications that only run on Windows Vista and later should call GetLocaleInfo with LCType set to LOCALE_SPARENT.

 

Syntax

int DownlevelGetParentLocaleName(
  _In_  LCID   Locale,
  _Out_ LPWSTR lpName,
  _In_  int    cchName
);

Parameters

Locale [in]

Locale identifier of the locale. You can use the MAKELCID macro to create a locale identifier or use one of the following predefined values.

Windows Vista and later: The following custom locale identifiers are also supported.

lpName [out]

Pointer to a buffer in which the function retrieves the parent locale name, or one of the following predefined values. This parameter is set to NULL if cchName is set to 0.

cchName [in]

Size of the buffer indicated by lpName, in UTF-16 code points. A value of 0 for this parameter causes the function to ignore the lpName buffer and return the size of the buffer, in characters (null characters included), required to contain the parent locale name.

Return value

Returns the count of UTF-16 code points in the locale name, including the terminating null character, if successful.

This 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:

  • ERROR_INSUFFICIENT_BUFFER. A supplied buffer size was not large enough, or it was incorrectly set to NULL.
  • ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.

Remarks

The required header file and DLL are part of the "Microsoft NLS Downlevel Data Mapping APIs" download, which is no longer available from the Microsoft Download Center. Use ICU globalization APIs on Windows 10 May 2019 Update and later versions.

Requirements

Requirement Value
Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Redistributable
Microsoft NLS Downlevel Data Mapping APIs onWindows XP with SP2 and later
Header
Nlsdl.h
DLL
NlsMap.dll

See also

National Language Support

National Language Support Functions

Mapping Locale Data

GetLocaleInfo