Platform SDK: RAS/Routing and RAS

RasSetEntryProperties

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

DWORD RasSetEntryProperties(
  LPCTSTR lpszPhonebook,  // pointer to full path and file name of 
                          // phone-book file
  LPCTSTR lpszEntry,      // pointer to an entry name
  LPRASENTRY lpRasEntry,  // buffer that contains entry information
  DWORD dwEntryInfoSize,  // size, in bytes, of the lpRasEntry
                          // buffer
  LPBYTE lpbDeviceInfo,   // buffer that contains device-specific 
                          // configuration information
  DWORD dwDeviceInfoSize  // size, in bytes, of the lpbDeviceInfo 
                          // buffer
); 

Parameters

lpszPhonebook
Windows NT/2000: 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
Pointer to a null-terminated string containing 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
Pointer to a RASENTRY structure that contains the new connection data to be associated with the phone-book entry specified by the lpszEntry 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
Specifies the size, in bytes, of the buffer specified by the lpRasEntry parameter.
lpbDeviceInfo
Pointer to a buffer containing device-specific configuration information. This is opaque TAPI device configuration information. For more information about TAPI device configuration, see the lineGetDevConfig function in the TAPI Programmer's Reference in the Platform SDK.

Windows NT/2000: This parameter is unused. The calling function should set this parameter to NULL.

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

Windows NT/2000: This parameter is unused. The calling function should set this parameter to zero.

Return Values

If the function succeeds, the return value is zero.

If the function fails, the return value can be one of the following error codes.

Value Meaning
ERROR_BUFFER_INVALID The address or buffer specified by lpRasEntry is invalid.
ERROR_CANNOT_OPEN_PHONEBOOK The phone book is corrupted or missing components.

Remarks

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 OSR2 or later.
  Header: Declared in Ras.h.
  Library: Use Rasapi32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.

See Also

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