RasGetCountryInfo function

The RasGetCountryInfo function retrieves country/region-specific dialing information from the Windows Telephony list of countries/regions.

For more information about country/region-specific dialing information and Telephony Application Programming Interface (TAPI) country/region identifiers, see the TAPI portion of the Platform Software Development Kit (SDK).


DWORD RasGetCountryInfo(
  _Inout_ LPRASCTRYINFO lpRasCtryInfo,
  _Inout_ LPDWORD       lpdwSize


lpRasCtryInfo [in, out]

Pointer to a RASCTRYINFO structure that, on output, receives the country/region-specific dialing information followed by additional bytes for a country/region description string.

On input, set the dwSize member of the structure to sizeof(RASCTRYINFO) to identify the version of the structure. Also, set the dwCountryId member to the TAPI country/region identifier of the country/region for which to get information.

Allocate at least 256 bytes for the buffer.

lpdwSize [in, out]

Pointer to a variable that, on input, specifies the size, in bytes, of the buffer pointed to by the lpRasCtryInfo parameter.

On output, this variable receives the number of bytes required.

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is one of the following error codes or a value from Routing and Remote Access Error Codes or Winerror.h.


The address or buffer specified by lpRasCtryInfo is invalid.


The dwCountryId member of the structure pointed to by lpRasCtryInfo was not a valid value.


The size of the lpRasCtryInfo buffer specified by the lpdwSize parameter was not large enough to store the information for the country/region identified by the dwCountryId member. The function returns the required buffer size in the variable pointed to by lpdwSize.


TAPI subsystem information was corrupted.



To enumerate information for all countries/regions in the Windows Telephony list, set the dwCountryId member of the RASCTRYINFO structure to 1 in the initial RasGetCountryInfo call. This causes the function to return information for the first country/region in the list. The value returned in the dwNextCountryID member is the country/region identifier of the next country/region in the list. Use this value in repeated calls to RasGetCountryInfo until dwNextCountryID returns zero, indicating the last country/region in the list.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]







Unicode and ANSI names

RasGetCountryInfoW (Unicode) and RasGetCountryInfoA (ANSI)

See also

Remote Access Service (RAS) Overview
Remote Access Service Functions



Community Additions