RasSetSubEntryProperties

The RasSetSubEntryProperties function creates a new subentry or modifies an existing subentry of a specified phone-book entry.

DWORD RasSetSubEntryProperties(
  LPCTSTR lpszPhonebook,    // pointer to full path and filename of 
                            // the phone-book file
  LPCTSTR lpszEntry,        // pointer to an entry name
  DWORD dwSubEntry,         // index of the subentry
  LPRASSUBENTRY lpRasSubEntry,
                            // pointer to structure containing 
                            // information about subentry
  DWORD dwcbRasSubEntry     // size, in bytes, of the structure
  LPBYTE lpbDeviceConfig,   // pointer to TAPI device configuration 
  DWORD dwcbDeviceConfig    // size of TAPI device configuration 
); 
 

Parameters

lpszPhonebook
Windows NT: Pointer to a null-terminated string that specifies the full path and filename 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 the name of an existing entry in the phone book.
dwSubEntry
Specifies the one-based index of the subentry. If the index matches an existing subentry index, the function changes the properties of that subentry. If the index does not match an existing index, the function creates a new subentry.
lpRasSubEntry
Pointer to a RASSUBENTRY structure that contains the data for the subentry.

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 RASSUBENTRY structure contains the offset to the first string.

dwcbRasSubEntry
Specifies the size, in bytes, of the lpRasSubEntry buffer.
lpbDeviceConfig
Pointer to a TAPI device configuration block. This parameter is currently unused. The caller should pass NULL for this parameter. For more information about TAPI device configuration blocks, see the function lineGetDevConfig.
dwcbDeviceConfig
Specifies the size of the TAPI device configuration block. This parameter is currently unused. The caller should pass zero for this parameter.

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_FIND_PHONEBOOK_ENTRY The phone-book entry does not exist.
ERROR_CANNOT_OPEN_PHONEBOOK The phone book is corrupted or missing components.
ERROR_INVALID_PARAMETER The function was called with an invalid parameter.

Remarks

A RAS phone-book entry can have zero or more subentries, each minimally consisting of a device and a phone number. A phone-book entry with multiple subentries can be configured to dial either the first available subentry or all subentries when the entry is dialed.

Use the RasGetEntryProperties function to retrieve a RASENTRY structure containing information about the subentries of a phone-book entry. The dwSubEntries member indicates the number of subentries and the dwDialMode member indicates the dialing configuration.

QuickInfo

  Windows NT: Requires version 4.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in ras.h.
  Import Library: Use rasapi32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Remote Access Service Overview, RAS Server Administration Functions, RasGetEntryProperties, RASENTRY, RASSUBENTRY