Retrieves information about the current version of a specified NLS capability for a locale specified by identifier.
Note For interoperability reasons, the application should prefer the GetNLSVersionEx function to GetNLSVersion because Microsoft is migrating toward the use of locale names instead of locale identifiers for new locales. This recommendation applies especially to custom locales, for which GetNLSVersionEx retrieves enough information to determine if sort behavior has changed. Any application that runs only on Windows Vista and later should use GetNLSVersionEx or at least pass the NLSVERSIONINFOEX structure when calling GetNLSVersion to obtain additional sorting versioning data.
Syntax
BOOL GetNLSVersion(
__in NLS_FUNCTION Function,
__in LCID Locale,
__inout LPNLSVERSIONINFO lpVersionInformation
);
Parameters
- Function [in]
-
The NLS capability to query. This value must be COMPARE_STRING. See the SYSNLS_FUNCTION enumeration.
- Locale [in]
-
Locale identifier that specifies the locale. You can use the MAKELCID macro to create an identifier or use one of the following predefined values.
Windows Vista and later: The following custom locale identifiers are also supported.
- lpVersionInformation [in, out]
-
Pointer to an NLSVERSIONINFO structure. The application must initialize the dwNLSVersionInfoSize member to sizeof(NLSVERSIONINFO).
Note On Windows Vista and later, the function can alternatively provide version information in an NLSVERSIONINFOEX structure.
Return Value
Returns TRUE if and only if the application has supplied valid values in lpVersionInformation, or FALSE otherwise. 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_FLAGS. The values supplied for flags were not valid.
- ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
Remarks
This function allows an application such as Active Directory to determine if an NLS change affects the locale identifier used for a particular index table. If it does not, there is no need to re-index the table. For more information, see Handling Sorting in Your Applications.
Requirements
| Minimum supported client | Windows Vista |
| Minimum supported server | Windows Server 2008 |
| Header | Winnls.h (include Windows.h) |
| Library | Kernel32.lib |
| DLL | Kernel32.dll |
See Also
- National Language Support
- National Language Support Functions
- Handling Sorting in Your Applications
- GetNLSVersionEx
- NLSVERSIONINFO
- NLSVERSIONINFOEX
- SYSNLS_FUNCTION
Send comments about this topic to Microsoft
Build date: 11/16/2009