Skip to content

Latest commit

 

History

History
144 lines (96 loc) · 6.9 KB

nf-winnls-getgeoinfoa.md

File metadata and controls

144 lines (96 loc) · 6.9 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winnls.GetGeoInfoA
GetGeoInfoA function (winnls.h)
Retrieves information about a specified geographical location. (ANSI)
GetGeoInfoA
winnls/GetGeoInfoA
intl\getgeoinfo.htm
Intl
73827ed9-bdc5-4b34-b849-fb44b3c5bd6e
12/05/2018
GetGeoInfo, GetGeoInfo function [Internationalization for Windows Applications], GetGeoInfoA, GetGeoInfoW, _win32_GetGeoInfo, intl.getgeoinfo, winnls/GetGeoInfo, winnls/GetGeoInfoA, winnls/GetGeoInfoW
winnls.h
Windows.h
Windows
Windows XP [desktop apps \| UWP apps]
Windows Server 2003 [desktop apps \| UWP apps]
GetGeoInfoW (Unicode) and GetGeoInfoA (ANSI)
Kernel32.lib
Kernel32.dll
Windows
19H1
GetGeoInfoA
winnls/GetGeoInfoA
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-Localization-l1-2-0.dll
KernelBase.dll
API-MS-Win-Core-Localization-l1-2-1.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
API-MS-Win-Core-Localization-L1-2-2.dll
API-MS-Win-Core-Localization-Ansi-L1-1-0.dll
Kernel32Legacy.dll
GetGeoInfo
GetGeoInfoA
GetGeoInfoW

GetGeoInfoA function

-description

[GetGeoInfo is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use GetGeoInfoEx.

]

Retrieves information about a specified geographical location.

-parameters

-param Location [in]

Identifier for the geographical location for which to get information. For more information, see Table of Geographical Locations. You can obtain the available values by calling EnumSystemGeoID.

-param GeoType [in]

Type of information to retrieve. Possible values are defined by the SYSGEOTYPE enumeration. If the value of GeoType is GEO_LCID, the function retrieves a locale identifier. If the value of GeoType is GEO_RFC1766, the function retrieves a string name that is compliant with RFC 4646 (Windows Vista). For more information, see the Remarks section.

Windows XP: When GeoType is set to GEO_LCID, the retrieved string is an 8-digit hexadecimal value.

Windows Me: When GeoType is set to GEO_LCID, the retrieved string is a decimal value.

-param lpGeoData [out, optional]

Pointer to the buffer in which this function retrieves the information.

-param cchData [in]

Size of the buffer indicated by lpGeoData. The size is the number of bytes for the ANSI version of the function, or the number of words for the Unicode version. The application can set this parameter to 0 if the function is to return the required size of the buffer.

-param LangId [in]

Identifier for the language, used with the value of Location. The application can set this parameter to 0, with GEO_RFC1766 or GEO_LCID specified for GeoType. This setting causes the function to retrieve the language identifier by calling GetUserDefaultLangID.

Note   The application must set this parameter to 0 if GeoType has any value other than GEO_RFC1766 or GEO_LCID.
 

-returns

Returns the number of bytes (ANSI) or words (Unicode) of geographical location information retrieved in the output buffer. If cchData is set to 0, the function returns the required size for the buffer.

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:

  • 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

If the application specifies GEO_RFC1766 for GeoType, it should specify a language identifier for LangId that is appropriate to the specified geographical location identifier. The appropriate language is either a locale-neutral language or one with a locale corresponding to the specified identifier. The resulting string, compliant with RFC 4646 (Windows Vista), constitutes a locale name.

For example, if Location is specified as 0xF4 for United States, GeoType is specified as GEO_RFC1766, and LangId is specified as either 0x09 for locale-neutral English or 0x409 for English (United States), the function retrieves "en-US" on successful return. In fact, the function ignores the locale-specific portion of the language. Thus, if the application specifies LangId as 0x809 for English (United Kingdom), the function also writes "en-US" to lpGeoData.

Consider another example. If Location is specified as 0xF4 for United States, GeoType is specified as GEO_RFC1766, and LangId is specified as 0x04 for Chinese, the function retrieves "zh-US" on successful return. This is not the name of a supported locale.

If the application specifies GEO_LCID for GeoType, the function treats the language identifier as a locale identifier (LCID). It attempts to return the locale identifier if it is associated with the provided geographical identifier in some way.

Note

The winnls.h header defines GetGeoInfo as an alias which 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 not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

EnumSystemGeoID

GetGeoInfoEx

National Language Support

National Language Support Functions

SYSGEOTYPE