RasSetEntryProperties function

The RasSetEntryProperties function changes the connection information for an entry in the phone book or creates a new phone-book entry.

Syntax


DWORD RasSetEntryProperties(
  _In_ LPCTSTR    lpszPhonebook,
  _In_ LPCTSTR    lpszEntry,
  _In_ LPRASENTRY lpRasEntry,
  _In_ DWORD      dwEntryInfoSize,
  _In_ LPBYTE     lpbDeviceInfo,
  _In_ DWORD      dwDeviceInfoSize
);

Parameters

lpszPhonebook [in]

Pointer to a null-terminated string that specifies the full path and file name of a phone-book (PBK) file. If this parameter is NULL, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box.

lpszEntry [in]

Pointer to a null-terminated string that specifies an entry name.

If the entry name matches an existing entry, RasSetEntryProperties modifies the properties of that entry.

If the entry name does not match an existing entry, RasSetEntryProperties creates a new phone-book entry. For new entries, call the RasValidateEntryName function to validate the entry name before calling RasSetEntryProperties.

lpRasEntry [in]

Pointer to the RASENTRY structure that specifies the new connection data to be associated with the phone-book entry indicated by the lpszEntry parameter.

The caller must provide values for the following members in the RASENTRY structure.

  • dwSize
  • szLocalPhoneNumber
  • szDeviceName
  • szDeviceType
  • dwFramingProtocol
  • dwfOptions
  • dwType

Windows XP or later:  dwType is supported.

If values are not provided for these members, RasSetEntryProperties fails with ERROR_INVALID_PARAMETER.

The structure might be followed by an array of null-terminated alternate phone number strings. The last string is terminated by two consecutive null characters. The dwAlternateOffset member of the RASENTRY structure contains the offset to the first string.

dwEntryInfoSize [in]

Specifies the size, in bytes, of the buffer identified by the lpRasEntry parameter.

lpbDeviceInfo [in]

Pointer to a buffer that specifies device-specific configuration information. This is opaque TAPI device configuration information. For more information about TAPI device configuration, see the lineGetDevConfig function in Telephony Application Programming Interfaces (TAPI) in the Platform SDK.

Windows XP:  This parameter is unused. The calling function should set this parameter to NULL.

dwDeviceInfoSize [in]

Specifies the size, in bytes, of the lpbDeviceInfo buffer.

Windows XP:  This parameter is unused. The calling function should set this parameter to zero.

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.

ValueMeaning
ERROR_ACCESS_DENIED

The user does not have the correct privileges. Only an administrator can complete this task.

ERROR_BUFFER_INVALID

The address or buffer specified by lpRasEntry is invalid.

ERROR_CANNOT_OPEN_PHONEBOOK

The phone book is corrupted or missing components.

ERROR_INVALID_PARAMETER

The RASENTRY structure pointed to by the lpRasEntry parameter does not contain adequate information, or the specified entry does not exist in the phone book. See the description for lpRasEntry to see what information is required.

 

Remarks

When setting properties for an all-users connection, if the calling application specifies a non-NULL value for the phone-book parameter, lpszPhonebook, the phone-book file must be located in the phone-book directory beneath the all-users application data path. To obtain the correct location for the phone-book file, first call SHGetFolderPath with a CSIDL value of CSIDL_COMMON_APPDATA. SHGetFolderPath returns the all-users application data path. Append the following string to this path:

Microsoft\Network\Connections\Pbk

The combined path is the correct location for the phone-book file.

Note  Specifying a non-NULL value for the lpszPhonebook parameter may not be supported in versions of Windows later than Windows XP.
 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Ras.h

Library

Rasapi32.lib

DLL

Rasapi32.dll

Unicode and ANSI names

RasSetEntryPropertiesW (Unicode) and RasSetEntryPropertiesA (ANSI)

See also

Remote Access Service (RAS) Overview
Remote Access Service Functions
RASENTRY
RasCreatePhonebookEntry
RasGetEntryProperties
RasValidateEntryName

 

 

Community Additions

ADD
Show: